Atmega328p Programming

Hi guys ,

So , I programmed the atmega328 of the arduino uno to just blink a led. Then I unplugged it and put it on a breadboard . I did all the necessary connections and it didn't work BUT when i plugged it back and connected the led to the specific pin it worked perfectly.

Note:

  • I checked the connections 100 times. I also saw a pin map of the atmega328 so I don't think that's the problem.
  • I used a 16MHz crystal but used 47 and 82 pF capacitors instead of 22pF. Do you think that's the reason it fails to work outside of the board?
  • I also can't program it on the way arduino website suggests.It just keeps saying double check the connections..

Thanks in advance!

Show us a good schematic of your circuit.
Show us a good image of your wiring.

.

Those capacitors are important for both timing and the shape of the clock. The range specified is small - 18 to 22 pF. You will need to replace the capacitors with two that are matched and within that range.

Yeah. On breadboard, sometime you don't even need any loading caps due to parasitic capacitance. But 47+pf would keep it from working for sure.

Thank you for your answers,

So I managed to burn the bootloader on the atmega328 by using an 1μF capacitor from reset to gnd.
When I try to upload the blink program I get this error:

{

Warning: Board breadboard:avr:atmega328bb doesn't define a 'build.board' preference. Auto-set to: AVR_ATMEGA328BB

}

Followed after a couple of minutes of this:

{

avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x91
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x91
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x91
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x91
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x91
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x91
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x91
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x91
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x91
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x91
Problem uploading to board
}

Also why is the builtin led blinking after the burning?

Also why is the builtin led blinking after the burning?

The "burning" failed. The blinking you see is probably due either to the bootloader, or the program you loaded earlier.