rod mcmahon
New Member
Hi Guys
I am having a problem with the fundamental understanding of serial communications, bytes, words and serin/read/write/serout.
So as I see it:-
serin 7,N2400,(“Go”) is really a conditional statement, the code will not jump to the next line unless it receives “Go” on the serial input pin, there is no storing of the variable to a memory location.
If I look at the example in the Basic help file in the programmer
Main: for b0 = 1 to 63
serin 6, N2400,bi
Write b0,b1 ‘write value into b1
Next b0
If we look at the write statement then the explanation is given as Write, location, data, data
Then the above write statement says that read variable b1 is placed into the byte place holder b0 = 1 to 63 depending on loop number. If I am correct then the comment to the above write statement is wrong. It should say ‘write b1 value to b0 position’. Yes or No?
Now lets look at bytes and words. Say I can transmit optional words say red, yellow, blue from one picaxe to the other. How do I send and how do I receive. I can send serout, 6,N2400,”RED” etc but how do I receive this? Do I have to send each letter separately and recombine at the receiving end ? How would I do this?
How many bytes is a letter? How many bytes is a word. I see that I can use the write statement using a word variable Write location, data, data WORD wordvariable, but I do not understand how to address this to the serial input and if I use it how many bytes are used. If using a picaxe 08 then this becomes critical methinks.
I need a toddlers guide.
I am having a problem with the fundamental understanding of serial communications, bytes, words and serin/read/write/serout.
So as I see it:-
serin 7,N2400,(“Go”) is really a conditional statement, the code will not jump to the next line unless it receives “Go” on the serial input pin, there is no storing of the variable to a memory location.
If I look at the example in the Basic help file in the programmer
Main: for b0 = 1 to 63
serin 6, N2400,bi
Write b0,b1 ‘write value into b1
Next b0
If we look at the write statement then the explanation is given as Write, location, data, data
Then the above write statement says that read variable b1 is placed into the byte place holder b0 = 1 to 63 depending on loop number. If I am correct then the comment to the above write statement is wrong. It should say ‘write b1 value to b0 position’. Yes or No?
Now lets look at bytes and words. Say I can transmit optional words say red, yellow, blue from one picaxe to the other. How do I send and how do I receive. I can send serout, 6,N2400,”RED” etc but how do I receive this? Do I have to send each letter separately and recombine at the receiving end ? How would I do this?
How many bytes is a letter? How many bytes is a word. I see that I can use the write statement using a word variable Write location, data, data WORD wordvariable, but I do not understand how to address this to the serial input and if I use it how many bytes are used. If using a picaxe 08 then this becomes critical methinks.
I need a toddlers guide.