I need to configure ADC in hardware triggering mode for PWM synchronous motor current measurement, i am using s32k312 micro,
I configured adc in HW triggered mode, but i am confused in the areas like setting TRGMUX and triggers for the BCTU and ADC.
I configured the PWM in OPWFMB (need to configure in variable period and dutycycle emios0_ch1)
Currently my triggering link is like: to trigger BCTU i created BCTU_EMIOS_0_4 trigger source(for internal trigger for BCTU) and to trigger ADC i created BCTU_Trg23 trigger source.
But in the BctuHwUnit configuration section i'm still confused with the settings like BCTU List items, Is it really needed in my case since i use only one adc unit as hardware triggering mode for reading the signals (which contains 4 signals total in that HwUnit, in which one of the signal is used for motor current measurement rest of them is not time dependent like rest of the signals converts like back-to-back mode for that scatter gather config is done for channel linking).
In my requirement for every 50µs (max. 100µs) a current value needs to be measured. Within an ISR the PID regulator is called to adjust the PWM based on the updated current measurement.
Regards,
s32k1
Hi,
Thank you so much for your interest in our products and for using our community.
There is no the specific module synchronization that you require for the S32K312. But you could refer to Adc_Sar_Bctu_Ip_example_S32K312 and Emios_Pwm_Ip_Example_S32K312 that are included in S32DS 3.4 with RTD 2.x.x. You can have multiple IDEs.
Additionally, you could refer to the 4.2.4. Analogue data capturing section from AN13767 and its respective Application Software in MCSPTE1AK344 page:
Hope it helps you.
Have a nice day!
Hi Community,
I have configured Adc in bctu control mode and the conversion of the channels are happening.
In order to measure the adc at the mid point of pwm active dutycyle,
Configure the Dummy PWM Signal:
Set Up TRGMUX:
Trigger BCTU:
BCTU to ADC: