using an Arduino board as an 'Programmer

Hi to all of you

Im using an Arduino board as an 'Programmer' like shown in this youtube video:

When trying to upload a sketch to the ATmega then i get an Errormessage:

avrdude: stk500_recv(): programmer is not responding

Anyone an idea what im doing wrong?

Please do this:

  • When you encounter an error, you’ll see a button on the right side of the orange bar “Copy error messages” in the Arduino IDE (or the icon that looks like two pieces of paper at the top right corner of the black console window in the Arduino Web Editor). Click that button…
  • In a forum reply here, click on the reply field.
  • Click the </> button on the forum toolbar. This will add the forum’s code tags markup to your reply.
  • Press “Ctrl + V”. This will paste the error between the code tags.
  • Move the cursor outside of the code tags before you add any additional text to your reply.

If the text exceeds the forum’s 9000 character limit, save it to a .txt file and post it as an attachment. If you click the “Reply” button here, you will see an “Attachments and other settings” link.

I hope a pdf is ok. Here the error message:

arduino.pdf (40.5 KB)

No, a PDF really isn't ok. Many people won't download PDFs because they might contain viruses. The line wrapping makes the output incredibly hard to read. Learning to work with text files is an essential skill for a programmer. It's actually easier than creating a PDF.

Try this:

  • Tools > Board > Boards Manager
  • Wait for the download to finish.
  • Click on "Arduino AVR Boards".
  • Click the "Update" button.
  • Wait for the update to finish.
  • Click the "Close" button.

Now try uploading again.

The "Arduino AVR Boards" is grey and i cant click on it.

You missed a step. Here are some more detailed instructions. Please follow them carefully.

  • Open the Tools menu.
  • Click on "Board".
  • Click on "Boards Manager"
  • Wait for the download to finish.
  • Click on "Arduino AVR Boards".
  • Click the "Update" button.
  • Wait for the update to finish.
  • Click the "Close" button.

pert:
You missed a step. Here are some more detailed instructions. Please follow them carefully.

  • Open the Tools menu.
  • Click on "Board".
  • Click on "Boards Manager"
  • Wait for the download to finish.
  • Click on "Arduino AVR Boards".
  • Click the "Update" button.
  • Wait for the update to finish.
  • Click the "Close" button.

Arduino AVR Boards Update is done. Version 1.8.2. but is still showing grey in Tools/Boards

That's normal. The "Arduino AVR Boards" under the Tools > Board menu is just the heading of that menu section. It's not intended to be clickable.

Now try uploading again.

Thers still an Errormessage. :frowning:
I cant upload the Error file for some reason. I will try later.

Hers the new Error-File

Arduino.doc (88.5 KB)

This what im getting now:

Aduino text.doc (43.5 KB)

Ok, the: Device signature = 0xffffff was showing a wire problem this is solved now.
But i still have the ....Yikes! Invalid device signature.

What is the invalid signature?

pert:
What is the invalid signature?

avrdude: Device signature = 0x000000

A strange thing is, when i upload the ArduinoISP-Sketch to the Arduino. Then the LED on the Arduino UNO is on. but as soon i connect the Ground of the Arduino with the Breadboard with ATmega the LED goes off or gets weaker and when i connect an LED to the Pin 19 the LED on the Arduino goes off..

I changed The Breadboard (a new one) and setup everything new on it and suddendly i could upload the Bootloader and my blinking sketch. Have no Idea what was wrong on the old Breadboard.

Now i Uoloaded my servosketch to the ATmega and want to run the servo only with the ATmega un the breadboard. I disconnected the Arduino and put my servo connected it to a exteral vcc5V and GD and the signal to Pin 13 of the Atmega. If i connect Pin6 to GD the Servo should do the Loop shown in the Code down below, but nothing hapens. Did i made a mistake?

#include <Servo.h>
int button1 = 4; //button pin, connect to ground to move servo
bool press1 ;
bool oldpress1 = false;
bool sweep1state = false;
int button2 = 5; //button pin, connect to ground to move servo
bool press2 ;
bool oldpress2 = false;
bool sweep2state = false;
Servo servo1;


void setup()
{
  pinMode(button1, INPUT_PULLUP);
  pinMode(button2, INPUT_PULLUP);
  servo1.attach(7);
  Serial.begin(9600);
  Serial.println(" make servo sweep to 170  and back to 90 when button 1 pressed ");
  Serial.println(" make servo sweep  to 0 and backk to 90 when button 2 pressed ");
  servo1.write(90);              // initialises the servo to 90
}


void loop()
{
  press1 = digitalRead(button1);  // check button1
  if (press1 == LOW && oldpress1 == HIGH) // test if button has been pressed
  {
    sweep1state = HIGH;         // if yes
  }
  if (sweep1state == HIGH)      // button1 has been pressed, sweep to 170 and back to 90
  {
    servo1.write(170);
    delay(2000);
    servo1.write(90);
    sweep1state = LOW;          // sweep accomplished.
  }
  oldpress1 = press1;           //update press1 for next program loop


  press2 = digitalRead(button2);
  if (press2 == LOW && oldpress2 == HIGH) // test if button has been pressed
  {
    sweep2state = HIGH;         // if yes
  }
  if (sweep2state == HIGH)      // button2 has been pressed, sweep 0 to 0 and back to 
  {
    servo1.write(0);
    delay(2000);
    servo1.write(90);
    sweep2state = LOW;          // sweep accomplished.
  }
  oldpress2 = press2;           //update press1 for next program loop
}

When something is going wrong, the key to troubleshooting is to eliminate as many unnecessary variables as possible. With the sketch you're using, the problem could be a bug in the code, it could be that the buttons are not correctly wired, it could be that the servo is not correctly wired.

So you need to test each component individually. Start with a simple sketch that just moves the servo back and forth. You can find one written for you at File > Examples > Servo > Sweep. If the servo moves with this sketch uploaded, then you know the servo is wired correctly and is working.

Next would be a simple sketch to test your buttons. Generally, I would recommend a sketch that reads the button pin and prints the state to the Serial Monitor. But I don't think you have a serial to USB adapter connected to your ATmega328P, so you don't have that output option. Next best would be an LED that turns on or off depending on the button pin reading. If you don't have an LED, then you'll have to use the servo as an output to indicate whether the button is being read correctly.

One common mistake people make when starting to work with bare microcontroller chips is thinking the physical pin numbers are the Arduino pin numbers. They are not. You need to study the pin mapping to know which physical pins on the microcontroller are mapped to each Arduino pin number:
https://www.arduino.cc/en/Hacking/PinMapping168

You can see that, for example, Arduino pin 4 is physical pin 6 on the chip (PD4).

Thank you, and i thought the same thats why i tested my Atmega with the LED Blinkingsketch of the Arduino Libary.
And i also found a Mapping overview like the one you posted.
No i dont have serial to USB adapter. (not yet :slight_smile:

Right now i couldnt manage to do the Atmega the blinking of the LED. But i will try to find the mistake and tell here. What i was not sure is: do i have to change the setup un the breadboard to run the program on the Atmega or can i keep it like when i program the chip. only disconnet pin 13, 12, 11 and10?

Draht:
No i dont have serial to USB adapter. (not yet :slight_smile:

It's a very useful tool to have. You can get them for around $1 USD with free shipping on eBay if you don't mind waiting for shipping from China. Make sure to get one with the DTR or RTS pin broken out so that you can set it up to do the auto-reset during uploads, otherwise you'll need to manually reset the board at just the right time during each upload.

But you can get by with just having an LED or two to blink as output to tell you what is happening in the program.

Draht:
Right now i couldnt manage to do the Atmega the blinking of the LED.

Definitely get that working first before trying anything more complicated.

Draht:
do i have to change the setup un the breadboard to run the program on the Atmega or can i keep it like when i program the chip. only disconnet pin 13, 12, 11 and10?

No, you can leave your Arduino as ISP programmer connected if you like. The sketch will start running right after you do the "Upload Using Programmer". The only reason you would need to disconnect any of the pins is if you wanted to use them in your sketch.