Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 14:53 29 Nov 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Making Custom Characters on 16X2 LCD

Author Message
cosmic frog
Senior Member

Joined: 09/02/2012
Location: United Kingdom
Posts: 284
Posted: 10:59am 15 Mar 2023
Copy link to clipboard 
Print this post

Making Custom Graphics on 1602/2004 LCD

This will work on HD44780 KS0066 SPLC780 controller chips that have 1,2 or 4 lines of text.

The characters are made on a 5X8 grid.
Here is a custom character of a Bell.
 16 8 4 2 1
1      *     =4
2    * * *   =14(8+4+2=14)
3    * * *   =14
4    * * *   =14
5  * * * * * =31(16+8+4+2+1=31)
6            =0
7      *     =4
8            =0

There are 8 custom characters.
CHR$(0) has the command LCD CMD 64
CHR$(1) has the command LCD CMD 72
CHR$(2) has the command LCD CMD 80
CHR$(3) has the command LCD CMD 88
CHR$(4) has the command LCD CMD 96
CHR$(5) has the command LCD CMD 104
CHR$(6) has the command LCD CMD 112
CHR$(7) has the command LCD CMD 120

So to print the Bell character above use-
LCD CMD 64 : LCD DATA 4,14,14,14,31,0,4,0
LCD 1,1,CHR$(0)

To Print another custom character just use the next CHR$-
LCD CMD 72 : LCD DATA X,X,X,X,X,X,X,X
LCD 1,2,CHR$(1)  

Remember if you are using the PicoMite to use BITBANG LCD.

Dave.
 
CaptainBoing

Guru

Joined: 07/09/2016
Location: United Kingdom
Posts: 2080
Posted: 01:16pm 15 Mar 2023
Copy link to clipboard 
Print this post

worth adding, you only need to do

LCD CMD 64 : LCD DATA 4,14,14,14,31,0,4,0

once, (e.g. in the preamble) not each time you do the

LCD 1,1,CHR$(0)

jus' sayin'
Edited 2023-03-15 23:19 by CaptainBoing
 
cosmic frog
Senior Member

Joined: 09/02/2012
Location: United Kingdom
Posts: 284
Posted: 01:26pm 15 Mar 2023
Copy link to clipboard 
Print this post

  CaptainBoing said  worth adding, you only need to do

LCD CMD 64 : LCD DATA 4,14,14,14,31,0,4,0

once, (e.g. in the preamble) not each time you do the

LCD 1,1,CHR$(0)

jus' sayin'


Good point.  
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024