System clock prescaler question

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

I need to run ATtiny2313 at 8Mhz with a 3 Volt supply (2xAA). Datasheet tells me this should be ok

Quote:
ATtiny2313: 0 - 10 MHz @ 2.7 - 5.5V, 0 - 20 MHz @ 4.5 - 5.5V

My question is, if I attach a 16Mhz xtal and set CLKPS to divide by 2, would that still be acceptable?

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

Yes, it will. The frequency restrictions are for the actual clock rate the AVR is running at, not the frequency of the source. You've got to be careful though. The operating frequency won't change until you actually change CLKPS, so if the CKDIV8 fuse is not set, then the AVR will be running at 16MHz until you change CLKPS. So make sure when you change the clock options for an external crystal that the CKDIV8 fuse is set. That way, the AVR will be running at 2MHz until you change the CLKPS register.

Regards,
Steve A.

The Board helps those that help themselves.

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

Thanks for the heads-up! I hadn't even thought about the startup frequency :o