Xtal frequencies.

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

Hello, I am looking to build one of the usb programmers from adafruit. http://www.adafruit.com/index.ph... as I just got a new computer which has no serial port. and i have all the parts on hand and can burn the chip and everything. but I have one problem. I don't have any 10Mhz xtals. the closes thing i have is a 20Mhz. My question is. is it possible, via some fuse setting or some thing, to scale the clock down by 2. So the avr will run at 10Mhz instead of 20?

//mmmlinux

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

Isn't that a 12 MHz crystal?

http://www.xs4all.nl/%7Edicks/av...

Twice 12 is 24 and the ATtiny2313 is only rated for 20 MHz. Still, it might work reliably at 24 MHz if you never run it with a CLKPR division factor of 1???? Check the crystal frequency first. If you are right and its actually a 10 MHz crystal, then you could set CLKPR to divide by 2 and use your 20 MHz crystal. If you are wrong and it is a 12 MHz crystal, then it will not run at 10 MHz because the software is written to only run at the correct speed.

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

Yes, it should be a 12MHz crystal. The USB standard requires 12MHz or a multiple frequency of 12MHz. If you only have a 24MHz crystal you should program the CKDIV8 fuse to stay on the safe side. So after a reset the MCU runs at 3MHz. In the main() you set the clock prescaler to divide the crystal clock by 2. This way you avoid that the chip ever runs at a too high frequency.

Regards
Sebastian

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

Be patient, get a 12 MHz crystal, and save yourself a lot of hassle.

Stealing Proteus doesn't make you an engineer.

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

yes, I am sorry. It does in fact require a 12Mhz crystal, and I have a 24Mhz crystal. sorry bout that. so there is no fuse i could program that will divide the clock for me? could i use a logic chip such as a binary counter to divide the crystal also? or will that not be fast enough to handle 24Mhz?