eFlexPWM input capture not capturing on S32K364 – flags set but CAPTCOMPB remains zero I'm using the eFlexPWM module (instance IP_EFLEXPWM_0) on an S32K364 microcontroller to measure the frequency and period of an external signal via input capture. I am using submodule 2 (SM[2]). My configuration is as follows: SM2_CAPTCTRLB->EDGB0 = 0x02; (capture on rising edge for capture circuit 0) SM2_CAPTCTRLB->EDGB1 = 0x02; (capture on rising edge for capture circuit 1) SM2_ARMB = 1; (arm the capture circuits) After running the code, I observe the following: In SM2_CAPTCTRLB, the counter status bits show: CB0CNT = 0x4 CB1CNT = 0x4 In SM2_STS, both flag bits are set: CFB0 = 1 CFB1 = 1 However, the captured values (SM2_CAPTCOMPB) remain 0 for both capture circuits – no data is latched. What could be causing this? Is there any additional configuration needed (e.g., clock enable, input muxing, or counter setup) that I might have missed? The flags indicate that capture events are detected, but the captured values are not updated. Any insight would be greatly appreciated. Feel free to add any additional details (like your pin muxing settings or counter mode) if needed. Good luck! Re: eFlexPWM input capture not capturing on S32K364 – flags set but CAPTCOMPB remains zero Hi
First, I checked the latest S32K3 RTD 7.0.x; however, the S32 Configuration Tool does not yet support the eFlexPWM E-Capture functionality. If it is convenient, could you share your project so I can test it on the S32K396? (Unfortunately, I don’t have the S32K364; I only have the S32K396-BGA-DC1 evaluation board.)
Secondly, please review section “56.3.14 Enhanced capture (E-Capture)” in S32K396RM (Rev. 4, 11/2024). Please check the registers mentioned in that section, especially those in Figure 254. E-Capture logic. You can also share screenshots of the eFlexPWM_0 registers with me.
Besides the bits you mentioned in SM2_CAPTCTRLB [EDGB0],[EDGB1],[ARMB], how did you configure the other bits in SM2_CAPTCTRLB?
Since you observed that SM2_CAPTCTRLB[CB0CNT] = 0x4 and [CB1CNT] = 0x4, have you checked the corresponding register values of SM2_CVAL4, SM2_CVAL4CYC, SM2_CVAL5, and SM2_CVAL5CYC?
In addition, if you want to read the value of SM2_CAPTCOMPB[EDGCNTB], please first enable SM2_CAPTCTRLB[EDGCNTB_EN] and SM2_CAPTCOMPB[EDGCMPB]. I’m not sure why you set SM2_CAPTCOMPB[EDGCMPB] to 0, as this seems to prevent the comparator in Figure 254. E-Capture logic from functioning correctly.
Best Regards, Robin
記事全体を表示