Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

External ADC Trigger for Teensy 3.x #67

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

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, [email protected]

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