Tiny48 vs. Mega48 Timer1 Fast PWM

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

I'm confused--I've got some Tiny48 apps and many Mega48-family apps. Now I've got an app where I will do Fast PWM on a Tiny48. The wording for inverted/non-inverted seems to be reversed.

I don't have a unit right now to test. Does anyone here have the experience to answer whether this is a datasheet problem, or does the Tiny48 PWM indeed work "backwards"?

Tiny48 datasheet excerpt:

Quote:
12.9.3 Fast PWM Mode
...
In non-inverting Compare Output mode, the Output Compare (OC1x) is set on the compare match between TCNT1 and OCR1x, and cleared at TOP. In inverting Compare Output mode output is cleared on compare match and set at TOP. ...

Mega48 datasheet excerpt:

Quote:
15.9.3 Fast PWM Mode
...
In non-inverting Compare Output mode, the Output Compare (OC1x) is cleared on the compare match between TCNT1 and OCR1x, and set at BOTTOM. In inverting Compare Output mode output is set on compare match and cleared at BOTTOM. ...

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.

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

Wonder if the AS4 sim2 or AS6 sim are good enough to check this?

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

Note that the datasheet(s) are "consistent"--the description of the COMxyz bits is consistent with the Fast PWM bits.

There is no mention of this in the AVR515 migration app note:
http://www.atmel.com/Images/doc8...

I'll try to remember to post a follow-up when I get hardware next week.

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.

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

The datasheet for the Tiny48 appears to be correct, and the "sense" of the PWM is reversed from that of all other AVR models that I've worked with over the years.

Now, why would that be? Just for grins, Tiny1634 is a new model...

Quote:
In non-inverting Compare Output mode, the Output Compare (OC1x) is cleared on the compare match between TCNT1 and OCR1x, and set at BOTTOM. In inverting Compare Output mode output is set on compare match and cleared at BOTTOM.

Weird.

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.