best kind regards. please if someone can give some help, I designed a small board based with ATMEL m328p-20 MU bought in China, now I am facing a problem uploading the bootloader and sketch via ICSP, I need to know the right way to load bootloader I don not know if the microcontroller has the bootloader upload, I am getting errors loading them.
What errors are you getting? Can you post for schematic/wiring diagram? Burning the bootloader is normally very simple. All you need to do is hook up your ISP programmer, select the right processor in the IDE, and hit 'Burn Bootloader'.
avrdude: Device signature = 0x000000
avrdude: Yikes! Invalid device signature.
Double check connections and try again, or use -F to override
this check.
avrdude done. Thank you.
the microcontroller is ATMEL m328p-20MU.....I am uploading the bootloader via ICSP
I have to upload the bootloader via ICSP port , and in the usart port I have to communicate with a serial device (RS232). Can I upload the sketch via ICSP? is t necessary upload the bootloader?
You can certainly upload the sketch via the ISP (not ISCP, that is a different protocol) header and an appropriate programmer. But if you can't upload the bootloader it is unlikely you'll be able to upload anything else.
You still didn't answer my question. What are you using for the ISP programmer?
lmorejon:
Can I upload the sketch via ICSP?
Yes. That is done in the Arduino IDE via Sketch > Upload Using Programmer.
lmorejon:
is t necessary upload the bootloader?
Tools > Burn Bootloader does two things:
Set fuses according to the hardware definition of the board you have selected from the Tools > Board menu.
Upload the bootloader.
When you do an Upload Using Programmer it erases the bootloader so in that case the second step of Burn Bootloader is pointless. However, the first step of Burn Bootloader is still important to make sure the fuses are correctly set.
Hi friends thanks for your replies, in the board I have ICSP port (MISO, MOSI, SCK, RESET, +5 V and GROUND) I use this port to upload bootloader , but I dont know what type of microcontroller Atmega 328p choose to load, there are several options, to load the sketch I use Rx, Tx pins of microntroller and use FTDI, but I dont have success loading sketch (blink test).
thanks a lot friends.....the problem was solved......I placed a capacitor 47 uf between +5V and ground (X2 Connector).....and I uploaded bootloader via ICSP and sketch using FTDI......
I'm glad to hear it's working now. You can sometimes get by without decoupling caps but really it's best to always use them because it saves a lot of headaches in the end. 0.1 uF is the typical value.