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.

TM4C1294NCPDT: PWM with 5 volt output (Energia)

Part Number: TM4C1294NCPDT
Other Parts Discussed in Thread: ENERGIA

Hello,

i want to create a PWM signal with Energia. With the "wiring_analog.c" library it is possible to usw this code to create an PWM:

pinMode(PL_4, OUTPUT);
PWMWrite(PL_4,1000,55,50); 

With this code i get a PWM signal with HIGH(3.3 volt) and LOW (0 volt)

Is it possivle to get a PWM signal with HIGH (5 volt)?

Thanks in advance.

best regards.

YAMAN

  • There are, "Voltage Translator ICs" - which quite successfully convert from "3V3" to "5V0."

    A single, small signal, NPN transistor (2N2222 is one)  - wired as, "Open Collector" - with emitter grounded - collector "pulled up to 5V" - and with your PWM signal "inverted" and resistance coupled to the NPN's base - (may) be able to work.     (such circuit will have slew & resulting frequency limitations - thus the first solution (i.e. voltage translator IC) is recommended if higher performance is required...)

    Unspecified is,  "What is being PWM-driven."     In some cases - the MCU's native 3V3 output signal level is "judged adequate" by the "5V receiving system."     (worth a quick try - prior to added circuit...)

  • Thanks for your answer. The PWM should be used as a gate-signal for the MOSFET MMIX1F520N075T2.

    I will try if the 3.3v PWM is enough for the gate signal. If not i will try it with the IC. 

    Thanks again.

  • Should you use a "MOSFET" - rather than the "bi-polar" device suggested - I suspect that a, "P-FET" will prove most useful.

    This is so as the lower cost & more available "N-FET" will require (some means) to raise its "Gate Voltage" IN EXCESS OF YOUR, "Desired Output Voltage to your (still) unspecified PWM receiving device."

    There exist "Gate Driver ICs" - which specifically address the needs of "N-FETs" when they are asked to provide voltage outputs (beyond) the driving source's voltage level.     (that's 3V3 - in your case)

    If your chosen "MMIX1F520N075T2" is a "P-FET" then you may  employ it as an "Inverter" and must  "invert your MCU's PWM Output" prior to presenting it to the P-FET's gate.    You must add a pull-up resistor to 5V - on the proper P-FET pin - which then ties to your external device's input...

    Edit:  Thinking a bit further - if indeed your chosen FET is a P-FET - then the MCU's 3V3 output (high) level - may NOT prove sufficient to hold that P-FET OFF!      This is why I suggested your use of an (older) NPN device - which "avoids" such issue - and insures the proper voltage delivery to your external device - while reacting properly to your MCU's (known & usual) voltage levels.

    Note:   It proves ALWAYS WISE to avoid the direct connection of any MCU pin to a "potentially harmful" external device.     (even an external device's INPUT!)     Far better practice is to,  "Deploy a buffering device"(usually a transistor) between the MCU and "outside world."     It is far faster/easier to "replace such transistor" than to attend the funeral for an MCU.     (He WAS a good MCU - had (many) friends etc...)

  • I took a quick look at the device. I rather doubt the 3V3 will be enough to consistently turn it on. In fact I don't think I'd try less than 10V and preferably 15V. If you take a look at their characterizations, most of them are done at 10V.

    And take a look especially at figure 9, note that the gate charge rapidly rises at 5V.

    At the very least I'd want another IC between the micro and the FET just to provide some protection. As cb1 suggests you would be advised to use a gate driver IC.

    Robert
  • Thanks for your answers. I combined your solutions. I took a transistor and pulled up to 10V and it works very well.

    Thanks a lot again.

    best regards

  • Greetings Robert,
    May I - and my fellow Chicago residents - thank you for "bestowing 1.9°F" (from your frozen tundra) upon our glorious (now FROZEN) city?

    It would appear - unless PWM frequency is sufficiently high - that the easiest "adaptation" is the use of a humble, bi-polar (rescued from trash bin) 2N2222/similar, NPN transistor. (fully specified - 1st answering post - rejected by poster via "his/her" (unlikely to succeed) proposal)

    Love it when, "those who seek help" - reject it - and offer their "clearly" (well-thought) method/madness - in substitution...     Do you smell smoke - too?      Has poster's "design" - now wind-blown - reached to central Canada - too?

    [edit]  Poster's post - arriving 2 minutes prior to this one - was (of course) unrecognized.      The "call for Gate Driver" arrived from "three" - (repetition counts "somewhere" - does it not?) - smoke's source (now) unknown.    (but "never" from our "Back Room - behind (another) "Back Room" facility...)

  • "Is it possivle to get a PWM signal with HIGH (5 volt)?"

    yes. for the kind of device you are driving, it is likely better for you to use a gate driver. you should first decide on the drive frequency, then calculate drive current from that, to get a sense of what kind of gate drivers will do for your application.

    it should deliver 10v to the gate for it to work.

    alternatively, look for a logic-level mosfet. they present two challenges: 1) larger gate capacitance; 2) tough to find for the kind of current you want.