NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.
Microcontroller Programming » External Crystal Clock with Atmega168 PWM
July 21, 2011 by lavared |
All, I have a few basic questions regarding the external crystal clock for PWM implementation. I'm using a nerdkit Atmega168 chip with the supplied 14.7MHz external crystal for PWM implementation. I have read that the Atmega168 chip also has internal RC clock of 8MHz(with a divider of 8, essentially 1MHz output). My questions are:
Srry for these basic questions but I'm relatively new to this field and still finding my feet here. Thanks |
---|---|
July 21, 2011 by hevans (NerdKits Staff) |
Hi lavaraed, Which clock is used for chip operation is determined by the fuse settings. The chip as you received it from us already has the fuses set to use the oscillator to run its clock source. The define F_CPU 14745600 does not have anything to do with the actual operation of the chip, it is merely a reference for any piece of code that needs to know what the frequency of the CPU is. There is a register that will set up a division factor for your system clock if you want to use it. You can read about the CLKPR register on the datasheet page 38. Hope that clears thing up. Humberto |
July 21, 2011 by lavared |
Thanks Humberto. That answers my question. |
Please log in to post a reply.
Did you know that LEDs (light emitting diodes) only conduct current in one direction, like normal diodes? Learn more...
|