;MPLAB V8.10 ;---------------------------------------------------------------------- ;Debug build of project `C:\Mplab8\_Mesprojets\_HAPR\Hapr2008.mcp' started. ;Preprocessor symbol `__DEBUG' is defined. ;Thu Dec 18 19:50:37 2008 ;---------------------------------------------------------------------- ;Clean: Deleting intermediary and output files. ;Clean: Deleted file "C:\Mplab8\_Mesprojets\_HAPR\HAPR_876_2008_.err". ;Clean: Deleted file "C:\Mplab8\_Mesprojets\_HAPR\HAPR_876_2008_.cod". ;Clean: Deleted file "C:\Mplab8\_Mesprojets\_HAPR\HAPR_876_2008_.hex". ;Clean: Deleted file "C:\Mplab8\_Mesprojets\_HAPR\HAPR_876_2008_.lst". ;Clean Warning: File "" doesn't exist. ;Clean: Done. ;Executing: "C:\Program Files\Microchip\MPASM Suite\MPASMWIN.exe" /q /p16F876 "HAPR_876_2008_.asm" /l"HAPR_876_2008_.lst" /e"HAPR_876_2008_.err" /d__DEBUG=1 /x"C:\MPLAB8\_Mesprojets\HAPR_876_2008_.xrf" /aINHX8M ;Loaded C:\Mplab8\_Mesprojets\_HAPR\HAPR_876_2008_.cod. ;---------------------------------------------------------------------- ;Debug build of project `C:\Mplab8\_Mesprojets\_HAPR\Hapr2008.mcp' succeeded. ;Preprocessor symbol `__DEBUG' is defined. ;Thu Dec 18 19:50:41 2008 ;---------------------------------------------------------------------- ;BUILD SUCCEEDED ;---------------------------------------------------------------------- ;21:12/08 correction bug calcul temperature T=20*points-6500 ; ajustement offset avec reel value mesuree 6500-6425=> +0.75°C correctif ;18/12/08 ajustage R 1200 au lieu de 1000 pour niveau 4.09V sur RA3 +ReF et 2.04 sur RA2 -REF ;10/12/2008 --------- PB & erreurs sur circuit imprimé.. corrections le 12/12/08 ; voir ligne 750 inversion ordre bits allumage leds suite erreur sens de cablage fiche femelle ; inversion +Vref et - Ref sur circuit imprimé ; inversion pistes pin 2-3 5 sur DB9F ... sens inverse ! ; sac de noeud sur inverseur RS232 .... ;---------- ; montage prototype transferé sur circuit imprimé ;---------- ;5/04/07 rajout sortie sur Rs232 tous les 32 caracteres soit 32*8*97.65mS soit ~25 sec. ;--------------- ;10 mars 07 Version (SANS MAX186) avec l'ADC du 16F876 mais avec echelle dilatee 1.64 … 3,33V ; pour avoir une resolution de 0,2øC ;03 mars rajout mode compilation AVEC/SANS SHIFT pour avoir Heure ;et temp sur 16 cars (voir ligne 191) ;02 mars 07 : ;modif filtrage mesure sur 64 valeurs , bug sur bank car apres affichage bcd retour bank0 ;------ ;18/02/07 separe pin test hardware et pin MAJ RTC ; ATTENTION si tension Pile=0V pas possible d'initialiser le RTC ; il faut Vpile > 2,5V ; 05/02/07 suppression du 0 dizaine d'heure et jour horloge et mesure Temper ;04/02/07 ;HARP_876_ICSP_8.asm ;------------------------------ ;message obtenu sur terminal au debut du programme : ;HAPR_876_ICSP_ADC_low_range_0801129 Q=8MHz ;16F876 avec bootloader ;ADC 10b gamme=2.00V ;RB2 … 0 pour MAJ RTC ;ver: 32car Defilants, RS232 output (c)PAULFJUJO ;MAJ DS1307 ;AAMMJJWWHHMMSS ;08120101210900 ; 1/12/08 21H09M00S ;============ ; corrige bug Renseigne_Time pointait sur Buffer_MAJ au lieu de Buffer_Texte ; attention buffer_Texte+10 => offset +16!! ne pas oublier le point -> Buffer_Texte+.10 ;HARP_876_ICSP_7.asm partie I2C debug‚e : ; bug routine I2C confusion entre ACK et M_ACK ; I2C g‚r‚ 100% software ;03/02/07 ;HAPR_876_ICSP_6.asm ; bug : interference entre IT Rb0 acquisition car et rangement dans buffer Texte ; et traitement Saisie_Caracteres pour mise … l'heure horloge DS1307 via Buffer MAJ ; modif pour ne garder que l'acquisition char en interrupt sur Rb0 ;et traitement separ‚s dans Waitsynchro et Saisie2car ; pin26=RB7 -- vert ---5 de DS1307 SDA ; pin25=RB6 -- jaune---6 de DS1307 SCL ;======================================= ; HARP_ICSP_5.asm 28/01/07 avec DS1307 ;Program Memory Words Used: 1914 ;Program Memory Words Free: 6278 ; bug sur horloge.. OK au 1er passage puis BAD ??? ;------------------------------ ; HARP_ICSP_4.asm 27/01/07 version OK avec traitement PCLATH ; tables caractere en fond de memoire, avant le bootloader zone B00... ; MAIS avec DS1307 non activ‚ ;------------------------------ ;voir link http://z.oumnad.123.fr/Microcontroleurs/PIC16F876.pdf ;HAPR_876_ICSP_3.asm 07/01/07 test BAD .. ;============== ;.HAPR_ICSP_3.asm Q=8MHz. ;PIC16F876 . ;PaulFjujo 070110 ;.1 ;.2 ;.3 ;.********* ;============== ; deplacement des tables caractere en fond de memoire, avant le bootloader ; rajout gestion DS1307 ; pin28=RB7 -- vert ---5 de DS1307 SDA ; pin27=RB6 -- jaune---6 de DS1307 SCL ;============================================== ;HAPR_876_ICSP_2.asm 30/12/06 test OK ;modif pour choix Msg1 avec temperature OU msg2 modifiable par pin RB2 ;meme apres passage dans boucle principale (plus besoin de reset!) ;rajout compilation conditionnelle BUILD_SOFT_WITH_8CAR ou 16 CAR ;rajout hardware: inter 2x N.C. pour passage mode pin RC6 RC7 en ICSP ou normal sur les Leds ; RB3 rest inaccessible car on reste en mode LVP ;HAPR_876_ICSP_1.asm 29/12/06 ; donc essai usage port C pour les 8 leds, mais condamne les specificit‚s USART,I2C..... ; et passage lecture RS232 sur Rb0 en interrupt ; et oblige de defaire les 2 fils de programmation! ;------------- BUG ? -> non, mais ;If low-voltage programming mode is not used, the LVP ;bit can be programmed to a '0' and RB3/PGM becomes ;a digital I/O pin. However, the LVP bit may only be programmed ;when programming is entered with VIHH on MCLR. ;The LVP bit can only be charged when using high voltage on MCLR. ; essai HAPR_876_ICSP_0.asm OK mais pas d'alumage led sur RB3 ! ; PB led Portb,3 ne s'active pas malgre LVP_OFF ...sinon il faut abandonner le mode basse tension ; BOOTLOADER: http://www.ehl.cz/pic/pic_e.htm ; 29/12/2006 16F876 avec bootloader install‚ , programmation ICSP via 2 fils RC7 Pin 18 et RC6 pin17 ; usage de ICSP bootloader inclus … partir de 1F00 ..a ..1FFF ; bootldr_876_ok_061224.asm ; programmation par liaison serie IN CIRCUIT ; pin17=RC6=Tx -- Blanc/vert ---- 3 de DS275 ; pin18=RC7=Rx ----- Vert ------- 1 de DS275 ; liaison RS232 ; pin21=RB0 <- blanc...3 de DS275 5 <- 2 RS232 Tx DB9M clavier ; pin22=RB1 -> vert ...1 de DS275 7 -> 3 Rs232 Rx DB9M ecran ; ne pas toucher … la zone 0x70 ..7B inclus ; donc 0x7C, 7D 7E 7F dispo ; version anterieure avec 16F88! ;============================================= ;03/11/06 LM335Z 2,73V 0øC ;*************************************** ; ASSIGNATIONS SYSTEME * ;*************************************** ; REGISTRE OPTION_REG (configuration) ; ----------------------------------- ;OPTIONVAL EQUB'00000000' ; RBPU b7 : 1= Resistance rappel +5V hors service ; INTEDG b6 : 1= Interrupt sur flanc montant de RB0 ; 0= Interrupt sur flanc descend. de RB0 ; TOCS b5 : 1= source clock = transition sur RA4 ; TOSE b4 : 1= S‚lection flanc montant RA4(si B5=1) ; 0= S‚lection flanc descendant RA4 ; PSA b3 : 1= Assignation pr‚diviseur sur Watchdog ; 0= Assignation pr‚diviseur sur Tmr0 ; PS2/PS0 b2/b0 : valeur du pr‚diviseur ; 000 = 1/1 (watchdog) ou 1/2 (tmr0) ; 001 = 1/2 1/4 ; 010 = 1/4 1/8 ; 011 = 1/8 1/16 ; 100 = 1/16 1/32 ; 101 = 1/32 1/64 ; 110 = 1/64 1/128 ; 111 = 1/128 1/256 ; REGISTRE INTCON (contr"le interruptions standard) ; ------------------------------------------------- ; INTCONVAL EQU B'00000000' ; GIE b7 : masque autorisation g‚n‚rale interrupt ; PEIE b6 : masque autorisation g‚n‚rale p‚riph‚riques ; T0IE b5 : masque interruption tmr0 ; INTE b4 : masque interruption RB0/Int ; RBIE b3 : masque interruption RB4/RB7 ; T0IF b2 : flag Tmr0 ; INTF b1 : flag RB0/Int ; RBIF b0 : flag interruption RB4/RB7 ; REGISTRE PIE1 (controle les interruptions p‚riph‚riques) ; ---------------------------------------------------- ; PIE1VAL EQU B'00000000' ; PSPIE b7 : Toujours 0 sur PIC 16F786 ; ADIE b6 : masque interrupt convertisseur A/D ; RCIE b5 : masque interrupt r‚ception USART ; TXIE b4 : masque interrupt transmission USART ; SSPIE b3 : masque interrupt port s‚rie synchrone ; CCP1IE b2 : masque interrupt CCP1 ; TMR2IE b1 : masque interrupt TMR2 = PR2 ; TMR1IE b0 : masque interrupt d‚bordement tmr1 ; REGISTRE PIE2 (contr"le interruptions particuliŠres) ; ---------------------------------------------------- ; PIE2VAL EQU B'00000000' ; UNUSED b7 : inutilis‚ = 0 ; RESERVED b6 : r‚serv‚ = 0 ; UNUSED b5 : inutilis‚ = 0 ; EEIE b4 : masque interrupt ‚criture EEPROM ; BCLIE b3 : masque interrupt collision bus ; UNUSED b2 : inutilis‚ = 0 ; UNUSED b1 : inutilis‚ = 0 ; CCP2IE b0 : masque interrupt CCP2 LIST P=16F876, c=132,n=60,st=ON,mm=ON,t=ON,x=ON,r=hex #include <../common/P16F876.INC> ; list c=132,n=60,st=ON,mm=ON,t=ON,x=ON,r=hex EXPAND ERRORLEVEL -306 ERRORLEVEL -302 __CONFIG _CP_OFF & _DEBUG_OFF & _WRT_ENABLE_OFF & _CPD_OFF & _LVP_ON & _BODEN_OFF & _PWRTE_ON &_WDT_OFF & _HS_OSC ;#define DEBUG ;#define BUILD_SOFT_WITH_8CAR ;#define TRACE ;#define TESTSAISIE #define BUID_WITH_SHIFT ;---------------------------------------------- ;DECLARATION VARIABLE ;---------------------------------------------- CBLOCK 0x020 ; debut de la zone variables Buffer_Texte :.32 ; reservation de 32 octets (car) SEC MIN HEURE JourSem Jour Mois Annee CtrlReg varun ; numero de CAR Ncol ; numero de caractere pendant l'affichage Curseur ; curseur d'ecriture (la ou le texte sera modifier) _Index_T ; Numero de car … afficher _Index_N ; index Now colonne en cours _Index_M ; adresse en cours dans Matrice des caracteres 0x200 … 0x4FF _Index_C ; numero de Colonne … afficher _Offset_C ; offset dans le caractere _RsCount _RsByte _Cpt1 _Temp1 _Temp2 cmpt1 ; compteur ; ---- Conf ADDR DEV_DS1307 ; adresse DS1307 RTC DEV_1624 ; Adresse DS1624 mesure T° BitsTaches STR_INDEX _N _N0 _N1 O_BYTE I_BYTE TC_HI TC_LO Nb_0 Drapeaux ; Drapeaux de 8 bits … usage multiple ;7 signe 1=negatif ;6 elligible =1 si un car dispo sinon sinon =0 ;5 affichage BCD 5 digits sur RS232 ;4 il est temps de sortir l(info sur RS232 ;3 Affichage mesure filtree au 1/100 de degres ;2 Traitement mesure Filtree T Exter 1=fait 0=en cours ;1 1 = blanc avant chiffre ;0 1=message 1 avec temper 1=message 2 modificable SANS mesure de temperature ENDC LastBank0 EQU Drapeaux IF ( LastBank0 >= 0x70 ) ERROR "Attention debordement zone RAM bank0" ENDIF Buffer_MAJ EQU SEC ; ---------------- CBLOCK 0x7C ;Attention 0x70 ... 0x7B used by bootloader STATUS_TEMP W_TEMP PCLATH_TEMP ENDC LastCDA equ PCLATH_TEMP IF ( LastCDA >= 0x7F ) ERROR "Attention debordement zone RAM Bootloader en bank0" ENDIF ;----------------- cblock 0xA0 ; en bank1 Cpt10 ; Bcd Mcount btmp btmp1 dixmil mille cent dix un ; variables 16 bits SommeTamb :1 Tamb_F :2 ; Tamb STamb_F :2 valx :2 val1 :2 val2 :2 val3 :2 reste :2 result :2 Nb_Test :2 count1 ;delay routines count2 ;delay routines count3 ;delay routines Nb_1 ; compteur bit pour Max186 endc ;---------------------- cblock 0x110 ; 96 bytes en bank2 DATA_EE_DATA endc ;---------------------- cblock 0x190 ; 96 bytes en bank3 dummy99 endc ;------- Hardware ------------ ; PIC16F876 en DIP28 narrow Q=8MHz ;-----------HARDWARE ---------------------------------------- ; PIC16F876 DS1624 DS1307 ; PORTB,7 (pin 28) --- output-->SDA (pin 1) ---- SDA (pin 5)----- I2C Devices..2.7K pullup ; PORTB,6 (pin 27) <--in/out---> SCL (pin 2) ---- SCL (pin 6)---To Other ....2.7K pullup ; PORTB 5 entree <----------------- test hardware si =0 ; PORTB 4 entree <----------------- choix message ; PORTB,3 xxxx reserved xxxxx ; PORTB,2 entree pour MAJ RTC si =0 ;liaison RS232 19200 bauds ; PORTB,1 -> vert ...1 de DS275 7 -> 3 Rs232 Rx DB9M ecran ; PORTB,0 <- blanc...3 de DS275 5 <- 2 RS232 Tx DB9M clavier ;--- ; PORTA,5 (pin 7)----- ; PORTA,4 (pin 6) ---- ; PORTA,3 (pin 5) ---------> +REF 3.00V => 1023 ; PORTA,2 (pin 4) <--------- -REF 1.00V => 0000 ; PORTA,1 (pin 3) <----------- Transistor 2N2222 <- capteur de proximite top synchro ; bornier 1(+)=Brun 2(-)=Bleu 3(signal)=Noir ; PORTA,0 (pin 2) <----------- Entree ANALOGIQUE (mes de temperature) ; PORTC ->(pin 11..18)--------> ULN2803----> 8x 270 ohms ----> 8 leds rouge diam 1,8mm ; DS275 8 et 2 au VCC et 4=Gnd ; "Voice Coil" Disque dur actionne/synchronise par oscilateur NE555, ; R ajustable domaine de frequence :10 … 25Hz ;---- Definitions --------- #define OSC_FREQ 8000000 #define Port_8_Leds PORTC ;pin 11.14, 15..18 ;----- #define I2C_SDA PORTB,7 ;RB7 (pin 28) ---> output-->SDA #define I2C_SCL PORTB,6 ;RB6 (pin 27) <--in/out---> SCL #define inp_Test_Hard PORTB,5 ;RB5 (pin 26) <--- input =0 pour Test Hardware #define PinChoixMsg PORTB,4 ;RB4 (pin 25) <--- input pour Choix de message #define Rb3notavailable PORTB,3 #define inp_MAJ_RTC PORTB,2 ;RB2 (pin 23) <--- input =0 pour MAJ RTC #define Rs_Tx PORTB,1 ;RB1 (pin 22) ----> Output -- Pin 1 DS275 5 >---Rx RS232 pin3 DB9F #define Rs_Rx PORTB,0 ;RB0 (pin 21) <---- Input -- Pin 3 DS275 7 <-- Tx RS232 pin2 DB9F ;--------- #define SCLK_Max PORTA,5 ;pin7 --- #define DIN_Max PORTA,4 ;pin6 --- #define CS_Max PORTA,3 ;pin5 <--- +REF #define LectBit_Max PORTA,2 ;pin4 <--- -REF #define Top_Synchro PORTA,1 ;pin3 <--- <- capteur de proximite #define Analog0 PORTA,0 ;pin2 <-*-* analogue input Mesure LM335 (2730mV @ 0°C) ;----- #define Quartz 8000000 ;8MHZ #define RETENUE Drapeaux,7 #define ELLIGIBLE Drapeaux,6 #define Drp_MSGx Drapeaux,0 CONSTANT TABUL =.9 ; caractere ascii tabulation ;---------------------------- ;demarage apres reset ;---------------------------- org 0x000 ; Adresse de depart apres reset nop ; ICSP nop ; ICSP goto start ;---------------------------- ;interruption ;---------------------------- org 0x04 MOVWF W_TEMP ;Copy W to TEMP register SWAPF STATUS, W ;Swap status to be saved into W CLRF STATUS ;bank 0, regardless of current bank, Clears IRP,RP1,RP0 MOVWF STATUS_TEMP ;Save status to bank zero STATUS_TEMP register MOVF PCLATH, W ;Only required if using page 1 MOVWF PCLATH_TEMP ;Save PCLATH into W CLRF PCLATH ;Page zero, regardless of current page ; est-ce une interrupt sur RB0 ? receive RS232 btfsc INTCON,INTE ; tester si interrupt Rb0 autorisee btfss INTCON,INTF ; oui, tester si Flag Rb0 arme goto timer_int ; NON Rb0_int bcf INTCON,INTE ; raz autorise int RB0 call Read_RS ; lecture caractere bcf INTCON,INTF ; en sortie de traitement interrupt Rb0 devalid‚e! bsf ELLIGIBLE ; arme drapeau signalant la capture d'un car goto Fin_it timer_int btfsc INTCON,TMR0IE ; tester si interrupt timer autorisee btfss INTCON,TMR0IF ; oui, tester si Flag interrupt arme goto Fin_it ; non test suivant bcf INTCON,TMR0IE ; tester si interrupt timer autorisee bcf INTCON,TMR0IF ; RAZ flag interrupt ; et on en fait quoi ? ; rien pour l'instant ;*************************** Fin_it MOVF PCLATH_TEMP, W ;Restore PCLATH MOVWF PCLATH ;Move W into PCLATH SWAPF STATUS_TEMP, W ;Swap STATUS_TEMP register into W ;(sets bank to original state) MOVWF STATUS ;Move W into STATUS register SWAPF W_TEMP, F ;Swap W_TEMP SWAPF W_TEMP, W ;Swap W_TEMP into W retfie ;on rentre ;---------------------- ; boucle principale ;---------------------- start ;init ports nop clrf PORTB clrf PORTA clrf PORTC bank1 movlw b'00011111' ;en sorties sauf RA0,RA1,RA2,RA3,RA4 en entrees movwf PORTA movlw b'00110101' ;en sorties sauf RB0,RB2,RB4,R5 movwf PORTB movlw 0x00 ;tout le port C en sorties movwf PORTC ;definition des voies digital ou analogique avec ADCON1 REGISTER (ADDRESS 9Fh) ;bit 7 ADFM: A/D Result Format Select bit 1 = Right justified. ;bit 6-4 Unimplemented: Read as '0' ;bit PCFG3:PCFG0 AN4/RA5 AN3/RA3 AN2/RA2 AN1/RA1 AN0/RA0 VREF+ VREF CHAN/Refs ; 0 1 0 1 D VREF+ D A A RA3 VSS 2/1 ; 1 1 1 0 D D D D A VDD VSS 1/0 ; 1 1 1 1 D VREF+ VREF- D A VREF+ VREF- 1/2 ;right justified, max.ref = +3.0V et min.ref= 1,5V voie analogique AN0 pint Ra0 movlw b'10001111' movwf ADCON1 ; usage timer0 en comptage, interruption des le 1er front descendant sur RA4 ; Prescaler assign‚ … WDT pour avoir un prescaler de 1:1 ; increment on falling edge ; ; Source clock = entree RA4 ; Interrupt edge bit ; movlw b'01111000' ; ; movwf OPTION_REG clrf PIE1 ; disables all interrupts clrf OPTION_REG bsf OPTION_REG,7 ;=1 disable pull_up bcf OPTION_REG,6 ;INTEDG =0 int sur front descendant RB0 bank0 Bcf Rs_Tx ; niveau logique 0 ;definition voie analogique ;bit 7-6: ADCS1:ADCS0: A/D Conversion Clock Select bits 10 = FOSC/32 ;bit 5-3: CHS2:CHS0: Analog Channel Select bits 000 = channel 0, (RA2/AN2) RA0,1,2,3,5 ;bit 2: GO/DONE: A/D Conversion Status bit,If ADON = 1 1=in progress 0=Done ;bit 1: Unimplemented: Read as '0' ;bit 0: ADON: A/D On bit 1 = A/D converter module is operating movlw b'10000001' ;clock/32 Channel=0 ADON=1 movwf ADCON0 clrf INTCON clrf Drapeaux clrf BitsTaches clrf Port_8_Leds clrf _RsByte clrf _Index_N ; Now clrf _Index_T ; zone de texte 32 car defilant clrf _Index_M ; zone Matrice des caracteres clrf _Index_C ; numero de CAR courant de la zone affichage clrf Ncol bank1 clrf SommeTamb clrf STamb_F clrf STamb_F+1 bank0 Presentation CALL Rs_CrLf clrf _Cpt1 movf _Cpt1,w call Msg_Eeprom ; switch … 1 pour mise … jour Horloge RTC ; et test Hardware des circuits leds btfsc inp_MAJ_RTC goto Pres0 ; mise … l'heure par defaut (pour debugging) ; MOVLW 0x00 ;00 S ; MOVWF SEC ; movlW 0X30 ;30 M ; movWF MIN ; MOVLW 0x20 ; 20 H ; MOVWF HEURE ; MOVLW 0x02 ;day mardi ; MOVWF JourSem ; MOVLW 0x28 ;date 28 ; MOVWF Jour ; MOVLW 0x01 ;Mois 01 ; MOVWF Mois ; MOVLW 0x07 ; ANNEE=07 ; MOVWF Annee ; MOVLW B'10010000' ;Registre de controle SQWE=1 RS0=RS1=0 sortie 1Hz ; MOVWF CtrlReg ; CALL Rs_CrLf ; call Affiche_Time ; CALL Rs_CrLf ; call Init_RTC ; la Led sur RTC DS1307 doit clignoter a 1HZ! ; mise … jour Horloge RTC CALL Rs_CrLf call MAJ_DS1307 CALL Rs_CrLf Pres0 btfsc inp_Test_Hard goto Pres1 ; version avec MAX186 ; call Rs_CrLf ; movlw EE4-EE0 ; MOVWF _Cpt1 ; call Msg_Eeprom ; call LectMax186 Test1 ; 8 lignes horizontales de bas en haut clrf _RsCount Test_8leds clrf Port_8_Leds call WSync movf _RsCount,w ;1 movwf Port_8_Leds ;rangee allum‚e pendant call delay_25mS ;40 msecondes call delay_10mS call delay_5mS incf _RsCount,f BTFSS STATUS, Z goto Test_8leds clrf Port_8_Leds Test2 ;Test Hardware, allumage successif des 8 Leds sur 4 balayages ; si ChoixMsg=1 , on doit voir 4 segments sur la largeur evoluant de bas en haut ;pour Tracage movlw .10 movwf _RsCount Test_Hardware movlw 0x00 movwf _Cpt1 bsf STATUS,C TH_1 call WSync movf _Cpt1,w ;1 movwf Port_8_Leds call delay_5mS clrf Port_8_Leds call delay_5mS movf _Cpt1,w ;2 movwf Port_8_Leds call delay_5mS clrf Port_8_Leds call delay_5mS movf _Cpt1,w ;3 movwf Port_8_Leds call delay_5mS clrf Port_8_Leds call delay_5mS movf _Cpt1,w ;4 movwf Port_8_Leds call delay_5mS clrf Port_8_Leds rlf _Cpt1,f BTFSS STATUS, C goto TH_1 decf _RsCount,f BTFSS STATUS, Z goto Test_Hardware Pres1 call Lecture_DS1307 ;lecture heure call Affiche_Time CALL Rs_CrLf call delay_1S ;init zone text RAM … partir de Msg en eeprom bcf Drp_MSGx call Choix_Message CALL Rs_CrLf RAZ_Index clrf PCLATH ; page 0 clrf cmpt1 clrf Nb_0 clrf _Index_T ; pointe sur debut de zone texte affichage clrf _Index_C ; CAR= 0 clrf _Index_M ; adresse Matrice= 0 clrf _Index_N ; colonne Now clrf Ncol clrf Drapeaux ; ************ main boucle ****************** boucle ; affichage en boucle des 32 caracteres btfsc PinChoixMsg ; test entree Choix de message ? largeur affichage 16car goto to_2 ; RA3=1 texte de 32car , modifiable par RS232 goto to_1 ; RA3=0 texte avec Horodatage et Mesure Temper to_2 btfsc Drp_MSGx ; change de message que si on change de mode goto _No_Change ; affichage mesure ou affichage message ; bsf Drp_MSGx call Choix_Message goto _No_Change to_1 btfss Drp_MSGx goto _No_Change ; bcf Drp_MSGx call Choix_Message _No_Change btfsc PinChoixMsg goto Sans_Mesure ; pas de mesure de temperature ni horodatage affich‚s ;armemement acquisition Analogique bsf ADCON0,ADON ; set Analog Converter ON bsf ADCON0,GO_DONE ; set GO on start conversion Sans_Mesure ; attente top synchro call WaitSynchro ; capteur de proximite entre en RA0 btfsc PinChoixMsg ; avec ou SANS acquisition mesure goto Next_Colonne ; car saisie de caracteres btfsc ADCON0,NOT_DONE ; conversion AD ok ? goto Next_Colonne ; version lecture DIRECTE LM335 -> entree ADC 1024 points pour gamme=2,048V bank0 bcf Drapeaux,2 ; non filtre movf ADRESH,w bcf RETENUE ; Positif bank1 ;Mesure en Points 0 a 1024 movwf val1 movf ADRESL,w movwf val1+1 ; -65 deg @ 2.08 V 139 deg @ 4.12V ; accumulation movf STamb_F,W ; valeur now -> rajoutee dans accumulateur movwf val2 movf STamb_F+1,W movwf val2+1 call add16 ;val1=val1+val2 movf val1,W movwf STamb_F ; sauvegarde cumul movf val1+1,W movwf STamb_F+1 incf SommeTamb,f ;compteur d'accumulation movlw .20 xorwf SommeTamb,w btfss STATUS,Z goto MesNonFiltree ; filtrage non ateint ;cumul de 20 mesures en Points - Offset a -65°C soit -6500 theorique ; ajustement offset avec reel value mesuree 6500-6425=> +0.75°C correctif ; bcf STATUS,C ; rrf val1,f ; rrf val1+1,f ; declage a droite = divise/2 bcf STATUS,C movlw High(.6425) movwf val2 movlw Low(.6425) movwf val2+1 call sub16 ; val1=val1-val2 ; valeur en 1/10em de degres btfss val1,7 ; btfss STATUS,C bit de signe ? goto Positif bank0 bsf RETENUE ; car valeur negative! Positif bank0 btfss RETENUE goto PositiveVal bank1 COMF val1,f COMF val1+1,f PositiveVal bank0 bsf Drapeaux,2 ; oui , on a 10 mesures donc c'est filtre! ;Filtrage Arithmetique sur 20 mesure cummulees, bank1 ; val1 et val1+1 contiennent (encore) le cumul des 20 valeurs call bcd_temp bank1 clrf SommeTamb ; raz compteur d'accumulation clrf STamb_F ; raz accumulayeur 16 bits clrf STamb_F+1 bank0 bcf Drapeaux,2 ; raz drapeau pour affichage au 1/10em de degr‚ MesNonFiltree bank0 ;-- affichage de 16 carateres, 128 colonnes --- Next_Colonne bcf STATUS,C movf _Index_N,W ; 0 … 127 colonne … afficher addwf _Index_C,w ; index col dans message de 32car movwf cmpt1 andlw 0x07 ; movwf _Offset_C ; 0 … 7 bcf STATUS,C rrf cmpt1,f ; decalage … droite= /2 bcf STATUS,C rrf cmpt1,f ; decalage … droie= /2 bcf STATUS,C rrf cmpt1,f ; cmpt1 =resultat division par 8 => Caractere affich‚ movf cmpt1,w ; index de car … afficher ; recupere le CAR … afficher dans le buffer Texte addlw Buffer_Texte ; rajoute offset du buffer Texte movwf FSR ; on va chercher le caractere movf INDF, w ; w a la valeur du caractere courant 'u'=117 addlw 0xE0 ; soustrait origine de 32 (add-32) ESPACE 117-32=85-> 55h movwf varun ; varun et W contiennent l'index du caractere movwf _Index_M ; offset dans table movlw .124 subwf _Index_M,w btfss STATUS,C goto Autorise movlw 0 goto Suiv_1 Autorise movlw .62 subwf _Index_M,w btfss STATUS,C goto not_in_table4 movwf _Index_M call Mulx8 ;@ 23/01/07 movlw HIGH(Char_tbl4) ; attention aux franchissements de page car > 1K movwf PCLATH movf _Index_M,w call Char_tbl4 clrf PCLATH goto Suiv_1 not_in_table4 movlw .31 subwf _Index_M,w btfss STATUS,C goto not_in_table3 movwf _Index_M call Mulx8 movlw HIGH(Char_tbl3) movwf PCLATH movf _Index_M,w call Char_tbl3 clrf PCLATH goto Suiv_1 not_in_table3 call Mulx8 movwf _Index_M movlw HIGH(Char_tbl2) movwf PCLATH movf _Index_M,w call Char_tbl2 clrf PCLATH Suiv_1 ; BECAUSE inversion cablage !!!!des 8 leds clrf I_BYTE movwf O_BYTE btfsc O_BYTE,0 bsf I_BYTE,7 btfsc O_BYTE,1 bsf I_BYTE,6 btfsc O_BYTE,2 bsf I_BYTE,5 btfsc O_BYTE,3 bsf I_BYTE,4 btfsc O_BYTE,4 bsf I_BYTE,3 btfsc O_BYTE,5 bsf I_BYTE,2 btfsc O_BYTE,6 bsf I_BYTE,1 btfsc O_BYTE,7 bsf I_BYTE,0 movf I_BYTE,w movwf Port_8_Leds ; sur le port B ; call delay_300uS ; appeler la tempo de temp d'affichage IFDEF BUILD_SOFT_WITH_8CAR call delay_200uS ENDIF incf _Index_N,f ; incremente Nø de colonne en cours incf Ncol,f btfss Ncol,3 ;apres 8eme colonne ,rajout inter-caractere goto Suiv_2 clrf Ncol CLRF Port_8_Leds call delay_300uS ; intercaractere call delay_200uS IFDEF BUILD_SOFT_WITH_8CAR call delay_100uS ENDIF Suiv_2 IFDEF BUILD_SOFT_WITH_8CAR ; compilation conditionnelle ;-- affichage de 8 carateres, 64 pixels ---- btfss _Index_N,6 ;=64 soit 8 car x 8? ELSE ;-- affichage de 16 carateres, 128 pixels ---- btfss _Index_N,7 ;=128 soit 16 car x 8? ENDIF goto Next_Colonne clrf _Index_N CLRF Port_8_Leds ;4/04/07 ------------- incf Nb_0,f btfss STATUS,Z goto Suiv_4 ;Lecture du buffer d'affichage temperature pour l'emettre sur le port serie en RS232 ; tous les 256 passages donc tous les 32 caracteres ( 32*8 decalage de colonne => ~25secondes) clrf Nb_0 Suiv_3 movf Nb_0,w addlw Buffer_Texte ; rajoute offset du buffer Texte Temperature movwf FSR ; on va chercher le caractere movf INDF, w ; w a la valeur du caractère courant 'u'=117 call Rs_Putchar incf Nb_0,f btfss Nb_0,5 ; 32 car goto Suiv_3 CALL Rs_CrLf clrf Nb_0 Suiv_4 IFDEF BUID_WITH_SHIFT incf _Index_C,f ; shift a chaque scan ,colonne 0 … 255 ENDIF goto boucle ;----------------- Choix_Message btfsc PinChoixMsg goto St0 movlw EE1-EE0 ;si Rb2=0 =>mesure de temperature bcf Drp_MSGx goto St1 St0 movlw EE2-EE0 ;si RB2=1 affiche PAULFJUJO ,message modifiable au clavier PC bsf Drp_MSGx St1 movwf _Cpt1 St2 movf _Cpt1,w call Read_EE movwf _RsByte movlw Buffer_Texte ;= 0x20 on pointe en debut de texte addwf Ncol,w ; + offset de rangement du caractere movwf FSR movf _RsByte,w ; recupere car lu en eeprom ANDLW 0x0FF ; si zero ,dernier car BTFSC STATUS, Z return movwf INDF ; le range dans zone text incf Ncol,f incf _Cpt1,f btfss Ncol,5 ; 32 car ? goto St2 return ;-------------------- Divise4 bank1 ; mot val1= mot val1/4 bcf STATUS,C ; carry=0 rrf val1,F rrf val1+1,F ; division par 2 mot de 16bits Divise2 bank1 bcf STATUS,C rrf val1,F rrf val1+1,F ; division par 2 mot de 16bits return ;------------- div16 bank1 clrf reste ; division 16 bits clrf reste+1 ; val1 = val1 / val2 ( reste ) movlw .16 movwf Mcount div161 rlf val1+1,f rlf val1,f rlf reste+1,f rlf reste,f movf val2,w subwf reste,W btfss STATUS,Z goto div162 movf val2+1,W subwf reste+1,W div162 btfss STATUS,C goto div163 movf val2+1,W subwf reste+1,f movf val2,W btfss STATUS,C incfsz val2,f subwf reste,f div163 rlf result+1,f rlf result,f DECFSZ Mcount,f goto div161 fin16 movf result,w movwf val1 movf result+1,w movwf val1+1 return ;----------------------- add16 bank1 movf val2,w ; addition 16 bits addwf val1,f ; val1 = val1 + val2 movf val2+1,w addwf val1+1,f btfsc STATUS, C incf val1,f return ;-------------------------- sub16 bank1 movf val2,w ; soustraction 16 bits subwf val1,f ; val1 = val1 - val2 movf val2+1,w subwf val1+1,f btfss STATUS,C decf val1,f return ;----------------------- Mulx8 bank0 ; index matrice = rang car * 8 + decalage dans le caractere bcf STATUS,C rlf _Index_M,f bcf STATUS,C rlf _Index_M,f bcf STATUS,C rlf _Index_M,f movf _Index_M,w addwf _Offset_C,w movwf _Index_M return ;------------------------ delay_RS bank1 MOVLW .31 ; pour 19200bds MOVWF count1 ; DECFSZ count1,F ; 1 cycle si pas de saut GOTO $-1 ; 2cycles bank0 Return delay_Half_RS bank1 MOVLW .15 ; pour 19200 bauds MOVWF count1 ; DECFSZ count1,F GOTO $-1 bank0 Return delay_25uS bank1 movlw 0x01 movwf count1 movlw 0x01 movwf count2 movlw .10 movwf count3 goto delay1 delay_100uS bank1 movlw 0x01 movwf count1 movlw 0x01 movwf count2 movlw .40 movwf count3 goto delay1 delay_200uS bank1 movlw 0x01 movwf count1 movlw 0x01 movwf count2 movlw .80 movwf count3 goto delay1 delay_300uS bank1 movlw 0x01 movwf count1 movlw 0x01 movwf count2 movlw .120 movwf count3 goto delay1 delay_500uS bank1 movlw 0x01 movwf count1 movlw .1 movwf count2 movlw .200 movwf count3 goto delay1 delay_1mS bank1 movlw 0x01 movwf count1 movlw .2 movwf count2 movlw .144 movwf count3 goto delay1 delay_5mS bank1 movlw 0x01 movwf count1 movlw .8 movwf count2 movlw .205 movwf count3 goto delay1 delay_10mS bank1 movlw 0x01 movwf count1 movlw .16 movwf count2 movlw .154 movwf count3 goto delay1 delay_25mS bank1 movlw 0x01 ;24,36mS /4Mhz movwf count1 ;25,4mS /32Mhz movlw .40 movwf count2 movlw .1 movwf count3 goto delay1 delay_100mS bank1 movlw 1 movwf count1 movlw .157 movwf count2 movlw .2 movwf count3 goto delay1 delay_250mS bank1 movlw 1 movwf count1 movlw .196 movwf count2 movlw .2 movwf count3 goto delay1 delay_500mS bank1 movlw .4 movwf count1 movlw .14 movwf count2 movlw .55 movwf count3 goto delay1 delay_1S bank1 movlw .7 movwf count1 movlw .27 movwf count2 movlw .112 movwf count3 goto delay1 delay1 decfsz count3,f goto $-1 decfsz count2,f goto $-3 decfsz count1,f goto $-5 bank0 return ;---------------------------------- WaitSynchro btfsc PinChoixMsg ; choix message defilant ou Date Heure Temp goto WSync call Lecture_DS1307 ;lecture date heure call Renseigne_Time ; MAJ du buffer d'affichage goto W0 WSync bank0 bsf INTCON,GIE ; Autorise IT bsf INTCON,INTE ;Autorise interrupt RB0 W0 ; Test capteur de proximite (invers‚)-> entre sur PortA,0 W1: btfsc Top_Synchro ; etat 1 = dans la zone d'affichage goto W1 ; etat 0 = dans la zone morte gauche W2 btfss Top_Synchro ; attente front montant ,donc mouvement de gauche vers droite goto W2 ; on affiche rien dans le sens droite gauche btfss PinChoixMsg ; car on a besoin de ce temps pour faire autre chose! goto W4 ; pas de test caract si affichage Date Heure Temperature ; on est ici dans le mode affichage texte defilant bcf INTCON,INTE ; interdit interrupt RB0 bcf INTCON,GIE ; Interdit IT btfss ELLIGIBLE ; 1 car capture par interruption est disponible ? goto W3 ; sinon , la suite movlw '&' ; est-ce une demande de modification message xorwf _RsByte,w btfss STATUS,Z goto W4 ;mise … jour du message de 32 car clrf _N1 ; Index de rangement 2 car -> 1 emplacement Modif_Encore clrf _RsByte bsf INTCON,GIE bsf INTCON,INTE ;Autorise interrupt RB0 ;attente saisi caractere au clavier Modif_1 btfss ELLIGIBLE goto Modif_1 bcf ELLIGIBLE bcf INTCON,GIE bcf INTCON,INTE ;interdit interrupt RB0 movf _RsByte,W ;echo call Rs_Putchar movlw .27 ;esc (abandon) xorwf _RsByte,w btfsc STATUS,Z goto Modif_OK movlw .13 ;CR (fin) xorwf _RsByte,w btfsc STATUS,Z goto Modif_OK movf _N1,w ADDLW Buffer_Texte ; offset table movwf FSR movf _RsByte,w movwf INDF ; sauvegarde W -> @FSR() incf _N1,f btfss _N1,5 goto Modif_Encore Modif_OK clrf _RsByte W3 bcf INTCON,GIE ; Interdit IT bcf INTCON,INTE ; interdit interrupt RB0 W4 call delay_200uS ; on s'ecarte un peu du bord bcf ELLIGIBLE ; raz drapeau capture return ;-------------------------------------- Read_RS bank0 Clrf _RsByte Movlw H'08' ;byte 8 bit Movwf _RsCount Rx1 call delay_RS ;bit de start Bcf STATUS,C ;Carry=0 Btfsc Rs_Rx ;lit et test l'entree RB0 Bsf STATUS,C ;Rx =1, saute si Rx =0 rrf _RsByte,f Decfsz _RsCount,f Goto Rx1 call delay_RS ;bit de stop call delay_RS ;bit de stop return ;----------------- Rs_Putchar bank0 movwf _Temp1 Movlw H'08' ;correspond a un byte de 8 bits Movwf _RsCount ;place dans RsCount Bcf Rs_Tx ;bit start a 0 Call delay_RS ;wait valeur 1bit 4800 Bauds Rrf _Temp1,F ;shift droite dans carry Btfsc STATUS,C ;si carry 0 alors saute Goto $+3 ;carry =1 Bcf Rs_Tx ;Tx dans PORTX =0 Goto $+2 Bsf Rs_Tx ;Tx dans PORTx =1 Call delay_RS Decfsz _RsCount,F ;RsCount =RsCount -1 Goto $-8 Bsf Rs_Tx ;bit de stop Call delay_RS ;byte envoye Call delay_RS ;byte envoye return ;------------- ;pour tracage PasseParLa movwf _RsByte call Rs_Putchar ; ECHO sur ecran TERMINAL Rs232 call Rs_CrLf return ;--------------- Rs_CrLf movlw .13 call Rs_Putchar movlw .10 call Rs_Putchar return ;=========================== Msg_Eeprom movf _Cpt1,w call Read_EE incf _Cpt1,f ANDLW 0x0FF BTFSC STATUS, Z Return call Rs_Putchar goto Msg_Eeprom return ;------- ; subroutine to read EEPROM memory Read_EE ; 16F876 bank2 MOVWF EEADR ;Data Memory Address to read bank3 BCF EECON1, EEPGD ;Point to DATA memory BSF EECON1, RD ;EEPROM Read bank2 MOVF EEDATA, W ;W = EEDATA bank0 return EEWRITE ; 16F876 ;W contient l'adresse ;DATA_EE_DATA contient la donn‚e bank2 MOVWF EEADR ; Data Memory Address to write movf DATA_EE_DATA,w ; Data value to write MOVWF EEDATA ; Data Memory Value to write bank3 BCF INTCON, GIE ; Disable Interrupts BCF EECON1, EEPGD ; Point to DATA memory BSF EECON1, WREN ; Enable writes MOVLW 0x55 ;Required MOVWF EECON2 ; Write 55h Sequence MOVLW 0xAA ; MOVWF EECON2 ; Write AAh BSF EECON1, WR ; Set WR bit to begin write BSF INTCON, GIE ; Enable Interrupts SLEEP ; Wait for interrupt to signal write complete BCF EECON1, WREN ; Disable writes bank0 return ;--------------------- ; conv mot 16bits --> en XX.XXøC 25.42øC bcd_temp bank1 movf val1,W movwf valx movf val1+1,W movwf valx+1 swapf valx,W iorlw 0xf0 movwf mille addwf mille,F addlw 0xE2 ; 226 movwf cent addlw 0x32 ;50 movwf un movf valx,W andlw 0x0F addwf cent,F addwf cent,F addwf un,F addlw 0xE9 ;233 movwf dix addwf dix,F addwf dix,F swapf valx+1,W ;<- modif 20mars03 was val1 andlw 0x0F addwf dix,F addwf un,F rlf dix,F rlf un,F comf un,F rlf un,F movf valx+1,W andlw 0x0F addwf un,F rlf mille,F movlw 0x07 movwf dixmil movlw 0x0A Lb1: addwf un,F decf dix,F btfss STATUS,C goto Lb1 Lb2: addwf dix,F decf cent,F btfss STATUS,C goto Lb2 Lb3: addwf cent,F decf mille,F btfss STATUS,C goto Lb3 Lb4: addwf mille,F decf dixmil,F btfss STATUS,C goto Lb4 bank0 btfsc Drapeaux,5 ; si drapeau.5=1 affichage sur 5 digits goto Bcd_5digits bcf Drapeaux,1 ; test blanc movlw ' ' btfsc RETENUE movlw '-' IFDEF BUID_WITH_SHIFT movwf Buffer_Texte+.25 ELSE movwf Buffer_Texte+.10 ENDIF btfss Drapeaux,2 goto Lb7 bank1 movf mille,w btfss STATUS,Z ; si digit=0 remplace par Blanc goto Lb5 bank0 movlw ' ' bsf Drapeaux,1 goto Lb6 Lb5 addlw '0' Lb6 bank0 IFDEF BUID_WITH_SHIFT movwf Buffer_Texte+.26 ELSE movwf Buffer_Texte+.11 ENDIF bank1 movf cent,w addlw '0' bank0 IFDEF BUID_WITH_SHIFT movwf Buffer_Texte+.27 ELSE movwf Buffer_Texte+.12 ENDIF movlw '.' IFDEF BUID_WITH_SHIFT movwf Buffer_Texte+.28 ELSE movwf Buffer_Texte+.13 ENDIF bank1 movf dix,w addlw '0' bank0 IFDEF BUID_WITH_SHIFT movwf Buffer_Texte+.29 ELSE movwf Buffer_Texte+.14 ENDIF goto Lb8 Lb7 bank1 movf cent,w btfss STATUS,Z ; si digit=0 remplace par Blanc goto Lb71 movlw ' ' goto Lb72 Lb71 addlw '0' Lb72 bank0 IFDEF BUID_WITH_SHIFT movwf Buffer_Texte+.26 ELSE movwf Buffer_Texte+.12 ENDIF bank1 movf dix,w addlw '0' bank0 IFDEF BUID_WITH_SHIFT movwf Buffer_Texte+.27 ELSE movwf Buffer_Texte+.13 ENDIF movlw '.' IFDEF BUID_WITH_SHIFT movwf Buffer_Texte+.28 ELSE movwf Buffer_Texte+.14 ENDIF bank1 movf un,w addlw '0' bank0 IFDEF BUID_WITH_SHIFT movwf Buffer_Texte+.29 ELSE movwf Buffer_Texte+.15 ENDIF bank0 return Lb8 bank1 movf un,w addlw '0' bank0 IFDEF BUID_WITH_SHIFT movwf Buffer_Texte+.30 ELSE movwf Buffer_Texte+.15 ENDIF bank0 return Bcd_5digits bank1 movf dixmil,w addlw '0' call Rs_Putchar bank1 movf mille,w addlw '0' call Rs_Putchar bank1 movf cent,w addlw '0' call Rs_Putchar bank1 movf dix,w addlw '0' call Rs_Putchar bank1 movf un,w addlw '0' call Rs_Putchar movlw ' ' call Rs_Putchar return ;----------------------------------- bcd3 bank1 movwf btmp ; affichage octet --> decimal 3 digits ( de 0 a 255 ) movlw '0' movwf cent movwf dix bcd31 movlw .100 subwf btmp,w bnc bcd32 movwf btmp incf cent,f goto bcd31 bcd32 movlw .10 subwf btmp,w bnc bcd33 movwf btmp incf dix,f goto bcd32 bcd33 movlw '0' addwf btmp,w movwf un movf cent,w call Rs_Putchar bank1 movf dix,w call Rs_Putchar bank1 movf un,w call Rs_Putchar return ;-------------------------- ; MAJ de l'horloge ;-------------------------- MAJ_DS1307 bsf BitsTaches,0 call Rs_CrLf movlw EE3-EE0 MOVWF _Cpt1 Actu1 movf _Cpt1,w CALL Read_EE incf _Cpt1,f ANDLW 0x0FF BTFSC STATUS,Z GOTO Actu2 call Rs_Putchar goto Actu1 Actu2 bcf Drapeaux,5 movlw .13 ; 13 a 0 AAMMJJWWHHMMSS call Saisie_Caracteres ; W contient N-1 caracters a saisir ;Abort si caractere ESC=27 -> W=0 movlw .27 ; ESC=abort xorwf _RsByte,W btfsc STATUS,Z goto Abort_MAJ ; 14 car saisis 7 valeurs rangees call Init_RTC call Lecture_DS1307 clrf _RsByte call Rs_CrLf call Affiche_Time call Rs_CrLf return Abort_MAJ clrf BitsTaches return ;----------------------------------------------- Saisie_Caracteres: ; 2 caracteres par octet => BCD format 00 a 99 ; preciser la longueur du buffer a remplir dans W <= N-1 caracteres ; Buffer_MAJ = buffer de stockage en page 0 movwf _N1 ; Index de rangement 2 car -> 1 emplacement bcf INTCON,T0IE ; interdit interrupt timer0 Actualise bsf INTCON,GIE clrf _RsByte bsf INTCON,INTE ;Autorise interrupt RB0 ;attente saisi caractere au clavier Actu3 btfss ELLIGIBLE goto Actu3 bcf ELLIGIBLE bcf INTCON,GIE bcf INTCON,INTE ;interdit interrupt RB0 movf _RsByte,W ;echo call Rs_Putchar movlw .27 ;esc (abandon) xorwf _RsByte,w btfss STATUS,Z goto Test_Back return Test_Back movlw .8 ;back space (<- correction) xorwf _RsByte,w btfss STATUS,Z goto Test_Tab movlw Buffer_MAJ subwf _N1,w btfsc STATUS,C ; negatif ? goto Actualise incf _N1,f ;incremente indice goto Actualise Test_Tab movlw .9 ;tabulation (-> correction) xorwf _RsByte,w btfss STATUS,Z goto Test_Num decf _N1,w btfsc STATUS,C ; negatif ? goto Test_Num decf _N1,f ;decremente indice goto Actualise Test_Num movlw '0' subwf _RsByte,w btfsc STATUS,C goto SUP_0 goto Actualise SUP_0 movlw '9' subwf _RsByte,w btfsS STATUS,C goto LESS_EQ_9 ; less <9 btfsC STATUS,Z goto LESS_EQ_9 ;or egal =9 goto Actualise LESS_EQ_9 btfsc _N1,0 ;test bit 0 du compteur goto HB goto LB HB MOVLW .48 subWF _RsByte,w movwf _Temp2 ;=x1 bcf STATUS,C rlf _Temp2,f ;x2 rlf _Temp2,f ;x4 btfsc Drapeaux,5 ; si drapeau:5=1 *10 , sinon *16 goto HB1 bcf STATUS,C ; <- rajout 31/01/07 rlf _Temp2,f ;x2 rlf _Temp2,f ;x4 goto HB2 HB1 addwf _Temp2,w ;x5 movwf _Temp2 rlf _Temp2,f ;x10 HB2 decf _N1,f goto Actualise LB MOVLW .48 subWF _RsByte,w AndLW 0x0F ; MSB + LSB addwf _Temp2,W movwf _RsByte Rangement ; dans buffer specifique Horodatage bcf STATUS,C rrf _N1,W ; Index/2= deplacement en octet ADDLW Buffer_MAJ ; offset table movwf FSR movf _RsByte,w movwf INDF ; sauvegarde W -> @FSR() movf _N1,w btfsc STATUS,Z goto OK_Saisie decf _N1,f btfss STATUS,Z goto Actualise OK_Saisie bcf INTCON,GIE movf _RsByte,w return ;------ Affiche_Time SWAPF Jour,W ANDLW 0x0F btfss STATUS,Z ;@ 5/2/07 goto Aff_T1 ; remplace 0 par espace en tete de message movlw ' ' goto Aff_T2 Aff_T1 ADDLW 30H Aff_T2 CALL Rs_Putchar MOVF Jour,W ANDLW 0FH ADDLW 30H CALL Rs_Putchar MOVLW "/" CALL Rs_Putchar SWAPF Mois,W ANDLW 0x0F ADDLW 30H CALL Rs_Putchar MOVF Mois,W ANDLW 0FH ADDLW 30H CALL Rs_Putchar MOVLW "/" CALL Rs_Putchar SWAPF Annee,W ANDLW 0x0F ADDLW 30H CALL Rs_Putchar MOVF Annee,W ANDLW 0FH ADDLW 30H CALL Rs_Putchar MOVLW " " CALL Rs_Putchar SWAPF HEURE,W ANDLW 0x0F btfss STATUS,Z ;@ 5/2/07 goto Aff_T3 movlw ' ' goto Aff_T4 Aff_T3 ADDLW 30H Aff_T4 CALL Rs_Putchar MOVF HEURE,W ANDLW 0x0F ADDLW 30H CALL Rs_Putchar MOVLW "H" CALL Rs_Putchar SWAPF MIN,W ANDLW 0x0F ADDLW 30H CALL Rs_Putchar MOVF MIN,W ANDLW 0FH ADDLW 30H CALL Rs_Putchar MOVLW "M" CALL Rs_Putchar SWAPF SEC,W ANDLW 0x0F ADDLW 30H CALL Rs_Putchar MOVF SEC,W ANDLW 0FH ADDLW 30H CALL Rs_Putchar MOVLW "S" CALL Rs_Putchar return ;-------------------------------------- ; The following routines are low level I2C routines applicable to most ; interfaces with I2C devices. ;------------------------------------------------------ I2C_DELAY goto $+1 goto $+1 goto $+1 goto $+1 goto $+1 goto $+1 goto $+1 goto $+1 goto $+1 goto $+1 goto $+1 goto $+1 goto $+1 goto $+1 goto $+1 goto $+1 goto $+1 goto $+1 goto $+1 goto $+1 goto $+1 goto $+1 goto $+1 goto $+1 goto $+1 goto $+1 goto $+1 goto $+1 return ;--------------- Renseigne_Time IFDEF BUID_WITH_SHIFT SWAPF Jour,W ANDLW 0x0F btfss STATUS,Z ;@ 5/2/07 goto Rt_1 movlw ' ' goto Rt_2 Rt_1 ADDLW 30H Rt_2 movwf Buffer_Texte+1 MOVF Jour,W ANDLW 0FH ADDLW 30H movwf Buffer_Texte+2 SWAPF Mois,W ANDLW 0x0F ADDLW 30H movwf Buffer_Texte+4 MOVF Mois,W ANDLW 0FH ADDLW 30H movwf Buffer_Texte+5 SWAPF Annee,W ANDLW 0x0F ADDLW 30H movwf Buffer_Texte+7 MOVF Annee,W ANDLW 0FH ADDLW 30H movwf Buffer_Texte+8 ENDIF SWAPF HEURE,W ANDLW 0x0F btfss STATUS,Z ;@ 5/2/07 goto Rt_3 movlw ' ' goto Rt_4 Rt_3 ADDLW 30H Rt_4 IFDEF BUID_WITH_SHIFT movwf Buffer_Texte+.10 ELSE movwf Buffer_Texte+.0 ENDIF MOVF HEURE,W ANDLW 0x0F ADDLW 30H IFDEF BUID_WITH_SHIFT movwf Buffer_Texte+.11 ELSE movwf Buffer_Texte+.1 ENDIF SWAPF MIN,W ANDLW 0x0F ADDLW 30H IFDEF BUID_WITH_SHIFT movwf Buffer_Texte+.13 ELSE movwf Buffer_Texte+.3 ENDIF MOVF MIN,W ANDLW 0FH ADDLW 30H IFDEF BUID_WITH_SHIFT movwf Buffer_Texte+.14 ELSE movwf Buffer_Texte+.4 ENDIF SWAPF SEC,W ANDLW 0x0F ADDLW 30H IFDEF BUID_WITH_SHIFT movwf Buffer_Texte+.16 ELSE movwf Buffer_Texte+.6 ENDIF MOVF SEC,W ANDLW 0FH ADDLW 30H IFDEF BUID_WITH_SHIFT movwf Buffer_Texte+.17 ELSE movwf Buffer_Texte+.7 ENDIF return ;------------------------ START: bsf STATUS,RP0 bcf I2C_SDA bcf STATUS,RP0 bsf I2C_SDA bsf I2C_SCL ;I2C start: change of SDA call I2C_DELAY ;from 1 to 0 while SCL = 1 bcf I2C_SDA call I2C_DELAY bcf I2C_SCL return ;--------------------- STOP: bsf STATUS,RP0 bcf I2C_SDA bcf STATUS,RP0 bcf I2C_SDA bsf I2C_SCL ;I2C stop: change of SDA call I2C_DELAY ;from 0 to 1 while SCL = 1 bsf I2C_SDA return ;--------------------- M_ACK: bsf STATUS,RP0 bcf I2C_SDA bcf STATUS,RP0 bcf I2C_SDA ;I2C master acknowledge: call I2C_DELAY ;SDA = 0 bsf I2C_SCL call I2C_DELAY bcf I2C_SCL return ;---------- NACK: bsf STATUS,RP0 bcf I2C_SDA bcf STATUS,RP0 bsf I2C_SDA ;I2C master non-acknowledge: call I2C_DELAY ;SDA = 1 bsf I2C_SCL call I2C_DELAY bcf I2C_SCL return ;----------- ACK: bsf STATUS,RP0 bsf I2C_SDA bcf STATUS,RP0 call I2C_DELAY ;I2C device acknowledge: bsf I2C_SCL ;SDA set 1 by master call I2C_DELAY ;SDA = 1 if device doesn't ACK bsf STATUS,Z ;SDA = 0 if devcie acknowledges btfsc I2C_SDA bcf STATUS,Z ;STATUS,Z=1 if device acknowledges bcf I2C_SCL ;STATUS,Z=0 if device doesn't ACK return ;------------ CLOCK_PULSE: ; SCL momentarily to logic one CALL HIGH_SCL call I2C_DELAY CALL LOW_SCL call I2C_DELAY RETURN ;------------ HIGH_SDA: ; high impedance by making SDA an input BSF I2C_SDA bank1 nop BSF I2C_SDA ; make SDA pin an input bank0 call I2C_DELAY RETURN ;------------ LOW_SDA: bank1 BCF I2C_SDA ; make SDA pin an output bank0 nop BCF I2C_SDA call I2C_DELAY RETURN ;------------ HIGH_SCL: BSF I2C_SCL bank1 nop BSF I2C_SCL ; make SCL pin an input bank0 call I2C_DELAY RETURN ;------------ LOW_SCL: bank1 BCF I2C_SCL ; make SCL pin an output bank0 BCF I2C_SCL call I2C_DELAY RETURN ;--------------------- ; The following routines are low level I2C routines applicable to most ; interfaces with I2C devices. IN_BYTE ; read byte on i2c bus CLRF I_BYTE MOVLW .8 MOVWF _N0 ; set index to 8 CALL HIGH_SDA ; be sure SDA is configured as input IN_BIT CALL HIGH_SCL ; clock high BTFSS I2C_SDA ; test SDA bit GOTO IN_ZERO GOTO IN_ONE IN_ZERO BCF STATUS, C ; clear any carry RLF I_BYTE, F ; i_byte = i_byte << 1 | 0 GOTO CONT_IN IN_ONE BCF STATUS, C ; clear any carry RLF I_BYTE, F INCF I_BYTE, F ; i_byte = (i_byte << 1) | 1 GOTO CONT_IN CONT_IN CALL LOW_SCL ; bring clock low DECFSZ _N0, F ; decrement index GOTO IN_BIT RETURN ;------------- OUT_BYTE: ; send o_byte on I2C bus MOVWF O_BYTE MOVLW .8 MOVWF _N0 OUT_BIT: BCF STATUS,C ; clear carry RLF O_BYTE, F ; left shift, most sig bit is now in carry BTFSS STATUS, C ; if one, send a one GOTO OUT_ZERO GOTO OUT_ONE OUT_ZERO: CALL LOW_SDA ; SDA at zero CALL CLOCK_PULSE CALL HIGH_SDA GOTO OUT_CONT OUT_ONE: CALL HIGH_SDA ; SDA at logic one CALL CLOCK_PULSE GOTO OUT_CONT OUT_CONT: DECFSZ _N0, F ; decrement index GOTO OUT_BIT RETURN ;--------------- Init_RTC CALL STOP call delay_25mS CALL START MOVLW 0xD0 ; B'11010000'=0xD0 = adresse device MOVWF DEV_DS1307 ; @D0H adresse device CALL OUT_BYTE CALL ACK clrf ADDR MOVF ADDR, W ; addresse registre CALL OUT_BYTE CALL ACK MOVF SEC,W CALL OUT_BYTE CALL ACK ; a ce momment la led connectee sur pin7 doit osciller a 1HZ ! MOVf MIN,W CALL OUT_BYTE CALL ACK Movf HEURE,w CALL OUT_BYTE CALL ACK Movf JourSem,w ;Jour de la semaine=07 CALL OUT_BYTE CALL ACK Movf Jour,w ;Jour du mois=02 CALL OUT_BYTE CALL ACK MOVF Mois,W ;Mois= 12 CALL OUT_BYTE CALL ACK MOVF Annee,W ;ANNEE=07 CALL OUT_BYTE CALL ACK MOVLW B'10010000' ;Registre de controle SQWE=1 RS0=RS1=0 sortie 1Hz CALL OUT_BYTE CALL NACK call STOP call delay_10mS return ;----------------------------- Lecture_DS1307 Call STOP call delay_25uS CALL START MOVLW 0xD0 ; B'11010000' MOVWF DEV_DS1307 ; @D0H adresse device CALL OUT_BYTE CALL ACK clrf ADDR ; adresse 0 MOVF ADDR, W ; send high byte of address CALL OUT_BYTE CALL ACK MOVLW 0xD1 ; B'11010001' MOVWF DEV_DS1307 ;Mode Lecture CALL START ;genere un start bit MOVF DEV_DS1307,W CALL OUT_BYTE CALL NACK ;-------- CALL IN_BYTE Call M_ACK MOVF I_BYTE,W MOVWF SEC CALL IN_BYTE Call M_ACK MOVF I_BYTE,W MOVWF MIN CALL IN_BYTE Call M_ACK MOVF I_BYTE,W MOVWF HEURE CALL IN_BYTE Call M_ACK MOVF I_BYTE,W MOVWF JourSem CALL IN_BYTE Call M_ACK MOVF I_BYTE,W MOVWF Jour CALL IN_BYTE Call M_ACK MOVF I_BYTE,W MOVWF Mois CALL IN_BYTE Call M_ACK MOVF I_BYTE,W MOVWF Annee ; CALL IN_BYTE ; Call M_ACK ; MOVF I_BYTE,W ; MOVWF CtrlReg ; call M_ACK CALL STOP return fin_de_programme equ $ ;--------------------------------- ;table de caractere 6x8 ;--------------------------------- org 0xB00 Char_tbl2 addwf PCL,f ; ajoute W a PCL pour aller lire au bon endroit dt 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00; 20 /32 dt 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00; ! 21 /33 dt 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00; " 22 /34 dt 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00; # 23 /35 dt 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00; $ 24 /36 dt 0x00,0x80,0x60,0x10,0x00,0x00,0x01,0x00; % 25 /37 dt 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x00; & 26 /38 dt 0x00,0x00,0x00,0x00,0x00,0x07,0x05,0x07; new ø 39 ; dt 0x00,0x00,0x00,0x00,0x07,0x00,0x00,0x00; ' 27 /39 dt 0x18,0x24,0x42,0x81,0x00,0x00,0x00,0x00; ( 28 /40 dt 0x00,0x00,0x00,0x81,0x42,0x24,0x18,0x00; ) 29 /41 dt 0x21,0x12,0x0C,0x7F,0x0C,0x12,0x21,0x00; * 2A /42 dt 0x08,0x08,0x08,0x7E,0x08,0x08,0x08,0x00; + 2B /43 dt 0x00,0x00,0x00,0x80,0x60,0x00,0x00,0x00; , 2C /44 dt 0x00,0x10,0x10,0x10,0x10,0x10,0x10,0x00; - 2D /45 ; dt 0x00,0x00,0x00,0xC0,0x30,0x00,0x00,0x00; . 2E /46 dt 0x00,0x00,0xE0,0xA0,0xE0,0x00,0x00,0x00; new . 46 ; dt 0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x00; . 2E /46 dt 0xC0,0x40,0x60,0x30,0x1C,0x06,0x03,0x00; / 2F /47 dt 0x00,0x3C,0x52,0x89,0x46,0x3C,0x00,0x00; 0 30 /48 dt 0x00,0x08,0x0E,0xFF,0x00,0x00,0x00,0x00; 1 31 /49 dt 0xCC,0xC6,0xA3,0xA1,0x93,0x96,0x8C,0x00; 2 32 /50 dt 0x00,0x42,0x81,0x91,0x91,0x91,0x7E,0x00; 3 33 /51 dt 0x18,0x14,0x12,0x11,0xFF,0x10,0x00,0x00; 4 34 /52 dt 0x4F,0x89,0x89,0x89,0xC9,0x78,0x00,0x00; 5 35 /53 dt 0x7E,0x91,0x91,0x91,0x91,0x91,0x72,0x00; 6 36 /54 dt 0x00,0xC1,0x61,0x31,0x19,0x0D,0x07,0x00; 7 37 /55 dt 0x76,0x89,0x89,0x89,0x89,0x89,0x76,0x00; 8 38 /56 dt 0x4E,0x91,0x91,0x91,0x91,0x91,0x7E,0x00; 9 39 /57 ; dt 0x00,0x00,0x00,0x36,0x00,0x00,0x00,0x00; : 3A /58 dt 0x00,0x00,0x00,0x28,0x00,0x00,0x00,0x00; new : 58 ; dt 0x00,0x00,0x00,0x24,0x00,0x00,0x00,0x00; : 3A /58 dt 0x00,0x00,0x80,0x68,0x00,0x00,0x00,0x00; ; 3B /59 dt 0x10,0x28,0x44,0x82,0x00,0x00,0x00,0x00; < 3C /60 ; dt 0x00,0x28,0x28,0x28,0x28,0x28,0x00,0x00; = 3D /61 dt 0x00,0x00,0x50,0x50,0x50,0x50,0x00,0x00; new = 61 dt 0x00,0x00,0x00,0x82,0x44,0x28,0x10,0x00; > 3E /62 Char_tbl2end org 0xC00 Char_tbl3 addwf PCL,f dt 0x00,0x0C,0x03,0x01,0xA1,0x12,0x0C,0x00; ? 3F /63 dt 0xFF,0x81,0xBD,0xA5,0xA1,0xBF,0x00,0x00; @ 40 /64 dt 0xFF,0x11,0x11,0x11,0x11,0x11,0xFF,0x00; A 41 /65 dt 0xFF,0x89,0x89,0x89,0x89,0x8F,0xF8,0x00; B 42 /66 dt 0x7E,0x81,0x81,0x81,0x81,0x42,0x00,0x00; C 43 /67 dt 0xFF,0x81,0x81,0x81,0x42,0x3C,0x00,0x00; D 44 /68 dt 0xFF,0x89,0x89,0x89,0x81,0x80,0x00,0x00; E 45 /69 dt 0xFF,0x11,0x11,0x11,0x11,0x01,0x00,0x00; F 46 /70 dt 0xFF,0x81,0xB1,0x91,0x91,0xF0,0x00,0x00; G 47 /71 dt 0xFF,0x18,0x18,0x18,0x18,0xFF,0x00,0x00; H 48 /72 dt 0x00,0x00,0xFD,0xFD,0x00,0x00,0x00,0x00; I 49 /73 dt 0x40,0x80,0x80,0x80,0x80,0x7F,0x00,0x00; J 4A /74 dt 0xFF,0x08,0x08,0x7C,0xC2,0x81,0x00,0x00; K 4B /75 dt 0xFF,0x80,0x80,0x80,0x80,0x80,0x00,0x00; L 4C /76 dt 0xFF,0x02,0x04,0x08,0x04,0x02,0xFF,0x00; M 4D /77 dt 0xFF,0x40,0x38,0x04,0x02,0xFF,0x00,0x00; N 4E /78 dt 0xFF,0x81,0x81,0x81,0x81,0xFF,0x00,0x00; O 4F /79 dt 0xFF,0x09,0x09,0x09,0x09,0x0F,0x00,0x00; P 50 /80 dt 0x3F,0x21,0x21,0x21,0xE1,0xBF,0x00,0x00; Q 51 /81 dt 0xFF,0x09,0x19,0x39,0x6F,0xC0,0x80,0x00; R 52 /82 dt 0x4E,0x91,0x91,0x91,0x91,0xE2,0x00,0x00; S 53 /83 dt 0x01,0x01,0x01,0xFF,0x01,0x01,0x01,0x00; T 54 /84 dt 0x7F,0x80,0x80,0x80,0x80,0x80,0x7F,0x00; U 55 /85 dt 0x1F,0x20,0x40,0x80,0x40,0x20,0x1F,0x00; V 56 /86 dt 0x7F,0x80,0xC0,0x3F,0x40,0x80,0x7F,0x00; W 57 /87 dt 0x81,0x42,0x24,0x18,0x24,0x42,0x81,0x00; X 58 /88 dt 0x01,0x02,0x04,0xF8,0x04,0x02,0x01,0x00; Y 59 /89 dt 0xC1,0xA1,0x91,0x89,0x85,0x83,0x00,0x00; Z 5A /90 dt 0xFF,0x81,0x81,0x81,0x00,0x00,0x00,0x00; [ 5B /91 dt 0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x00; \ 5C /92 dt 0x00,0x00,0x00,0x00,0x00,0x81,0x81,0xFF; ] 5D /93 Char_tbl3end org 0xD00 Char_tbl4 addwf PCL,f dt 0x00,0x04,0x02,0x03,0x02,0x04,0x00,0x00; ^ 5E /94 dt 0x00,0x00,0x40,0x40,0x40,0x40,0x00,0x00; _ 5F /95 dt 0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00; ` 60 /96 dt 0x00,0x78,0x84,0x84,0xF8,0x80,0x80,0x00; a 61 /97 dt 0x00,0xFF,0x90,0x90,0x90,0x60,0x00,0x00; b 62 /98 dt 0x00,0x70,0x88,0x88,0x88,0x00,0x00,0x00; c 63 /99 dt 0x00,0x60,0x90,0x90,0xFE,0x00,0x00,0x00; d 64 /100 dt 0x00,0x78,0xA4,0xA4,0xB8,0x00,0x00,0x00; e 65 /101 dt 0x00,0xFC,0x22,0x22,0x22,0x00,0x00,0x00; f 66 /102 dt 0x00,0x3C,0xA4,0xA4,0xFC,0x00,0x00,0x00; g 67 /103 dt 0x00,0xFC,0x20,0x10,0xE0,0x00,0x00,0x00; h 68 /104 dt 0x00,0x00,0x00,0xE8,0x00,0x00,0x00,0x00; i 69 /105 dt 0x00,0x40,0x80,0x80,0x74,0x00,0x00,0x00; j 6A /106 dt 0x00,0xFC,0x20,0x58,0x80,0x00,0x00,0x00; k 6B /107 dt 0x00,0xFC,0x80,0x00,0x00,0x00,0x00,0x00; l 6C /108 dt 0x00,0xE0,0x10,0x60,0x10,0xE0,0x00,0x00; m 6D /109 dt 0x00,0xE0,0x10,0x10,0x10,0xE0,0x00,0x00; n 6E /110 dt 0x00,0xF0,0x90,0x90,0xF0,0x00,0x00,0x00; o 6F /111 dt 0x00,0xF8,0x28,0x28,0x38,0x00,0x00,0x00; p 70 /112 dt 0x00,0x38,0x28,0x28,0xF8,0x00,0x00,0x00; q 71 /113 dt 0x00,0xF8,0x10,0x08,0x30,0x00,0x00,0x00; r 72 /114 dt 0x00,0x90,0xA8,0xA8,0x48,0x00,0x00,0x00; s 73 /115 dt 0x00,0xF8,0xA0,0xA0,0x80,0x00,0x00,0x00; t 74 /116 dt 0x00,0xF0,0x80,0x80,0xF0,0x00,0x00,0x00; u 75 /117 dt 0x00,0x30,0x40,0xC0,0x40,0x30,0x00,0x00; v 76 /118 dt 0x60,0x80,0x80,0x60,0x80,0x80,0x60,0x00; w 77 /119 dt 0x00,0x90,0x60,0x60,0x90,0x00,0x00,0x00; x 78 /120 dt 0x00,0x08,0x90,0xA0,0xF8,0x00,0x00,0x00; y 79 /121 dt 0x00,0x88,0xC8,0xA8,0x98,0x88,0x00,0x00; z 7A /122 dt 0x10,0x2C,0xC3,0x81,0x00,0x00,0x00,0x00; { 7B /123 dt 0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00; | 7C /124 Char_tbl4end org 0xE00 Char_tbl5 addwf PCL,f dt 0x00,0x00,0x00,0x00,0x00,0xC1,0x36,0x08; } 7D /125 dt 0x00,0x04,0x02,0x04,0x08,0x04,0x00,0x00; ~ 7E /126 dt 0x00,0x1E,0x12,0x12,0x12,0x1E,0x00,0x00;  7F /127 Char_tbl5end ORG 0x2100 EEPROM_16F876 equ $ ;un zero doit terminer la phrase ;message de bienvenue EE0 DT '\r',"HAPR_876_2008_081221 Q=8MHz",'\f','\r' DT "16F876 avec bootloader 9600bds",'\f','\r' DT "ADC 10b gamme=2.00V",'\f','\r' DT "RB2=0 pour MAJ RTC",'\f','\r' DT "ver: " IFDEF BUID_WITH_SHIFT DT "32car Defilants" ELSE DT "16car Fixes" ENDIF DT ", RS232 output" DT " (c)PAULFJUJO",.13,.10,.0 ;message 1 HAPR IFDEF BUID_WITH_SHIFT ; "12345678901234567890123456789012" <-32 car EE1 DT " 18/12/08 21:05:00s TEMP 12.50'" ELSE EE1 DT "18:32:25 T= 21.9" ENDIF ;message 2 HAPR EE2 DT " PAULFJUJO HARP876-ICSP-ASM 2008" EE3 DT "MAJ DS1307 ",'\f','\r' DT "AAMMJJWWHHMMSS",.13,.10,.0 ;EE4 DT "ADC 16F876 = ",.0 finEEprom EQU $ EEpromLibre EQu .256-(finEEprom - EEPROM_16F876) END ; directive fin de programme