Jump to content
43oh

Tiva-C TM4C123G - Hardware PWM performance better than software?


Recommended Posts

Hello,

I'm planning for a project the use of 12 Channels PWM (Frequency must be above 60khZ, because of driving some VCA´s and not getting into the audio range).

As I know, Energia uses "software" PWM with the use of timers (the hardware PWM´s of the new TIVA's is not implimented).

 

So my question is, may I can get some overall performance boost using the driverlib hardware PWM rather than the energia software version?

 

Thanks

 

regards

Matthias

Link to post
Share on other sites

Hello,

I'm planning for a project the use of 12 Channels PWM (Frequency must be above 60khZ, because of driving some VCA´s and not getting into the audio range).

As I know, Energia uses "software" PWM with the use of timers (the hardware PWM´s of the new TIVA's is not implimented).

 

So my question is, may I can get some overall performance boost using the driverlib hardware PWM rather than the energia software version?

 

Thanks

 

regards

Matthias

 

what do you consider software PWM?

 

as far as i know energia has the hardware PWM implementation with the timers.

it sets up a timer to automaticaly generate a PWM without further intervention from the processor. The timer peripheral keeps generating the PWM with the frequency and duty set.

 

To me software PWM is when you set a timer to count time with a interrupt and every x time acording to your freqency and duty, it sets any pin you want to HIGH or LOW. This gives the processor more overhead, and if you have to many interrupt sources it can mean the action of changing the pin state isn't done in the exact time.

The hardware PWM has the advantage of having a dedicated peripheral doing all the work in the background of processor code. This would also give it more percision.

 

There's also a PWM peripheral wich i alredy asked the advantages over PWM generated by the general purpose timers:

http://e2e.ti.com/support/microcontrollers/tiva_arm/f/908/t/357542.aspx

Link to post
Share on other sites

Hello and thank you for your answer and sorry for my delayed reply. I'd to think a little bit over.

Ok, my description of "energia uses software pwm" is a little bit rough.

But the main difference between the "old" stellaris launchpad and the new tiva driverlib style is, that the tiva has 2  build in pwm modules (see driver lib guide page 205ff)

So my question is more:

Is the new way of the tiva's (using the 2 pwm modules) faster than the "old" energia/timer way for the stellaris launchpad?

The drawback of using the pwm modules is, that you 've to use only up to 16 hardcoded pins. I've attached a sheet with the different pinouts (row: "Hardware PWM" and "Energia PWM"), please ignore the "connected with" tab - it's for my project :)

I dont need a special pwm mode with sync/dead band... just converting voltage like a DAC (but with the carrier frequency >60kHz, the "DAC output frequency" ist quiet low: <50-100Hz), so I read your link and get the conclusion to myself, that there should be no big advantage for me using the pwm module....

 

Thank you and

regards

 

Matthias

8-bit-synth-pinout-tiva-sheet.pdf

Link to post
Share on other sites

meanwhile I tested  a little sketch (just  in a loop 12x PWMWrite(pinX,255,x,60000) ) and a little time measurement:

12x writing PWM with energia tooks about 88 microseconds, so it´s more than 10kHz, way beyond  my needed ~100 Hertz, so much headroom for the other stuff :)

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...