Part Number: TM4C123GH6PM
Hi, I use PWM signal at TM4C123... and I have missing pulses, where I have no Idea what is wrong in code,
pls give me a hint.
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Part Number: TM4C123GH6PM
Hi, I use PWM signal at TM4C123... and I have missing pulses, where I have no Idea what is wrong in code,
pls give me a hint.
Hi,
First of all, if you want to PWM_GEN_1 then this generator is associated with M0PWM2 and M0PWM3. M0PWM1 is associated with PWM_GEN_0.
How are you calling the MST_WritePWMMotor? What do you mean you are calling it cyclically? I don't see you enabling interrupt so you most likely are not changing the duty cycle in the ISR. If you are calling the MST_WritePWMMotor within a while(1) loop then it will not work as desired. Sometime the counter may have already passed the new duty cycle you are trying to write.
Hi, Thanks for the hint with the generator.
The MST_WritePWMMotor function is called in the timer interrupt, when a new PWM value is calculated, I guess, the new PWM-value is set when the counter is starting a new cycle, witch can be synchronized with PWM_OUTPUT_MODE_SYNC_LOCAL. If I understand you right, the new PWM can only be set in the Interruptfunction?
I've not "slogged thru" the full detail - yet is it NOT concerning that: "Only a single (or few) PWM Pulses are missed" - yet the WRONG PWM Generator code assignment was implemented?
How then did the PWM even become successfully generated? (even while suffering, "PWM Interruptus") Something here is improperly reported - or otherwise NOT right...
In situations as this - firm/I long have found - that our FOCUS upon, "ONE PWM Generator at a time" - and resultant Success" far trumps, "Multiple PWM Generators - all in play - and (NO SURPRISE) - cascade of issues arrive! "KISS" dictates that, "Small, focused, measurable & systematic steps" - rather than (pardon) "witches brew" - best, "Speeds, Eases & Enhances" client-user success. ALWAYS...
Hi cb1,
The poster said he is generating two PWMs. You are correct that there are two problems. One PWM has missing pulses and the other PWM is just not generated. Looking at his scope cap the channel A1 is just flat low.
[Edit] Because the wrong pin is selected for M0PWM1 and hence it is staying flat.
Thank you, Charles. As stated - I had NOT "slogged thru" (fine detail) simply reacted to the FAILED PWM encoding - to insure THAT was well noted.
As always - "TOO MANY ingredients (often) SPOILS the Soup" - and (sometimes/OFTEN) client-user projects - AS WELL...
KISS - via Singular Focus, upon Measurable & Systematic STEPS - always leads to the best outcomes - w/minimal Krash/Burn... (KISS Violations - witnessed here daily - leads to, "far too FEW" able to Self-Resolve!)
Thank you, Charles - and (to poster) ... REALLY it will be EASIER for you (and for your helper crüe) (here) - as well.
Too MANY Variables (initially) greatly adds to YOUR DIFFICULTY by:
It has LONG been established - that, "One small, well focused, measurable & systematic Step at a Time" (i.e. KISS) - yields the BEST RESULTS - for ALL CONCERNED...
Hi Charles
The interrupt function heled, many thenks!
Another problem, I have a board here with chrased at the customer. I thougt it is the power supply, tested it and power is ok. Then I connected to the IDE and it works fine, then disconnect, it seems so that there is no SW in the flash. the TI-Controllers are new to me, have you a hint for me, where to look at first? Thanks.
rgds E.
Hi Charles
The CPU crashed, means it worked and suddenly the CPU lost all the flash content (it seems so - no LED was blinking, its the same when no power, but power is/was ok) now I erased the whole CPU with the Launchpad an reprogrammed it new in my IDE, and now the CPU is working, also standalone, It is suspect to me... If You have an idea, let me know. Thanks for your support, regardes Ewald