ATMEGA48P and Device Signature

Go To Last Post
25 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

I hope somebody can help me... I built my own board that mounts an ATmega48P. The chip is new, I didn't burn the fuses. When I try to read the Device Signature I receive the error "

Failed to enter programming mode. ispEnterProgMode: Error status received: Got 0xc0, expected 0x00 (Command has failed to execute on the tool)

Unable to enter programming mode. Verify device selection, interface settings, target power, security bit, and connections to the target device."

Timestamp:    2021-04-23 15:24:45.973
Severity:        ERROR
ComponentId:    20100
StatusCode:    1
ModuleName:    TCF (TCF command: Device:startSession failed.)

 

I read the previous posts regarding this issue, but I didn't find any workable solution.

I verified the SPI connection (MOSI, MISO and SCK) from the MCU pin up to the 10pin flat cable.

The RESET pin of the MCU is pulled up to +5V through a 10kohm resistor.

I changed the +5V voltage supply to another one. The GND is well distributed on the layout.

I changed the MCU to a new one.

I changed the USB cable with a new one.

The programmer ATMEL ICE seems in good condition and the led switch properly.

I use Microchip Studio 7

 

Anyone has some solution to suggest?

 

 

 

  

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

did you apply power to the chip? the ISP is not going to do that for you.

Did you make sure the programming speed is not to high? it should be 125KHz or less.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi Meslomp,

The voltage on Pin7 (VCC), Pin20 (AVCC) and Pin21 (AREF) is OK. I tried with several frequencies: 125kHz and lower up to 10kHz, but the result is always the same: no SPI communication. 

Right now I verified by oscilloscope that after pushing the button of Device Signature, the RESET is pulled low to ground by the programmer (it's right), but the signals MISO and MOSI don't change.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Show the physical ISP header you are using, a 6 pin type or other? Looking at the header from the wrong side is "common".

John Samperi

Ampertronics Pty. Ltd.

https://www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi.

the programmer/ATMEL_ICE reads 4.9V, so I suppose that the wiring between MCU and programmer is right. I attach the pinout on my board with some reference pictures. I verified the continuity of the connection between MCU pin and 10pin connector (programmer side). It seems OK.

Initially the RESET line is around 1.21V, after pushing the Device Signature button, this signal falls down to 0.48V (attachment). According to the DS in this period the programmer should start the communication through the MOSI line, but on this line I don't measure any waveform.

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

We'd like to see a better image of the actual PCB. Maybe a screenshot from your CAD program?

 

The photo above doesn't show the actual connector, it's not on the underside of the board is it?

#1 Hardware Problem? https://www.avrfreaks.net/forum/...

#2 Hardware Problem? Read AVR042.

#3 All grounds are not created equal

#4 Have you proved your chip is running at xxMHz?

#5 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand."

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

I disabled the other stages, only the MCU (ATMEGA48P) is powered. Temporary I apply the voltage supply from an external source that provides a stable signal. The reset line is pulled up to +5V by a 10Kohm resistor, this circuitry is implemented by an external carbon PTH resistor. I didn't connect any 100nF capacitor between RESET line and GND, I think that for this purpose is not necessary.

It's a 2-layers board. I attached a section of the layout, I hope it's enough to find some issue.

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0


Why are your gnd(s), traces?  this should only be a gnd pour!

Your power trace from one side of the chip to the other is too small!

Why is AREF connected to AVCC, AREF should only have a 100nf to gnd, as connected, a bad program will damage the chip as wired.

The circled traces with angled traces from pads are too close to adjacent pads.

Show us a picture of your programmer connected to the board, as stated above, it may be you have your ISP on the wrong side of the board. (thus your connections are backwards)

Jim

 

 

(Possum Lodge oath) Quando omni flunkus, moritati.

"I thought growing old would take longer"

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

it may be you have your ISP on the wrong side of the board

That's what it look like ie Reset should be pin 5 as shown but only if the ISP connector is put on top of the board (same side as the chip) and not underneath.

John Samperi

Ampertronics Pty. Ltd.

https://www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi Jim,

really thanks for your suggestions. There are several points to improve in the next proto.

I attach a new picture with the 6pin ISP header connected to the board. The problem persists.

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Is the Red trace cable going to pin 3 (middle pin)? It seems to be the case with my ICE.

 

Also I hope you have the ribbon cable connected to the AVR socket and not the ARM socket....just in case.

 

Sorry but I have run out of ideas. blush

John Samperi

Ampertronics Pty. Ltd.

https://www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi John,

yes, the flat cable is original and the red cable is pin3 (SCK) of the 6-pin header.

The 10-pins header is plugged to AVR socket (see photo).

 

Today I ordered some PTH components and I am going to assemble a basic circuit on breadboard. I will tell to all of you the result.

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 

That is a bit of a goofy schematic---aren't the connector pin numbers important?  Where is the reset signal???!!?

Now you see what you can end up with when using this approach---much head scratching

 

 

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

Last Edited: Tue. Apr 27, 2021 - 05:55 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi, today I received the PTH components and I wired a basic circuitry on breadboard (see attachments). Unfortunately the result is the same... no communication. To remove any doubts, I used a new ATMEGA48P. Any suggestion? 

 

 

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

#1 Hardware Problem? https://www.avrfreaks.net/forum/...

#2 Hardware Problem? Read AVR042.

#3 All grounds are not created equal

#4 Have you proved your chip is running at xxMHz?

#5 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand."

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 

It is EXTREMELY easy to get things 180 deg spun or mirrored upside down when just plugging wires into an isp cable (or to make a bad connection...plug in a header and SOLDER wires to it....do NOT just stick wires into the connector).  From the i it appear that maybe you are using a jheder...cant tell

 

 

Make sure you follow this exactly & don't get it upside down or rotated 180    Is the cable from the ICE known good?  I have had several go bad from all the tugging!!!  try pluggin direct to the ice throw the cable aside.

 

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

Last Edited: Thu. Apr 29, 2021 - 03:31 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

I checked carefully your suggestion and notes. I applied them on my breadboard and the result is the same.
I decided to buy demo-board mounting the ATMEGA328P. Moreover I replaced the power supply with a new one. In this case the system is completely new except ATMEL ICE+cable and the PC+Microchip_Studio. I tried and... the result is the same, same kind of failure.

I exclude the PC+Microchip_Studio because I made a test also on another PC. Therefore the only stage that could have a problem is ATMEL ICE+cable. Does it has sense?

I communicated/programmed several chips with my own board, after suddenly it stopped to work.  

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It looks like you have connected the ATMEL-ICE ribbon correctly.

It looks like you have a regular Uno clone board.

The LED is green.  So the Uno is receiving power from the external jack.

 

I would expect the ATMEL-ICE to read the Uno's VCC and Signature from AS7.0.

 

If you get an error it implies your ribbon is faulty.   (I assume that it is a 100% working Arduino Uno)

 

Seriously.   You rely on having good Tools.   Treat the delicate ribbon carefully.   Replace a faulty ribbon.

 

I am happier with 2.54mm headers.   Receive standard ribbons or Dupont cables.    Ribbons are more reliable than Duponts.

If you have a custom header,   make a custom Adapter with header strip and Protoboard.

 

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Sadly, sounds like you programmer ICE or cable is kaput...the cables go bad often...did you try a spare?

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You said  "Initially the RESET line is around 1.21V". It should be near Vcc before of the Tool use.

Rgds

Milan

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

the ATMEL ICE kit includes another ribbon (see photo). I used it and the failure persists, therefore the only item that I didn't replace is the programmer. It's new and I handled it carefully. I checked the PCBA and by a draft visual inspection it seems in good condition.  Do you have news that it can break easily?

I don't have any other clue to fix this problem. Do you have some suggestion?

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Didn't the ICE came with a cable with a 6 pin header as you show in #12? The "octopus" cables are easily misunderstood and miswired.

John Samperi

Ampertronics Pty. Ltd.

https://www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Isn't there a selftest command in the atprogram utility for atmel ice? Maybe some experienced freak can help you with that if that thing works.

I never used it. Don't know much about it. Caution - use at your own risk.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ARE YOUR WIRES 6 & 9 SWAPPED???...THE NUMBER MARKINGS ARE GARBAGE IN THAT REGARD (count wires)

 

Do you have a cheapo programmer you can try (instead of the ICE)?  That might give some clues about cables, connections, PC, power, studio , etc.

If it works with the cheapo programmer, then that tells you something.

 

Open up the ice & will all power removed, try ohming the connections from the ICE PCB to the processor pins...do they all check good & proper?

 

I don't have the ICE, but is there some ICE config menu that needs setup/adjusted that has been overlooked?

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

Last Edited: Fri. May 7, 2021 - 06:52 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The 1st thing that needs addressing is the question in #20, if it's really 1.2V WITH or WITHOUT the ice being plugged in then there is a wrong connection.

 

The next question that needs answering is in #9. It looks like that the connector's PCB is correct but the connector itself was mounted at the bottom of the board. This could have damaged the ICE.

John Samperi

Ampertronics Pty. Ltd.

https://www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly