Help with simple serial obex/30
stargazer2050
Posts: 89
2 propeller quickstarts
Obex 30
Want to pass a single digit variable one way
Do i load the obex30 on both boards as is?
Where do you assign the pin numbers ?
Where to put the variable or data to transfer?
What to expect and where to look for resultant transfer
How to capture the variable on the other side?
Obex 30
Want to pass a single digit variable one way
Do i load the obex30 on both boards as is?
Where do you assign the pin numbers ?
Where to put the variable or data to transfer?
What to expect and where to look for resultant transfer
How to capture the variable on the other side?
Comments
How do i capture that in a variable on the other machine?
When i load prop comm which sets tx rx.pins, i have a page of clicking and symbols.
Prop comm
Trying to send a variable from one to the other
Is that what this software is for?
Recommend another?
You could use anything from Simple_Serial to Extended FullDuplexSerial and others depending on your needs.
Please avoid double posts, it only upsets people.
Usually with he objects there also is a demo, it is a nice starting point.
In general the serial objects allow you to set the rx and tx pins, inverted/noninverted (if the idle signal is high or low), and baud rate.
It is not clear what you are trying to do.. try to post some more details.
Massimo
Would like to send one byte from board #1 to board #2 and save the same "variable". No need to verify ( for now)
Im sending slowly, once in a minute or so
I'm doing it now with pin to pin and counting the pulses but timing errors are hard to supress.
A possible path:
Try to start with a single board and the serial terminal.
Have the propeller sending chars to the terminal, in an endless loop.
Then send a char from the terminal, and have the board answering you back, either the same char or the char with a change, just to have the basic setup working.
If you get strange chars back there probably is a baud rate setting issue.
After that increase the complexity.
You can also format a string with the data inside. You can find a lot of examples regarding GPS data. GPS is sending strings, that are parsed by the propeller.
Consider using a different serial object Simple serial is very basic. In the propeller install dir there is the full duplex serial, which is better.
In the object comments you can find a lot of informations.
Massimo
On the transmit side (if you declared serial as the object), you'd just call serial.init(-1,transmitPin,9600) on the transmit end to initialize where transmitPin is the I/O pin you're using. You'd call serial.tx(byteValue) periodically to transmit a byte to the other end.
On the receive side, you'd call serial.init(receivePin,-1,9600) to initialize it and have something like byteVariable := serial.rx to wait for the next byte to be sent and store it in the variable.
Both the transmit and receive end could be running in their own cog. The transmit cog would send a byte every so often and the receive cog would wait for that value to be sent. The .init call would have to be done during the initialization of the cog's method rather than in your main program's initialization.
The Propalot uses IR and not serial for some reason
Not familiar with use of expression 'serial.rx' although i see it occasionally
If you use the "dec" method to send a number followed by a carriage return "Char(13)", then the other Propeller can use PST's "DecIn" method to receive the number.
This is explained a little in post #13 of this thread.