Arduino to Propeller communication.
Paul K.
Posts: 150
I have a little project where I want the UNO board to send commands to a Prop shield. The Prop shield will actually be my main board/controller for my robot.
I only what the UNO to send commands to the Prop(some kind of string of data). Basically I can write a simple C program and the Prop does all the work.
I'm thinking SPI object or some other serial object is the way to get these to to talk.
I really haven't seen anything like this before.
I think this is the way to go?
If anyone knows of some projects that are similar if you could point me that way.
I only what the UNO to send commands to the Prop(some kind of string of data). Basically I can write a simple C program and the Prop does all the work.
I'm thinking SPI object or some other serial object is the way to get these to to talk.
I really haven't seen anything like this before.
I think this is the way to go?
If anyone knows of some projects that are similar if you could point me that way.
Comments
The included SoftwareSerial object is good for this. Assuming Arduino 1.0, you can transmit at up to 115,200 bps, which is plenty fast. The Prop will keep up.
With that out of the way, you need to figure out how you're going to send commands. I like to follow what's become somewhat of a standard for Prop-based co-processing tasks, and use the ! character to start a new message, followed by a character that defines the type of message, and then finally the byte(s) of the message. The length and content of the message is up to you, and depends entirely on the complexity of the data you need to transfer. From the Arduino side it's just a simple:
mySerial.print("!MA");
or whatever.
On the Prop end you look for a sequence starting with !.
Beau's firmware for the Propeller serial servo product is a very nicely done example of parsing serial comm. His example shows two concurrent serial objects, but the bulk of the program is pretty easy to follow. You can pick out the pieces you need.
I have an article in SERVO that discusses exactly this topic, but it won't be out for another two or three weeks (and no, I can't share it before they publish it). But if you provide some more detail of your project I'm sure I and others could provide more specific coding examples.
-- Gordon
One reason I like asynchronous serial is that you can use the IDE monitor window to send commands. So you can debug the Propeller and Arduino programs separately.
It actually would be data in from XBee to Uno then passed along to the Prop.
Gordon I'm looking forward to reading your article when I get my Servo Magazine in the mail.
And I will use the ! method for sending data.
In the meantime I'm going to try to get some code written.
The maximum current draw through a Prop protection diode is 0.5mA so 1k is too small, use 3k3 or larger if talking to 5V logic. That or a resistive divider.