SEROUT Coding for LCD/OLED

ROYMARNEWICK

New Member
Hopefully somebody can help with the SEROUT command.

Background :
I have only done one program on an MCU and it has been extensively tested using the Picaxe Editor software using the “Simulate” facility. This has been successful. However, for extending the capability of my program, I require more program memory. I also have not purchased any hardware – so cannot do any prototype testing.
My program uses many SEROUT commands, which are very heavy on memory. These presently utilise the typical 2 line code (and work correctly) – for example ;
100 serout B.7, N2400, (254, 128) ; cursor to beginning of line 1
101 serout B.7, N2400, (“Hello”) ; display “Hello” on line 1
102 serout B.7, N2400, (254, 192) ; cursor to beginning of line 2
103 serout B.7, N2400, (“Goodbye”) ; display “Goodbye” on line 2

I have now saved the messages to the LCD/OLED memory as follows :
50 serout B.7, N2400, (253, 1, “Hello”) ; “Hello” saved as message No.1
51 serout B.7, N2400, (253, 2, “Goodbuy”) ; “Goodbye” saved as message No.2
….
….
100 serout B.7, N2400, (1) ; display message No1 to line 1 of display
101 serout B.7, N2400, (2) ; display message No2 to line 2 of display

When the modified code is run, the words “Hello” and “Goodbuy” do not display at all and the screen only display a single character which looks similar to a T rotated 90 degrees anti-clockwise. My queries are :
• As I understand, messages 1,3,5 & 7 are printed to line 1 and messages 2,4 & 6 are printed to line 2. Am I correct in understanding that I do not require the lines 100 & 102 of the old code in the new code – as the message number, dictates the default line and start position at the beginning of the line?
• I am assuming that the messages do not display correctly on the Picaxe simulation because Picaxe does not correctly simulate the saving and retrieval of messages from the LCD/OLED memory – am I correct – or is there a fault with my code?

I do not have any Picaxe hardware yet to try a live prototype – so any help will be most appreciated.

Roy Marnewick
 

Goeytex

Senior Member
Hi Roy and Welcome,

I have now saved the messages to the LCD/OLED memory as follows :
50 serout B.7, N2400, (253, 1, “Hello”) ; “Hello” saved as message No.1
51 serout B.7, N2400, (253, 2, “Goodbuy”) ; “Goodbye” saved as message No.2

The lines above do not save the messages. This is how they are displayed.

serout B.7, N2400, (253, 1) ' Display Message 1
serout B.7, N2400, (253, 2) ' Display Message 2


The messages are saved by writing them to EEPROM of the 18M2 Firmware on the display module. Refer to the AXE133 Datasheet.

I doubt that the simulator supports the display of messages since the message is not a part of the program being simulated.

Once you get the hardware you can reprogram the messages. The firmware program should be in the Samples Folder
 
Last edited:

neiltechspec

Senior Member
You can save a few bytes by combining the cursor positioning and the text like this :-

serout B.7, N2400, (254,128,"Hello")

Saves 4 bytes.

Neil.
 

westaust55

Moderator
Which LCD/OLED display are you basing your project upon.

Only the AXE033 display has onboard messages saved with SEROUT commands.
The AXE133 has pre defined messages in the onboard PICAXE that are downloaded when the display program is downloaded.

Also which PICAXE chip are you using?
Most now have at least 2 memory slots under PE V6.
 

ROYMARNEWICK

New Member
Thanks for that - I had not spotted that format of code. Upon getting responses from yourself, Goeytex, and Neiltechspec, I have discovered that the code for saving and retrieval of messages is different for the OLED and LCD modules (from the datasheets). I have quite a few Serout commands, so saving 4 bytes per Serout may get me home without having to use saved messages. I am an absolute novice - so the simple solutions are preferred, so I will try this first.
Thanks - Roy
 

ROYMARNEWICK

New Member
Thanks Goeytex, Neiltechspec & Westaust55

As I said - I am an absolute novice - I am even having a problem with this Forum, as I do not know how to follow threads etc.
I did not realize that the coding for saving and retrieval of messages was different for the OLED & LCD modules. I plan on using the OLED (AXE133Y), and my MCU will be an 18M2.

I now understand that with the AXE133 (OLED) :
1. "the AXE133 has pre-defined messages in the onboard Picaxe chip that are downloaded when the display is downloaded" (Westaust55). Some questions here :
a) how do I see what these messages are?
b)How do I change them to messages that I require? - I need very specific (basic) instructions !!!
2. "the messages are saved by writing them to EEPROM of the 18M2 Firmware" (Goeytex). Questions :
a) I have used the EEPROM statement once for writing a few bits of data to EEPROM of the 18M2 chip I am programming - but not the 18M2 on the OLED module. How do i write to the 18M2 on the OLED Module? - again - I need very basi and simple instuctions on how to do this

Thanks to all
Roy Marnewick
 

geoff07

Senior Member
To change the messages in the display you need to download the firmware from picaxe.com, and edit it appropriately using PE. The display has a download socket which you use to load your modified version. Then it becomes a part of the hardware, until you decide to reprogramme it again.

Once you have looked at a copy of the firmware you may find all becomes clear. If not, ask again!
 

westaust55

Moderator
Firstly, you need to download the AXE133 base program from the PICAXE website (here):
http://www.picaxe.com/downloads/axe133y.bas.txt

Next change the messages to suit your requirements. There are 15 lines of program code starting at:
EEPROM $10, (" www.picaxe.com ") ; store msg in the EEPROM memory
EEPROM $20, ("This is msg 2 ") ; store msg in the EEPROM memory

Finally, download the modified BASIC program to the PICAXE onboard the AXE133 display.
Take care to ensure the correct selection is made for LCD or OLED display type.
This is done the couple of lines near the top:
#define use_OLED
;#define use_LCD
just move the semicolon as necessary so the correct definition is used. Default is for OLED.
 

ROYMARNEWICK

New Member
Thanks westaust55

Your detailed expalnation is most appreciated. i am sure that I will come right when I purchase the hardware.

Regards - Roy
 
Top