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/TM4C1237H6PM: PWM issue

Part Number: TM4C1237H6PM

Tool/software: Code Composer Studio

We use PD0 to output 4MHz clock using the PWM function.  The code worked fine in the LaunchPad development board that has TM4C123G on it.  When we move the code to our board that has TM4C1237 micro, it does not work.  Don't know why.

  • Hello Steven,

    Did you change any clock or pin configurations?

    Are the same PWM generators being used?

    Have you been running other code successfully on the custom board?

    If you could post the code you are running, that would help here as well.

    In general, need more details because while the problem statement is clear, it is to vague to really give pointed feedback.

  • Hello Steven,

    I haven't heard back from you, so I’m assuming you were able to resolve your issue.

    I will close this thread now, but if you have not solved this issue then post a reply below (or open a new thread if the thread has locked due to time-out).

  • Greetings Ralph,

    Earlier you generated a systematic, 'User Check List.'     Should the poster (still) be in need - the following is offered.

    I've an added suggestion:

    • temporarily switch PD0 from its current mode into GPIO Output - then observe.    (this at least - confirms that 'PD0 (may) provide an output level.)

    And a 'Swag:'

    • while the 'pro-designed/implemented' LPad - succeeded in producing poster's '4MHz clock' - (perhaps) his custom board cannot reach that frequency.    Suggest that the clock be (initially) 'divided by 8' - and again observed.    Should the output (magically) appear - then:
      • board design
      • component performance

    either 'alone or in combination' - may not allow such 'high-frequency' output.

  • Thanks for the responses.  Sorry for the late update.  The reason is that now we've problem to run the code successfully on the both the boards -- the development board and our board that have the TM4C1237 on it.  One thought is that may be the PWM signal frequency setting is too high?   We set at 4MH.  The system clock is 20MHz.  One question is that, at the 20MHz clock,  what is the maximum PWM frequency that can be achieved.  Thanks!

  • Yes, we are experimenting lower PWM frequency to see if it works.

  • Steven Li said:
    Yes, we are experimenting lower PWM frequency to see if it works.

    That's good - yet even better - configure as GPIO Output - if the output then Fails - (any) attempt at PWM output is DOOMED!

    Another tip (likely a good one) - when seeking 'high frequency output' - configure that GPIO pin for  'maximum current output capability.'   (even if - especially if - you will switch to PWM (or Timer) output mode...)

    You (also) must be conscious of any/all 'devices, pcb traces etc.' - which attach to those 'PWM Output' traces.    (ALL are potential 'traffic cops' - and will 'Light you Up!')

  • Hello Steven,

    Steven Li said:
    One question is that, at the 20MHz clock,  what is the maximum PWM frequency that can be achieved.  T

    I tested this and the maximum speed is 2.5 MHz PWM when System Clock = 20 MHz.

    You will need to raise your clock speed to get 4 MHz, or maybe try and use 2 MHz.

  • Hello Ralph,  

    Problem resolved.  Now the PWM code works on both boards and we get 4MHz clock signal nicely.

    Thanks a lot for your support!

  • Steven Li said:
    We use PD0 to output 4MHz clock using the PWM function.  The code worked fine in the LaunchPad development board that has TM4C123G on it. 

    The above from your opening post.     Later - you noted that (even) the LPad developed 'isues.'

    As you confirmed a 4MHz Output initially - does that not suggest that your (earlier) System Clock was 'mis-reported' - or that your measurement of a 4MHz output was in error.

    You have awarded 'two Verifies' - yet those following these posts would really benefit from these 'mysteries' being solved...    Note that (even) a 'too slow system clock' would enable a GPIO 'output' - or a clock output  (8x reduced in frequency)  - and 'results' under those conditions remain unknown.

    How DID you:

    • restore the LPad - which was originally reported to output that 'desired' 4MHz clock
    • solve the 'did not work' performance of  your custom board  (i.e. WHAT did not work?)

    Describing both 'solutions' would be of interest & value to many here...