F Fletcher New Member May 7, 2004 #1 The story is this lcd wont stay in data mode. The RS line keeps going low as soon as the enable line is strobed. Im using a pic 16f628. heres the code from the main proc.: Code: CALL INIT ;PERFORM INITILISATION BSF LCD_CTRL,RS ;SET RS LINE HIGH CALL DELAY40 ;DELAY 40uS MOVLW 0X41 MOVWF LCD_DATA ;MOVE 41H ONTO DATA LINES CALL DELAY40 ;DELAY 40uS BSF PORTA,2 ;SET ENABLE LINE HIGH CALL DELAY40 ;DELAY 40uS BCF PORTA,2 ;SET ENABLE LINE LOW CALL DELAY40 ;DELAY 40US SLEEP Does anyone have any suggestions?
The story is this lcd wont stay in data mode. The RS line keeps going low as soon as the enable line is strobed. Im using a pic 16f628. heres the code from the main proc.: Code: CALL INIT ;PERFORM INITILISATION BSF LCD_CTRL,RS ;SET RS LINE HIGH CALL DELAY40 ;DELAY 40uS MOVLW 0X41 MOVWF LCD_DATA ;MOVE 41H ONTO DATA LINES CALL DELAY40 ;DELAY 40uS BSF PORTA,2 ;SET ENABLE LINE HIGH CALL DELAY40 ;DELAY 40uS BCF PORTA,2 ;SET ENABLE LINE LOW CALL DELAY40 ;DELAY 40US SLEEP Does anyone have any suggestions?
Nigel Goodwin Super Moderator Most Helpful Member May 7, 2004 #2 Have a look at my tutorials, I have reliable PIC LCD routines, using either timed delays, or the hardware busy flag.
Have a look at my tutorials, I have reliable PIC LCD routines, using either timed delays, or the hardware busy flag.
F Fletcher New Member May 7, 2004 #3 I had a look but there isnt really anything that helps me. Thanks anyway. anyway ive worked out if i set porta bit 0, then i set porta bit 2, porta bit 0 turns back off. Why is this so?
I had a look but there isnt really anything that helps me. Thanks anyway. anyway ive worked out if i set porta bit 0, then i set porta bit 2, porta bit 0 turns back off. Why is this so?
Nigel Goodwin Super Moderator Most Helpful Member May 7, 2004 #4 Fletcher said: I had a look but there isnt really anything that helps me. Thanks anyway. Click to expand... The only point was that those are known working reliable routines, why reinvent the wheel?. anyway ive worked out if i set porta bit 0, then i set porta bit 2, porta bit 0 turns back off. Why is this so? Click to expand... None of the code you've posted so far does that, also are you sure the hardware connections are correct?.
Fletcher said: I had a look but there isnt really anything that helps me. Thanks anyway. Click to expand... The only point was that those are known working reliable routines, why reinvent the wheel?. anyway ive worked out if i set porta bit 0, then i set porta bit 2, porta bit 0 turns back off. Why is this so? Click to expand... None of the code you've posted so far does that, also are you sure the hardware connections are correct?.
Exo Active Member May 7, 2004 #5 Did you turn the Pic16f628's comparators off? If not, maybe theyre the ones messing everything up.. If you dont want to use the comparators you sould add the lines... MOVLW 0x07 MOVWF CMCON to the top of your code, this makes the comparator pins on porta digital pins
Did you turn the Pic16f628's comparators off? If not, maybe theyre the ones messing everything up.. If you dont want to use the comparators you sould add the lines... MOVLW 0x07 MOVWF CMCON to the top of your code, this makes the comparator pins on porta digital pins
F Fletcher New Member May 7, 2004 #7 Exo said: Did you turn the Pic16f628's comparators off? If not, maybe theyre the ones messing everything up.. If you dont want to use the comparators you sould add the lines... MOVLW 0x07 MOVWF CMCON to the top of your code, this makes the comparator pins on porta digital pins Click to expand... ahh, thanks dude. That fixes everything up.
Exo said: Did you turn the Pic16f628's comparators off? If not, maybe theyre the ones messing everything up.. If you dont want to use the comparators you sould add the lines... MOVLW 0x07 MOVWF CMCON to the top of your code, this makes the comparator pins on porta digital pins Click to expand... ahh, thanks dude. That fixes everything up.