Amateur radio, programming, electronics and other musings

LCDs and custom character woes

LCDs and custom character woes

Tonight I have been experimenting with custom characters on the 4×20 LCD.  I used a custom character when I defined the degree symbol on the Thunderbolt monitor.  As part of that I wanted to be able to have a screen which showed a large UTC clock.  Having decided that I could double the size by using characters covering a 2×2 character space I worked out that HH:MM:SS would occupy 14 chars.  3×3 would just have been possible as that would have taken exactly 20 chars.

My initial research told me that I can store up to 8 custom characters in the LCD with and write them out by referring to the byte address that they had been stored in.  I found a great site for helping out with the design to byte array translation.

I generated 4 custom characters and write them out to produce a zero.  I followed the same pattern to draw out a large one next to the zero.  When I ran the program all I saw was two large ones next to each other.  I found this weird.  I took out the code which wrote out  the second number and reran the program.  I got two ones as before.  I quickly realised that what was happening was as I was reinitialising the custom character it was updating it on the LCD.  This meant I was limited to only being able to display two different large numbers at a time.

Ultimately it means I have to either use a less pretty way of drawing numbers which only use a the 8 character spaces, use a different kind of display or scrap the idea of the large clock.  For the time being I’m going to scrap the idea…. unless someone has some code to donate which produces a nice looking clock.