I'm new to Arduino and have been tinkering around getting ready to start a few pet projects. At the moment i'm gearing up to make some standalone arduino's.
I have purchased a few ATMEGA328P-PU microcontrollers (See here for item details) and the seller notes that the microcontrollers are pre loaded with the optiboot bootloader. However they also note that in order to write to these microcontrollers I need to burn them.
Taking a step back and please correct me if I'm wrong but if they are preloaded with optiboot are they not already burnt?
Regardless I figured I may as well learn how to burn them myself and have researched Optiloader and loaded it onto my programmer.
I have setup my Arduino Mega as the programmer and on my breadboard I have wired up everything as per this link.
However when I run the sketch and look at the serial monitor all I get is this.
OptiLoader Bootstrap programmer.
2011 by Bill Westfield (WestfW)
Target power on! ...
Starting Program Mode
It never progresses past this and seems to do nothing. Any idea where I could have gone wrong, I have checked my wiring a few times and everything seems right, the power light is on but no life from the TX or RX LED's
The image is broken. Please post a new one.
The wiring
for a MEGA and a UNO to burn a bootloader is entirely different.
Upload ArduinoISP in the examples in Arduino IDE to your mega.
Modify the following pin connections,Leave everything else as it it.
Yes after reading a little more i realised the pin map was completely different.
MalharD:
The image is broken. Please post a new one.
The wiring
for a MEGA and a UNO to burn a bootloader is entirely different.
Upload ArduinoISP in the examples in Arduino IDE to your mega.
Modify the following pin connections,Leave everything else as it it.
As the error says, please check the connections.
Can you post a photo of the circuit ?
Is the crystal attached ?
Try removing the two caps attached to the crystal.
MalharD:
As the error says, please check the connections.
Can you post a photo of the circuit ?
Is the crystal attached ?
Try removing the two caps attached to the crystal.
Crystal is attached, have tried removing the two caps, no real change, slightly different signature same error code
Is +5v connected to pin 7 and Pim 8 to to GND ?
Connect pin 20 to VCC and pin 22 to GND.
Try connecting a 100u capacitor to +5v and GND.
Power the mega with external supply.
Can you post a photo ?
MalharD:
Is +5v connected to pin 7 and Pim 8 to to GND ?
Connect pin 20 to VCC and pin 22 to GND.
Try connecting a 100u capacitor to +5v and GND.
Power the mega with external supply.
Can you post a photo ?
Ok everything has been connecting except the 100uf capacitor, I dont have any at the moment (awaiting to arrive). All i got is a few 10uf.
The Mega is powered through the USB serial. Correct me if im wrong.
Grd is there to pin 8 (far right white wire)
Current error
avrdude: Device signature = 0xff7fff
avrdude: Expected signature for ATmega328P is 1E 95 0F
Double check chip, or use -F to override this check.
Two or three 10u wil do.
Try removing the two 22p caps.
I was unable to bootload to some of my chips with those caps connected
Try connecting external supply to the mega
MalharD:
Two or three 10u wil do.
Try removing the two 22p caps.
I was unable to bootload to some of my chips with those caps connected
Try connecting external supply to the mega
Thanks for your ongoing support.
three capacitors used still no luck. Also removed the 22p caps and added external power.
I swapped out the microcontroller and the signature went to 000000, from reading WestFW's posts I figured this is due to the controller not sitting right in the breadboard. Played around with it and the signature went back to 0x7f007f.
No worries I'll change out the crystal and I've contacted the buyer for instructions. A mate has my multimeter at the moment but I'll check the circuit again with that.
Given these chips are ATMEGA328P-PU's do I need to change the avrdude.config file or is that just for the ATMEGA328P
PU means only package type DIL (AU, PU, MUR). It is ATmega328P. Do not change config file.
You definitely need 22p caps from XTALs to GND. Switch on detailed log in IDE preferences. Check your wiring. It seems to be badly connected something, broken wire etc. Also, you can check the clock signal if it is present, simply with the DMM. The voltage about 2.5V DC on XTAL1 pin indicates that it is oscillating.
Hmm, I have no such experience. For me, it works exactly as is described in the datasheet. Capacitance depends on the crystal properties but the value is not critical, something between 12-22pF. However, I can imagine that it works without the capacitors. I've built many of these Arduino clone with ATmega1284P and similar, always with the capacitors.