How to configure OPWMCB to trigger ADC conversion using MCUXpresso

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

How to configure OPWMCB to trigger ADC conversion using MCUXpresso

2,136 次查看
MVR
Contributor V

Hello everyone,

I'm using S32K344 and S32K3 RTD AUTOSAR 4.4 2.0.1 D2207.

I would like to configure the PWM as OPWMCB (Center aligned Output PWM Buffered) using 6 aligned channels and notify via software or automatically trigger ADC conversion via hardware, occurring at the beginning of cycle as circled in the image below:

MarcusVR_0-1660684448226.png

I would like to use BCTU for trigger ADC conversion (recommended in application note), how I can configure using the MCUXpresso Config Tools?

Thanks.

0 项奖励
回复
2 回复数

2,113 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi,

theoretically, in OPWMCB mode you need to select the timebase using Bus Select (Cn[BSL]). The timebase you select must be running in Up Count-Down Count mode and this timebase define PWM period. The channel generating this timebase can be then used to trigger ADC conversions at period boundary. See MCB mode description to know more about flag generation in MCB Up Count-Down Count mode.

You can refer to below example for BTCU ADC triggering. PIT is used to trigger BTCU but you can add eMIOS and modify TRGMUX module to use eMIOS instead if PIT

https://community.nxp.com/t5/S32K-Knowledge-Base/Example-S32K344-PIT-BTCU-ADC-DMA-DS3-4-RTD100/ta-p/...

BR, Petr

2,073 次查看
MVR
Contributor V

Hello @PetrS ,

I saw your example, I will test. If I define the timebase in EMIOS MCL being "Up Count-Down Count", is it enough to BCTU generate the trigger when I link with some EMIOS PWM channel?

I have read the document "AN13413 - ADC Guidelines Spec and Configuration" as well and I understand that there are two options for it:

1) EMIOS -> TRGMUX -> BCTU -> ADC

2) EMIOS -> BCTU -> ADC

Why we need of TRGMUX in this case? Really is it necessary?

Thanks,

MVR

0 项奖励
回复