From: Dave H. <dhy...@gm...> - 2006-04-10 05:18:10
|
Hi Chris, On 4/9/06, Chris Sears <chr...@gm...> wrote: > Dave > > Since all I want is a 1KHz rising edge, > I'm trying to duplicate the 3C 1KHz timer onto 3A or 3B. > You would think it would just be something like: > > WRITE_REG(OCR3A, 128); > WRITE_REG(OCR3B, 128); > WRITE_REG(OCR3C, SPEED_OFF); > > I get a nice PWM on E5, but I still get no signal on pins E3 and E4. > All of the PWM pins are output enabled. > > int tccr1a =3D (1 << COM1A1) | (0 << COM1A0) // ChanA, non-invert= ing PWM > | (0 << WGM13) | (0 << WGM12) > | (0 << WGM11) | (1 << WGM10); // PWM, Phase Correct, 10= -bit; > int tccr1b =3D (0 << WGM13) | (1 << WGM12) > | (1 << CS22) | (0 << CS21) | (0 << CS20); // prescale = =3D 64 > > int tccr3a =3D (1 << COM3C1) | (0 << COM3C0) // ChanC, non-invert= ing PWM > | (0 << WGM33) | (0 << WGM32) > | (0 << WGM31) | (1 << WGM30); // PWM, Phase Correct, 10= -bit > int tccr3b =3D (0 << WGM33) | (1 << WGM32) > | (0 << CS22) | (1 << CS21) | (1 << CS20); // prescale = =3D 8 I found the problem. You're only setting COM1A and COM3C. The others are set to zero, which means off. Question: why the READ_REG & WRITE_REG macros (I'm just curious, perhaps it's so you can add debugging?) -- Dave Hylands Vancouver, BC, Canada http://www.DaveHylands.com/ |