16x1 lcd display custom characters

louislouis

New Member
Hello,

I want to try display custom character (empty bat sign) on 16x1 lcd. I work on wireless thermometer, measure actual outside temp, read and store min, max temp. calculate average temp, check outside battery level etc. All working fine, but I have problem with displaying some custom character what I want.

Here is a code for LCD init and sending. I using 08M2 and 74164 shift register for lcd driving.

Code:
PowerOnReset:
GOSUB InitialiseLcd ;Init LCD SCREEN

main:

 

let outbyte = 199 : GOSUB SendCursor


let outbyte = %00000 : GOSUB SendData

let outbyte = %00100 : GOSUB SendData

let outbyte = %10101 : GOSUB SendData

let outbyte = %10001 : GOSUB SendData

let outbyte = %10001 : GOSUB SendData

let outbyte = %10001 : GOSUB SendData

let outbyte = %11111 : GOSUB SendData

let outbyte = %11111 : GOSUB SendData



goto main
 
Last edited:

hippy

Technical Support
Staff member
All working fine, but I have problem with displaying some custom character what I want.
It would help if you can describe what the problem you encounter is, what the code doesn't do which you expect it to do, what it does do instead.

To use a custom character you have to send a CGRAM programming command specifying which character to program, send 8 rows of data bytes, and then send a data byte with the number of the CGRAM character defined to get it on screen. You may need to position the cursor after programming the character.
 

nick12ab

Senior Member
You're setting the cursor (RAM pointer) to 199, then attempting to write the custom character.

The CGRAM starts at 64, so you need to set the cursor to that in order to write the first CGRAM character bitmap. After that, you must set the cursor to 128 (or any other display location) and write data representing the CGRAM location you've written the bitmap to (0-7) unless you want to write some more CGRAM character bitmaps first.
 

louislouis

New Member
Hello Hippy,

So, if I run the posted code, the display show on last position (adress 199 represent this on 1x16 lcd) only four rows (look at attached picture) instead battery sign which I sending in to the lcd.
How to define the CGRAM programming command ?
 

Attachments

Top