1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Slow clock speed with Atmega328P AVR microcontroller on breadboard

Discussion in 'Programming/Internet' started by C. Dunn, Oct 8, 2018.

  1. C. Dunn

    C. Dunn Guest

    I have a small breadboard with an Atmega328p 28 pin microcontroller with a 16 MHz crystal and two 20 pF capacitors on it (similar to this demo: https://www.arduino.cc/en/Tutorial/ArduinoToBreadboard).

    The difference with that demo is I am using a USBasp ISCP programmer to program the chip instead of an Arduino, and I was able to successfully program the infamous 'blink' program to my MCU and I couldn't be more happy.

    However, instead of delaying for 1000 ms (1 second), I needed to change the parameter of my wait function to "20 ms" to achieve an on/off time of 1 actual second.

    Is there something I'm missing here? Do I need to add anything to my circuit or perhaps change the capacitor values in order to fix the clock speed? Thank you.

    Login To add answer/comment
     

Share This Page