AVR pwm

Go To Last Post
3 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I am using atmega328p. Can i create two different pwms on OC1A and OC1B, both using the 16bit timer1. 

 

Last Edited: Sun. Sep 16, 2018 - 09:39 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Ken Sherriff's blog "Secrets of Arduino PWM"  has a good blurb on PWM

 

http://www.righto.com/2009/07/secrets-of-arduino-pwm.html

 

I imagine you've seen his webpage by now.

good luck.

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

vcoder wrote:
Can i create two different pwms on OC1A and OC1B, both using the 16bit timer1.

So, what brought you to this point?  Is there no information in the datasheet?  What parts of the datasheet chapter on Timer1 are you having problems with?

 

What have you tried so far?  What are the results?  How are you testing -- schematic/connections; Vcc level, AVR clock speed; toolchain/version; complete simple test program.

 

What are the needed PWM specifications?  What is the desired period?  Is it the same for both channels?  Do you need both 0% and 100% duty cycle?  Is ICR1 being used for an input capture?

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.