Inverting Serial Data without MAX232.

Discuss PIC and electronic related things

Moderators: David Barker, Jerry Messina

Post Reply
xnederlandx
Posts: 33
Joined: Wed Jul 01, 2009 5:55 am

Inverting Serial Data without MAX232.

Post by xnederlandx » Tue Dec 15, 2009 9:46 am

Hi,

I'm trying to communicate with a GPS (BR-355 from Global Sat)
I've configured it to send certain NMEA messages (Plain Ascii Strings) at 4800 baud.

I have communicated with other GPSs sending NMEA messages with my program (true, non-inverted) and have checked that this one is compatible with the messages it sends.

It was designed to be plugged directly in to the computer. I want to connect it to my PIC18F2525, but would like to avoid using a MAX232.
I've read the datasheet, and BAUDCON Bit5 should allow me to invert the data. When I change this to either 1 (inverted) or 0 (un-inverted), nothing happens.

When I plug it into the computer, it works, however.

Am I doing something wrong? Or do I need a MAX232?

Thanks in advance.

gramo
Registered User
Registered User
Posts: 200
Joined: Tue Mar 20, 2007 6:55 am
Location: Australia
Contact:

Post by gramo » Tue Dec 15, 2009 10:08 am

Looks like a feature list rather then a complete datasheet, though chances are it is operating at +/-5V RS232 voltage levels.

King Snake from the digital-diy.com forums (he also gets around here at SF) recently had a similar issue, and came up with some solutions

If it is using standard RS232 voltages, then you will need some sort of hardware in between, as they operate with -ve voltage levels
digital-diy.com - Hobby microcontroller projects and tutorials. Assembly, PICBasic and C examples.

Australian distributor for the Swordfish Compiler

xnederlandx
Posts: 33
Joined: Wed Jul 01, 2009 5:55 am

Post by xnederlandx » Tue Dec 15, 2009 8:14 pm

I just found the datasheet on the GPS.

It specifies that
"
Protocol
Electical Level: Output Voltage Level: 0V ~ 2.85V
Baud rate: 4800 bps
Output Message: NMEA 0183 GGA,GSA, GSV, RMC, VTG, GLL
"
Checking the 18F2525 datasheet - Page 337 - Input High Voltage - D041A/B
It specifies that on pins RC3 and RC4 (serial data rx and tx), the minimum voltage for a "high" signal is 0.7 x VDD (= 3.5V)

So I assume a problem is too a low a voltage on the input?

Francis
Registered User
Registered User
Posts: 314
Joined: Sun Mar 25, 2007 9:40 am
Location: Devon

Post by Francis » Tue Dec 15, 2009 9:30 pm

Dunno, might be. Haven't seen your code or looked at your connections.
Try reducing the supply V to your PIC and try it.
Play... :)

xnederlandx
Posts: 33
Joined: Wed Jul 01, 2009 5:55 am

Post by xnederlandx » Wed Dec 16, 2009 1:26 am

Solution found...
Had to make a little inverter which also boosts the voltage to 5V with a few resistors, a transistor and a diode.

Works beautifully now.

Thanks for all the suggestions & help. :D

User avatar
ohararp
Posts: 194
Joined: Tue Oct 03, 2006 11:29 pm
Location: Dayton, OH USA
Contact:

Post by ohararp » Wed Dec 16, 2009 5:38 pm

I had a similar problem before switching to 3.3V pics. I am interested in the schematic you used though if you don't mind sharing.
Thanks Ryan
$25 SMT Stencils!!!
www.ohararp.com/Stencils.html

Francis
Registered User
Registered User
Posts: 314
Joined: Sun Mar 25, 2007 9:40 am
Location: Devon

Post by Francis » Thu Dec 31, 2009 7:16 pm

Do any of these examples help Ryan?

Image

Post Reply