1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

Simulating NMEA data

Discussion in 'Oshonsoft' started by camerart, Apr 3, 2015.

  1. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,304
    Likes:
    11
    Location:
    Dorset UK.
    Hi,

    I have a 18F4520 set up to read NMEA data, and show the result of a calculation, and works ok with a GPS module sending once/second. Obviously I am only getting one reading, as the GPS is stationary.

    I need to check GPS movement, and have tried copying NMEA paragraphs (Paragraph = a second burst of sentences) and sending them to the PIC with a Teraterm macro/FTDI, sending paragraphs once/second. This is not working.

    Both DATA signals are approx 3V, the FTDI can be changed to 5V.

    I'm considering a MAX232.

    Any ideas?

    Camerart.
     
  2. Tony Stewart

    Tony Stewart Well-Known Member Most Helpful Member

    Joined:
    Aug 31, 2012
    Messages:
    3,151
    Likes:
    281
    Location:
    Richmond Hill , ON Canada near Toronto
    The FT232R supports High Current IOs with this option, the UART IO pins will drive out at 12 mA instead of their normal 4 mA.
    If you select external Osc and have none, it won't work.

    All Rs232 input thresholds are 2 diode drops or 1.3V

    The IO ports on the 18F4520 are set at 20% of Vdd, so a higher voltage for Vcc does little.
    (5V gives no advantage )

    So check your clock and data polarity and levels.
     
    Last edited: Apr 5, 2015
  3. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,142
    Likes:
    907
    Location:
    Rochdale UK
    ONLINE
    If your pic is running at 5V I suggest a divider to send... I use a 1k / 2k2 to drop the 5V to 3.3V on the tx line

    However... If you are just sending MNEA data Then the pic should read a 3V pulse fine... I use a compass that spits out MNEA sentences.. I have a small VB6 program that allows me to rotate and simulate a 360 degree motion... It works via the USB and the very same FT232r TTL setup as you... The only difference is I use a pic18f45k20..
     
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,304
    Likes:
    11
    Location:
    Dorset UK.

    Hi Tony, Thanks for your answer, can you clarify a couple of things please?

    Does FT232R mean FTDI programmer?
    "this option" Does this mean the 3v or 5v jumper?

    If I've tried the 5v option, could that mean that I have used 12mA instead of 4mA and burnt the input pins out?

    Camerart.
     
  6. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,304
    Likes:
    11
    Location:
    Dorset UK.
    Thanks Ian,

    If I set the FTDI to 3.3V does this satisfy your first line? "If your pic is running at 5V I suggest a divider to send... I use a 1k / 2k2 to drop the 5V to 3.3V on the tx line"

    Could the difference between 18'F'4520 and 'K' make any difference?

    We appear to have similar set-ups. Does your compass spit out bunches of different NMEA sentences in 'say' 1/sec batches? Do you simulate these bunches or do you just send the required NMEA sentence in 1/sec intervals? Which terminal do you use, I use Teraterm?

    Camerart.
     
  7. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,142
    Likes:
    907
    Location:
    Rochdale UK
    ONLINE
    No... I run at 5v anyway...

    My compass spits out this "$HCHDG,xxxxx.x"
    So I lock onto the decimal place and work back until the comma... I only need 1 degree presision


    Funny enough... My first compass used Oshonsoft and a pic16f877a to retrieve the data and displayed it on a 2x16 display

    I cannot post it here as it is still a current product!!!
     
  8. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,304
    Likes:
    11
    Location:
    Dorset UK.
    Hi,

    Do you simulate data into your PIC or only use the Compass as input? If so which Terminal do you use to send data to the PIC?
     
  9. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,142
    Likes:
    907
    Location:
    Rochdale UK
    ONLINE
    I have written a small VB6 program to send the correct sentence to the pic.... It emulates the compass entirely..
     
  10. Tony Stewart

    Tony Stewart Well-Known Member Most Helpful Member

    Joined:
    Aug 31, 2012
    Messages:
    3,151
    Likes:
    281
    Location:
    Richmond Hill , ON Canada near Toronto
    3V can usually drive 5V logic but needs series R to limit input current to 3mA for the ESD/SCR diode rail clamps for accepting 5V into 3V chip.
    Thresholds are less than 50% for this reason and others.

    But I think maybe it is more basic. Did you cross Tx. Rx? both pins should be high.
    [​IMG]


    for TTL High is idle with low as startbit. and for RS232 it is inverted to positive logic..
     
  11. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,304
    Likes:
    11
    Location:
    Dorset UK.
    Hi,

    Using a program I got with help from: http://logmett.com/forum/ and Teraterm + FTDI set for 3.3v, I can now simulate NMEA data.

    Thanks to all,

    Camerart.
     
  12. Tony Stewart

    Tony Stewart Well-Known Member Most Helpful Member

    Joined:
    Aug 31, 2012
    Messages:
    3,151
    Likes:
    281
    Location:
    Richmond Hill , ON Canada near Toronto
    good stuff.

    If it was just a smart term you needed, in the old BBS days.... we used Mustang Software's QModem which support Autolearning scripts, and user generated interactive scripts with x,y, and z modem protocol at any speed using DOS.
     

Share This Page