S32K358 FlexIO: clock source selection and PWM

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

S32K358 FlexIO: clock source selection and PWM

368 Views
saikiranG
Contributor I

Is it possible to select a different clock source apart from CORE CLK for FlexIO, and are there any peripheral‑level dividers available before the clock reaches the FlexIO module?

I'm using S32K358 FlexIO PWM (flexio_mcl_IP, flexio_pwm) to generate low‑frequency PWM (~100 Hz). I only see the FlexIO internal prescaler options (1/16/256) and timer period (max 512 ticks) configuration, with no further clock division.

At 240meg core clock, I could technically go up to 1.83KHz the least with 256 prescaler.

May I know is there a way to change the clock source option for flexIO so that I drive it at frequencies less than core clock? 

Am I missing any clock dividers, or is this an expected limitation of FlexIO PWM, in which case another peripheral is recommended?
0 Kudos
Reply
1 Reply

337 Views
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @saikiranG,

Is it possible to select a different clock source apart from CORE CLK for FlexIO, and are there any peripheral‑level dividers available before the clock reaches the FlexIO module?

No, FlexIO module works directly with CORE_CLK:

Julin_AragnM_0-1767982541347.png

And for dividers, there are only the prescaler options you mentioned, ÷1, ÷16, ÷256 (configured in FlexIO timers). Before that, there is MC_CGM_MUX_0_DIV0, which is the divider for CORE_CLK.

Unfortunately, this is a limitation of the FlexIO module. You can use eMIOS module instead.

My colleague explains OPWFMB calculation in this other community post: Lower frequency PWM in OPWFMB mode - NXP Community.

Best regards,
Julián

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2290851%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ES32K358%20FlexIO%3A%20clock%20source%20selection%20and%20PWM%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2290851%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EIs%20it%20possible%20to%20select%20a%20different%20clock%20source%20apart%20from%20CORE%20CLK%20for%20FlexIO%2C%20and%20are%20there%20any%20peripheral%E2%80%91level%20dividers%20available%20before%20the%20clock%20reaches%20the%20FlexIO%20module%3F%3C%2FP%3E%3CP%3EI'm%20using%20S32K358%20FlexIO%20PWM%20(flexio_mcl_IP%2C%20flexio_pwm)%20to%20generate%20low%E2%80%91frequency%20PWM%20(~100%E2%80%AFHz).%20I%20only%20see%20the%20FlexIO%20internal%20prescaler%20options%20(1%2F16%2F256)%20and%20timer%20period%20(max%20512%20ticks)%20configuration%2C%20with%20no%20further%20clock%20division.%3C%2FP%3E%3CP%3EAt%20240meg%20core%20clock%2C%20I%20could%20technically%20go%20up%20to%201.83KHz%20the%20least%20with%20256%20prescaler.%3C%2FP%3E%3CP%3EMay%20I%20know%20is%20there%20a%20way%20to%20change%20the%20clock%20source%20option%20for%20flexIO%20so%20that%20I%20drive%20it%20at%20frequencies%20less%20than%20core%20clock%3F%26nbsp%3B%3C%2FP%3E%3CDIV%3EAm%20I%20missing%20any%20clock%20dividers%2C%20or%20is%20this%20an%20expected%20limitation%20of%20FlexIO%20PWM%2C%20in%20which%20case%20another%20peripheral%20is%20recommended%3F%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2291132%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20S32K358%20FlexIO%3A%20clock%20source%20selection%20and%20PWM%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2291132%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F258195%22%20target%3D%22_blank%22%3E%40saikiranG%3C%2FA%3E%2C%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EIs%20it%20possible%20to%20select%20a%20different%20clock%20source%20apart%20from%20CORE%20CLK%20for%20FlexIO%2C%20and%20are%20there%20any%20peripheral%E2%80%91level%20dividers%20available%20before%20the%20clock%20reaches%20the%20FlexIO%20module%3F%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3ENo%2C%20FlexIO%20module%20works%20directly%20with%20CORE_CLK%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Julin_AragnM_0-1767982541347.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Julin_AragnM_0-1767982541347.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F372360i0E1B887B1F18125F%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Julin_AragnM_0-1767982541347.png%22%20alt%3D%22Julin_AragnM_0-1767982541347.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EAnd%20for%20dividers%2C%20there%20are%20only%20the%20prescaler%20options%20you%20mentioned%2C%26nbsp%3B%C3%B71%2C%20%C3%B716%2C%20%C3%B7256%20(configured%20in%20FlexIO%20timers).%20Before%20that%2C%20there%20is%26nbsp%3BMC_CGM_MUX_0_DIV0%2C%20which%20is%20the%20divider%20for%20CORE_CLK.%3C%2FP%3E%0A%3CP%3EUnfortunately%2C%20this%20is%20a%20limitation%20of%20the%20FlexIO%20module.%20You%20can%20use%20eMIOS%20module%20instead.%3C%2FP%3E%0A%3CP%3EMy%20colleague%20explains%26nbsp%3B%3CSPAN%3EOPWFMB%26nbsp%3Bcalculation%20in%20this%20other%20community%20post%3A%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2FS32-Design-Studio%2FLower-frequency-PWM-in-OPWFMB-mode%2Ftd-p%2F1826787%22%20target%3D%22_blank%22%3ELower%20frequency%20PWM%20in%20OPWFMB%20mode%20-%20NXP%20Community%3C%2FA%3E.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EBest%20regards%2C%3CBR%20%2F%3EJuli%C3%A1n%3C%2FP%3E%3C%2FLINGO-BODY%3E