Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

Proyect with GPS and LCD

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    www.mcselec.com Forum Index -> BASCOM-AVR Archive
View previous topic :: View next topic  
Author Message
felones

Bascom Member



Joined: 21 Oct 2005
Posts: 15
Location: Santiago

chile.gif
PostPosted: Tue Oct 25, 2005 8:37 pm    Post subject: Proyect with GPS and LCD Reply with quote

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... Laughing
Back to top
View user's profile
bzijlstra

Bascom Ambassador



Joined: 30 Dec 2004
Posts: 1179
Location: Tilburg - Netherlands

netherlands.gif
PostPosted: Tue Oct 25, 2005 9:17 pm    Post subject: Reply with quote

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
View user's profile Visit poster's website
ATIU

Bascom Member



Joined: 15 Oct 2004
Posts: 528

philippines.gif
PostPosted: Tue Oct 25, 2005 10:47 pm    Post subject: Reply with quote

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
View user's profile
Funci

Bascom Member



Joined: 03 Aug 2005
Posts: 58
Location: CRO

croatia.gif
PostPosted: Tue Oct 25, 2005 11:31 pm    Post subject: Reply with quote

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
View user's profile Visit poster's website
felones

Bascom Member



Joined: 21 Oct 2005
Posts: 15
Location: Santiago

chile.gif
PostPosted: Wed Oct 26, 2005 5:13 pm    Post subject: Reply with quote

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.. Laughing
Back to top
View user's profile
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    www.mcselec.com Forum Index -> BASCOM-AVR Archive All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
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