defragster
Senior Member+
Would be fun/easy to test Serial.print() timing to USB. It is very efficient - not sure if not using a conditional and just sending each sample - where USB will decide when to send the packet. Do as indicated and make one full buffer and send conditionally, or just gather all sample data and send when sampling is done.
A T_3.6 can get just over 20K lines of 35 chars to the PC in a second, the T4 with higher speed USB is getting 100-300K depending on OS and the ability of the PC to receive the messages. In seeing that test I wonder but didn't attempt to see how much time is consumed in the USB transfers.
May be a way to look into the FTM code and let it count and see about reading it's count for change - if possible to do that without interrupting its function?
Making yield() void is handy - better to just stay in loop() during the test - but that would still allow common interrupts - like systimer 1000/sec.
T_3.6 can make some few million loop() passes per second - T4 I've seen over 20 million with minimal code just counting the passes and watching for a second to expire.
Knowing how long a sample test period lasts - and how many hits are expected between Trigger/reset would help understand the output data rates.
A T_3.6 can get just over 20K lines of 35 chars to the PC in a second, the T4 with higher speed USB is getting 100-300K depending on OS and the ability of the PC to receive the messages. In seeing that test I wonder but didn't attempt to see how much time is consumed in the USB transfers.
May be a way to look into the FTM code and let it count and see about reading it's count for change - if possible to do that without interrupting its function?
Making yield() void is handy - better to just stay in loop() during the test - but that would still allow common interrupts - like systimer 1000/sec.
T_3.6 can make some few million loop() passes per second - T4 I've seen over 20 million with minimal code just counting the passes and watching for a second to expire.
Knowing how long a sample test period lasts - and how many hits are expected between Trigger/reset would help understand the output data rates.