I have written some code which works but the 2nd line of the display does not work. I have made sure ive set the lcd to be in 2line mode and set the correct 5x8 font but i just cant get any text come up. However i can get the cursor to flash on that line.
I thought it was decimal 40?, I have a 2x40 LCD and that goes immediately from the end of line 1 to the beginning of line 2. With a smaller LCD you have to shift the cursor down to line 2 your self, or wait until it gets to the 40th character.
The actual memory in a smaller LCD is still actually 2x40, and the LCD has commands to scroll along this 40 character wide buffer if you want.
Yeah i realise that and my program actually writes the first line, then it goes back into command mode, writes the new cursor location (40h for this display), then it goes back into data mode and starts writing the second line. Probem is the second line never shows.
Yeah i realise that and my program actually writes the first line, then it goes back into command mode, writes the new cursor location (40h for this display), then it goes back into data mode and starts writing the second line. Probem is the second line never shows.
Th weird thing is I if i start writing a whole bunch of characters on the first line eventually the counter in the lcd will hit 40h and start writing perfectly on the second line.
This is the bit in my program where is changes lines:
Code:
BCF PORTA,0 ;Set RS Line low (command)
MOVLW 0X40 ;Set DDram address in W
CALL SENDDATA ;move data in W to lcd data lines and strobe enable line
BSF PORTA,0 ;Set RS Line back to high ready for next character
Anything look wrong with that?
Ive checked everything else, ive made the delays a bit longer to be sure, the only other thing i can think of is there are these commands in the datasheet which i havent used. They are 'cursor or display shift' and 'set DDRAM address'.
Wait, dont worry ive worked it out now. For some reason the DDRAM address table on my datasheet goes from 00 - 4F but i found another datasheet which goes from 80 - CF. I dont get that at all.