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.

CCS/TM4C123GH6PM: Problem with power and debug

Part Number: TM4C123GH6PM


Tool/software: Code Composer Studio

Hi everyone,

Now I am writing a code to control quadcopter and I using 2 PWM module to generate the PWM signal and I have a problem related to tiva C debug when I load my program on Tiva C, the PWM work correctly. However if I restart the Tiva ( cut off power and turn it on) , PWM will react abnormally. Is there any problem with flash memory when I cut off power? Thanks for your supports.

  • More often than not - such "disturbance to flash memory post power-down" result from "issue(s) w/in the start-up file."

    Your writing notes "Abnormal PWM" - yet fails to mention "all other" aspects of your code. If the issue "IS" confined to PWM - the problem's source may be at the PWM interrupt level - instead...

    Sufficient detail IS required...
  • Thanks for your reply,

    My PWM mode is setup in NO SYNC mode with the period of 4 ms. The pulse width range that I used for my quadcopter is for control ESC is from 1ms to 2ms. But, when I cut off the power after loading the program and send high signal (aprox 1.4ms pulse width) to the quadcopter (high power) the PWM react like it send the max signal (2ms pulse width) on the ESC but only one PWM pin goes wrong others is normal. Is there any affection by voltage drop ? My Tiva was power up drom BEC of ESC.
  • Additional information My battery I used is LIpo 2S . Can this causes the problem?
  • I agree with CB1 that it is most likely not a problem with the flash. It is very important that the TM4C have good power. I suggest you monitor the 3.3V supply to the TM4C when the PWMs are driving the motors. Voltage dips or spikes may cause erratic execution of the TM4C.
  • Flash issue - as we both (now) note - seems unlikely.

    Poster does not note the impact of "power-cycle" upon "all other portions of his program."     Such (was) requested - and provides a reasonably sound means to, "Remove Flash from poster's "bag of issues."

    Providing stable and "to spec" power is ALWAYS the "central requirement" for ANY MCU's project success!     Power must be monitored under actual operating conditions - even those (especially those) "most stressful!"

  • Thanks for your reply,

    I mean when I plugin the cable to the TIVA and upload my code with the battery is still connected. and when I disconnect TIVA with my laptop while battery is still connected and everything works fine. However, whenever the TIVA is restarted then the PWM meets the problem now. Sorry for my description cause its difficult to tell you in more details.
  • Please check that the linker is using "ROM" autoinitialization. Right click on the project name, then select "Show build settings ...". Expand the options until you see the advanced linker options as shown below. ROM autoinitialization is the default, so this is usually not a problem.

  • Thanks for your supports

    My code has been already set like your picture before ! Do you have any other recommends ? Thanks in advance!

  • If I may - when such issues develop - your use of a, "Very Simple - Vendor supplied (known good) program - minus ANY change" proves best.

    Replace your current program - follow this direction - and observe & report the result...