I'am trying to modify this code for my 1x16 display but can only get the first 8 characters to light up, i think it must be something in the function set but i cant realy find out, so if someone can take a look at the code and datasheet??
am on my cell so can't really look into it, but I believe a 16x1 display is basically an 8x2 with the 8s side by side. So to address the 2nd 8 characters you need to issue a second line command
To add to what Norlin said, to write to characters 8 to 15 send command 0xc0. The second line (or in your case the right hand side of the display) starts at address 0x40 and the command to set address is 0x80 - combined is 0xc0.
hi,
You write the start location of the left handside to the LCD, using the control cmd, [0x00] just before you start writing the data to the LCD, then after the 1st 8 characters, write the righthand start address [0x40], then continure with the data write.
Code:
hallo
write the LCD location 1 here use
movlw '0x80'
Call OutLcdControl
movlw 'H'
movwf LcdDaten ; LCD data
call OutLcdDaten ; LCD data out
movlw 'a'
movwf LcdDaten ; LCD data
call OutLcdDaten ; LCD data out
movlw 'l'
movwf LcdDaten ; LCD data
call OutLcdDaten ; LCD data out
movlw 'l'
movwf LcdDaten ; LCD data
call OutLcdDaten ; LCD data out
movlw 'o'
movwf LcdDaten ; LCD data
call OutLcdDaten ; LCD data out
movlw ' '
movwf LcdDaten ;LCD data
call OutLcdDaten ;Ud data LCD
movlw 'O'
movwf LcdDaten ; LCD data
call OutLcdDaten ; LCD data out
movlw 'Y'
write the LCD location 1+8 here use
movlw '0xC0'
Call OutLcdControl
movwf LcdDaten ; LCD data
call OutLcdDaten ; LCD data out
movlw '2'
movwf LcdDaten ; LCD data
call OutLcdDaten ; LCD data out
movlw 'L'
movwf LcdDaten ; LCD data
call OutLcdDaten ; LCD data out
Thanks Eric
Have just try it, but still not working, so i think now i change over to use a 2x16 lcd, i know a 2x16 works with this program, i have try it before. But the program anyway just use the first line of the lcd
I wonder if you couldn't design a somewhat 'generic' PutLCD routine that could keep track of and increment a Tab variable and automatically issue the position control command when needed? Perhaps using assembler equates for determining 1x16, 2x16, 1x20, 2x20, 4x20, etc., display types?
I wonder if you couldn't design a somewhat 'generic' PutLCD routine that could keep track of and increment a Tab variable and automatically issue the position control command when needed? Perhaps using assembler equates for determining 1x16, 2x16, 1x20, 2x20, 4x20, etc., display types?
I suspect you could too Mike (Pommie) but who's got time (grin)...
I did just get a couple 2x20 displays and a single 4x20 display recently but not sure when I'll get a chance to 'play'. The new 128x64 GLCD with touchscreen and RGB backlight has higher priority for me right now. I'm going to use an 18F4431 with its multiple PWM outputs as a high performance controller and I only just finished writing and testing a bootloader for that device so it's going slowly.
Wow! I just found my very first LCD display from many years ago. It's a very large 2x16 display without a backlight. It's really physically huge compared to the compact 2x20 and 4x20 backlit units I received recently.
I remember stopping by a new (at the time) local company called Optrex and speaking with one of their engineers and he gave me this particular display as a sample which I then used it in an EPROM/EEPROM programmer project of my own design which used a Motorola 68HC11FN1 controller.
Are you able to write to both lines of the 2x16, essentially it's just like writing to the second 8 of the 1x16.
Try printing all ASCII characters at it, loop 0 to 127, and print the ASCII value to the display, when you do this the second part of the display should be filled, starting forty charcaters in.
LCD displays are essentially all 2x40, with the second line continuing from the end of the first 40 character line - the display itself is a 'window' on this 2x40 buffer, and you can scroll it along the buffer with commands.