Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

troubles with HD44780 displays

Status
Not open for further replies.

Fletcher

New Member
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?
 
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?
 
Fletcher said:
I had a look but there isnt really anything that helps me. Thanks anyway.

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?

None of the code you've posted so far does that, also are you sure the hardware connections are correct?.
 
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
 
And are you sure you set TRISx=0 for the pins in question?
 
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

ahh, thanks dude. That fixes everything up.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top