Raspberry Pi RXD/TXD to Activity Board
Rsadeika
Posts: 3,837
I just fired up my RPi board, and I was thinking about connecting an Activity Board via RX/TX pins, has anybody done this, and is it safe for both boards? What I have seen on so far are some confusing discussions, for me at least, about doing this. In some cases their is talk about level shifters, which make it sound like a real RS232 connection, but I am thinking about a straight connection to the Activity Board from the RPi board.
Thanks
Ray
Thanks
Ray
Comments
If you mean this Activity Board http://www.adafruit.com/products/1371 I don't see any RS232 interface or drivers on it.
I presume your serial connection would go to the Prop pins.
In that case you have no problem with level shifters and such.
I have connected a Propeller to the Tx/Rx on the PI GPIO header and it worked just fine.
I actually put 200 ohm resistors in line with Tx and Rx just for safety but if things are working and you Prop I/O is programmed correctly there is no need for even that.
We even drive the Prop reset pin from a Pi GPIO pin so that we can reprogram the Prop from the Pi.
You will probably want to configure your Pi OS not to use the GPIO Tx/x as the Linux console port.
After reading what I just wrote about the RPi, working with the Activity Board is a breeze compared to working with the RPi board. If the above gets too complicated, I guess my next option would be, plug the USB cable from the Activity Board into the USB on the RPi, start up minicom, and it should be communicating with the Activity Board via P31/P30. I will be using the RPi in a headless manner, so I guess I am very limited as to comm programs that I can use with something like PuTTY.
Ray
I like to add the resistors in series with the Tx and Rx lines just in case the Prop accidentally get a pin set as an output that conflicts with a GPIO pin.
Using the serial port on the Pi GPIO is very easy. Especially if you are using Python. All you have to do is install the Python serial module python-serial and then write some simple code in your application. Like so:
One slight difficulty is that by default the Pi operating systems, like Raspian, will send Linux boot messages over that serial port and then use it as a console port when it's booted. This may well mess with your application. Disabling that only requires:
1) Removing one line from /etc/inittab. Look for the line with the AMA0 device in it.
2) Remove the kernel command line parameter that sets the console port. It's in one of the configuration files in /boot. Can't remember what that's called just now.
Lets us know if you have difficulties.
Here is a nice page describing using serial from Python: http://www.elinux.org/Serial_port_programming
Even having 2 or 3 feet of flexible wire is a good thing, but low-power hard-wire remote control begins to get very handy with a few chips.
For Propforth, Sal uses an RPi to talk to the prop. He connects the prop pins dierctly to the RPi GPIO. Not only that, he solders them while both boards are live. This way he can check the connections with communication in progress. I haven't done it, but he said it takes longer to warm up the soldering iron than it takes to get it set up and working.
I thought that I would try this out before I make an actual attachment to the Activity Board. If I do a 'port.write()' with an Activity Board attched, I think I would become very frustrated, so, work out the kinks before hand.
Ray
No idea really but I have seen things like this not write anything until an end of line is sent.
That is why the is a flush() call in many situations to force characters to be output.
Is the a flush() method in that serial module?
Ray
I think that a prop and the RPi go very good together to make a very powerful system for robots.
You need to hook up Rx, Tx, Gnd and GPIO 17 has the Propeller rest signal.
Sadly the version of SimpleIDE I had that does that is very old now. I am working on making the same adaptions to the most recent IDE and loader. Ready "real soon now"
Yes, the Pi and the Prop make a great team.