433 MHZ tx/rx - passing text

sbscott

Senior Member
I have a set of cheap 433MHZ units hooked to two 08m2. Works fine transmitting values (b0). Not sure how to transmit and rec. text between the two. Done some digging but not sure how SERIN/OUT handles a text block.
 

nick12ab

Senior Member
Text is transmitted as ASCII codes. So serout pin,baud,("ABC") is the same as serout pin,baud,(65,66,67). Both those formats are acceptable.
 

nick12ab

Senior Member
OK, got that. But, what about the rec side? How do I code the SERIN?
Any bytes received with the serin command will be the same as those sent with the serout command, so if serout pin,baud,("ABC") is used, the three bytes received will be 65, 66 and 67. If you then send these to the computer terminal by using sertxd (65, 66, 67) the termianl will show ABC.
 

ashfaqjuna

New Member
Are you using any rf encoder and decoder chips or rfin /rfout commands ? Or just interfacing the rf modules straight to the uart pins and hoping it will work ?
 

westaust55

Moderator
How about to a serial LCD screen?
Still the same. use the SEROUT command to the serial LCD device
SEROUT, <pin>, <baud_rate>, (65, 66, 67)

if say you have received the three bytes.characters into variable b5, b6 and b7 respectively then
SEROUT, <pin>, <baud_rate>, (b5, b6, b7)

what you need to understand is that all computers and microcontrollers etc work in binary. All other representations such as decimal, hexadecimal or ASCII are for the benefit of human reading.
For example %01010101 = $55 = 85 dec = "U"


If you are using simple Tx and Rx modules connected directly to PICAXE chips then that will work but you need to add a preamble before you send the actual data and best to use a qualifier at the start of the data.
The best preamble is a series of say six $55 values, followed a pause whose duration is approx equal to the duration of sending one byte at the baud rate, then send the data.
This scheme first posted about by forum member womai is covered in some details in threads if you wish to search the forum.
 
Last edited:

nick12ab

Senior Member
Still the same. use the SEROUT command to the serial LCD device
SEROUT, <pin>, <baud_rate>, (65, 66, 67)
When sending data to a serial LCD like the Rev-Ed ones, if a display location isn't specified then these digits will just appear after whatever was last written. If you don't want that to happen, set a position first like this:
serout pin,baud,(254,location,b0,b1,b2) where b0, b1 and b2 are the bytes you received. Location is 128+x for the first line and 192+x for the second line - x is zero-indexed character position.
 

westaust55

Moderator
To take the above yet one step further which is covered in datasheets and PICAXE manuals:

if you have say the value 65 in a variable b5 and want to sent that to an LCD display you need to consider what you wish to see.
If the 65 is intended as an ASCII code and you expect to see a character/letter "A" then just send the value as per the previous commands.

But when you wish to see/display the value held in a variable as a number such as "65" then add the hash symbol ( # ) in front of the variable.
so with b5 = 65, b6 = 66 and b7 = 67 now that command might look like:
SEROUT, <pin>, <baud_rate>, (254, <location>, #b5, b6, b7)
and the output would be "65BC"
(if you want spaces between the values/characters then add " ", in the SEROUT command as a separator
 
Top