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.

TIVA PWM input question

Other Parts Discussed in Thread: TM4C123GH6PM

Hi,

We are working on developing a system where the main uC is TM4C123GH6PM.

On this module, we will have 5 PWM inputs at 5V

Two questions:

1.  Can TIVA handle directly the 5V inputs or do I need to foresee a max 4V input?

2.  I am thinking about using PC4-PC5-PC6-PC7-PD7 as inputs for the PWM, and managing the PWM with interrupt routines.  Is there a more efficient strategy/feature that I can use/you suggest on TM4C?

  • Andrew Jones42 said:
    using PC4-PC5-PC6-PC7-PD7 as inputs for the PWM

    Usually - routing a PWM signal to a Timer pin proves most efficient.   Are those pins legitimate Timer inputs?   (my sense - No!  Appears you've chosen based upon Port "Commonality and or for eased signal routing - not my recommendation...)

    Many of this vendor's MCU pins are 5V tolerant - yet our small tech firm favors a simple voltage divider to bring the signals to 3V3 max.   Unknown is the PWM source(s) it may make sense to "buffer" those PWM signals if they are bit distant from the MCU.

    It's tempting to employ a single Timer to determine (both) PWM "high and low" times.   Use of two Timers (or two halves) of a single Timer usually yields simpler code and greatly speeds/simplifies development.

    We've not (yet) tried to measure 5 PWM signals - suspect the frequency and range of PWM duty cycle may add some complication.   Should the frequency vary - I'd grant highest interrupt priority to your highest frequency PWM signal.   In a situation this complex - each of your interrupt handlers must be, "short/sweet" - do not hold these handlers hostage to UART transfers or delays!

    KISS dictates that you attempt first with a single PWM input signal - into a Timer pin - and move to multiple such signals & measurement in incremental steps.  Attempting to measure all five signals - from the outset - unless you're both "way smart & lucky" - is doomed.  (and - the failure will not provide much of real value...)

    Silent in your post is your handling of the PWM measurements.   Again any "excess time" in processing or (more likely) UART transmission is likely to confound your multi-channel, PWM measurements.

    Finally - PD7 holds a "special delight" for you.  I'd avoid that pin - or enter PF0/PD7 under forum search - to learn of the unexpected (and most always) unwanted special defaulting of this pin...

  • Hello Andrew,

    The TM4C123 has 5V tolerant IO's. However you would need to make sure that the rise time and fall time of the PWM input to TM4C123 is controlled, i.e. it is not very fast rise/fall time. The TM4C123 5V tolerant IO's have an issue of latch up with fast rise/fall signals and the WA is documented in the errata as well.

    What exactly you are using the PWM input would define the strategy.

    Regards
    Amit