2021-08-11 10:18 AM
Hi guys
I'm using the nucleo STM32L432kc
For the purpose of measuring fluide conductivity i need the following actions.
- Generate a PWM1 signal with a frequency between (100Hz_ 10KHz) with a fixed duty cycle of 50%
- 2 DAC signals DAC1= 1,5V+ Vext
DAC2= 1,5V -Vext
with 20mV <Vext < 100mV
- for the acquisition a 3 inputs ADC Have to measure the The voltages from the externel circuitry outputs every last third of the half PWM cycle by doing the 3 channels scan .
The approach I'm using is I'm using an other INVERTED PWM2 signal with the half of the PWM1 period and 64% duty cycle to trigger the ADC acquisition.
Can someone help me with the configuration or propose and other idea ?
2021-08-11 12:28 PM
Thinking you could do with ONE TIM, the square wave in toggle mode, and 3x PWM with the remaining channels.
Remember PSC/ARR values are written in an N-1 form ie divide by 4 [0, 1, 2, 3] is written as a 3
You'd need to look at the ADC resources, and the TIM vs ADC triggers.
2021-08-11 08:25 PM
but with same timer i could only have different duty cycles and the frequency remains the same
2021-08-11 08:34 PM
Does T have different values for the upper/lower traces in your diagram?
If they are unrelated I clearly misunderstood.