init_lcd call wait0 ; tempo env 100 ms pour l afficheur movlw b'00000010' ;mode 4 bits movwf PORTB call e_pulse ; impultion sur E nop nop movlw b'00000010' ;mode 4 bits movwf PORTB call e_pulse ; impultion sur E nop nop movlw b'00001000' ;mode 4 bits movwf PORTB call e_pulse ; impultion sur E nop nop call busy movlw b'00000010' ; 1 ligne carac 5*8 movwf PORTB call e_pulse ; impultion sur E movlw b'00000000' movwf PORTB call e_pulse ; impultion sur E call big_busy ; attend 1,5 ms movlw b'00000000' ; Display On/Off Control movwf PORTB call e_pulse ; impultion sur E movlw b'00001110' ; aff et curseur visible movwf PORTB call e_pulse ; impultion sur E call busy movlw b'00000000' ; Display Clear movwf PORTB call e_pulse ; impultion sur E movlw b'00000001' movwf PORTB call e_pulse ; impultion sur E call big_busy movlw b'00000000' ;Entry Mode Set movwf PORTB call e_pulse ; impultion sur E movlw b'00000110' ; deplacement curseur vers la droite movwf PORTB call e_pulse ; impultion sur E call busy e_pulse ; crée l'impultion sur E nop nop bsf E nop nop bcf E return busy ; crée tempo d'env 50 us movlw 8 movwf temp_busy attd_boucle nop nop nop ; nb = 6 * n + 5 = 41 cycles = 50 us changé 6 en 8 decfsz temp_busy,F goto attd_boucle return big_busy movlw d'35' ; changé 29 en 35 movwf temp2 attd_boucle2 call busy decfsz temp2,F goto attd_boucle2 return tempo500ms ; temporisation de 500 ms call wait0 call wait0 call wait0 call wait0 RETURN wait0 ; Boucles réalisant une tempo élémentaire d'env 100ms movlw .200 ; Charge count1 avec valeur décimale 200 movwf count1 d1 movlw .200 ; Charge count2 avec valeur décimale 200 movwf count2 d2 decfsz count2,1 ; décremente et saute ligne suiv. si zero goto d2 ; si différent de zero decfsz count1,1 ; décremente count1 si c ount2 == zero goto d1 ; boucle interne si count2 <> zero RETURN