Mike Maurice
Active member
First some preliminary background that may be useful to someone else doing something similar.
A teensy 4.1 at 800 mhz and a TAU1202 GPS unit outputting at 115k baud to the teensy on serial8.
I used the DMA code sample from the PJRC forum and it worked with minor tweaking. My tests indicate that the DMA buffer needs to be about 512 bytes, to prevent loss of data. I tried smaller, but have not tried larger yet. Tests using normal serial (not DMA) had problems with loss of data, regardless of the buffer size even though I jiggered the .h file to use 256, instead of the standard 64.
Putting a memcpy routine to copy the data to a secondary buffer, in the DMA interrupt routine was not satisfactory, as expected. It is now in the loop routine.
The TAU1202 has an active antenna hooked to it, but one that receives the L5 channel is on order but won't be here till the end of the month. Often get 20-23 sats, even with the antenna inside the house.
Now, for the next problem. I am streaming the gps data to a bluetooth HC-06 at 115k baud. Using the standard serial library with SerialX.write(buffer, count). The overhead and delay of this write inside the loop has an unacceptable impact on the loop performance.
I intend to increase the HC-06 baud rate to some higher level, but I would like to convert this stream to DMA and remove most of the overhead from the loop. But, am flummoxed as how to setup the DMA to write from memory to the serial port that the HC-06 is on: Serial5.
A pointer to even a code sample of something similar would probably do.
I have looked over the forum and even the internet in general and haven't found any simple usable example.
Thanks in advance...
A teensy 4.1 at 800 mhz and a TAU1202 GPS unit outputting at 115k baud to the teensy on serial8.
I used the DMA code sample from the PJRC forum and it worked with minor tweaking. My tests indicate that the DMA buffer needs to be about 512 bytes, to prevent loss of data. I tried smaller, but have not tried larger yet. Tests using normal serial (not DMA) had problems with loss of data, regardless of the buffer size even though I jiggered the .h file to use 256, instead of the standard 64.
Putting a memcpy routine to copy the data to a secondary buffer, in the DMA interrupt routine was not satisfactory, as expected. It is now in the loop routine.
The TAU1202 has an active antenna hooked to it, but one that receives the L5 channel is on order but won't be here till the end of the month. Often get 20-23 sats, even with the antenna inside the house.
Now, for the next problem. I am streaming the gps data to a bluetooth HC-06 at 115k baud. Using the standard serial library with SerialX.write(buffer, count). The overhead and delay of this write inside the loop has an unacceptable impact on the loop performance.
I intend to increase the HC-06 baud rate to some higher level, but I would like to convert this stream to DMA and remove most of the overhead from the loop. But, am flummoxed as how to setup the DMA to write from memory to the serial port that the HC-06 is on: Serial5.
A pointer to even a code sample of something similar would probably do.
I have looked over the forum and even the internet in general and haven't found any simple usable example.
Thanks in advance...