2

I bought some material on the net to start working with Arduino. I didn't want to buy an Arduino, since it costs a bit too much IMHO, so I bought an ATMega328P-PU, and made an Arduino on a breadboard. However, when I use my USBasp to program it it says that he can't set sck period (settings are: Arduino Uno as Board, USBasp as Programmer). It says that it has loaded the bootloader/program anyway, so I tried to go on and ignore it. The blink program can be loaded via programmer, but it doesn't blink (I'm using a small lamp, connecting it directly to 5V and ground works). Here I describe the circuit:

  • First Atmega Pin, Arduino Reset -> 10 kOhm Resistor (Brown, Black, Black, Red, Brown) -> Ground (not GND pin);

  • 1st pin, Arduino Reset -> also to USBasp RST;

  • 7th pin, Arduino VCC -> directly to 5V (and USBasp VCC);

  • 8th, GND -> directly to Ground (and USBasp GND);

  • 9th, XTAL -> to one pin of the 16MHz Crystal Oscillator, and to 22 pF capacitor, which connects to ground (not the pin);

  • 10th, XTAL -> exactly as above, but it's connected to the other pin of the same crystal;

  • 17th, digital 11 -> USBasp MOSI;

  • 18th, dig 12 -> USBasp MISO;

  • 19th, dig 13 -> USBasp SCK, and to the lamp whose other pin goes to ground (neither pin nor direct works), but the lamp needs to be disconnected while loading programs to prevent errors (target not responding);

  • 20th, AVCC, and 21st, AREF -> directly to 5V;

  • 22nd -> directly to ground (not pin).

Nick Gammon
38.9k13 gold badges69 silver badges125 bronze badges
asked Feb 16, 2016 at 15:34
3
  • The can't set sck period message has to do with the USBasp. I get the same message every time I upload. It will still upload just fine. Commented Feb 16, 2016 at 16:38
  • Pin 1 (reset) should have a pull-up to +5V, not to Gnd. Commented Feb 16, 2016 at 21:46
  • With your help, now it works. it was probably the resistor. Now I'm waiting for Mikael Patel's answer, but probably that wasn't the problem. However, it may cause some in the future Commented Feb 17, 2016 at 15:07

2 Answers 2

2

First Atmega Pin, Arduino Reset -> 10 kOhm Resistor (Brown, Black, Black, Red, Brown) -> Ground (not GND pin);

So it's permanently in RESET mode then? How can it ever do anything if you're holding it in RESET all the time?

RESET should be pulled UP by the resistor, not DOWN.

answered Feb 16, 2016 at 15:55
1
  • That was a nice catch! Commented Feb 16, 2016 at 16:06
1

The blink program can be loaded via programmer, but it doesn't blink (I'm using a small lamp, connecting it directly to 5V and ground works).

19th, dig 13 -> USBasp SCK, and to the lamp whose other pin goes to ground (neither pin nor direct works), but the lamp needs to be disconnected while loading programs to prevent errors (target not responding);

The lamp needs to be low power (< 20 mA) to work this way. If it uses more power you will burn the MCU pin.

Use a LED and a resistor instead. Or at least use a voltmeter.

21st, AREF -> directly to 5V;

This is not a good idea. Should be capacitor to ground. See for instance Uno schematics.

Cheers!

answered Feb 16, 2016 at 15:42
3
  • How many Farads? In the schematics I can't find it... By the way, thanks! I'll use my voltmeter. Commented Feb 17, 2016 at 14:47
  • Follow the AREF from the upper right connector and there it is 100nF. For more details avrfreaks.net/forum/capacitor-aref-atmega328 Commented Feb 17, 2016 at 15:19
  • Ok, i need to buy those... I've only got 22 pF ones. Thanks a lot! Commented Feb 17, 2016 at 15:24

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.