mitxela.com forum
Welcome. Please log in or register.

NEO 6m fast readout issues
kacperbnb Posted: 4 Jul 2022, 05:54 PM
Avatar


Member
Posts: 3
Joined: 4-July 22
Hi,
I am using softwareserial to get the value from neo6m to arduino chip (74HC595 displays)
The problem i am having is the sending of packets takes about 100ms. This halts the program to 'read' the values from serial connection and then resumes which leaves my display flickering.

Is there a way to run the program between softwareserial packets?
If not this way, then how was it done on mixtela precision clock? (The clock receives signal, red diode blinks, and all is synced)

Thanks in advance for any guidance



-------------
[top]
mit Posted: 4 Jul 2022, 07:45 PM
Avatar
yeah whatever

Admin
Posts: 538
Joined: 4-May 16
The precision clock doesn't use Arduino, it uses an ATtiny2313 and the code is programmed in assembly.

You didn't say which arduino chip you're using but I think they should all have a hardware serial port. Your best bet is to read the serial data in the main loop and do the display updates in an interrupt routine, but with software serial that would probably mess up the timings.

-------------
[top]
kacperbnb Posted: 6 Jul 2022, 04:12 PM
Avatar


Member
Posts: 3
Joined: 4-July 22
thanks i will use nano (atmega328)

I got inspired by your project and wanted to make something that resembles 'precision clock'
I tried and you are right, the timing will be messed up. I guess accuracy will be +-1s. Thanks

-------------
[top]
mit Posted: 7 Jul 2022, 08:49 AM
Avatar
yeah whatever

Admin
Posts: 538
Joined: 4-May 16
The atmega328 is much more capable than the attiny chip on the precision clock, it should totally be possible to get it to work. I guess the arduino environment doesn't let you use the hardware serial port because it's worried about interference when the bootloader runs.

I can strongly recommend programming the chip in plain C using avr-gcc and using a (very cheap) USBASP adapter to program the chip, it will let you use the hardware however you like.

-------------
[top]
kacperbnb Posted: 9 Jul 2022, 04:47 PM
Avatar


Member
Posts: 3
Joined: 4-July 22
i got it to work with hardware serial port (you have to remove the connection when uploading the code).
Can you let me know how do you receive/format signal, I currently use tinygps++.h library get the date formatted for me

-------------
[top]
mit Posted: 11 Jul 2022, 08:42 PM
Avatar
yeah whatever

Admin
Posts: 538
Joined: 4-May 16
You can see the way I do it in the source code here: https://github.com/mitxela/PrecisionClockMkII/blob/master/GPSClock.asm#L818

I don't use a buffer for the serial data, just read it a byte at a time and check as it comes in.

cpi is compare immediate. brne is branch-if-not-equal. So the first three lines are "receive byte, if it's not '$' then go back to main". It checks for exactly "$GPRMC" which is the message we're looking for (the P is commented out, because some modules report "$GNRMC" or other variations).

After that you have all the data you need in ascii in comma-separated format.

If you're using a library it might help to look at the source code to the library and adapt it to your needs.

-------------
[top]

Sign in to post a reply.