S12G ADC SYNC

cancel
Showing results for 
Search instead for 
Did you mean: 

S12G ADC SYNC

Jump to solution
252 Views
fanziyu
Contributor III

Hi folks!

Is there a way with the S12G128 to sync or trigger an ADC sample & conversion from the start of the PWM period?

PWM Frequence is 20k

I use HalfBridge to control a brush DC by PWM and need measure the current ,the current sense is a square wave(20k) .

Is there a clever way to solve the problem ? it is too late for me to change the chip.

Thanks

0 Kudos
1 Solution
168 Views
lama
NXP TechSupport
NXP TechSupport

Hi,

Yes, there is internal HW connection between PW0 and ETRIG0, PWM1 and ETRIG1, etc ...   Please check chapter 2.6.4 ADC External Triggers ETRIG3-0 in reference manual (page 254,255). If PWM is enabled, ETRIG will be driven by PWM (internally or trough pin).  Since PWM outputs in 16-Bit Mode are PWM1, PWM3, PWM5 and PWM7, only two internal links 
ETRIG1 and ERIG3) could be used of ADC triggering.  I would like to recommend in your case external link from PWM outputs into some of remaining 
port AD inputs (ETRIGSEL=0, ETRIGCH[3:0] refers to appropriate PAD input). For more details please see Table 11-5. External Trigger Channel Select Coding (page 427).   Best regards,
Ladislav

View solution in original post

0 Kudos
1 Reply
169 Views
lama
NXP TechSupport
NXP TechSupport

Hi,

Yes, there is internal HW connection between PW0 and ETRIG0, PWM1 and ETRIG1, etc ...   Please check chapter 2.6.4 ADC External Triggers ETRIG3-0 in reference manual (page 254,255). If PWM is enabled, ETRIG will be driven by PWM (internally or trough pin).  Since PWM outputs in 16-Bit Mode are PWM1, PWM3, PWM5 and PWM7, only two internal links 
ETRIG1 and ERIG3) could be used of ADC triggering.  I would like to recommend in your case external link from PWM outputs into some of remaining 
port AD inputs (ETRIGSEL=0, ETRIGCH[3:0] refers to appropriate PAD input). For more details please see Table 11-5. External Trigger Channel Select Coding (page 427).   Best regards,
Ladislav

View solution in original post

0 Kudos