SLOW Serin2 and Serout2


Closed Thread
Results 1 to 4 of 4

Hybrid View

  1. #1
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    I hear DEBUG is supposed to be faster than any of the other software serial routines, although I do not know this as fact.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  2. #2
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    I will lay odds it is the GPS that is slow.

    The Trimbles and Garmins I play with take around 2 seconds to do a loop through its data. I am not familiar with the module you have but it is probably the same as there are only a few GPS chips out there and add what ever Parallax did in front of it to receive command like ["!GPS", $05] is just going to slow the works down more.
    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    Apr 2006
    Location
    Alberta Canada
    Posts
    166


    Did you find this post helpful? Yes | No

    Default

    so, that old code used 3110 bytes and took about 5 seconds to run through.

    im still working on it, but i changed to using nmea data, which is something i have never been able to get working before, and its now down to 1204 bytes and cycles in 1 second!!! i think the problem was that the parallax module takes the nmea data, then rips it all apart, and only sends out what is requested. so i think going straight from the nmea to the PIC is probably a better way to do it anyways!

    so heres the new code:

    DEFINE OSC 20

    'VARIABLES

    lcd VAR PORTf.7
    gpsin VAR PORTb.3
    baudLCD CON 32 'baud rate for lcd
    baudgps con 188 'baud rate for gps 32


    valid VAR byte
    hours var byte(2)
    minutes var byte(2)
    seconds var byte(2)
    degreelat var byte(2)
    minlat var byte(2)
    seclat var byte(4)
    degreelong var byte(3)
    minlong var byte(2)
    seclong var byte(4)
    speed var byte(3)
    decspeed var byte


    course var byte(3)
    deccourse var byte
    decdeglat var byte
    decdeglong var byte


    degreelong = 0
    minlong = 0
    seclong = 0
    degreelat = 0
    minlat = 0
    seclat = 0
    speed = 0


    'STARTUP PROGRAM

    startup:

    SerOut2 lcd, baudlcd,[254,"X"] 'clear screen
    Pause 200
    SerOut2 lcd, baudlcd,[254,"X"] 'clear screen again

    'MAIN PROGRAM

    start:

    serin2 gpsin, baudgps,[WAIT ("$GPRMC"), SKIP 1, STR hours\2,str minutes\2, str seconds\2, SKIP 1, valid, skip 1, str degreelat\2,str minlat\2, SKIP 1, str seclat\4, SKIP 3, str degreelong\3, str minlong\2, SKIP 1, str seclong\4, SKIP 3, str speed\3, SKIP 1, decspeed, SKIP 1, str course\3, SKIP 1, deccourse]

    SerOut2 lcd, baudlcd,[254,"G",1,1, " TIME=", STR hours\2, ":", str minutes\2, ":", str seconds\2, " ", valid, 254,"G",1,2, str degreelat\2, str minlat\2,".", str seclat\4," ", str degreelong\3, str minlong\2,".", str seclong\4, 254,"G",1,3, str speed\3,".", decspeed," ", str course\3,".", deccourse]


    GoTo start
    end


    I will try changing to DEBUG sometime and see what happens, and im going to keep playing with this, but if anyone knows a better or more efficient way of doing this, let me know..

Similar Threads

  1. Serin2 pass through to Serout2
    By scottl in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 15th November 2007, 19:17
  2. Serin2 and serout2
    By abood in forum Forum Requests
    Replies: 1
    Last Post: - 15th August 2005, 13:20
  3. SEROUT2 and SERIN2 commands
    By bangunprayogi in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 4th August 2005, 09:03
  4. Simple PC Menu System with Serin2
    By Tom Gonser in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 3rd April 2005, 08:27
  5. Serin2 and Serout2 with or without level converter
    By fbestepe in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 31st May 2004, 07:10

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts