The file "PK2Devicefile.dat" have not edited the microcontroller type. Use DEVICE EDITOR software from here https://sites.google.com/site/pk2devicefileeditor/ and here is the Device ID PIC's
The file "PK2Devicefile.dat" have not edited the microcontroller type. Use DEVICE EDITOR software from here https://sites.google.com/site/pk2devicefileeditor/ and here is the Device ID PIC's
where did you find that , its not what I understand the case to be. are you confusing usb support for sd card support ?The project as i have it in mind need to have an SD in order to store the Data from GPS Nmea.
I found out that only a microcontroller with 48mhz supports something like that
unless you specify what spi rate the sd card supports and what sd card system you intend to use [sdfs3 ? fat16? fat 32?] along withMay i use the same speed for All the peripherals SD, Ulcd, GPS? Or do i need to specify different one for each module?
the baud rate used for the serial I/f's and your osc speed it would be guesswork only.
not really you need to supply a lot more infoCould You help me and clarity what i need for each GPS, SD, Ulcd?
compared to PIC18F4550 or PIC18F2550 a pic 18f26k22 has two times the flash memory , sram ,spi ports, eusarts has more timers and can run at 64 MHz . I think it would be a good fiti need to communicate Serial with GPS module and then i need to store the raw Nmea Data to SD and display what i need from the Nmea protocols to display
for that sort of project
Last edited by richard; - 21st June 2018 at 02:49.
Warning I'm not a teacher
Oops well i'm wrong, base on the following and FAT16 it is not necessary.The project as i have it in mind need to have an SD in order to store the Data from GPS Nmea.
I found out that only a microcontroller with 48mhz supports something like that
where did you find that , its not what I understand the case to be. are you confusing usb support for sd card support ?
http://melabs.com/samples/PBP-mixed/sdfs3.htm
I was confused with this link as they specify high MCU speed for FAT32
http://www.picbasic.co.uk/forum/showthread.php?t=18370
Regarding Serial speed baudrate:May i use the same speed for All the peripherals SD, Ulcd, GPS? Or do i need to specify different one for each module?
unless you specify what spi rate the sd card supports and what sd card system you intend to use [sdfs3 ? fat16? fat 32?] along with
the baud rate used for the serial I/f's and your osc speed it would be guesswork only.
1) For GPS, i have tried to send the "right" command for increase the baudrate, with no sucess....it seems that the GPS receives the command but does not like it :P.
2) ulcd seems to work with higher baud rate, but i need to configure the delay times for each command. I havent really understand how to increase the baudrate corresponding to delays. The ulcd needs some delay time to accept the command and display it properly. Is it right?
3) SD card with FAT 16 (when i reach that point we will discuss further). At the moment it is clear that up to 2GB fat 16 is required and is not necessary high MCU speed. But i will try to get the maximum from the PIC.
I understand that im not clear, as i really wont have the knowledge to explain it. Actually im confused with MCU speed, which is the speed that PIC running each command and calculate each command, with the speed of the communication ports.Could You help me and clarity what i need for each GPS, SD, Ulcd?
not really you need to supply a lot more info
I guess that a higher MCU speed is better in order to calculate faster the information from the peripherals. I know my questions are too basic, and believe me i start reading all these stuff in order to understand better. I feel that you cannot help me i i dont understand these basic processes of the PIC.
So i started to read about MCU speed, clock and counter.
i need to communicate Serial with GPS module and then i need to store the raw Nmea Data to SD and display what i need from the Nmea protocols to display.
compared to PIC18F4550 or PIC18F2550 a pic 18f26k22 has two times the flash memory , sram ,spi ports, eusarts has more timers and can run at 64 MHz . I think it would be a good fit
for that sort of project
Really appreciate your advice....PIC18LF26K22 or PIC18LF4550 fits to my project better because i would like to use a single 3.7V Lipo battery not more than 800-1000mha. The Final circuit will have:
1. PIC18LF26K22 or PIC18LF4550
2. GPS module for all the info....Date, Time, Speed, Coordinates etc.
3. SD for storage the raw NMEA Data
4. A display only for the on the go use. For battery saving, a ulcd will not be used normally. SD will keep the info.
Many thanks once again.
I would like to apologize for "breaking" the original TOPIC. Is it possible an Admin to move all the discussion i have started from POST #66, in a NEW thread? Thanks.....
Last edited by astanapane; - 21st June 2018 at 08:45.
the data sheet for the module should resolve that issue1) For GPS, i have tried to send the "right" command for increase the baudrate, with no sucess....it seems that the GPS receives the command but does not like it :P.
the ulcd data sheet should give you that information2) ulcd seems to work with higher baud rate, but i need to configure the delay times for each command. I havent really understand how to increase the baudrate corresponding to delays. The ulcd needs some delay time to accept the command and display it properly. Is it right?
since sd cards use spi [a synchronous data transfer method] cpu osc speed is largely irrelevant as long as it not too fast for the card/mssp combination3) SD card with FAT 16 (when i reach that point we will discuss further). At the moment it is clear that up to 2GB fat 16 is required and is not necessary high MCU speed. But i will try to get the maximum from the PIC.
when you use the mssp module there are several spi clock options.
a PIC18LF4550 is in my opinion not a good choice , the project calls for a chip with two eusarts.
I agree, as I have said from the start what you are asking has no relevance to maidenhead in any way shape or formI would like to apologize for "breaking" the original TOPIC. Is it possible an Admin to move all the discussion i have started from POST #66, in a NEW thread? Thanks.....
Warning I'm not a teacher
Hi Richard,
thanks once again for your time and help. You are right regarding the 18LF4550. It is not for my application.
The leap years, month and days are fixed. Please let me know if you find any mistake on this.
Is there any way now to test the leap year?
Apart from that i have found the attached file for the PICKIT2. Do you have any reference on that?Code:arraywrite ndays,13,NDAY,[0,31,28,31,30,31,30,31,31,30,31,30,31] if ((year//4 = 0) and (year//400 != 0)) then 'check the leap year ndays[2] = 29 'then February has 29 days else ndays[2] = 28 'else has 28 days endif hh = hh + 3 'the Hour from GPS is UTC so for our country in Greece we add +3 if hh>23 then 'if the hh+3 hour is greater than 23 (23:00) then day = day + 1 'we check the day added is true hh = hh//24 'but the hour not exceed the 24 so go to 00:00 if (day > ndays[month]) then month = month + 1 day = 1 if (month > 12) then year = year + 1 month = 1 endif endif endif NDAY: ndays[0] = 0 ndays[1] = 31 'January ndays[2] = 28 'February ndays[3] = 31 'March ndays[4] = 30 'April ndays[5] = 31 'May ndays[6] = 30 'June ndays[7] = 31 'July ndays[8] = 31 'August ndays[9] = 30 'September ndays[10] = 31 'October ndays[11] = 30 'November ndays[12] = 31 'December
the above code only needs to run if month = 2if ((year//4 = 0) and (year//400 != 0)) then 'check the leap year
ndays[2] = 29 'then February has 29 days
else
ndays[2] = 28 'else has 28 days
endif
only the obvious , send it a few go nogo date strings and check the resultIs there any way now to test the leap year?
Warning I'm not a teacher
Some modules requires you to send a checksum at the end of the command. Here for a NEO-6M GPS Module:
Do you really need to change the baud rate? If you are just logging then 9600 is more than enough.Code:'Turn off RMC - Recommended minimum specific GPS/Transit data hserout2 ["$PUBX,40,RMC,0,0,0,0,0,0*47", 13, 10] pause 500 'Turn off GSA - GPS DOP and active satellites hserout2 ["$PUBX,40,GSA,0,0,0,0,0,0*4E", 13, 10] pause 500 'Turn off GSV - GPS Satellites in view hserout2 ["$PUBX,40,GSV,0,0,0,0,0,0*59", 13, 10] pause 500 'Turn off GLL - Geographic position, latitude / longitude hserout2 ["$PUBX,40,GLL,0,0,0,0,0,0*5C", 13, 10] pause 500 'Turn on ZDA hserout2 ["$PUBX,40,ZDA,0,1,0,0,0,0*45", 13, 10] pause 500
FYI, here is my source for most of the NMEA sequences: http://aprs.gids.nl/nmea/
Yep, thanks a lot.....i've seen all that, for my case i have the MKT 3333 and 3339 module. Which have the following
The problem is that it does not work for some reason.Code:'serout2 gps_rx,84, ["$PMTK314,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0*0D",13,10] 'serout2 gps_rx,84, ["$PMTK251,57600*2C",13,10] ' baudrate, check MTK manual configuration 'serout2 gps_rx,84, ["$PMTK220,200*2C",13,10] ' 200(millisecond)=0.2(sec)-->1/0.2 pps=5 Hz
I think i need to use the HSEROUT2 instead of SEROUT2. I'm confused at this point.
I get online help for checksum from this site
http://www.hhhh.org/wiml/proj/nmeaxor.html
Ok i have right now:
1. TX port which is connected to ulcd. Baudrate : 38400
Example code:
Code:pause 2000 serout2 LCD,6,[$55] ' uOLED Initialize this is the 'U' character of autoband rate to LCD pause 500 serout2 LCD,6,[$56,$01] ' this is the Version info pause 500 serout2 LCD,6,[$45] ' clear the lcd pause 100
2. RX port from GPS module. Baudrate : 9600
Example code:
The GPS at the moment is locked at 9600. Via the serial terminal GPS software i set it to 19200 and accepts the command. But only for the time the module is connected to the power. When we disconnect the power from GPS, the default commands are set.Code:;serin2 gps_tx,84,timeout,lostcable,[wait("$GNRMC"),_ ;we wait for $GNRMC
I dont mind for that right now as i found out that i can communicate with PIC at 19200 with GPS and receive the commands on the display.
The setting for the Clock Speed is 8Mhz.
Now if i increase the speed of the baudrate with GPS and goes up to 38400 then i cannot display anything.
I did an experiment and added an external Crystal of 16 Mhz. For my surprise values presented on the display.
I have a question now. something i dont like with the following code:
Why should i need to add both of the lines?Code:@ ERRORLEVEL -306 ; this command prevents the compiler to give you a notice of ; crossing page boundary - make sure bits are set #CONFIG __config _CONFIG1, _HS_OSC & _WDT_OFF & _LVP_OFF & _CP_OFF #ENDCONFIG Include "MODEDEFS.BAS" DEFINE OSC 8 OSCCON=%01110000 '8 Mhz
In case i remove any of these, it compiles ok, but program is not working.Code:DEFINE OSC 8 OSCCON=%01110000 '8 Mhz
I need to specify that this is an internal OSC, but above in the configuration bits i have put _HS_OSC (if i remember that must be set from the manual)
Is it right?
thanks a lot for your help once again.
OSCCON=%01110000 '8 Mhz ;sets the actual fosc speedWhy should i need to add both of the lines?
DEFINE OSC 8 ; tells the compiler what fosc speed to base timing calculation on
software timed serout2 @ > 38400 baud with fosc < 8mhz may have an unacceptable error rate
Warning I'm not a teacher
Bookmarks