Tool chain disaster

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


Newbie needing a little help please. (Apologies if this has been posted on another link, please let me know if this is the case...) I'm really struggling with this!

 

I have a Atmel Ice, running Atmel Studio, and trying to program an ATMEGA328p. My toolchain has worked previously but stopped. 

 

I am getting an error message:

 

 

I have tried:

1. Checking connections...

2. Replacing the ATMEGA328p chip (incase I've somehow bricked it...)

3. Reinstalling Atmel Studio

4. Buying a new Atmel Ice programmer!!!

 

I know the code is fine... As I've tried loading literally an empty project with nothing but an empty while loop...

 

 

I think the wiring is fine (although would be extremely embarrassed if it's not...)

 

 

 

So,... Think it must be an Atmel Studio problem... ???

 

Any thoughts?

 

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

Your 7805 regulator requires capacitors in order to work correctly. As well, you need some bypass capacitors on the mega328. Just because it worked before, doesn't mean it should work again. This would be my first port of call.

 

FYI 'toolchain' refers to the compiler and associated programs. 

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

It doesn't look like you have ground on pin22.  Post how you think it should be wired.

 

David

Last Edited: Sun. Nov 10, 2019 - 12:53 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Also, have you used debugWire to debug the chip? If you didn't exit debugWire correctly then you can also see this behavior...

:: Morten

 

(yes, I work for Atmel, yes, I do this in my spare time, now stop sending PMs)

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

Why would you build something like this without all the filter capacitors?  

You buy a new programmer, but can't buy 30 cents worth of critical caps?  Pay close attention to what you are doing!

 

Why is the chip plugged into a socket?  It should plug into the breadboard...cut the potential problems (bad connections) in half.

1) What voltage do you measure from the regulator?  ...it needs caps regardless

2) Be careful when plugging into the ISP by hand...you can easily get the numbering upside down, reversed, mirrored, inverted etc.  Remember it is 1 3 5 on one side and 2 4 6 on the other NOT like a dip chip.

 

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

Last Edited: Sun. Nov 10, 2019 - 05:23 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Arduino nano's are SO much easier and cheaper then bare chips for use on a bread board, and has ALL the needed caps, xtal, and voltage regulator too!

Jim

 

Click Link: Get Free Stock: Retire early! PM for strategy

share.robinhood.com/jamesc3274
get $5 free gold/silver https://www.onegold.com/join/713...

 

 

 

 

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

Thanks all for the comments. I have introduced the capacitors on the LM7805 and have a capacitor on pins 7 & 8 of the ATMega328p (all new capacitors). I have further connected pin 22 to ground. Unfortunately this has not fixed the error message.

 

I believe the connections are correct as I have a prototype board wired (self made but tried and tested) with all the necessary connections which is not working either...

 

Is it possible the chip is in Debug wire mode, noting the command under the Debug menu 'Disable DebugWIRE and Close' option is grey (anavailable))

 

I am also wondering if I have inadvertently set a fuse... However as I can't talk with the chip, I cant see the settings...

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

Try to start a debug session over debugWire. If it works, then the chip is in debugWire mode (and while in the debug session, the Disable debugWire option is available)

:: Morten

 

(yes, I work for Atmel, yes, I do this in my spare time, now stop sending PMs)

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

1) What voltage do you measure from the regulator?  (to the AVR)

 

Also, set your ISP programming clock rate to the lowest slowest possible setting---long poor wires can have trouble at higher speeds

 

plugin cables & sticking in wires can easily lead to reversals....ohm out from the  ICE ISP connector pins to your AVR PINS, to check for any reversals

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

Last Edited: Mon. Nov 11, 2019 - 08:44 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I believe the connections are correct as I have a prototype board wired (self made but tried and tested) with all the necessary connections which is not working either...

 

a schematic or even just a connection list will allow others to confirm.  Assuming all correct, then a faulty ribbon cable can cause the 0xC0 error as can a number of other things.

 

Post your schematic!

 

 

David 

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

 

I'm assuming you didn't forget to hit the APPLY button (I believe you need to do this to actually make the connection):

Or perhaps you are hitting it & then immediately get the error.

I always hit apply, then read signature, before I try writing (programming) to the chip...don't want to program with noise/garbage & lock the chip up.

 

If your regulator is providing 5V, but the ice is selectable & you have it set for 3.3V , there will be issues (though I don't think the ice has that feature, but if it does....)

 

As mentioned...those cables go bad & I have had that happen.  Try a spare, if you can.  I've had those breadboards where a few holes didn't make contact*...that was fun (but wouldn't explain your "working board" failing).

 

   * also, the bottom is often "paper"---sometimes leads or the internal connecting strips can wear through to the metal plate (if mounted to a base plate)...another fun investigation

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

Last Edited: Tue. Nov 12, 2019 - 09:00 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

avrcandies wrote:
If your regulator is providing 5V, but the ice is selectable & you have it set for 3.3V , there will be issues (though I don't think the ice has that feature, but if it does....)
The ICE sense the target Vcc and auto-adjusts.

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


Hi all,

Again appreciate the assistance..

 

A couple of points;

- the output voltage from the lm7805 going into the Atmega328 is measured at a steady 4.99 - 5.00V.

- Unfortunately since I cannot communicate with the circuit in the first place, I cannot start in Debug wire mode. I assume that I couldn't have set anything previously that would impact a new connection, however, I am now getting this message...

 

 

Is it possible that I have incorrect default fuse settings in Atmel Studio? I understand from other forums this would usually indicate a wiring problem, but i'm positive its not in this case here.

 

 

 

David, 

Your comments regarding a faulty ribbon resonate.

It is the last part of the hardware that I feel could require further review. I have a new part on express order for the next couple of days and am looking forward to matching wires to the right chip ports! Figures crossed... 

 

Thanks all,

 

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

Your comments regarding a faulty ribbon resonate.

Did you try ohming out from the ISP CE connector PCB pins over the the AVR chip pins?

  vtgt to Vcc

  gnd to gnd

  mosi to mosi

  miso to miso

  rst to reset

  sck to sck 

 

check each & wiggle the cable around while doing so.  This tests both the cable & your pin numering.

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

I understand from other forums this would usually indicate a wiring problem, but i'm positive its not in this case here.

 

It looks a very simple setup so post the schematic and we can try to spot the problem.  The ribbon cable is less likely to be the cause.

 

David 

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


Hey all,

 

Thanks for the tips! Ohming is a great tool and one that I'm ashamed I didn't fully appreciate.

 

Unfortunately, after mapping my wiring from the Atmel Ice Connection point to the chip pins,... I haven't come across any bad connections.

 

In the process I have mapped all the connections. I realize that this isn't a schematic however please see the attached jpeg that I created while completing a tracing exercise on each run. This is my current setup, not necessarily the correct wiring... ... ...

 

Im still really confused... Could this be an Atmel Studio problem?

 

 

 

 

 

 

 

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

Your pin numbering is incorrect but the connections themselves look right.  I suggest you buy https://www.amazon.co.uk/gp/prod... or similar which has an ISP connector so you can check out your ICE. Take out the one on the UNO as it is programmed with Arduino bootstrap and plug in your chip.

 

David

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

Thanks David,

 

Is this likely to help? I have a number of ATMega chips that have been previously programmed that will not work in this configuration. I am unsure why everything has stopped working now?

I am a little suspicious of Atmel Studio... However, this problem has occurred on two separate PC's with independent versions of Atmel Studio... (?) 

 

  

Can I ask why you think my numbering is incorrect. I'm hoping I have made a silly error and repeated it many times.

 

Noted that I have traced every wire very carefully to get to the configuration detailed in the jpeg... This is the setup I am running...

 

David

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


When you ohmed out did you follow the ICE pin out?  Why are you not showing your connection numbering?

For example pin 1 on the ice should ohm out to isp pin3

 

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

 

 

 

Hi David,

 

Your pin numbers do not follow the actual pin numbers as below however the connections look correct.

 

 

The reason for suggesting an Uno is that would be a known good platform to test your ICE.

 

David

 

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

 

I'm still really confused... C

Note your isp connector labeling is wrong...pin numbering is not 123456 like a dip.  It is:

 

1 3 5

2 4 6

 

Also, you've already muddled the waters by not using the Atmel ISP pin numbering--WHY?

MISO  should be pin 1

SCK    should be pin 3

RESET should be pin 5

VTG    should be pin 2

MOSI  should be pin 4

GND    should be pin 6

 

This doesn't mean your wiring is wrong, you just add an unneeded confusion factor!

 

 

However the ICE connector on the box is not marked (WHY Atmel, WHY)...you have to use their cable  diagram to figure out which pin is which on the box

 

Here is the diagram supplied by Atmel...note that in this case the red wire will not be pin 1! (why oh why)

 

 

So when this plugs in (notch on top) it looks like pin 1 will be on top right of the box and pin 2 will be on bottom right of the box (according to the above ribbon cable)..They really need to clearly mark the box with some numbering.

Have you found a picture that shows the physical box numbering?  That's what really matters.

In any case, your connector does not seem to be connecting to the top right box pin....might be worth a check

 

 

 

 

 

 

 

 

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

Last Edited: Sat. Nov 16, 2019 - 07:23 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

From post #16:

 

AVcc (pin 20) should be connected to Vcc,  Gnd (pin 22) should be connected to Gnd,

and a 0.1uF bypass cap should be connected between AVcc and Gnd.

 

Also, it is good practice to add a 4.7K to 10K pull-up resistor between Reset and Vcc.

 

 

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

Assembling the Atmel-ICE | Atmel-ICE

...

Be sure to orient the cable so that the red wire (pin 1) on the cable aligns with the triangular indicator on the blue belt of the enclosure.

...

"Dare to be naïve." - Buckminster Fuller

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



so that the red wire (pin 1) on the cable 

but ...the official Atmel guide shows pin 1 is NOT the red wire...(why oh why)

 

from page 15 of the manual:  http://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-ICE_UserGuide.pdf

Could they be any more conflicted? There are some posts indicating somehow they foot things backwards.  I suppose try one way & try the other...one should work.

 

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

Thank you all for your comments.

 

I have really struggled with this and finally found the solution (but I'm still at a loss as to what is happening, and would love some insight!!!)

 

How the problem has been fixed:

1. I replaced the ATMEGA328P with a ATMEGA168 chip and found that a new project (created for a ATMega168) was able to connect to the chip!!!

2. Inserting a brand new ATMega328P still could not communicate with the Atmel ICE (using a new project for a ATMega328P)

3. Attaching a 16mHz Crystal to the ATMega328P now allows communication between the Atmel ICE and the ATMega328P

 

I have been doing this for some time now and realise it is best practice to have a crystal in place, however, I never used one in the past and never had this problem.

 

Is there something in the Atmel Studio compiler settings that might be causing this problem? 

 

Am I missing something here? 

 

Thanks,

 

 

 

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

Read the fuses and see what clock is set to.

 

David

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

Quite a few 328s are sold preprogrammed as "Arduino CPUs" which means the flash already contains bootloader code and the fuses are preset to expect a crystal (most probably 16MHz)