View previous topic :: View next topic |
Author |
Message |
felones
Joined: 21 Oct 2005 Posts: 15 Location: Santiago
|
Posted: Tue Oct 25, 2005 8:37 pm Post subject: Proyect with GPS and LCD |
|
|
Hi to all,
I'm new working on the AVR and the bascom program, for that I request you for help. I have a project of GPS where using the ATmega48V I must gather the information of Latitude and length and visualize it on a 20x2 LCD.
The idea is that the AVR communicates the GPS to itself across RS232 to and somehow it could store the information in registers and then her deployment in the LCD. The GPS transmits in NMEA-0183 protocol.
Does anybody have any proposal of solution?
Thanks to all again.... FELO... |
|
Back to top |
|
|
bzijlstra
Joined: 30 Dec 2004 Posts: 1179 Location: Tilburg - Netherlands
|
Posted: Tue Oct 25, 2005 9:17 pm Post subject: |
|
|
Made this way back....
' SK-Unit & SK-Base
'
' Name of program: GPSLCD.BAS
'
' Purpose : Put the NMEA Lon/Lat-information
' from a GARMIN 12 GPS-receiver on a LCD-screen
' The GARMIN 12 should send to the RS232 at 2400 baud
' Asked by a friend, who wants to see the coordinates
' while sitting in his boat
'
' Date : 07/10/2000
'
' Ben Zijlstra - BZijlstra@home.nl
'
' Hardware and examples on http://members.home.nl/bzijlstra
'
' ***************************************************************************
'
' Hardware configuration:
'
' AIN0 = P1.0
' AIN1 = P1.1
' LCD RS = P1.2
' LCD E = P1.3
' LCD DB4 = P1.4
' LCD DB5 = P1.5
' LCD DB6 = P1.6
' LCD DB7 = P1.7
' RXD = P3.0
' TXD = P3.1
' INT0 = P3.2 = RC5
' INT1 = P3.3
' T0 = P3.4
' T1 = P3.5 = SDA
' P3.7 = SCL
'
'
' ***************************************************************************
$regfile = "89C2051.DAT"
$crystal = 11059200
$baud = 2400
Config Scl = P3.7
Config Sda = P3.5
Config Lcd = 20 * 4
Config Lcdpin = Pin , Db4 = P1.4 , Db5 = P1.5 , Db6 = P1.6 , Db7 = P1.7 , E = P1.3 , Rs = P1.2
Dim Regel As String * 41
Dim Test As String * 6
Dim Temp As String * 8
Dim Uur As Integer
Dim Voorloop As String * 1
Dim Deel1 As String * 3
Dim Deel2 As String * 6
Dim Deel3 As String * 1
' ***************************************************************************
'Example of a line: $GPGLL,5134.937,N,00500.998,E,170449,A*26
' | | | |
' | | | |
' Cmd | | |
' | | |
' Latitude | |
' | |
' Longitude |
' |
' UTC - time
Home
Cls
Lcd "GPSLCD - SK-Unit"
Wait 5
Lus:
Do
Input Regel
Test = Left(regel , 6)
Loop Until Test = "$GPGLL"
Deel3 = Mid(regel , 17 , 1)
If Deel3 <> "N" Then
Upperline
Lcd "Geen informatie"
Goto Lus
End If
Deel3 = Mid(regel , 29 , 1)
If Deel3 <> "E" Then
Upperline
Lcd "Geen informatie"
Goto Lus
End If
If Deel3 <> "E" Then Goto Lus
Deel2 = Mid(regel , 31 , 6)
Uur = Val(left(deel2 , 2))
Uur = Uur + 2 'UTC to Dutch wintertime
If Uur > 23 Then Uur = Uur - 24
If Uur < 10 Then Voorloop = "0" Else Voorloop = ""
Temp = Voorloop + Str(uur) + ":" + Mid(deel2 , 3 , 2) + ":" + Mid(deel2 , 5 , 2)
Home
Upperline
Lcd "Time: " ; Temp
Lowerline
Lcd "--------------------"
Thirdline
Deel1 = Mid(regel , 8 , 2)
Deel2 = Mid(regel , 10 , 6)
Deel3 = Mid(regel , 17 , 1)
Lcd "Lat " ; Deel1 ; "'" ; Deel2 ; Chr(34) ; " " ; Deel3
Fourthline
Deel1 = Mid(regel , 19 , 3)
Deel2 = Mid(regel , 22 , 6)
Deel3 = Mid(regel , 29 , 1)
Lcd "Lon " ; Deel1 ; "'" ; Deel2 ; Chr(34) ; " " ; Deel3
Wait 5
Goto Lus
End |
|
Back to top |
|
|
ATIU
Joined: 15 Oct 2004 Posts: 534
|
Posted: Tue Oct 25, 2005 10:47 pm Post subject: |
|
|
I prefer using the NEMA RMC statement because it already includes heading, speed, date/time and most of the navigation data needed. |
|
Back to top |
|
|
Funci
Joined: 03 Aug 2005 Posts: 58 Location: CRO
|
Posted: Tue Oct 25, 2005 11:31 pm Post subject: |
|
|
Yes... Atiu, RMC sentence have all relevant data, but if Fellones needs only LAT and LON then he can use everything what he wants.
Only he must take care about type of GPS and is that type of GPS sending out sentence that he is "expecting" with his program! |
|
Back to top |
|
|
felones
Joined: 21 Oct 2005 Posts: 15 Location: Santiago
|
Posted: Wed Oct 26, 2005 5:13 pm Post subject: |
|
|
Hi to all...
Thank you very much for the help that you are giving me. bzijlstra your code is very simple for understand and thanks for that. But I have a new question, like ATIU said, I need all the variables that appear in the RCM and also the satellites that are visible, for what I will need to work also with the command $GPGSA.
I can setting the GPS for send only the RMC and the GSA. How can I capture both commands and files them in his respective strings?...FELO.. |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum
|
|