Electronic – ATMEL AVR ATmega168P 8 mhz

atmegaatmelavr

Hello I will use this circuit to put lights in a model car:

Now the question is if you can see is required one ATMEL AVR ATmega168P with CPU clock frequency to 8 mhz and I can´t find in any place something with 8 mhz. For example:

http://www.mouser.com/ProductDetail/Atmel/ATMEGA168P-20PU/?qs=sQl1Qs3BAuUB3FY8Qd8AOQ%3D%3D

http://www.amazon.com/ATMEL-ATMEGA168P-20PU-ATMEGA-20MHZ-DIP-28/dp/B00MMYP0AM/

I heard about the ATmega168P-PU like the link at top but in specifications they say 20mhz. In resume any place I found 168P I can´t see something that say 8Mhz. Can I use for example that chip amazon sells and does not affect in the function?

I bought this programmer also:

Atmel AVR AVRISP mkII AVR ISP mk2 USB XPII Debugger Programmer for Studio 4/5/6
eBay item:251058218265

I hope you can help I have everything I just miss the 168P 8Mhz or if someone know where can I buy.

update:

Then in conclusion I can buy

http://www.amazon.com/ATMEL-ATMEGA168P-20PU-ATMEGA-20MHZ-DIP-28/dp/B00MMYP0AM/

And I will be safe ok?

Best Answer

The clock frequency the CPU runs at depends on the external crystal you use. The data sheet specification (like 20MHz) indicates just the maximum clock frequency you can run the controller at.

Most (all?) AVRs also provide an internal RC clock generator which is set to 1MHz by default. However, the internal RC clock has large tolerances and tends to drift massively with temperature changes. This might not be an issue for your project though.

If the circuit is supposed to use and external crystal, the circuit diagram you posted omits it. There are other things "missing" like the reset-line pull-up, so the schematic is probably just intended to show the required GPIO wiring.