serin serout and words

Mark.R

Member
Im just starting to have a play (as they say) with sending some data from Words in one picaxe to words in another, is this possible. From what I've researched so far you can't but you can send bytes...so...

From my understanding you cant have

serout <pin>, <baud>, (w0, w1, w2)

but you can have

serout <pin>, <baud>, (b0, b1, b2, b3, b4, b5)

is this correct, if so how would you get these bytes back into words once transmitted to the second picaxe using something like

serin <pin>, <baud>, b0, b1, b2, b3, b4, b5

can anyone help or point me to a further thread.

Thanks
 

Mark.R

Member
Actually now I've had time to think about it I'm probably being a bit dense. If serin has clocked data into b0 & b1 say, that would already have put the data into w0......right??
 

cpedw

Senior Member
Yes, right. You don't even need to know whether b0 is the low end or the high end of w0. It gets into the correct place provided you don't alter the order b0, b1, b2, b3, b4, b5 between serout and serin.
 

Mark.R

Member
If I send b0, b1, b2, b3, b4, b5 can I then receive them into say b20, b21, b22, b23, b24, b25 or do they have to match between serout & serin?
 

inglewoodpete

Senior Member
If I send b0, b1, b2, b3, b4, b5 can I then receive them into say b20, b21, b22, b23, b24, b25 or do they have to match between serout & serin?
Asynch serial data transmission is typically an 8-bit protocol: hence sending bytes is by far the most commonly supported way of transporting data using this medium.

Once a byte is transmitted on a wire it is just a byte on a wire(!) and the receiving end must know what speed the data is being sent at and what the received data means. Is the data a byte integer (0-255) or is it an ASCII character? If it is text, is it English text or another language? So the receiver must "know" what the data represents and how it is to be reassembled. The data might be transmitted by a PICAXE but the receiver could a PC, MAC, Raspberry Pi or another PICAXE (or a hundred other devices). The received data can go into any register or array etc. That's for you, the programmer to decide.
 

Mark.R

Member
Just to confirm I can now send the three words w10, w11 & w12 as b20, b21, b22, b23, b24, b25 and receive them into b0, b1, b2, b3, b4, b5 for w0, w1 & w2 and the data comes across a treat.
 
Top