Hello,
I have a quick question about the capabilities of the Teensy 3.2 and/or 3.6 (if there's a difference) Flex Timer module and configuring them for event capture mode.
I have read the datasheet a enough to see that it LOOKS like I can set the clock source for the 16-bit flex timer counter to be the system clock (lets say 120Mhz for T 3.2, 180Mhz->240Mhz for T 3.6) with a pre-scalar of 1, meaning it runs at full speed. Is this correct?
I'd like to trigger interrupts on both the flex timer overflowing (so I can increment some variable to keep track of how many times the 16-bit clock has wrapped) and on rising edge event capture (to go and read the FTMx_COUNT register and reset it). I'm trying to measure the passing of time between two 60Hz edges as precisely as possible, so I can compute the phase error to extreme accuracy..
The timer will overflow many many times in the 16.666ms period between edges, but that's okay as long as I can count the overflows.
Is what i'm trying to do possible? Is there a better way to do it with the Teensy hardware?
I have a quick question about the capabilities of the Teensy 3.2 and/or 3.6 (if there's a difference) Flex Timer module and configuring them for event capture mode.
I have read the datasheet a enough to see that it LOOKS like I can set the clock source for the 16-bit flex timer counter to be the system clock (lets say 120Mhz for T 3.2, 180Mhz->240Mhz for T 3.6) with a pre-scalar of 1, meaning it runs at full speed. Is this correct?
I'd like to trigger interrupts on both the flex timer overflowing (so I can increment some variable to keep track of how many times the 16-bit clock has wrapped) and on rising edge event capture (to go and read the FTMx_COUNT register and reset it). I'm trying to measure the passing of time between two 60Hz edges as precisely as possible, so I can compute the phase error to extreme accuracy..
The timer will overflow many many times in the 16.666ms period between edges, but that's okay as long as I can count the overflows.
Is what i'm trying to do possible? Is there a better way to do it with the Teensy hardware?