Page 1 of 1

freeing the uart port

Posted: Sun Jan 06, 2013 7:04 pm
by Patrick222122
I am wondering if anyone has managed to free the uart of the pi using the debian operating system. I tried myself using method outlined in tutorial for weezy and it did not work. If you have please tell me how( note by the time you read this post I might have found the answer I seek)

Re: freeing the uart port

Posted: Sun Jan 06, 2013 7:33 pm
by joan
Edit /boot/cmdline.txt to remove the mentions of ttyAMA0.

Edit /etc/inittab and put a hash at the start of the line which mentions ttyAMA0

Re: freeing the uart port

Posted: Sun Jan 06, 2013 8:50 pm
by Patrick222122
Now I need a library to communicate over the uart. Any suggestions?(I can program in the C's and to less degree in python)

Re: freeing the uart port

Posted: Sun Jan 06, 2013 9:45 pm
by joan
You don't need a library. I posted some code in http://www.raspberrypi.org/phpBB3/viewt ... 39#p252739

You'll only be interested in the command to open the serial port for reading/writing. The actual reads/writes are performed with standard functions.

Re: freeing the uart port

Posted: Mon Jan 07, 2013 12:02 am
by Patrick222122
Actullaly I do need a library because I am using the pi to serve as a frontal lobe and opcital of sorts for a robot I am working on.

Re: freeing the uart port

Posted: Mon Jan 07, 2013 2:46 am
by Patrick222122
maybe I should have made that last post more clear. The frontal and opcitial lobes are parts of the brain that deal with high level though and vision respectfully. I try to connect the pi to a proplleror development board

Re: freeing the uart port

Posted: Mon Jan 07, 2013 5:11 pm
by Patrick222122
I also need to know which pins I need to connect to RX,tx, ground and3.3v on the propellor

Re: freeing the uart port

Posted: Mon Jan 07, 2013 5:32 pm
by daveake
You connect GND and GND together, Tx to Rx, and Rx to Tx.

I don't know how much power the Propellor board takes, but if it's 3.3V at no more than 50mA then you can connect 3.3V from the Pi to the 3.3V line on the Propellor.

For low-level "send a byte" stuff, you don't need any special library. In 'C' you use standard system I/O calls. For Python you can use pySerial (I just googled that - I've not used it). You will also need to set the baud rate/data bits/partity/stop bits on each device to match.

Nobody can advise about higher level libraries without knowing how you want to use the serial link.

Re: freeing the uart port

Posted: Mon Jan 07, 2013 10:21 pm
by Patrick222122
yes I know that already,I must worded the question wrong, I want to know which pins on the pi are TX RX, 3.3v and ground

Re: freeing the uart port

Posted: Tue Jan 22, 2013 5:43 pm
by daveake
All the pins you need to connect to are listed in the GPIO section of the RPi wiki:

http://elinux.org/RPi_Low-level_peripherals

Dave