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).

  • 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. – Gerben Feb 16 '16 at 16:38
  • Pin 1 (reset) should have a pull-up to +5V, not to Gnd. – Nick Gammon Feb 16 '16 at 21:46
  • @NickGammon sorry, I misread the guide... Thanks! – Oxen Eknat Feb 17 '16 at 14:44
  • 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 – Oxen Eknat Feb 17 '16 at 15:07
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.

  • That was a nice catch! – Mikael Patel Feb 16 '16 at 16:06
  • Yeah, I misread the guide... Thank you a lot! – Oxen Eknat Feb 17 '16 at 14:45
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!

  • How many Farads? In the schematics I can't find it... By the way, thanks! I'll use my voltmeter. – Oxen Eknat Feb 17 '16 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 – Mikael Patel Feb 17 '16 at 15:19
  • Ok, i need to buy those... I've only got 22 pF ones. Thanks a lot! – Oxen Eknat Feb 17 '16 at 15:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.