Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 21:31 25 Nov 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : GPS Logger SD Card

     Page 2 of 2    
Author Message
vk4tec

Senior Member

Joined: 24/03/2012
Location: Australia
Posts: 239
Posted: 12:23am 25 Mar 2012
Copy link to clipboard 
Print this post

Thanks David

+ I see that the LCD routines I am familiar with in Assembly have been ported to basic
+ I also has a 8 x 7 Segment LED display - that will become my GPS clock.
+ The 8 segment display is futurelec ET-SDP8 (R2) and uses a MAX7219 chip
+ MMBasic is cool - I can now finish off some of my projects !


And start some more
Andrew Rich VK4TEC
www.tech-software.net
 
vk4tec

Senior Member

Joined: 24/03/2012
Location: Australia
Posts: 239
Posted: 12:38am 25 Mar 2012
Copy link to clipboard 
Print this post

One project that I have had on the back burner for ages is

+ Synchronous serial to ethernet UDP packets
+ HDLC is used to mark packets on the serial line
+ Synchronous serial is used for noise immunity
+ A HDLC packet needs to be stripped
+ A TCP/IP packet UDP needs to be formed and sent.
+ Serial id 64 kbs RS422 EIA530

Going the other way would be harder , but thats next.

UDP Ethernet to SYNCH Serial

- Andrew VK4TEC -
Andrew Rich VK4TEC
www.tech-software.net
 
vk4tec

Senior Member

Joined: 24/03/2012
Location: Australia
Posts: 239
Posted: 07:36am 25 Mar 2012
Copy link to clipboard 
Print this post

I have a question regarding buffering

When I was programming in Assembly lanuguage, the receive buffer of the PIC I was programming was not allowed to go past three characters sitting in the buffer or an OVERRUN would be declared.

My aim with my GPS to SD logger is not to write to a LCD screen but an SD Card.

How many characters can be allowed to "build up" in the RX buffer in the background ?

Will I have buffers issues if I want to write to an SD CARD ?

Does the DuinoMite have enough grunt to say write to the SD CARD whilst the GPS data is still coming ?

In one project, I had to turn OFF the RX UART while I did the LCD routine, then come back to the USART RX = =ON and continue.

What is the RX buffer depth of the Duino and will I have enough time to write to SD CARD ?

I guess I could get a character, write to SD, get a character, write to SD

If I am not interested in matching any strings ?

I guess that would work ?

The other thing I could do is throw away lines.

Get GPRMC line, turn off RX, write GPRMC to SD CARD, turn back on RX UART ?

- Andrew -
Andrew Rich VK4TEC
www.tech-software.net
 
vk4tec

Senior Member

Joined: 24/03/2012
Location: Australia
Posts: 239
Posted: 06:56pm 25 Mar 2012
Copy link to clipboard 
Print this post

Concept

MOD-GPS ----> DuinoMite (MM/DM Basic) ----> microSD card

Store GPS NMEA $GPRMC $GPGGA $GPGSA sentences only

Suggested Code ( No Hardware Yet )


10 REM ************************************************************ *************
20 REM GPS to SD Card Logger - DuinoMite and MOD-GPS
30 REM Andrew Rich (VK4TEC) 25/03/2012
40 REM GPS is TTL UART compatible 19200,N,8,1
41 REM MOD-GPS on UEXT port - Store $GPRMC $GPGGA $GPGSA only
42 REM Language is MM/DM Basic - Geoff Graham
43 REM Suggestions - LED / STOP button, then close and dump to CONSOLE?
50 REM ************************************************************ *************
60 CLS `Clear the screen
70 PRINT "GPS to microSD Card Logger $GPRMC $GPGGA $GPGSA Andrew Rich 25/03/2012
80 OPEN "COM3:19200" AS #1 ‘Open GPS port UEXT port for MOD-GPS (UART PORT)
90 IF NOT EOF(#1) THEN 110 `Is something received from GPS ?
100 GOTO 90 `Wait for something to be recieved
110 C$=INPUT$(1,#1) `Get a character from UEXT COM3 GPS
120 IF C$ = CHR$(10) THEN 160 `Is the character a Line Feed ?
130 MSG$=MSG$+C$ `Build up the received data string by adding next character
140 GOTO 90 `loop for next character
160 IF LEFT$(MSG$,6) = "$GPRMC" THEN 190 ‘is it NMEA $GPRMC sentence ?
161 IF LEFT$(MSG$,6) = "$GPGGA" THEN 190 `is it NMEA $GPGGA sentence ?
162 IF LEFT$(MSG$,6) = "$GPGSA" THEN 190 `is it NMEA $GPGSA sentence ?
170 MSG$="" `Its not the line we want so reset $MSG and start again
180 GOTO 90 `Get next character loop
190 LOCATE 0,100: PRINT MSG$ ‘GPS message received - show on screen ( could be $GPRMC $GPGGA $GPGSA )
195 REM - LED can be toggled here to indicate GPS data ?
200 OPEN "B:\GPS_NMEA.TXT" FOR APPEND AS #2 `Open the text file GPS_NMEA.TXT for Append on microSD CARD (B:)
210 PRINT #2,$MSG `Append to the SD CARD file GPS_NMEA.TXT with either $GPRMC $GPGGA $GPGSA sentence
220 CLOSE #2 `Close off the file in case the card needs to be removed
400 GOTO 170 `Loop around - get next character, after reseting $MSG goto next character
490 REM
500 REM ********************** END OF CODE *******************************

Example input data - $GPRMC $GPGGA $GPGSA $GPGSV ( ignored )

$GPRMC,192157.110,A,4208.3427,N,02445.0243,E,0.13,92.58,2111 11,,,A*5E
$GPGGA,192158.110,4208.3427,N,02445.0243,E,1,03,2.2,134.8,M, 37.1,M,,0000*5C
$GPGSA,A,2,07,23,20,,,,,,,,,,2.5,2.2,1.0*31
$GPRMC,192158.110,A,4208.3427,N,02445.0243,E,0.11,83.24,2111 11,,,A*58
$GPGGA,192159.110,4208.3428,N,02445.0242,E,1,03,2.2,134.8,M, 37.1,M,,0000*53
$GPGSA,A,2,07,23,20,,,,,,,,,,2.5,2.2,1.0*31
$GPGSV,3,1,12,23,63,042,38,20,38,124,35,07,38,197,39,13,72,3 13,24*70
$GPGSV,3,2,12,04,43,277,22,10,35,306,25,16,20,087,,02,16,316 ,24*72
$GPGSV,3,3,12,32,14,118,20,30,14,047,,08,10,203,24,01,01,169 ,*71
$GPRMC,192159.110,A,4208.3428,N,02445.0242,E,0.10,84.84,2111 11,,,A*5B


- Andrew Rich VK4TEC -
Edited by vk4tec 2012-03-27
Andrew Rich VK4TEC
www.tech-software.net
 
BobD

Guru

Joined: 07/12/2011
Location: Australia
Posts: 935
Posted: 08:07pm 25 Mar 2012
Copy link to clipboard 
Print this post

Andrew
if you have version 3 or higher of MMBasic then you can discard line numbers and use labels in GOTOs and other commands. There are also several variations of DO .... LOOPs that would make life easier. Labels are more efficient than line numbers so you can process more in a given time.
 
vk4tec

Senior Member

Joined: 24/03/2012
Location: Australia
Posts: 239
Posted: 10:54am 27 Mar 2012
Copy link to clipboard 
Print this post

Ok I got it working

DuinoMite Mini

MOD-GPS 19200

Writes any NMEA $GP___ sentence to SD CARD

100 OPEN "COM3:19200" AS #5
150 PAUSE 1000
200 C$ = INPUT$(1,#5)
250 IF C$ = CHR$(10) THEN 400
300 MSG$ = MSG$+C$
350 GOTO 200
400 IF LEFT$(MSG$,3)= "$GP" THEN 550
450 MSG$ = ""
500 GOTO 200
550 PRINT MSG$
600 OPEN "GPSLOG.TXT" FOR APPEND AS #3
650 PRINT #3, MSG$
700 CLOSE #3
750 MSG$=""
800 GOTO 200


> files
Directory: \
AUTORUN.BAS 317
GPSLOG.TXT 11411
>

$GPGSA,A,3,21,31,18,06,19,09,14,22,03,,,,1.7,0.9,1.5*30
$GPRMC,105200.000,A,2720.2500,S,15302.5990,E,0.00,226.58,270 312,,,A*7B
$GPGGA,105201.000,2720.2500,S,15302.5990,E,1,09,0.9,15.2,M,3 7.5,M,,0000*71
$GPGSA,A,3,21,31,18,06,19,09,14,22,03,,,,1.7,0.9,1.5*30
$GPRMC,105201.000,A,2720.2500,S,15302.5990,E,0.00,226.58,270 312,,,A*7A
$GPGGA,105202.000,2720.2500,S,15302.5990,E,1,08,0.9,15.2,M,3 7.5,M,,0000*73
$GPGSA,A,3,21,31,06,19,09,14,22,03,,,,,1.8,0.9,1.5*36
$GPGSV,3,1,10,14,76,319,29,22,56,182,17,06,42,297,37,03,36,2 77,34*7B
$GPGSV,3,2,10,21,34,057,46,18,31,122,14,19,27,235,25,09,15,1 28,18*73
$GPGSV,3,3,10,31,09,002,41,27,05,139,*7F


Andrew Rich VK4TECEdited by vk4tec 2012-03-28
Andrew Rich VK4TEC
www.tech-software.net
 
vk4tec

Senior Member

Joined: 24/03/2012
Location: Australia
Posts: 239
Posted: 12:45pm 01 Apr 2012
Copy link to clipboard 
Print this post

Done - added LCD as well

And DM MMBasic 3.1

More info:-

http://www.tech-software.net/GPS_SD_LCD.pdf

http://www.kenseglerdesigns.com/cms/forums/viewtopic.php?f=1 3&t=400&start=10

Andrew Rich VK4TEC
Andrew Rich VK4TEC
www.tech-software.net
 
vk4tec

Senior Member

Joined: 24/03/2012
Location: Australia
Posts: 239
Posted: 04:24pm 25 Apr 2012
Copy link to clipboard 
Print this post

Update

+ Number of satellites in solution
+ Horizontal Disolution of precision
+ VALID / INVALID location
+ Altitude ( meters )
+ Latitude / Longitude Deg Min Dec Min
+ Latitude / Longitude Deg Dec Deg
+ Waypoints from SD card
+ GPRMC and GPGGA trace screen
+ Local time calculation
+ Speed in km/h
+ Course in Degrees
+ Date
+ UTC time
+ Distance to waypoint
+ Bearing to waypoint
+ Contrast and Backlight adjust
+ Log to SD card
+ NMEA sentences and count
+ ETE - expected time enroute
+ ETA - expected time of arrival
+ LOG filename derived from date

Youtube video
Andrew Rich VK4TEC
www.tech-software.net
 
     Page 2 of 2    
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024