the question about using the same eMIOS instance for both PWM output and ICU capture

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

the question about using the same eMIOS instance for both PWM output and ICU capture

822 次查看
yin_qiu
Contributor III

dear NXP experts:

I met a problem while using eMIOS for ICU.

the MCU I am now taking use is S 32K312 and I take use of eMIOS_1 for both PWM output and ICU capture. the detail information is that I take use of eMIOS_1 channel0 as BUS B for PWM output and take use of  eMIOS_1 channel22 as BUS F for ICU. 

the pin for PWM output is PTE21 and it is related with eMIOS_1 channel 1,so I think eMIOS_1 channel 0 can provide BUS B for PTE21 for the PWM output.

the pin for ICU capture is PTC7 and it is related with eMIOS_1 channel 7, so I think eMIOS_1 channel22 can provide BUS F for the ICU capture.

now I set a clock divider as 20 for eMIOS_1 and I think the clock for eMISO_1 is 6M . I also set the PWM period value as 6000 so the actual period time is 1ms and I get the actual PWM period in oscilloscope。

But the ICU value is not expected . by analysis :BUS  F provide a base for ICU and the BUS F is 6M, SAIC mode in ICU should also get 6000 tick by calling "

Icu_GetDutyCycleValues(IcuChannel_PTC7,&ICU_HP_PTC7)".but the actual period is 3600.
I feel confused about the ICU period.
 
I did a test for comparation. I take use of another MCU pin related to emios_0 to generate a same PWM signal and connect this pin to PTC7 . I get the correct result : the period for ICU in PTC 7 is 6000.
 so I have a question about the Phenomenon, any misunderstanding about the using of eMIOS? or the one eMIOS instance can not be used for both PWM and ICU if BUS is used?01174df3d340b05c7b89e51105011195.png

 

 

 

0 项奖励
回复
4 回复数

802 次查看
_Leo_
NXP TechSupport
NXP TechSupport

Hi,

Thank you so much for your interest in our products and for using our community.

Could you please share your project (working on the S32K312EVB-Q172) so I can test such issue from my side?

Please specify which versions of S32DS and RTD and refer to RTD example projects for PWM and ICU with eMIOS.

Have a nice day!

0 项奖励
回复

780 次查看
yin_qiu
Contributor III

hi _Leo_

I take use of "S32K3xx_SBC_FS23_R21-11_1.0.0" and "SW32K3_S32M27x_RTD_R21-11_4.0.0_P04" for EB config and the attached file is EB pjt.

if the whole project is necessary , pls let me know.

thx a lot.

0 项奖励
回复

671 次查看
_Leo_
NXP TechSupport
NXP TechSupport

Due to limited resources, we are currently unable to review your configuration. Sorry for the inconvenient.

If more extensive support is required, please contact field application engineer assigned to you - either NPX FAE and distribution FAE. If don’t have such contact yet, please contact our local distributor:

https://www.nxp.com/support/sample-and-buy/distributor-network:DISTRIBUTORS

On the other hand, and regarding your main question "one eMIOS instance cannot be used for both PWM and ICU if BUS is used?".

It is possible to perform PWM and ICU with the same eMIOS instance. Please refer to AN13767 (4.2.3. Center-aligned PWM and 4.2.5. Quadrature decoder sections) and its respective SW in MCSPTE1AK344.

Hope it help you.

Have a nice day!

0 项奖励
回复

784 次查看
yin_qiu
Contributor III
hi _Leo_
I'd like to share my project ,but I take use of ghs for compiler and python2 for c files management in my project also there is FS23 Chip in my hardware, I am not sure you have the similar hardware in your side.
I can share my EB project and could you pls help me to do the general analysis?
0 项奖励
回复