CGRAM use FRM010

hippy

Ex-Staff (retired)
I think the answer is; yes LCD CGRAM characters can be programmed and used with the FRM010 ( and AXE033 ).

To program a CGRAM character you have to use a 254,%01xxx000 command where 'xxx' is the CGRAM character number (0-7) in binary then send 8 bytes of 5-bit wide pixel data, which must be non-zero, so easiest is to set bit 5.

For example to program CGRAM character 1 ...

SerOut LCD, BAUD, ( 254, %01001000 )
SerOut LCD, BAUD, ( %101110 )
SerOut LCD, BAUD, ( %101110 )
SerOut LCD, BAUD, ( %100100 )
SerOut LCD, BAUD, ( %111111 )
SerOut LCD, BAUD, ( %100100 )
SerOut LCD, BAUD, ( %101010 )
SerOut LCD, BAUD, ( %110001 )
SerOut LCD, BAUD, ( %100000 )

Then I believe it's necessary to send a positioning command, such as Start of Line 1 ...

SerOut LCD, BAUD, ( 254, %10000000 )

And to use the CGRAM characters send the number of the CGRAM character plus 8. So to display CGRAM Character 1 send 9 ...

SerOut LCD, BAUD, ( 9 )

You should then see the character of a man. Only tested on AXE033.

Complete example code ...

#Picaxe 18M2

Symbol LCD = B.1
Symbol BAUD = N2400

Pause 1000

SerOut LCD, BAUD, ( 254, %01000000 )
SerOut LCD, BAUD, ( %101110 )
SerOut LCD, BAUD, ( %101110 )
SerOut LCD, BAUD, ( %100100 )
SerOut LCD, BAUD, ( %111111 )
SerOut LCD, BAUD, ( %100100 )
SerOut LCD, BAUD, ( %101010 )
SerOut LCD, BAUD, ( %110001 )
SerOut LCD, BAUD, ( %100000 )

SerOut LCD, BAUD, ( 254, %01001000 )
SerOut LCD, BAUD, ( %101110 )
SerOut LCD, BAUD, ( %101110 )
SerOut LCD, BAUD, ( %100100 )
SerOut LCD, BAUD, ( %111111 )
SerOut LCD, BAUD, ( %101110 )
SerOut LCD, BAUD, ( %111111 )
SerOut LCD, BAUD, ( %101010 )
SerOut LCD, BAUD, ( %100000 )

SerOut LCD, BAUD, ( 254, %10000000 )

SerOut LCD, BAUD, ( 8, 9 )

End
 
Last edited:

Vroom

Member
Hippy- thanks, I will try do that. I thought AXE033 Serial LCD Firmware chip is different to FRM010 chip.

PICAXE Programming Editor have Serial LCD CGRAM like serout 7, N2400, (254, 64, 32, 38, 54, 52, 36, 55, 32, 40) but not work on FRM010.

I have LCD117 chip, not know if possible with use CGRAM like your code, commands are different.
 

pha555

Senior Member
It is right there at http://www.phanderson.com/lcd106/lcd107.html

SerOut 0, Baudmode, ["?D00000000000000000"] ' define special characters
Pause 200 ' delay to allow write to EEPROM

SerOut 0, Baudmode, ["?D11010101010101010"]
Pause 200

SerOut 0, Baudmode, ["?D21818181818181818"]
Pause 200

SerOut 0, Baudmode, ["?D31c1c1c1c1c1c1c1c"]
Pause 200

SerOut 0, Baudmode, ["?D41e1e1e1e1e1e1e1e"]
Pause 200

SerOut 0, Baudmode, ["?D51f1f1f1f1f1f1f1f"]
Pause 200

Peter Anderson
 

BillyGreen1973

Senior Member
Hippy- thanks, I will try do that. I thought AXE033 Serial LCD Firmware chip is different to FRM010 chip.

PICAXE Programming Editor have Serial LCD CGRAM like serout 7, N2400, (254, 64, 32, 38, 54, 52, 36, 55, 32, 40) but not work on FRM010.

I have LCD117 chip, not know if possible with use CGRAM like your code, commands are different.
Axe033 firmware and FRM010 firmware ARE different, however they use the same commands :D

The line produced by the Program Editor just converts the binary to decimal, and uses the decimal figures. Both are acceptable, however by using the binary it is a little easier to 'visualise' the pixel patterns.
 

hippy

Ex-Staff (retired)
There are slight differences between FRM010 and AXE033, in particular that the AXE033 will display pre-defined messages when ascii codes $00 to $07 (0-7) are sent.

This prevents the CGRAM character numbers being directly used on the AXE033, but most compatible displays also duplicate 0-7 at 8-15, hence the add 8 trick. The FRM010 I believe does allow them to be directly used but use the trick and the code will work with AXE033 and FRM010.

The AXE033 intercepting 0-7 values is also why it's necessary to always send non-zero values when defining the CGRAM character pixels. This will also work with both AXE033 and FRM010.
 
Top