Storing and recalling ASCII Strings

hal8000

Member
I'm looking at ways to store and recall strings of ASCII text on a Picaxe 18M2

I know I can store a string in EEPROM with a start address, e.g.

EEPROM 10,("Voltage VC1=6.23")

I am also assuming that this will require 1 byte for every character (including spaces) 16 bytes for above example.

Is there any way to store the string like
"Hello World" other than in EEPROM?

b0 - b127 on M2 parts only store 1 byte and w0 - w13 store 2bytes each, if I have understood Pixaxe Manual 2 correctly,
so a string like "Hello" could not be stored in the above location as it is 5 bytes long.

Ultimately I am trying to display lines of text on a 1602F LCD display, working in 4 bit mode.

It will be much easier for me to use the AXE033 module and send strings serially, but just thought I'd ask
if there are alternative ways of storing and recalling ascii strings.
Thanks in advance.
 

westaust55

Moderator
I am also assuming that this will require 1 byte for every character (including spaces) 16 bytes for above example.
Correct. 1 byte per character unless you wish to employ some encoding scheme that would occupy extra program space to decode.

Is there any way to store the string like
"Hello World" other than in EEPROM?
EEPROM can be changed by the program during execution.
The READTABLE command can only be used with data embedded permanently within the program and the data cannot be changed which likely suits your purposes.

The LOOKUP commands can be used in a loop to fetch the data one byte at a time but is slower as the strings become longer.

The READTABLE command can only be used with data embeded permantently within the program and the data cannot be changed which likely suits your purposes.
From recent tests by another forum member, this function is quite fast.

It will be much easier for me to use the AXE033 module and send strings serially.
With the AXE033 there is also the opportunity to store up to seven 16 character pre-defined messages directly in the AXE033 memory using a program line such as:
serout 7,N2400, (x)​
where x = 1 to 7 inclusive
 
Last edited:

hal8000

Member
Thanks a lot guys, that is valuable information to know.
I am going to order a serial OLED shortly, I like the look
of the yellow on black display.

Thanks for your help.
 
Top