Jump to content

Recommended Posts

Posted

Source: https://sites.google.com/site/semilleroadt/raspberry-pi-tutorials/gpio

This is my first post so any feedback would be appreciated.

For those of you who have a Raspberry Pi and either do not have access to a USB UART adapter or just want a backup your Raspberry Pi can be used instead.

In order to use the GPIO pins on your Pi as a UART connector you are going to need to edit two system files "/boot/cmdline.txt" and "/etc/inittb" and use a terminal of you choice for the UART connection.

Step 1:

Backup the system files on you pi.

cp /boot/cmdline.txt /boot/cmdline.bak

cp /etc/inittab /etc/inittab.bak

Step 2:

Remove the following parameters from the /boot/cmdline.txt

nano /boot/cmdline.txt

and delete the following lines:

console=ttyAMA0,115200

kgdboc=ttyAMA0,115200

Step 3:

Comment out (#) the following line at the bottom of /etc/inittab

nano /etc/inittab

and add a # at the begging of the following line:

T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100

Step 4: (Optional)

You may wish to test that your new configuration is working.

Connect the RXD and TXD pins on the Pi together (listed below) and install the following python script:

http://sourceforge.net/projects/pyserial/files/pyserial/

Then run:

python setup.py install

and open a python terminal:

python

and run the following commands

import serial
ser = serial.Serial("/dev/ttyAMA0")
ser.write("UART the Font")
read = ser.read()
print read
ser.close()

Success:

If setup has worked correctly then the variable set above will be printed on the screen.

Step 5:

connect the ground, tx and rx connectors.

GPIO15 = RXD to TXD on Pineapple

GPIO14 = TXD to RXD on Pineapple.

GND = GND to GND on Pineapple.

GPIO pinout can be found here: http://www.hobbytronics.co.uk/raspberry-pi-gpio-pinout

Step 6:

Choose a terminal emulator of choice, here we will use minicom.

apt-get install minicom

Then create the connection:

minicom -b 115200 -o -D /dev/ttyAMA0

If everything was successful on your pineapple you should now have a serial connection to your pineapple :).

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...