PicAxe ChipLCD/OLED screens
A Microbot being used as a set of traffic lightsThese are a self-assembly accessory, a bit fiddly to solder but easy with practice. The OLED display is far superior, brighter and with better contrast. This page will refer to the Budget Serial OLED Module

The display has its own PICAXE-18M2 chip and a 3.5mm PICAXE Programming Connector. This allows the PICAXE-18M2 to be reprogrammed (e.g. to update the AXE133 firmware). The default AXE133 firmware is available via the PICAXE website. You can customise this firmware to include your own start-up message and store 14 other custom messages which another PicAxe chip can access.

Note: the default BASIC firmware is dual purpose (LCD/OLED) but the download version is by default set for LCD. You need to remove the REM from the following line of you want it to work with an OLED screen:

#define use_OLED ; enable this line for Winstar OLED modules

The connections between the 3-pin PCB and the screen moduleThe Microbot sends serial data to the screen module. The screen module is connected to the Microbot by a standard 3-wire cable and 3-pin PCB.

Make sure the white wire connects to the data (square gold) pin on the PCB and the IN connector on the screen unit.

The Logicator for Pic LCD command is easy to use. If variables are to be displayed then they are entered in square brackets.

Using the Logicator for Pic LCD command blockThe Logicator for Pic LCD command can only work if the screen module is attached to a 3-pin PCB on one of the B connectors such as B0, the centre-rear. To connect to one of the C connectors a BASIC command block will be needed.

The BASIC code to send serial data to a display module on connector C2 would be:

serout C.2,N2400,(254,1)   ; clear the screen
pause 500                  ; allow the screen to power up or clear
serout C.2,N2400,(254,128) ; move to line 1, position 1
serout C.2,N2400,("WAIT")  ; the text to display

Note: The last 2 lines could be combined i.e. serout C.2,N2400,(254,128,"WAIT")

To use variables in a BASIC block use the bintoascii command. This splits the variable value up into the ASCII characters for the units, tens, hundreds etc. For example, to display the value of variable C:

serout C.2,N2400,(254,1)   ; clear the screen
pause 500                  ; allow the screen to power up or clear
serout C.2,N2400,(254,128) ; move to line 1, position 1
bintoascii varC,b7,b8,b9   ; split the variable into 3 ASCII characters
serout C.2,N2400,("Variable C: ",b7,b8,b9)

Control commands are all prefixed by the number 254. They are used to send commands to the Serial LCD Module (e.g. serout B.7,N2400,(254,192) ; move to start of the second line)

The most common control commands are:

  • 254,1 Clear Display (must be followed by a ‘pause 30’ command)
  • 254,8 Hide Display
  • 254,12 Restore Display
  • 254,14 Turn on Cursor
  • 254,16 Move Cursor Left
  • 254,20 Move Cursor Right
  • 254,128 Move to line 1, position 1
  • 254, y Move to line 1, position x (where y = 128 + x)
  • 254,192 Move to line 2, position 1
  • 254, y Move to line 2, position x (where y = 192 + x)

Message commands are all prefixed by the number 253. There are 16 (0-15) predefined messages which can be altered by editing the BASIC firmware and downloading it


Sample programs:

Traffic Lights bot.plf

  • This program uses BASIC command blocks to control red, amber and green LED's on the rear 3 connectors of a Microbot, and an OLED/LCD screen attached on the front centre connector C2.

  • A BASIC block used to send serial data to an LCD/OLED screenThe LCD screen is connected to the centre-front connector C2 using a 3-pin PCB. This is an input connection so a BASIC command block is needed.

  • If the standard LCD command block in Logicator for PIC was used and set to output 2 it would send the serial data to B2, the piezo buzzer.

Display_demo1.plf

  • This program shows the use of control codes on a BASIC command block to offer extra functions that the Logicator for PIC LED command block cannot provide.

  • The BASIC code is listed below:

pause 500
serout C.2,N2400,(254,1) ;clear the display
serout C.2,N2400,(254,128) ;move to line 1, position 1
serout C.2,N2400,("Hello")
pause 1000
serout C.2,N2400,(254,20) ;move the cursor 1 to the right
serout C.2,N2400,("World!")
pause 1000
serout C.2,N2400,(254,192) ;move to line 2, position 1
serout C.2,N2400,(253,3) ;display stored message 3

random_write_read_eprom_display.plf

  • This program shows how the Microbot chip EEPROM can be used to store a random value (0-255)using the WRITE command block. The READ command block loads the stored value into variable A and it is then displayed on the screen.

  • The BASIC code part is listed below:

serout C.2,N2400,(254,1) ;clear the screen
pause 500
serout C.2,N2400,(254,128) ; move to line 1, position 1
bintoascii varA,b7,b8,b9
serout C.2,N2400,("Random No. = ",b7,b8,b9)