; STACK is 8 levels ; PIC16C74 Pins ; ; ;RA0 RA1 RA2 RA3 RA4 RA5 ;EmptyFIFO /StartC /HighB /VsampRef COMOBT /FIFOReadPIC ;Input Output Output Output Output OutPut ;RB0 RB1 RB2 RB3 RB4 RB5 RB6 RB7 ;P3 P4 P2 P1 PL1 PL2 PS PR ; All output ;Input DATA from CAN ;RC0 RC1 RC2 RC3 RC4 RC5 RC6 RC7 ; All input ;Bidir DATA to FIFOs ;RD0 RD1 RD2 RD3 RD4 RD5 RD6 RD7 ; Bidir ; RE0 RE1 RE2 ; Debug /FIFOWrite FIFOFull ; output Output Input list p=16c74A,f=INHX8M include P16c74A.inc __config h'3fba' ; Everything OFF , HS as oscillator VersionLow = d'1' ; version du soft VersionHigh = d'05' ; version du soft , ici 1.0x ; v1.05 Tentative de regeneration du signal video, meme si la fifo est pleine ; CamID = 0x54 ; Camera ID, changer pour une autre camera PrescanPixel = d'30' ; Nbre de pixels de prescan OverscanPixel = d'30' ; Nbre de pixels d'overscan DarkLines = d'0' ; Nbre de lignes noires TaillePixelHi = d'15' ; 15 Microns TaillePixelLo = 000 ; .0 Microns, 99 pour 15.99 LargXPhotoHI = 0x08 ; 2048 Nbre de pixels dans la ligne LargXPhotoLO = 0x00 ; LargYPhotoHI = 0x08 ; 2048 Nbre de lignes LargYPhotoLO = 0x00 ; LargXTotalHI = 0x08 ; Doit faire LigneUsefullP+OverscanPixel+PrescanPixel ici 2108, arrondi a 2200 LargXTotalLO = 0x98 ; 2200 pixels LargYWipeHI = 0xFF ; Nbre de lignes a vider LargYWipeLO = 0x9 ; => N * $FF NbreBit = d'14'; Numerisation sur 14 bits TrackingCCD = 0 ; N'est pas un CCD de tracking MayaIDName1 = d'77' ; M Ecrit MAYA2K ou autre chose, 12 chars max. MayaIDName2 = d'97' ; a MayaIDName3 = d'121' ; y MayaIDName4 = d'97' ; a MayaIDName5 = d'50' ; 2 MayaIDName6 = d'75' ; K MayaIDName7 = 0 MayaIDName8 = 0 MayaIDName9 = 0 MayaIDName10 = 0 MayaIDName11 = 0 MayaIDName12 = 0 Phase3 = 0 ; Port B Bit 0 ; write Phase4 = 1 ; Port B Bit 1 ; write Phase2 = 2 ; Port B Bit 2 ; write Phase1 = 3 ; Port B Bit 3 ; write PL1 = 4 ; Port B Bit 4 ; write PL2 = 5 ; Port B Bit 5 ; write PhiS = 6 ; Port B Bit 6 ; write PhiR = 7 ; Port B Bit 7 ; write EmptyFIFO = 0 ; Port A Bit 0 ; read StartConv = 1 ; Port A Bit 1 ; write HighByteE = 2 ; Port A Bit 2 ; write VsampCCDref = 3 ; Port A Bit 3 ; write ComOBT = 4 ; Port A Bit 4 ; write FIFORead = 5 ; Port A Bit 5 ; write PinDebug = 0 ; Port E Bit 0 ; write FIFOWrite = 1 ; Port E Bit 2 ; write FIFOFull = 2 ; Port E Bit 3 ; read NoShutter = 0 ; Bit 0 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ReadData macro ;Read DATA from the FIFO nop nop nop nop nop bcf PORTA,FIFORead nop nop nop nop nop nop nop movf PORTD,0 bsf PORTA,FIFORead endm ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;Variables ! commandValue equ 0x20 Param1 equ 0x21 Param2 equ 0x22 Param3 equ 0x23 Param4 equ 0x24 Param5 equ 0x25 Param6 equ 0x26 Param7 equ 0x27 Param8 equ 0x28 Param9 equ 0x29 Param10 equ 0x2A Temp1 equ 0x2B Temp2 equ 0x2C Temp3 equ 0x2D Temp4 equ 0x2E Temp5 equ 0x2F Temp6 equ 0x30 Temp7 equ 0x31 Temp8 equ 0x32 Temp9 equ 0x33 Temp10 equ 0x34 TempL equ 0x35 TempH equ 0x36 ACCaLO equ 0x38 ACCaHI equ 0x39 ACCbLO equ 0x3A ACCbHI equ 0x3B TempL_DX equ 0x3C TempH_DX equ 0x3D NbrePixH equ 0x3E NbrePixL equ 0x3F BoucleL equ 0x40 BoucleH equ 0x41 NbpackL equ 0x42 NbpackH equ 0x43 NextPacket equ 0x44 CCDHigh equ 0x6F CCDLow equ 0x70 RemainderX1_HI equ 0x71 RemainderX1_LO equ 0x72 VidePartial_LO equ 0x73 VidePartial_HI equ 0x74 CpTL equ 0x75 CpTH equ 0x76 Temp equ 0x77 NbPix32 equ 0x78 ; Nbre de pixels en 32 bits NbPix24 equ 0x79 NbPix16 equ 0x7A NbPix8 equ 0x7B ACCcLO equ 0x7C ACCcHI equ 0x7D ACCdLO equ 0x7E ACCdHI equ 0x7F ; MEMORY : 192 byte ; 20->7Fh Bank1 ; A0h->FF Bank2 ; Page 07FFh Program page 0 ; Page 0800h Program Start page 1 ; Page 0FFFh End program Page 1 ; Pour rendre les parametres plus clairs, des adresses coincident avec paramX NviderCCD equ 0x21 Pause1 equ 0x21 Pause2 equ 0x22 Pause3 equ 0x23 Pause4 equ 0x24 BinningX equ 0x21 BinningY equ 0x22 LowX1 equ 0x23 HighX1 equ 0x24 LowY1 equ 0x25 HighY1 equ 0x26 LowDX equ 0x27 HighDX equ 0x28 LowDY equ 0x29 HighDY equ 0x2A ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; DIRECTIVES ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; TRUE equ 1 FALSE equ 0 ; Debug Mode ;DEBUG equ TRUE ; cette directive permet de demarrer le programme a un autre endroit pour debugger ;REALCHIP equ FALSE ; Cette directive serta activer le point de depart et les attentes FiFOFullPic TESTCOM equ FALSE ; cette directive envoie une rampe a la place des donnees du CAN ;Real Mode DEBUG equ FALSE REALCHIP equ TRUE ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; org H'0000' IF REALCHIP goto Start ENDIF IF DEBUG goto TestStart ENDIF ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; WriteData ; Write to the FIFO ; Waits that FIFO is not Full IF REALCHIP WR_FifoFull btfss PORTE,FIFOFull ; teste si la FIFO est vide goto WR_FifoFull ENDIF movwf PORTD nop bcf PORTE,FIFOWrite nop bsf PORTE,FIFOWrite return ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; TempoLigne nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop return ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Attends 1 seconde pour le Boot ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; WaitForSx52Reset movlw d'17' movwf Temp3 Resetpause3 movlw 0 movwf Temp2 Resetpause2 movlw 0 movwf Temp1 Resetpause1 nop nop decfsz Temp1,1 goto Resetpause1 decfsz Temp2,1 goto Resetpause2 decfsz Temp3,1 goto Resetpause3 return ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Dinput ;Change the data bus to input bsf STATUS,RP0 movlw 0xff movwf TRISD bcf STATUS,RP0 Call TempoLigne return Doutput ;Change the data bus to output bsf STATUS,RP0 movlw 0x00 movwf TRISD bcf STATUS,RP0 Call TempoLigne return ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ReadParametre WaitForDataSX52 btfss PORTA,EmptyFIFO ; teste si la FIFO est vide Goto WaitForDataSX52 ; ReadData ; Macro, met dans W le resultat return ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Decale une ligne du CCD en mode reverse TH7899M, propre au CCD ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; DecaleLigne movlw b'00000101' Xorwf PORTB,1 call TempoLigne movlw b'00001000' Xorwf PORTB,1 call TempoLigne movlw b'00000001' Xorwf PORTB,1 call TempoLigne movlw b'00000010' Xorwf PORTB,1 call TempoLigne movlw b'00000100' Xorwf PORTB,1 call TempoLigne movlw b'00000001' Xorwf PORTB,1 call TempoLigne movlw b'00001000' Xorwf PORTB,1 call TempoLigne movlw b'00000011' Xorwf PORTB,1 return ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Envoie un handshake au PC pour lui dire que la commande est terminee et a bien ete executee ; SendBackToPC ; Send Data back to FIFO ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; SendBackToPC Call Doutput ; Send the size of the backup including the two bytes of size ; If this is wrong, SX52 could hang movlw 0x00 call WriteData movlw 0x0D call WriteData movf commandValue,0 call WriteData movf Param1,0 call WriteData movf Param2,0 call WriteData movf Param3,0 call WriteData movf Param4,0 call WriteData movf Param5,0 call WriteData movf Param6,0 call WriteData movf Param7,0 call WriteData movf Param8,0 call WriteData movf Param9,0 call WriteData movf Param10,0 call WriteData Call DInput return ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Vide tout le registre de lecture ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Vide_RegistreFULL movlw LargXTotalHI movwf VidePartial_HI movlw LargXTotalLO movwf VidePartial_LO Call VideRegistrePartial ; Vide Lo et Hi pixels return ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ViderCCD NviderCCD fois ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ViderCCD Call ReadParametre movwf NviderCCD ; parametre 1 bsf PORTE,0 lVidag movlw LargYWipeHI ; $FF en general movwf Temp10 ; loop2vid movlw LargYWipeLO ; N * movwf Temp9 ; loop1vid call DecaleLigne ; decale LargYWipeLO lignes et vide ! fait parfois des points espaces de LargYWipeLO pixels dans l'image.... decfsz Temp9,1 ; goto loop1vid ; Call Vide_RegistreFULL ; decfsz Temp10,1 ; goto loop2vid ; decfsz NviderCCD,1 ; goto lVidag ; fait les param1 vidages Call SendBackToPC ; Commande terminee bcf PORTE,0 ; DEBUG return ;******************************************************************************** ; Renvoie l'ID de la camera et des tas de parametres PROPRES au CCD ;******************************************************************************** CameraID Call Doutput ; Send the size of the backup including the two bytes of size ; If this is wrong, SX52 could hang movlw 0x00 ; ne pas changer call WriteData movlw d'30' ; ne pas changer call WriteData movlw CamID call WriteData movlw PrescanPixel call WriteData movlw OverscanPixel call WriteData movlw TaillePixelHI call WriteData movlw TaillePixelLO call WriteData movlw LargXPhotoHI call WriteData movlw LargXPhotoLO call WriteData movlw LargYPhotoHI call WriteData movlw LargYPhotoLO call WriteData movlw LargXTotalHI call WriteData movlw LargXTotalLO call WriteData movlw NbreBit call WriteData movlw TrackingCCD call WriteData movlw MayaIDName1 call WriteData movlw MayaIDName2 call WriteData movlw MayaIDName3 call WriteData movlw MayaIDName4 call WriteData movlw MayaIDName5 call WriteData movlw MayaIDName6 call WriteData movlw MayaIDName7 call WriteData movlw MayaIDName8 call WriteData movlw MayaIDName9 call WriteData movlw MayaIDName10 call WriteData movlw MayaIDName11 call WriteData movlw MayaIDName12 call WriteData movlw VersionHigh call WriteData movlw VersionLow call WriteData movlw DarkLines call WriteData Call DInput return ;************************************************************************************* ; Si la pose est abortee, renvoyer en retour le temps reellement effectuee par le PIC ; dans les parametres ;************************************************************************************* ExecutePose Call ReadParametre movwf param1 ; parametre 1 Call ReadParametre movwf param2 ; parametre 2 Call ReadParametre movwf param3 ; parametre 3 Call ReadParametre movwf param4 ; parametre 4 Call ReadParametre movwf param5 ; parametre 5 ; ouverture ou pas de l'obturateur movf Param4,0 movwf Temp4 movf commandValue,0 movwf Temp10 btfss param5,NoShutter bsf PORTA,ComOBT ; Ouvre l'obturateur si necessaire ; Compte la Pose bcf PORTE,0 ; Debug Expose4 movf Param3,0 movwf Temp3 Expose3 movf Param2,0 movwf Temp2 Expose2 movf Param1,0 movwf Temp1 Expose1 btfss PORTA,EmptyFIFO ; teste si la FIFO est vide, si vide boucler goto ProceedExp ; vide, continuer Call Dinput ReadData movwf Temp10 ; Commande Abort ? EmptyFIFOAbortExp btfss PORTA,EmptyFIFO ; teste si la FIFO est vide goto ProcessCommandAbort ReadData Goto EmptyFIFOAbortExp ProcessCommandAbort movlw 0xFA ; Abort Command subwf Temp10,0 btfss STATUS,Z goto ProceedExp movf Temp10,0 movwf commandValue ; Sauve la commande Abort ! goto ENDExposureAbort ProceedExp decfsz Temp1,1 goto Expose1 decfsz Temp2,1 goto Expose2 decfsz Temp3,1 goto Expose3 decfsz Temp4,1 goto Expose4 ENDExposureAbort btfss param5,NoShutter bcf PORTA,ComOBT ; ferme l'obturateur movf Temp4,0 ; Ecrit les valeurs movwf Param4 ; si 0 partout la pose a ete realisee completement movf Temp3,0 ; autrement c'est que la pose a ete abortee movwf Param3 ; et ces parametres servent a calculer le temps qui a ete movf Temp2,0 ; reellement execute. movwf Param2 movf Temp1,0 movwf Param1 bsf PORTE,0 ; Debug Call SendBackToPC ; Commande terminee, si ABort la commande abort est renvoyee return ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Decale les lignes en fonction du Binning Y ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; BinYdecal movf BinningY,0 ; Boucle sur les lignes movwf Temp1 BinningYloop: Call DecaleLigne decfsz Temp1,1 Goto BinningYloop ; Binne les lignes, eventuellement return ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Vide le registre partiellement ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; VideRegistrePartial ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; jete les pixels inutiles ; Boucle 16 bits movf VidePartial_HI,0 movwf Temp2 ; Temp2=HighX1 incf Temp2,1 bsf PORTB,PhiR ; Phir a 1 NextPixelDecalP1: movlw 0x01 subwf Temp2,0 ; si 1, derniere boucle btfsc STATUS,Z ; Zero ? Goto ZeroPixelDecal movlw d'0' movwf Temp1 Goto NextPixelDecalP2 ZeroPixelDecal: ; Derniere boucle movf VidePartial_LO,0 movwf Temp1 movf Temp1,1 ; zero ? btfsc STATUS,Z Goto EndPixeldecalLoop NextPixelDecalP2: movlw b'01110000' Xorwf PORTB,1 ; Bagote a fond PhiL2,L1 et phiS, avec PhiR a 1 nop nop Xorwf PORTB ,1 decfsz Temp1,1 Goto NextPixelDecalP2 decfsz Temp2,1 Goto NextPixelDecalP1 EndPixeldecalLoop: bcf PORTB,PhiR ; Phir a 1 return ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Fonctions Arithmetique ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; neg_A comf ACCaLO, F ; negate ACCa ( -ACCa -> ACCa ) incf ACCaLO, F btfsc STATUS,Z decf ACCaHI, F comf ACCaHI, F retlw 0 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Double Precision Subtraction ( ACCb - ACCa -> ACCb ) D_sub call neg_A ; At first negate ACCa; Then add ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Double Precision Addition ( ACCb + ACCa -> ACCb ) D_add movf ACCaLO,W addwf ACCbLO,F ; add lsb btfsc STATUS,C ; add in carry incf ACCbHI,F movf ACCaHI,W addwf ACCbHI,F ; add msb retlw 0 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Double Precision Multiply ( 16x16 -> 32 ) ; ( ACCb*ACCa -> ACCb,ACCc ) : 32 bit output with high word ; in ACCb ( ACCbHI,ACCbLO ) and low word in ACCc ( ACCcHI,ACCcLO ). ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; D_mult32 ; results in ACCb(16 msb's) and ACCc(16 lsb's) movlw 0x10 ; for 16 shifts movwf temp movf ACCbHI,W ; move ACCb to ACCd movwf ACCdHI movf ACCbLO,W movwf ACCdLO ; D=B clrf ACCbHI ; Clear B clrf ACCbLO clrf ACCcHI ; Clear C clrf ACCcLO mloop rrf ACCdHI, F ; rotate d right rrf ACCdLO, F btfss STATUS,C ; Carry, need to add? goto NO_ADD ; no addition necessary movf ACCaLO,W ; Addition ( ACCb + ACCa -> ACCb ) addwf ACCbLO, F ;add lsb btfsc STATUS,C ;add in carry incf ACCbHI, F movf ACCaHI,W addwf ACCbHI, F ;add msb NO_ADD rrf ACCbHI, F rrf ACCbLO, F rrf ACCcHI, F rrf ACCcLO, F decfsz temp, F ; loop until all bits checked goto mloop retlw 0 ;******************************************************************* ; 16 bit increment routine ;******************************************************************* ; ; reset un compteur, incremente le numero de packet ; ResetCPT movlw 0 movwf CptL movwf CptH incf NbpackL,F btfsc STATUS,Z incf NbpackH,F return ; Incremente un nombre 16 bits Inc16b incf CptL, F btfsc STATUS,Z incf CptH, F retlw 0 ;******************************************************************* ; Ecrit a la Fifo la taille de trame ;******************************************************************* FIFOWriteSizeDATA ; 0x0402 = 1024o +2 o = 1026 movlw 0x04 ; Initiate FIFO poid fort sur la taille de la ligne a lire call WriteData movlw 0x02 ; Initiate FIFO poid faible sur la taille de la ligne a lire call WriteData movf NbpackH,W ; Packet number call WriteData movf NbpackL,W ; Packet number call WriteData call Inc16b ; deja 2 octets return ; Nombre de pixels lu, nombre sur 32 bits IncNbPixelRead incf NbPix8,F btfss STATUS,Z Goto EndNbPixelRead incf NbPix16,F btfss STATUS,Z Goto EndNbPixelRead incf NbPix24,F btfss STATUS,Z Goto EndNbPixelRead incf NbPix32,F EndNbPixelRead:return ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Fake_AC_level bsf PORTB,PhiS bsf PORTB,PhiR ; Reset actif bcf PORTB,PhiR ; Reset inactif Call TempoLigne ; Fait semblant de lire des pixels bcf PORTB,PhiS Call TempoLigne return ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; La FIFO DOIT etre capable de contenir toute une ligne du CCD, a savoir, 4Ko pour un CCD de 2K ; Neanmoins, le cs8900 ne peut recevoir que des trames Ethernet de 1536 octets ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Cette partie est assez difficile en termes de calculs arithmetiques, car tout se passe en 2x8 bits !! ; Etape 1 : saucisonner les chaines de pixels en trames de 1K ; Etape 2 : Ecrire 2xN pixels dans la FIFO + 2 valeurs de 8 bits pour la taille + 2 valeurs de numero de trame ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ReadoutPixels ; call niveau 3 movf HighDX,W movwf TempH_DX movf LowDX,W movwf TempL_DX movf TempH_DX,W movwf BoucleH incf BoucleH,1 NextPixelReadP1: ; Boucle sur BoucleL et BoucleH movlw 0x01 subwf BoucleH,0 ; si 1, derniere boucle btfsc STATUS,Z ; Zero ? Goto ZeroPixelRead movlw d'0' ; 256 loops movwf BoucleL Goto NextPixelreadP2 ZeroPixelRead: ; derniere boucle movf TempL_DX,W movwf BoucleL movf BoucleL,F ; zero ? btfsc STATUS,Z Goto EndPixelLoop ; don't proceed ;;;;;;;;;;;;;;;; BOUCLE PIXELS NextPixelReadP2: ;;; doit faire 40 instructions max !! = 8us ;;; ;;; bsf PORTB,PhiR ; Reset actif bcf PORTB,PhiR ; Reset inactif IF DEBUG Call incNbPixelRead ; Incremente le nombre de pixels lus ! ENDIF bcf PORTA,VsampCCDref ; SHC5320 track mode nop btfss CptH,1 ; Egal a 512 ? Goto Proceed_readout Call ResetCPT Call FIFOWriteSizeDATA Proceed_readout movf BinningX,0 movwf Temp3 bsf PORTA,VsampCCDref; Hold CCD REFERENCE SIGNAL : 1.4us ; SHC5320 has acquired data decfsz Temp3,1 ; Binning >1 ? Goto NextPixel_TO_Bin Goto NoBinning ; No skip next block NextPixel_TO_Bin: movlw b'00110000' ; L1 et L2 bagottent Xorwf PORTB,1 ; Amene les charges sous la porte S nop nop Xorwf PORTB,1 ; decfsz Temp3,1 ; goto NextPixel_TO_Bin NoBinning: movlw b'01110000' ; PhiS a 0, PhiL1 a 1, PhL2 a 0 Xorwf PORTB,1 ; Amene le signal CCD ;;;;;;;;;;; le can doit avoir fini de convertir ici bcf PORTA,HighByteE ; High byte required nop movf PORTC,W ; PORTC->W IF TESTCOM ; Debug ... teste la communication movf CptH,W ENDIF movwf CCDhigh ; Save it bsf PORTA,HighByteE ; High byte NOT required nop movf PORTC,W ; PORTC-> W recupere la valeur low byte ! IF TESTCOM movf CptL,W ENDIF movwf CCDLow ; Save it ;;;;;; Fin lecture DATA bcf PORTA,StartConv ; StartConvert bsf PORTA,StartConv ;;;;;;;;;; ecrit les datas dans la FIFO movf CCDhigh,W movwf PORTD ; Write Data to Port IF REALCHIP WR_FifoFullHB btfsc PORTE,FIFOFull ; teste si la FIFO est vide goto WR_FifoFullHB_OK ; Si FIFO pleine bagote PhiR pour maintenir le niveau AC Call Fake_AC_level ; goto WR_FifoFullHB ENDIF WR_FifoFullHB_OK bcf PORTE,FIFOWrite bsf PORTE,FIFOWrite ; Write it to FIFO movf CCDLow,W movwf PORTD ; Write Data to Port IF REALCHIP WR_FifoFullLB btfsc PORTE,FIFOFull ; teste si la FIFO est vide goto WR_FifoFullLB_OK ; Si FIFO pleine bagote PhiR pour maintenir le niveau AC Call Fake_AC_level ; goto WR_FifoFullLB ; ENDIF WR_FifoFullLB_OK bcf PORTE,FIFOWrite bsf PORTE,FIFOWrite ; Write it to FIFO ;;;;;; Fin ecrit Data FIFO ;;;;;; Incremente CPH et CPL incf CptL, F btfsc STATUS,Z incf CptH, F ;;;;;; Fin Incremente CPH et CPL movlw b'01110000' Xorwf PORTB,1 ; Remonte PhiS,L2 et descend L2 decfsz BoucleL,1 Goto NextPixelreadP2 decfsz BoucleH,1 Goto NextPixelreadP1 ;;;;;;;;;;;;;;;; FIN BOUCLE PIXELS EndPixelLoop: ; Ligne terminee return ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Readout FAKE, lit les CCD mais ecrit rien a la FIFO, sert a reveiller proprement la chaine ; analogique du CCD en realisant du pre-clocking. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Readout_Awake_CCD movlw LargXTotalHI movwf TempH_DX movlw LargXTotalLO movwf TempL_DX movf TempH_DX,W movwf BoucleH incf BoucleH,1 NextPixelReadP1Fake: ; Boucle sur BoucleL et BoucleH movlw 0x01 subwf BoucleH,0 ; si 1, derniere boucle btfsc STATUS,Z ; Zero ? Goto ZeroPixelReadFake movlw d'0' ; 256 loops movwf BoucleL Goto NextPixelreadP2Fake ZeroPixelReadFake: ; derniere boucle movf TempL_DX,W movwf BoucleL movf BoucleL,F ; zero ? btfsc STATUS,Z Goto EndPixelLoopFake ; don't proceed ;;;;;;;;;;;;;;;; BOUCLE PIXELS NextPixelReadP2Fake: ;;; doit faire 40 instructions max !! = 8us bsf PORTB,PhiR ; Reset actif bcf PORTB,PhiR ; Reset inactif bcf PORTA,VsampCCDref ; SHC5320 track mode nop nop nop movf BinningX,0 movwf Temp3 bsf PORTA,VsampCCDref ; Hold CCD REFERENCE SIGNAL decfsz Temp3,1 ; SHC5320 has acquired data Goto NextPixel_TO_BinFake Goto NoBinningFake NextPixel_TO_BinFake: movlw b'00110000' ; L1 et L2 bagottent Xorwf PORTB,1 ; Amene les charges sous la porte S nop nop Xorwf PORTB,1 ; decfsz Temp3,1 ; goto NextPixel_TO_BinFake NoBinningFake movlw b'01110000' ; PhiS a 0, PhiL1 a 1, PhL2 a 0 Xorwf PORTB,1 ; Amene le signal CCD ; le can doit avoir fini de convertir ici Call TempoLigne bcf PORTA,StartConv ; StartConvert bsf PORTA,StartConv nop nop movlw b'01110000' Xorwf PORTB,1 ; Remonte PhiS,L2 et descend L2 decfsz BoucleL,1 Goto NextPixelreadP2Fake decfsz BoucleH,1 Goto NextPixelreadP1Fake ;;;;;;;;;;;;;;;; FIN BOUCLE PIXELS EndPixelLoopFake return ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Param1 : BinningX 1 to 255; 0 will make 256 ! ; Param2 : BinningY 1 to 255 ; ; Param3 : Low Byte X1 Fenetre demarre a 1 ; Param4 : High Byte X1 ; ; Param5 : Low Byte Y1 -> Nombre de lignes a vider avant ; Param6 : High Byte Y1 -> la premiere ligne : 255*High+Low ; ; Param7 : Low Byte DX Tient compte du BINNING !!! DX=Dx/BinX ; Param8 : High Byte DX ; ; Param9 : Low Byte DY Tient compte du BINNING !!! DY=Dy/BinY ; Param10: High Byte DY ; ;******************************************************************************** ; 1. Partie 1 : decaler et vider les Y1 lignes du CCD ; 2. Partie 2 : decaler et binner les binY lignes du CCD ; 3. Partie 3 : degager les pixels inutiles du registre horizontal ; 4. Partie 4 : Lire les pixels ; 5. Partie 5 : Degager les pixels inutiles en fin de registre de lecture ;******************************************************************************** ReadOUTCCD ; call niveau 2 Call ReadParametre movwf param1 ; parametre 1 Call ReadParametre movwf param2 ; parametre 2 Call ReadParametre movwf param3 ; parametre 3 Call ReadParametre movwf param4 ; parametre 4 Call ReadParametre movwf param5 ; parametre 5 Call ReadParametre movwf param6 ; parametre 6 Call ReadParametre movwf param7 ; parametre 7 Call ReadParametre movwf param8 ; parametre 8 Call ReadParametre movwf param9 ; parametre 9 Call ReadParametre movwf param10 ; parametre 10 Call Doutput ; Afin de pouvoir ecrire dans la FIFO ; Calcule sur 32 bits DX * DY movf HighDX,W movwf ACCaHI movf LowDX ,W movwf ACCaLO movf HighDY,W movwf ACCbHI movf LowDY ,W movwf ACCbLO Call D_mult32 movf ACCbHI,W ; Nbre de pixels en 32 bits movwf NbPix32 movf ACCbLO,W movwf NbPix24 movf ACCcHI,W movwf NbPix16 movf ACCcLO,W movwf NbPix8 clrf NbPix8 clrf NbPix16 clrf NbPix24 clrf NbPix32 Clrf NbpackL Clrf NbpackH ; Calcule les pixels restant .... a vider du register HRZ ; Remainder =LargX - (X1+DX*BinninX) movf HighDX,W ; Doit tenir compte du binningX movwf ACCaHI movf LowDX ,W movwf ACCaLO movlw 0x00 movwf ACCbHI movf BinningX,W movwf ACCbLO Call D_mult32 ; ( ACCb*ACCa -> ACCb,ACCc ) movf ACCcHI,W movwf ACCaHI movf ACCcLO,W movwf ACCaLO movf HighX1,W ; debut de fenetre movwf ACCbHI movf LowX1 ,W movwf ACCbLO Call D_add ; ACCb + ACCa -> ACCb movf ACCbHI,W ; B->A movwf ACCaHI movf ACCbLO ,W movwf ACCaLO movlw LargXTotalHI ; Additionnal pixels to wipe movwf ACCbHI movlw LargXTotalLO movwf ACCbLO Call D_sub ; ( ACCb - ACCa -> ACCb ) movf ACCbHI,W movwf RemainderX1_HI movf ACCbLO ,W movwf RemainderX1_LO ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Call ResetCPT Call FIFOWriteSizeDATA ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Etape 1 : enleve les lignes inutiles ; HighY1 is null ? movf HighY1,1 ; move to itself btfsc STATUS,Z ; Zero ? Goto lowByteWindowY ; Poid fort N*256+M NextLineDecalPfa1: movlw d'0' movwf Temp10 NextLineDecalPfa2: Call DecaleLigne btfsc Temp10,0 ; Effacer une ligne tout les modulo 4 decalages Goto NoLineWipeFA btfss Temp10,1 Call Vide_RegistreFULL NoLineWipeFA decfsz Temp10,1 Goto NextLineDecalPfa2 decfsz HighY1,1 Goto NextLineDecalPfa1 lowByteWindowY: ; Poid faible (M) le reste ; LowY1 is null ? movf LowY1,1 ; move to itself btfsc STATUS,Z ; Zero ? Goto EndWindowY NextLineDecalPfa: Call DecaleLigne btfsc LowY1,0 ; Effacer une ligne tout les modulo 4 decalages Goto NoLineWipeFf btfss LowY1,1 Call Vide_RegistreFULL NoLineWipeFf decfsz LowY1,1 Goto NextLineDecalPfa EndWindowY: Call Vide_RegistreFULL ; Dans tout les cas ! ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;; termine, lignes degagees Call Readout_Awake_CCD ; lit une ligne sans la transferer a la FIFO ; pour reveiller l'ampli du CCD ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ICI, debut de lecture de l'image ou fenetre elle meme movf HighDY,0 movwf Temp10 ; Temp10=HighDY incf Temp10,1 MainLineLoop1: movlw 0x01 subwf Temp10,0 ; si 1, derniere boucle btfsc STATUS,Z ; Zero ? Goto ZeroLigneDecal movlw d'0' movwf Temp9 Goto MainLineLoop2 ZeroLigneDecal: movf LowDY,0 ; derniere boucle movwf Temp9 movf Temp9,1 ; zero ? btfsc STATUS,Z Goto EndMainLineLoop MainLineLoop2: Call BinYdecal ; Decale BinningY fois la ligne movf HighX1,W movwf VidePartial_HI movf LowX1,W movwf VidePartial_LO Call VideRegistrePartial ; vide LowX1 et HighX1 pixels Call ReadoutPixels ; Lit HighDX et LowDX pixels movf RemainderX1_HI,W movwf VidePartial_HI movf RemainderX1_LO,W movwf VidePartial_LO Call VideRegistrePartial ; Vide le reste du registre horizontal decfsz Temp9,1 Goto MainLineLoop2 decfsz Temp10,1 Goto MainLineLoop1 EndMainLineLoop: ; Termine avec un paquet de 512 faux pixels btfsc CptH,1 ; Egal a 512 ? Goto ExitReadout movlw 0xFF call WriteData movlw 0x55 call WriteData Call Inc16b Goto EndMainLineLoop ExitReadout: Call DInput ; Laisser le Bus libre. bcf PORTA,VsampCCDref ; SHC5320 track mode pour eviter qu'il ne chauffe trop.... return ;******************************************************************************** ; ; Ne fait rien, renvoie juste les parametres sans les modifier ; Pour verifier que tout est OK et que le Pic est bien vivant. ; ;******************************************************************************** TestPARAMS Call ReadParametre movwf param1 ; parametre 1 Call ReadParametre movwf param2 ; parametre 2 Call ReadParametre movwf param3 ; parametre 3 Call ReadParametre movwf param4 ; parametre 4 Call ReadParametre movwf param5 ; parametre 5 Call ReadParametre movwf param6 ; parametre 6 Call ReadParametre movwf param7 ; parametre 7 Call ReadParametre movwf param8 ; parametre 8 Call ReadParametre movwf param9 ; parametre 9 Call ReadParametre movwf param10 ; parametre 10 Call SendBackToPC ; Commande terminee return ;******************************************************************************** ; Init les IOs du PIC ;******************************************************************************** InitIOs ; Port A movlw 0x0 ; PreInits movwf PortA bsf PORTA,StartConv ; StartConvert a 1 bsf PORTA,HighByteE ; High Byte Enabled bcf PORTA,VsampCCDref ; Hold off bcf PORTA,ComOBT ; OBT off bsf PORTA,FIFORead ; Fiforead, inverted logic ; Port B movlw 0x0 movwf PortB movlw b'01100000' ; set to 1 PhiS,PhiL2, rest is 0 movwf PortB ; Port E bsf PORTE,FIFOWrite ; FifoWrite, inverted logic return ;******************************************************************************** ; Init IOs du Pic sous forme de commande externe ;******************************************************************************** InitIOsCommand Call InitIOs Call SendBackToPC ; Commande terminee return ;******************************************************************************** ; Toutes clocks a 1 en //, tres utile pour tester les niveaux haut d'horloges ;******************************************************************************** AllCloksToOne ; Pratique pour regler les tensions movlw b'11111111' movwf PortB Call SendBackToPC ; Commande terminee return ;******************************************************************************** ; Toutes clocks a 0 en //, tres utile pour tester les niveaux bas des horloges ;******************************************************************************** AllCloksToZero movlw b'00000000' movwf PortB Call SendBackToPC ; Commande terminee return ;******************************************************************************** ; Ouvre le shutter, sous forme de commande externe ;******************************************************************************** OpenShutter bsf PORTA,ComOBT ; Ouvre l'obturateur Call SendBackToPC ; Commande terminee return ;******************************************************************************** ; Ferme le shutter, sous forme de commande externe ;******************************************************************************** CloseShutter bcf PORTA,ComOBT ; Ouvre l'obturateur Call SendBackToPC ; Commande terminee return ;******************************************************************************** ;******************************************************************************** ;******************************************************************************** ;******************************************************************************** ; Manage toute les commandes relatives au PIC ;******************************************************************************** ; Une commande est une chaine d'octets, le premier octet est la commande ; et les autres sont des parametres ; ; Commande param1 param2 param3 param4 param5 param6 .... ; ; Certaines commandes n'ont pas de parametres, le nombre de parametre est ; variables en fonction de la commande ; La commande est mise en forme par le SX52 qui l'extraie de la trame IP/UDP ; ;******************************************************************************** manageCommand ; call niveau 1 movlw 0x01 ; Comande n1 subwf commandValue,0 btfsc STATUS,Z call ViderCCD ; Param1 est le nombre de vidages movlw 0x02 ; Comande n2 subwf commandValue,0 btfsc STATUS,Z call ExecutePose ; Param1 Param2 Param3 Param4, gere 85 heures de pose sur un nombre 32 bit, a 1us la boucle ; Cette routine lit la FIFO pour un eventuel ABORT de la pose. movlw 0x03 ; Commande n3 subwf commandValue,0 btfsc STATUS,Z call CameraID ; Renvoie CamID a des fins de determiner quelle camera est ce. movlw 0x04 ; Commande n4 subwf commandValue,0 btfsc STATUS,Z call ReadOUTCCD ; Param1 : BinningX 0-255 ; Param2 : BinningY 0-255 ; Param3 : Low Byte X1 Fenetre ; Param4 : High Byte X1 ; Param5 : Low Byte Y1 ; Param6 : High Byte Y1 ; Param7 : Low Byte DX ; Param8 : High Byte DX ; Param9 : High Byte DY ; Param10 : Low Byte DY movlw 0x05 subwf commandValue,0 btfsc STATUS,Z call TestPARAMS ; Renvoie les N parametres movlw 0x06 subwf commandValue,0 btfsc STATUS,Z call InitIOsCommand ; Init des IOs movlw 0x07 subwf commandValue,0 btfsc STATUS,Z call AllCloksToOne ; met tout le port B a 1 movlw 0x08 subwf commandValue,0 btfsc STATUS,Z call AllCloksToZero ; met tout le port B a 0 movlw 0x09 subwf commandValue,0 btfsc STATUS,Z call OpenShutter ; Ouvre le shutter movlw 0x0A subwf commandValue,0 btfsc STATUS,Z call CloseShutter ; Ferme le shutter return ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Start ICI le programme ! ;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Start bsf STATUS,RP0 ; select register page 1 movlw b'00000111' ; W=3 movwf ADCON1 ; Set port A and E as digital movlw b'00000001' ; set RA0=EmptyFIFO as input, rest as output movwf TRISA ; Set port A Direction movlw d'0' ; W=0 movwf TRISB ; Set port B as output (CCDs clocks) movlw b'11111111' movwf TRISC ; Set port C as input from CAN movlw b'11111111' ; D port is bidir, make it as input by default movwf TRISD movlw b'00000100' ; set RE2=FIFOFull as Input, PSPMODE disabled movwf TRISE bcf STATUS,RP0 ; DEselect register page 1 Call TempoLigne ; Startup, pour demarrer ; INIT des chips Call InitIOs Call WaitForSx52Reset ; Waits that SX52 has issued FIFO reset, otherwise it may read something BEFORE ; the SX52 has really started, and crash. ; wait for NOT fifo_empty loop1Main bsf PORTE,PinDebug ; Debug , fait une horloge sur le port E pour verifier que le Pic est revenu dans la boucle d'attente nop nop bcf PORTE,PinDebug btfss PORTA,EmptyFIFO ; teste si la FIFO est vide, si vide boucler goto loop1Main ; vide, rester ;Read command loop2Main Call Dinput ReadData movwf commandValue ; Commande principale call manageCommand ; Decrypte les commandes et les execute btfsc PORTA,EmptyFIFO ; teste si la FIFO est vide goto loop2Main ; Autre ordre a executer ? goto loop1Main ; Non, FIFOVide ;;;;;;;;;;;;;;;;;;;;;;;;;;; Tests du mode de DEBUG ;;;;;;;;;;;;;;;;;;;; ; Mode pas a pas IF DEBUG TestStart movlw d'1' ; movwf LowY1 movlw d'0' ; movwf HighY1 movlw d'1' ; movwf LowX1 movlw d'0' ; movwf HighX1 movlw d'1' ; movwf BinningX movlw d'1' ; movwf BinningY movlw d'10' ; movwf LowDX movlw d'0' ; movwf HighDX movlw d'1' ; movwf LowDY movlw d'0' ; movwf HighDY call ReadOUTCCD goto TestStart ENDIF end