Patrick222122
Posts: 80
Joined: Sun Dec 02, 2012 5:51 pm

freeing the uart port

Sun Jan 06, 2013 7:04 pm

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)

User avatar
joan
Posts: 14468
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: freeing the uart port

Sun Jan 06, 2013 7:33 pm

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

Patrick222122
Posts: 80
Joined: Sun Dec 02, 2012 5:51 pm

Re: freeing the uart port

Sun Jan 06, 2013 8:50 pm

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)

User avatar
joan
Posts: 14468
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: freeing the uart port

Sun Jan 06, 2013 9:45 pm

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.

Patrick222122
Posts: 80
Joined: Sun Dec 02, 2012 5:51 pm

Re: freeing the uart port

Mon Jan 07, 2013 12:02 am

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.

Patrick222122
Posts: 80
Joined: Sun Dec 02, 2012 5:51 pm

Re: freeing the uart port

Mon Jan 07, 2013 2:46 am

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

Patrick222122
Posts: 80
Joined: Sun Dec 02, 2012 5:51 pm

Re: freeing the uart port

Mon Jan 07, 2013 5:11 pm

I also need to know which pins I need to connect to RX,tx, ground and3.3v on the propellor

User avatar
daveake
Posts: 184
Joined: Thu Jul 12, 2012 12:07 am

Re: freeing the uart port

Mon Jan 07, 2013 5:32 pm

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.

Patrick222122
Posts: 80
Joined: Sun Dec 02, 2012 5:51 pm

Re: freeing the uart port

Mon Jan 07, 2013 10:21 pm

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

User avatar
daveake
Posts: 184
Joined: Thu Jul 12, 2012 12:07 am

Re: freeing the uart port

Tue Jan 22, 2013 5:43 pm

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

Return to “Debian”