Skip to content

Conversation

@uutzinger
Copy link

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, uutzinger@gmail.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants