PWM Duty Cycle Doesn't Change When Rotating the Potentiometer on EVB

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

PWM Duty Cycle Doesn't Change When Rotating the Potentiometer on EVB

Jump to solution
315 Views
simon98
Contributor III

Hi NXP Team,

I'm trying to learn PWM on S32K358EVB-Q289.

I'm folllowing this guide https://community.nxp.com/t5/NXP-Model-Based-Design-Tools/Controlling-LED-intensity-with-ADC-and-PWM...

I reconfigured all the pins in order to match my hardware.

When i flash the model on the board the RGBLED RED turns on but when i move the potentiometer the brightness doesn't change.

As i'm using MBDT i configured Freemaster over uart, setting an oscilloscope and i could see that the values of the adc chage over time when i rotate the potentiometer.

How could i fix this? I repeatedly checked the steps of the guide and i'm pretty sure i've correctly implemented.

Thanks 

Simon

0 Kudos
Reply
1 Solution
278 Views
simon98
Contributor III

Hi @FlorinCiuca 

As you can see in the project i was not using the REDLED0 but the REDLED1 that is routed to emios2_ch21_y as you can see in the attached screen.

The problem i found was teh frequency too high that couldn't ever have shown me the blinking of the led.... So i modified the Dafault Period of the EMIOS bus and then worked fine

View solution in original post

0 Kudos
Reply
2 Replies
286 Views
FlorinCiuca
NXP Employee
NXP Employee

Hello @simon98,

Thank you for your interest in Model-Based Design Toolbox for S32K3!

I analyzed the attached project and I can say that most of the ADC configuration options are performed correctly, the only exception being the Last Mile Regulator which is still enabled (please re-visit Step 2.4 from the linked article). However, when looking in the schematics of the S32K358-Q289 EVB, it can be observed than neither of the RGB LEDs can be routed as eMIOS channels:

FlorinCiuca_0-1728337666038.png

Unfortunately, this means that the dimming effect desired cannot be achieved and the configurations performed for eMIOS in the attached project have no effect.

If you want to further explore the ADC and PWM capabilities of the board, I suggest using different pins that fully support them.

I hope this explanation clarifies the current issues you have, and, if further issues occur please don't hesitate to contact us again.

Best regards,

Florin!

0 Kudos
Reply
279 Views
simon98
Contributor III

Hi @FlorinCiuca 

As you can see in the project i was not using the REDLED0 but the REDLED1 that is routed to emios2_ch21_y as you can see in the attached screen.

The problem i found was teh frequency too high that couldn't ever have shown me the blinking of the led.... So i modified the Dafault Period of the EMIOS bus and then worked fine

0 Kudos
Reply