GPS PPS aligned External ADC sampling in STM32L4P5 for multiple location sync of ADC
- August 31, 2023
- 3 replies
- 5317 views
Dear Members,
I am using STM32L4P5VGT, STM32CubeMX 6.9.1, and STM32Cube_FW_L4_V1.18.0.
In our board, we are using external ADC(16 bits with 8 CH, SAR, and simultaneously S/H. ADC sampling rate starts from 2K to 16K. In our use case, there will be multiple such boards in the field at different locations, and sampling of all these ADC should be in sync as much as possible. For this purpose, onboard GPS PPS output is used to realign the Sampling PWM output of the MCU which is the trigger of ADC start, if it drifts at every second. The MCU is also using TXCO with very low ppm. It is also expected that if the PPS pulse is missing due to weather conditions, PWM output should continue without sync till the GPS recovers.
The scheme used as follows and it is working fine as per requirement:
1. The TIM2, CH2 is used as PPS input (ICP direct mode), and
2. The TIM2, CH1 is used ADC Start Conversion input (PWM Generation CH1 mode)
3. TIM2 timer used, Slave with Reset Mode, Trigger Source TI2FP2, Clock source is internal, No Interrupt and DMA
4. CubeMX Timer Settings are attached due to message constraints.
Question 1 - Why do I need the ICP mode of CH2, I am not capturing timer values. Can I do without ICP mode by making changes in the configuration of the timer trigger etc.? I tried but did not work.
Thanks in advance for the update.
Mahabir Prasad
