PWM 2313

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

Gday

I setup the PWM function on a AT90S2313, output at PB3 (OC1)
Xtal is 4MHz.
Timer1 running @ ck/64, PWM OC1 clear and 8-bit mode, but a measure a PWM period of about 8msec on my scope, how is this possible?
Because 1/4MHz*64*256 = 4.096msec.

:roll:

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

Quote:
Timer/Counter1 in PWM Mode

When the PWM mode is selected, Timer/Counter1 and the Output Compare Register1 (OCR1A) form an 8-, 9-, or 10-bit, free-running, glitch-free and phase-correct PWM with output on the PB3(OC1) pin. Timer/Counter1 acts as an up/down counter, counting up from $0000 to TOP (see Table 11), where it turns and counts down again to zero before the cycle is repeated. When the counter value matches the contents of the 8, 9 or 10 least significant bits of OCR1A, the PB3(OC1) pin is set or cleared according to the settings of the COM1A1 and COM1A0 bits in the Timer/Counter1 Control Register (TCCR1). Refer to Table 12 for details.

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

8-bit $00FF (255) f TC1 /510

fTC1 divide by 510?

4MHz/510*64=8.16msec.

8)