PDA

View Full Version : Cannot write whole 16 characters using 16x1 lcd



hvacrtech
- 7th October 2007, 23:07
I have no problem with 16x2 LCD but when I swap to 16x1 unit, cannot do whole 16 character fill in and cuts off after 8th charactor on a single line.

Any solution?

Code: Default for 16x2,

define lcd_dreg portc
define lcd_dbit 0
define lcd_rsreg portc
define lcd_rsbit 4
define lcd_ereg portc
define lcd_ebit 5
define lcd_bits 4
define lcd_lines 2
define lcd_commandus 2000
define lcd_dataus 44

Example
LCDOUT $FE,1,"Hello World" ' works fine for 16x2

for 16x1 unit, this is what occurs using 16x1 displayed as Hello Wo, where's the "rld", cuts off after 8th character.


using Lumex LCM-S01601DSF.

Jerson
- 8th October 2007, 01:23
The 16x1 LCD is organized as 8x2 lines display. So, you need to write the 2nd 8 characters as line 2. I am not sure of the addresses though right now.

Jerson

locko
- 8th October 2007, 10:02
Could be C0 or 88.
If not you will have to make a small program to cycle through the different addresses until you find the 9 char address.

Paul

Acetronics2
- 8th October 2007, 10:13
Vista 32 | NO SLEEP!!!!!!!

LOL !!!

Alain

locko
- 8th October 2007, 13:36
LOL,

There seem to be lots of people that do not get on with Vista, but my new laptop came with Vista and it has been very stable sytem so far.

Just lucky I quess.....

Paul

Jerson
- 8th October 2007, 14:57
Ok, here it is - just so you can sleep ;)



/* Write ASCIIZ String to LCD at specified row and column from *Buffer */
void LCD_puts(byte code *Buffer){
byte x;

LcdColumn = 0;
LCD_write(0x80,CMD);
while (x = *Buffer++) {
LCD_write(x,DATA);
if (LcdColumn++ == 7) LCD_write(0xc0,CMD);
}
}


CMD is the command register of the LCD, DATA is the data register. Addresses are 0x80 and 0xc0


JF

hvacrtech
- 8th October 2007, 15:36
I had it working before anyone posted my question. I using code what was used for 8x2 and 16x2, it filled out correctly but uses more codes to do this instead of regular 16x2.