Continue to Site

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.

  • 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.

PIC plus-5110 LCD-GPS-BMP280-HMC5983

Status
Not open for further replies.
hi C,
This is a demo Sim version of the program.
It takes an incoming GPS message and saves into an Array.
The array is then parsed into the main values as Named Strings also converted to Named Single Numeric values for Maths operations.

So to display a message on the 5110:-
call wr_msg( x0,y0, name of the string) '

eg: call wr_msg( 0,0, strlat) ' or if you prefer

msg1 =strlat
call wr_msg( 0,0, msg1)


The delay has been finding code that will work in Oshonsoft using String and Single combinations.

E
 

Attachments

  • A002.gif
    A002.gif
    10.5 KB · Views: 214
  • CamDemoMsgs1.bas
    9.7 KB · Views: 189
Hi E, [Strange, I didn't get a notification that you had posted it!]

Excellent!
I'll see if I can get the 5110 working and let you know.
Thanks.
C.
 
hi C,
I see that you are using the 18F4520 with the internal 8MHz clock.??
If so, you could easily enable the internal * 4 PLL and run the PIC at 32MHz, this would give you more time to do complex maths routines.

Let me know and I will edit a program for you

E
 
hi C,
I see that you are using the 18F4520 with the internal 8MHz clock.??
If so, you could easily enable the internal * 4 PLL and run the PIC at 32MHz, this would give you more time to do complex maths routines.

Let me know and I will edit a program for you

E
Hi E,
I'll to set the *4PLL first and if I can I'll let you know.
My PCB has provision for a XTL. I think the fastest allowed is 20mHz. Would it be better to use a 16mHz being a division of 32, OR simply use the INT OSC?
C.
 
hi,
Using the Internal Osc at 8MHz with the PLL enabled would give 32MHz operation for zero cost and reduce the PCB tracks.
Use the Oshonsoft Config and select INTOSC as shown in this image.
OSCCON = %01110010 'internal 8Mhz clock
OSCTUNE.PLLEN = 1 '*4 PLL enabled so Fosc == 32MHZ

E.
BTW I see that you are getting very close to using all your GPR space.!!!

This Basic cammy3.bas is a cleaned up version, note the GPR usage.

EDIT: also has the TIME formatted,
 

Attachments

  • A001.gif
    A001.gif
    12.3 KB · Views: 204
  • A002.gif
    A002.gif
    13 KB · Views: 208
  • A003.gif
    A003.gif
    13.5 KB · Views: 204
  • cammy3.bas
    7.1 KB · Views: 207
Last edited:
hi,
Using the Internal Osc at 8MHz with the PLL enabled would give 32MHz operation for zero cost and reduce the PCB tracks.
Use the Oshonsoft Config and select INTOSC as shown in this image.
OSCCON = %01110010 'internal 8Mhz clock
OSCTUNE.PLLEN = 1 '*4 PLL enabled so Fosc == 32MHZ

E.
BTW I see that you are getting very close to using all your GPR space.!!!

This Basic cammy3.bas is a cleaned up version, note the GPR usage.

EDIT: also has the TIME formatted,
Hi E,
I think the X4 is set correctly.

What is using the GPR space?

"Has the TIME formatted?" I'm not sure what that means, but here is a Variable TEXT showing 'strtim' Is this it?

C.
 

Attachments

  • Variables.txt
    2.5 KB · Views: 196
hi,
The 'te:st:st' is the Time taken from the GPS string eg: 123456 , formatted would be 12:34:56 .
In your Test Message, replace the word 'test' with a Time value HHMMSS .

GPR are the PICs General Purpose Ram locations.
When you DIM a parameter as a String, the Program allocates that String as Bytes in GPR's, so they are not available for use by the rest of the Program.
The 18F4520 has only 1536 Bytes of GPR space,
In your original Program you have only 61 Bytes left.!

If the next section of Code you write within that Program uses more than 61 Bytes for DIM's etc... the Program will not compile.

E
 
Hi,
Don't get 12V mixed up with 5V! Just 'popped' my GPS:arghh: It's probably the regulator, so I may be able to fix it.

At one point I had "LAT" and the LAT STRING showing on the 5110. I can see the NMEA going into RX and out of the TX on the 18LF4520, with TERATERM (putty) So we're pretty close.

It's possible that even though the GPS looks like it working ok, it could be because it's inside and cloudy.

C.
 
HI,
Success.

Here is a photo (Qualiteee) of the 5110 showing TIME and the time updationg ok. [No seconds!]

Here is the program:

I changed the GPS to an NEO-6 This isn't as sensitive as the 8, and I found that because it is in poor conditions, the NMEA sentences aren't being gleaned reliably, so I found one that always seems to show the TIME, so the 'verify' letter is 'C instead of G.

C.
 

Attachments

  • TIME.jpg
    TIME.jpg
    198.8 KB · Views: 201
  • 18LF4520 8MHz x4 5110 NEO8 SML 311217 1430 DIFFERENT NMEA SENTENCE.txt
    7.7 KB · Views: 178
HAPPY NEW YEAR

The program at #249 used NMEA sentence $GPRMC, because I was unable to get $GPGGA to work. I tried many combinations of letters for the selection. Also I temporarily tried removing the 4x 8mHz selection, and erase PIC memory before programming.

Here are two jpgs from the Teraterm (Putty) readout 1/ Just before the strtim shows after TIME, and 2/ Once the strtim shows after TIME on the 5110. From this I can't see why only RMC works and not GGA?? [It works in SIM]

C.
 

Attachments

  • NMEA G C NO.jpg
    NMEA G C NO.jpg
    12.8 KB · Views: 195
  • NMEA G C YES.jpg
    NMEA G C YES.jpg
    16.3 KB · Views: 195
  • NMEA G C NO.jpg
    NMEA G C NO.jpg
    12.8 KB · Views: 196
  • NMEA G C YES.jpg
    NMEA G C YES.jpg
    16.3 KB · Views: 192
hi C,
The GPGGA time looks wrong to me.??
Are sure it has the 123459.00
E

'await NEO GPS RXD
get_neo: ''$GPGGA,123459.00,5001.00000,N,00059.00000,W,1,04,1.80,1.2,M,47.7,M,,*7F?
'$GPRMC,123459.00,5001.00000,N,00059.00000,W,1,04,1.80,1.2,M,47.7,M,,*7F? NOTE DIFFERENT SENTENCEXXXXXXX

My example.
'$GPGGA,123519,5050.198,N,00106.769,W,1,08,0.9,123.4,M,46.9,M,,*47?
 
Hi E,
I have two files of NMEA information, one has the ??????.00, and the other only has ??????,

As shown on the live Teraterm readings from the GPS, there is ??????.11 which changes to .00 within a second. The two live jpgs show just before the 5110 shows the updating time, and the second shows at the time udating time shows on the 5110, when using RMC only. To me they both look very similar, regarding TIME

I'm not sure what the [.00] are for except split second timing perhaps.

C.
 
Last edited:
hi C,
Checking on-line I get this
$GPGGA,HHMMSS.SS,DDMM.MMMMM,K,DDDMM.MMMMM,L,N,QQ,PP.P,AAAA.AA,M,±XX.XX,M,SSS,RRRR*CC<CR><LF>

https://hemispheregnss.com/gnssreference/GPGGA.htm

So for the time HHMMSS.SS
Leftstr(msg,2)+":" + MidStr(msg,3,2)+":" + MidStr(msg,5,2)
== HH:MM:SS

E

EDIT:
Please post a complete GPS msg, $GPGGA
 
Hi E,
P.S:
I added a LED toggle after: [If str1(5) = 0x47 Then 'G'] With RMC it toggles with GGA it doesn't toggle.
C.
 
Hi E,
I edited a '1' to make it compile, is this correct?

strtim = Leftstr(msg1,2)+":" + MidStr(msg1,3,2)+":" + MidStr(msg1,5,2)

This didn't work.

C.
 
Hi E,
Ive tried lots of letter combinations in the:
'If str1(4) = 0x52 Then 'R'
If str1(5) = 0x47 Then 'G'
If str1(6) = 0x41 Then 'A' LOOP.

Any 1 letter or combinations of letters in the RMC sentence works ok. Any combination in the GGA sentence doen't work. It appears that it isn't recognising certain letters.

As shown in the JPGs as soon as the GPS 'sees' the time in RMC it prints it.

If I try If str1(6) = 0x41 Then 'A' then 'A' only is shown after the "TIME" In other combinations, I get different odd digits, but nothing in GGA.

C.
 
hi C,
Got your PM OK.
Please post your problem basic, I have modified a BB to use a 18F4520 and a 9110 LCD, so that I can try your prog.

E
BTW: I use Termite program for serial.
 
hi C,
Got your PM OK.
Please post your problem basic, I have modified a BB to use a 18F4520 and a 9110 LCD, so that I can try your prog.

E
BTW: I use Termite program for serial.
Hi E,
Here is the latest program. As mentioned it simulates ok. When $GPRMC is used, it now shows HH:MM:and SS all updating with GPS input.

I also have Termite, but since making macros for the Tracker, I now use Teraterm.

C.
 

Attachments

  • 18LF4520 8MHz x4 5110 NEO8 SML 020118 1000.txt
    8.2 KB · Views: 172
hi C,
Downloaded, will reply tomorrow.
E
 
hi C,
Got your PM OK.
Please post your problem basic, I have modified a BB to use a 18F4520 and a 9110 LCD, so that I can try your prog.

E
BTW: I use Termite program for serial.
Hi E,
Here is the latest program. As mentioned it simulates ok. When $GPRMC is used, it now shows HH:MM:and SS all updating with GPS input.

I also have Termite, but since making macros for the Tracker, I now use Teraterm.

C.
hi C,
Downloaded, will reply tomorrow.
E
Hi E,

Ok.

I've had some programming tips regarding long programs by a mate. He says he uses modules for each section of a program. I've seen this with Ardiuinos, but never quite understood it. Since you added an INCLUDE for font1, would it be a good idea to have each of the sensors etc, as INCLUDES also? i,e, GPS,,,,,Barometer,,,Compass etc.

C.
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top