Go Down

Topic: Burn bootloader atmega328p-au (Read 1 time) previous topic - next topic

Ahacker

So i have been trying to burn bootloader to a new atmega328p-au. I have connected the ic to a circuit with 16mhz crystal and a resister between vcc and reset. I have a arduino mega and a raspberry pi 2. I tried burning the bootloader using the arduino as isp but the ide keeps saying invalid signature. I have changed the signature to 14 in the avrdude.config.  Please help

ron_sutherland

Not sure I understand your setup, are you trying to use the Mega as an ISP tool (e.g. loaded with the ArduinoISP sketch) and controlled by the Raspberry Pi. Or are you saying those are the two options you have for use as an ISP tool?

This instruction looks reasonable for using the Pi as an ISP tool, though I did not dig into it.

http://ozzmaker.com/program-avr-using-raspberry-pi-gpio/

Perhaps post an image of your setup (may need to be a png format for the forum to accept).
my projects: https://github.com/epccs

DrAzzy

#2
Sep 27, 2016, 10:42 pm Last Edit: Sep 27, 2016, 10:48 pm by DrAzzy
Enable verbose upload - that way you'll see what signature it's getting. 0x000000 = wiring problem or crystal not connected correctly; I'm almost certain that's what you're getting.

Are connections to the bare chip correct? That doesn't sound right at all.
The minimum for bootloading at 16mhz:

16mhz crystal on XTAL1 and XTAL2 pins.
Ceramic capacitor (of value specified by the crystal - 20pf is common) from XTAL1 to ground and XTAL2 to ground.
Ceramic capacitor, 0.1uf between Vcc and Gnd, and another between AVcc and Gnd. These must be located *right* *next* *to* *the* *chip*, and they must be ceramic caps, and they must be around 0.1uf.
AVcc should be connected to Vcc.
AREF should not be connected to Vcc.

To make autoreset (and hence programming over serial) work normally, you also need 10k resistor from reset to Vcc, and a 0.1uf ceramic cap from reset to the DTR pin of the serial adapter.
ATTinyCore for x4/x5/x61/x7/x8/x41/1634/828/x313 megaTinyCore for the megaavr ATtinies - Board Manager:
http://drazzy.com/package_drazzy.com_index.json
ATtiny breakouts, mosfets, awesome prototyping board in my store http://tindie.com/stores/DrAzzy

Ahacker

Ok so i have connected the crystal but how am i supposed to check if its working. N i don't have those capacitors along the vcc n gnd only caps i hav is on the crystal

DrAzzy

#4
Sep 28, 2016, 04:57 pm Last Edit: Sep 28, 2016, 04:57 pm by DrAzzy
how am i supposed to check if its working.
By trying to burn bootloader to it again and seeing if it is successful this time?

i don't have those capacitors along the vcc n gnd
Well then, that answers your first question: It's not working, because you do not have the decoupling caps installed.

You really do need those - the chip will be unreliable without them (I've seen random resets, random failure to program, chip resetting when analogRead() is called - all sorts of stuff).
ATTinyCore for x4/x5/x61/x7/x8/x41/1634/828/x313 megaTinyCore for the megaavr ATtinies - Board Manager:
http://drazzy.com/package_drazzy.com_index.json
ATtiny breakouts, mosfets, awesome prototyping board in my store http://tindie.com/stores/DrAzzy

Jiggy-Ninja

I have changed the signature to 14 in the avrdude.config.
I don't see that anyone else noticed this, but this was probably a bad idea. Change it back.
Hackaday: https://hackaday.io/MarkRD
Advanced C++ Techniques: https://forum.arduino.cc/index.php?topic=493075.0

DrAzzy

I don't see that anyone else noticed this, but this was probably a bad idea. Change it back.
Most definitely. I noticed it, but I forgot to comment on it.
ATTinyCore for x4/x5/x61/x7/x8/x41/1634/828/x313 megaTinyCore for the megaavr ATtinies - Board Manager:
http://drazzy.com/package_drazzy.com_index.json
ATtiny breakouts, mosfets, awesome prototyping board in my store http://tindie.com/stores/DrAzzy

Go Up