Can't get TIM4 TOGO to start ADC3 conversions on STM32F7DISCOVERY board.
- January 7, 2019
- 3 replies
- 1666 views
I'm trying to get TIM4_TOGO output to start conversions on ADC3 on a STM32F7 DISCOVERY board.
I've attached main.c. I use a GPIO output toggle with oscilloscope to detect code execution and timing. I can see the toggle from the TIM interrupt handler, with the correct timing I'm after. I don't see any toggle from the ADC Handler unless I use software start from the main infinite loop, but this is not from the timer. I've been looking at this for a few days and haven't made any progress, please help!
(Yes, I have other things going on in the code, including an OS for a GUI on an LCD, but the TIM4 interrupt is working ok, so I believe that it is generating update events OK, and the A/D works when started by software. Just not sure how to connect the two via TIM4_TOGO).
This first pic shows the output from the GPIO pin that is toggled from the TIM4 Interrupt handler. This is working perfectly. Not the timebase on scope is 100uS/div, and the toggle edges are a bit shorter than this. This is the rate I want to start ADC3 conversions.

When I check the ADC Interrupt by toggling the pin, which should be triggered by the timer and subsequent completion of the conversion at the same rate as the timer update, I don't get anything.
When testing the ADC3 by using the ADC software start in my infinite loop, I do get the toggle at the much lower frequency, which shows that the ADC Interrupt Handler is working at the end of conversions. (Note the timebase is now 500 ms!

Why is the TIM4_TOGO not causing an ADC3 trigger/conversion to start?
The main.c is attached, and below are images of my code with syntax color formatting and line numbers:




Any help greatly appreciated, I'm starting to pull my hair out!