donis
Posts: 5
Joined: Fri Nov 15, 2013 5:37 pm

GPIO Pings re-assigment?

Fri Nov 15, 2013 6:42 pm

Hello folks,
I have been using a Raspberry Pi B rev 2. I need to read data continuously on GPIO 15 (pin # 10, UART RXD) and have verified that no data is received. Data is to be supplied by a gps receiver. Set up a serial connection (hyper terminal on a laptop and minicom on the Rpi). I ran a minicom session to verify serial communication connections and I can send data from the Rpi on UART TXD (pin 8) to a laptop but NOTHING is received on the Rpi running minicom. The pi is up to date! These are my questions:
- How to check if UART RXD is properly configured?
- Should I try removing & re-installing GPIO? and how?
- Any quick piece of code to rest send/receive functions on the rraspberry pi?
-Any ideas?

Thanks so much

User avatar
DeeJay
Posts: 2027
Joined: Tue Jan 01, 2013 9:33 pm
Location: East Midlands, UK

Re: GPIO Pings re-assigment?

Fri Nov 15, 2013 9:26 pm

What external hardware are you using to convert from the (presumed) rs232 serial output from the gpsr or laptop? (Just because the GPIO pins are labelled for use as a serial uart does not automagically convert the signal levels as well. 'Standard' rs232 serial comms do not use ttl [for the RPi, 0.0 - 3.3 volts] signal levels.)
How To Ask Questions The Smart Way: http://www.catb.org/~esr/faqs/smart-questions.html
How to Report Bugs Effectively: http://www.chiark.greenend.org.uk/~sgtatham/bugs.html

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

Re: GPIO Pings re-assigment?

Fri Nov 15, 2013 9:31 pm

All the gpios on the Pi are 3.3V. What voltage does your GPS unit use?

Use

stty -F /dev/ttyAMA0 4800

to set the default GPS baud rate. Change the 4800 if your unit uses a different value.

Try

cat /dev/ttyAMA0

to see if the GPS is working.

donis
Posts: 5
Joined: Fri Nov 15, 2013 5:37 pm

Re: GPIO Pings re-assigment?

Sat Nov 16, 2013 1:14 pm

DeeJay wrote:What external hardware are you using to convert from the (presumed) rs232 serial output from the gpsr or laptop? (Just because the GPIO pins are labelled for use as a serial uart does not automagically convert the signal levels as well. 'Standard' rs232 serial comms do not use ttl [for the RPi, 0.0 - 3.3 volts] signal levels.)
>>This is my hardware: GARMIN 17X GPS, powered with battery (not with the Rpi). I measured the signals out of the gps receiver to be 3.3V for PPS, and signal expected on the UART RXD is about 2V. I receive the pps signal on the Rpi using "/dev/pps0" and the data stream looks correct. The serial data expected on the RXD UART of the Rpi is not seen. The rest of the hardware set up is as follows:
GPS receiver with battery power
GRD (Rpi pin #6) to GRD on GPS
UART TXD (Rpi pin #8) to Receive on GPS
UART RXD (Rpi pin #10) to TRX on GPS.
I have but not using a “RS232 Serial Port To TTL Converter Module MAX3232″.
Running "cgps -s" always times out with no data and "cat /dev/ttyAMA0" gives some type of un-readable characters (like opening a binary file with a text editor!)

Should I expect a different result if I power the GPS with the raspberry pi?

Thanks again

donis
Posts: 5
Joined: Fri Nov 15, 2013 5:37 pm

Re: GPIO Pings re-assigment?

Sat Nov 16, 2013 1:26 pm

joan wrote:All the gpios on the Pi are 3.3V. What voltage does your GPS unit use?

Use

stty -F /dev/ttyAMA0 4800

to set the default GPS baud rate. Change the 4800 if your unit uses a different value.

Try

cat /dev/ttyAMA0

>>I tried sty -F /dev/ttyAMA0 9600 (value used by the unit) but then
cat "dev/ttyAMA0" shows some unreadable characters (like opening a binary file with a text editor!).

I know the GPS works as I have tested on a regular PC.

to see if the GPS is working.

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

Re: GPIO Pings re-assigment?

Sat Nov 16, 2013 3:31 pm

Try a different baud rate.

User avatar
DeeJay
Posts: 2027
Joined: Tue Jan 01, 2013 9:33 pm
Location: East Midlands, UK

Re: GPIO Pings re-assigment?

Sun Nov 17, 2013 7:52 am

donis wrote: I have but not using a “RS232 Serial Port To TTL Converter Module MAX3232″.
I wonder if that might be the clue?

I've taken a vow not to waste time repeating myself, but note again that standard rs232 serial signal levels do not use the same signal levels (voltages) as the gpio pins on the RPi.
How To Ask Questions The Smart Way: http://www.catb.org/~esr/faqs/smart-questions.html
How to Report Bugs Effectively: http://www.chiark.greenend.org.uk/~sgtatham/bugs.html

klricks
Posts: 6627
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
Contact: Website

Re: GPIO Pings re-assigment?

Sun Nov 17, 2013 3:20 pm

Have you modified the inittab and cmdline.txt files to convert the serial port from a Linux console to a general purpose serial port? (No other configuration is needed as the UART is enabled by default).

You can test your setup by connecting TX and RX together with a wire. Data (key-presses) will then be echoed back to the terminal program - Minicom.
Unless specified otherwise my response is based on the latest and fully updated Raspbian Buster w/ Desktop OS.

karlkiste
Posts: 189
Joined: Tue Jan 22, 2013 8:50 am
Location: berlin, germany

Re: GPIO Pings re-assigment?

Sun Nov 17, 2013 3:42 pm

If your RS232 sending device sends only 0V/3.3V, but on a DB9 connector, you still cannot connect it directly. The voltage levels may be right, but the logic is not. You'll need an inverter at least. RS232 defines a "1" as -3..-15V and "0" as +3..+15V, while the pi assumes 1 to be +2.5V..+3.3V and 0 like 0V..0.7V.

donis
Posts: 5
Joined: Fri Nov 15, 2013 5:37 pm

Re: GPIO Pings re-assigment?

Fri Nov 22, 2013 5:47 pm

Folks,

The issue was resolved by getting a different GPS receiver: "Ultimate GPS breakout" from Adafruit industries. The problem with my previous GPS is that it was putting out a negative voltage output and this wasn't within the bounds accepted by the GPIO UART.

Thanks a lot for your ideas and support.

Don

Return to “Troubleshooting”