Go Down

Topic: Invalid Device Signature, was working before (Read 1 time) previous topic - next topic

HamzaY

May 25, 2019, 04:01 am Last Edit: May 25, 2019, 04:11 am by HamzaY
Hi i am trying to program atmega328p-au using arduino mega as an isp. I was able to burn boot loader and upload a blink sketch. Which was working.

Later i tried to upload other sketches and i would get invalid signature error with signature being some random value. But after some tries the sketch would upload.

After that signature would always verify and but i would get byte mismatch on location 0x0000.

Now i am getting Invalid Device signature error with signature being 0x000000 always.

My wiring:(it's correct as i did upload blink sketch and bootloader using this)

328p ------------ Mega
15(MISO) -------->51
16(MOSI) -------->50
17 (SCK) -------->52
29(Reset)-------->10------->10k ohm ------->5v

328p is powered using external supply.
All grounds are common.

Help will be really appreciated.
 

pert

Try connecting a 10 uF capacitor between the reset and ground pins on your Mega.

HamzaY

#2
May 25, 2019, 04:20 am Last Edit: May 25, 2019, 04:21 am by HamzaY
Try connecting a 10 uF capacitor between the reset and ground pins on your Mega.
I forgot to mention in the post but the capacitor is already connected between reset and ground on mega. Also a capacitor between 5v and ground of supply is also connected already. Also capacitor does not seems to be issue as i am getting no signature at all. Just blank 0x000000 and it was working before.

HamzaY

Hi i am trying to program atmega328p-au using arduino mega as an isp. I was able to burn boot loader and upload a blink sketch. Which was working.

Later i tried to upload other sketches and i would get invalid signature error with signature being some random value. But after some tries the sketch would upload.

After that signature would always verify and but i would get byte mismatch on location 0x0000.

Now i am getting Invalid Device signature error with signature being 0x000000 always.

My wiring:(it's correct as i did upload blink sketch and bootloader using this)

328p ------------ Mega
15(MISO) -------->51
16(MOSI) -------->50
17 (SCK) -------->52
29(Reset)-------->10------->10k ohm ------->5v

328p is powered using external supply.
All grounds are common.
cap between 5v and ground.
cap between reset and ground of Mega

Help will be really appreciated.
 

dmjlambert

Perhaps during bootloading you set fuses to values that require an external crystal to be attached to the ATmega328p, but you don't have a crystal attached.   

HamzaY

Perhaps during bootloading you set fuses to values that require an external crystal to be attached to the ATmega328p, but you don't have a crystal attached.   
I am using MiniCore atmega328p board library to upload boot loader. I did select 16 MHz external crystal before uploading bootloader.

But the external crystal is attached and working.
I know because of these facts:
1- I checked crystal using oscilloscope before burning boot loader it was working.
2- After uploading bootloader i also successfully upload blink sketch.
3- Blink sketch was working.

dmjlambert

Are you trying to upload the next sketch using serial via the bootloader, or continuing to use the mega as ISP?

HamzaY

#7
May 25, 2019, 05:08 am Last Edit: May 25, 2019, 05:10 am by HamzaY
Are you trying to upload the next sketch using serial via the bootloader, or continuing to use the mega as ISP?
While using mega as isp i am trying to upload through 'upload using a programmer' option.

Also sorry for late reply i can post 1 reply every 5 min.


dmjlambert

OK I just wanted to make sure you weren't trying to use serial and the bootloader to upload, such as through an FTDI adapter or something like that.   It would add an additional thing to troubleshoot.  Plus whenever you upload a sketch such as the blink sketch via programmer, it removes the bootloader from the ATmega328p.   That is OK, because when you're uploading a sketch with a programmer, you don't need the bootloader anyway.   It is still good you did the burn bootloader step, because that is when your fuses are set.  

Anyway, it seems to me you may have an intermittent problem, which is annoying.  Many things  could be causing that.   Bad wiring, something wrong with the soldering, power supply, circuit design, etc.   It is probably time to show us a full schematic of your circuit or board, and perhaps a good clear photo of the board.  

Robin2 made this guide that you may find useful, to include displaying the picture in your post, instead of just plain upload that shows a link.   https://forum.arduino.cc/index.php?topic=519037.0
It is not mandatory, but it may increase the audience that will participate in trying to help you troubleshoot.   

pert

bump
Really? A bump after 12 minutes? That's not how things go here. You'll only make it less likely for you to get help with that sort of behavior.

From the "How to use this forum" post:
Quote
13. Forum etiquette

Once you have made your post, here are a few other guidelines:

Don't cross-post!

We know you are anxious to get an answer to your problem, but re-posting the same question to multiple parts of the forum causes duplicate effort, and divides the focus on your problem. You'll get a better answer if everyone can discuss it in one place. Cross-posting is very annoying; the moderators will delete your extra posts, and you will get a warning. Save all the hassle, and just post the question once. It will be noticed.

If you aren't sure what section to post in (Programming Questions, Electronics, etc.) make a guess. Don't cross post "just in case".

Don't bump!

Don't bump your thread after an hour. Because of the different time-zones the person who knows the answer may be asleep, or away for the day. Maybe after a couple of days.

If your question didn't get an answer, honestly review it to see if you posted enough information to help people answer you. Did you even ask a question?
You already broke the first two rules! Please take the time to read the "How to use this forum" post.

HamzaY

#11
May 25, 2019, 06:13 am Last Edit: May 25, 2019, 06:49 am by HamzaY
Really? A bump after 12 minutes? That's not how things go here. You'll only make it less likely for you to get help with that sort of behavior.

From the "How to use this forum" post:You already broke the first two rules! Please take the time to read the "How to use this forum" post.
After my first post i realized that i had posted in wrong section and someone replied to that post so i did not wanted that post to be deleted in case he chose to reply again. I understand the rule now and will delete the other post.
Also i will also keep rule about bump in mind.
Edit: this is my first time posting on arduino forum i think only moderator can delete the post correct me if i am wrong.



OK I just wanted to make sure you weren't trying to use serial and the bootloader to upload, such as through an FTDI adapter or something like that.   It would add an additional thing to troubleshoot.  Plus whenever you upload a sketch such as the blink sketch via programmer, it removes the bootloader from the ATmega328p.   That is OK, because when you're uploading a sketch with a programmer, you don't need the bootloader anyway.   It is still good you did the burn bootloader step, because that is when your fuses are set.   

Anyway, it seems to me you may have an intermittent problem, which is annoying.  Many things  could be causing that.   Bad wiring, something wrong with the soldering, power supply, circuit design, etc.   It is probably time to show us a full schematic of your circuit or board, and perhaps a good clear photo of the board.   

Robin2 made this guide that you may find useful, to include displaying the picture in your post, instead of just plain upload that shows a link.   https://forum.arduino.cc/index.php?topic=519037.0
It is not mandatory, but it may increase the audience that will participate in trying to help you troubleshoot.   
This is the circuit. Black lines are used to represent a connection or a wire.


This pcb was originally made for 328pb-au instead of 328p-au that i am using now. I modified the circuit according to 328p-au pinout.

Picture of overall system little messy but wiring is correct checked many times.


This is mcu on my pcb


Breadboard


Arduino



dmjlambert

I suggest using the method Robin2 made in that article I mentioned, to include displaying the picture in your post, instead of just plain upload that shows a link, or worse yet text that looks like a link that somebody trying to help you would have to copy and paste into a separate browser window.   I suggest make your posts easier to follow for those who may want to chime in.   By the way, I did notice you making a post offering a tip on another post, kudos and it is great to see you're able to contribute.   

dmjlambert

Good improvement on the posts, thanks.   It would be good to improve the schematic a bit, so we understand the corrections made by the black lines. 

dmjlambert

Do you have both VCC pins and the AVCC pin connected to the power supply, and all 3 grounds connected to ground?   I can't tell from the pictures.   
Do you have 0.1uF decoupling capacitors connected close to the VCC and ground pins?  I think other folks will point out those are important to include and I don't see them in your schematic.   

Go Up