Hi, I'm using the PWM component and assigned it to PTD5(Pin 62). I also have a 'heartbeat' led assigned to PTC1(Pin 44) that blinks every 10 seconds.
When I change the Period for the PWM it also has a direct impact on the heartbeat.
Below you'll see the Period is .5kHz. If I change to 1kHz, my heartbeat changes also and blinks every 5 seconds.
TU1:TimerUnit_LDD is assigned to the PWM:
To determine if TU1 had an affect on any other components I removed it from my project to determine which components were affected by it:
As you can see above, only PWM1:PWM was affected.
Can someone explain why this would happen. I'm not sure how to fix this and why the PWM period has an impact on other components that are not using it.
Thanks,
Brian
Note: I'm using KDS Version 3.2.0
Brian
I think that you need ti explain what is driving the heart-beat LED (is it timer driven? Which timer, Is it SW driven based on a Tick interrupt - which tick?).
PWM from the FlexTimer is driven by the bus clock or the fixed clock MCGFFCLK (unless the clock is from an external pin) and an optional pre-scaler, so as long as some setting is not adjusting your main clock or bus clock divider (or sharing a FlexTimer) I also don't see the relationship at the moment.
Regards
Mark
Hi Mark, TU1 is only used for the PWM.
The code for my heartbeat function is below.
I did inherit this code from an old co-worker. If it's timer driven or software driven based on a Tick, I'm not certain.
I've been trying to figure that part out without success.
The enable/disabled contents within TU1 is listed below:
How can I confirm if a "Tick interrupt" is being used? Note, I have no external clocks coming into the uC.
Thanks Mark,
Brian
Brian
Search for the variable Tick and see where it is being "incremented". I suspect it will be in a timer routine (usually Systick interrupt).
Regards
Mark