Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In order to measure analog signals from external clock source one either needs to use to PDB (pin 11) or LPTMR (pin13) hardware functions. Suggested updates provides support of ADC library for external ADC clocks.
These code updates were created in order to read the Hamamatsu micro spectrometer C12880MA, which provides clock and video signal within the specifications of the spectrometer using the Teensy microcontroller platform.
Proper reference of the original ideas on how to implement external clock is provided within the source code.
I updated those ideas using the device manual and included them in the ADC library and provided test programs.
Unfortunately at this time external clock modifications are only applicable for Teensy 3 platform, and when compiling on Teensy 4 the system should respond as intended with the settings_defines.h.
ADC_Module.cpp/h was updated to include
startExtTrigPDB
stopExtTrigPDB
startExtTrigLPTMR
stopExtTrigLPTMR
settings_defines.h was updated to include LPTMR
a small modification was made to stopPDB to turn off ADC pre triggers
4 example programs are provided showing the use of pdb or lptmr external trigger with and without DMA.
The programs use PWM output pin to simulate external clock on pin 23. Pin 23 needs to be connected to either pin 11 or pin 13.
It then compares the number of actual ADC_isr calls to the actual frequency set at the PWM pin.
With VERY HIGH SPEED settings, system can achieve >800Msamples/sec.
With HIGH SPEED settings, system can achieve >450samples/sec.
Please consider including these updates to the ADC library.
Thank you.
Urs Utzinger, [email protected]