A pic 16f628a. Read/Write and RegisterSelection pins are to ground (for write and instruction mode)
E pin is on porta,0 and the portb is on the data bus lines(in the right order).
Just to blink the cursor...but it does'nt.
Very strange... I have took an program from another forum member that had the same problems then me and fixed them, loaded it after minor mods and ... does'nt works! he use an lcm1602a, the almost same then ecm1602a.
bsf STATUS,RP0
clrf PORTB
CLRf PORTA
bcf STATUS,RP0
CALL T25MS ; Attend 50msec pour l'initialisation du LCD
CALL T25MS
BCF PORTA,1 ; Clear RS
BCF PORTA,0 ; Clear Enable
MOVLW B'00111100' ; CMD 2 lignes, display ON
MOVWF PORTB
call pulse
CALL T25MS ; Attend 25ms
MOVLW B'00001111' ; CMD Display ON, Cursor ON, Blink ON
MOVWF PORTB
call pulse
CALL T25MS
MOVLW B'00000001' ; Clear Display
MOVWF PORTB
call pulse
CALL T25MS
MOVLW B'00000111' ; Increment mode, Entire shift ON
MOVWF PORTB
call pulse
CALL T25MS
BSF PORTA,1
MOVLW b'11001100'
MOVWF PORTB
call pulse
GOTO END_INIT_LCD
END_INIT_LCD
T25MS
movlw b'100001'
movwf 21h
here
decfsz 20h
goto here
decfsz 21h
goto here
return
pulse
nop
nop
bsf PORTA,0
call T25MS
bcf PORTA,0
return
END
I think that my pic has gone crazy or something because the pin 7 and 6 of the PORTB goes high several times before being high for ever because of the loop at the en of the program... I Tested that by putting an led on the mcu port................................................................................................
As you can see, in all the movlw b'xxxxxxxx' the msb and bit 6 are HIGH ONLY at the end of the program, but my led lights up 8 times...
The PORTB is not acting the way it supposed at all!And its not the first time
Can someone explain that?
(Could it be the pickit2 or the pic?)
I REALLY REALLY REALLY need your help.