s32k312_emios-bctu-adc hardware triggering

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

s32k312_emios-bctu-adc hardware triggering

1,312 Views
S32k1
Contributor I

Hi @Irina_Costachescu,

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

0 Kudos
Reply
2 Replies

1,282 Views
_Leo_
NXP TechSupport
NXP TechSupport

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:

_Leo__0-1723233070367.png

Hope it helps you.

Have a nice day!

0 Kudos
Reply

1,050 Views
S32k1
Contributor I

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,

  1. Configure the Dummy PWM Signal:

    • The dummy PWM signal is correctly set to half the period of the original PWM signal. This will help you achieve the desired delay for midpoint measurement.
  2. Set Up TRGMUX:

    • Configured the TRGMUX to route the eMIOS channel (e.g., TRGMUX_IP_INPUT_EMIOS0_IPP_CH3) to the BCTU trigger input (TRGMUX_IP_OUTPUT_BCTU_TRG23).
  3. Trigger BCTU:

    • Used the dummy PWM signal to trigger the BCTU at the midpoint of the original PWM signal’s on-time.
  4. BCTU to ADC:

    • The BCTU is configured to start the ADC conversion upon receiving the trigger.

      Also when ever there is any pwm dutycycle update I need to change the delay point in such a way that it should be at the mid of pwm active dutycycle, for that i have used Bctu Tigger notification callback to update the trigger point.

      But when i output the result in DSO the signal waves are showing not as expected. Yellow - PWM Output 
      Green  - BCTU trigger( should be at the mid point), also for some signals it is missing.

      S32k1_0-1729685686033.png

       

0 Kudos
Reply