atmel ice programming

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

 

Hi guys,

I use atmel ice programmer and Atmel Studio.

I designed a new board which use Atmega2560.Everything was ok.I compile program with arduino IDE and copy hex file and paste it memories tab that located in atmel studio.

Finally i load the program to the my circuit.The circuit is working but it works very slowly.For example the buzzer would be high for 1 second but it loud for 8-10 seconds.

my fuses and lock bits;

extended 0xFD

high 0xD9

low 0xFF

Lock bit 0xFC

CKSEL 8.0mhz 16k+65ms

 

First programming everything is ok(but slow).But when i try it second time it gives a fault(Failed to enter programming mode. ispEnterProgMode: Error status received: Got 0xc0, expected 0x00 (Command has failed to execute on the tool))

I choose in device programming )atmel-ice,Atmega2560,ISP and apply it.It seems ISP clock 125khz.

And i press read button and it gives same error.It doesnt recognize my microprocessor.

I remove my chip and put new one.When i program it first time everything is ok(but still slow working).Then i try second time it gives same error like disposable chip:))Just one programming.

What is the problem?

 

P.s: my crystal is 16 mhz and ground capacitors are 18 pf.And everything is correctly connection.Anyway i can program it for 1 time otherwise i think i would never programm it if i have a connection fail.

 

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

Make sure that the CVDIV8 fuse is unchecked.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

Yes it is uncheck.Anyway when i choose this fuse setting it has already uncheck

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

Your fuses enable the BOD, is your VCC level above 4.5v?

 

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

yes my VCC is 5.0 or 5.1V.

What means BOD?

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

BOD= Brown Out Detector, I think yours was set for 2.7V anyway.

 

Maybe you should show us now how you have programmed your delay. Is it just a simple _delay_ms() or a timer delay?

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

It is just a simple delay command.

But now my problem is different.I can programm my chip just one time.Second time it gives error and not recognize my chip.First of all i would be solve this problem.

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

Please do not double-post! You probably programmed fuses for "External Oscillator" rather than for a crystal or ceramic resonator.

 

Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

Last Edited: Mon. Nov 4, 2019 - 07:49 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Your problem is with setting the lock bits. You're selecting LB Mode 3 which prevents further programming.

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

Show us what you have actually got.  e.g. photo

 

I am brave enough to solder an SMD once (with a soldering iron).   There is no way that I could replace it without destroying the pcb traces.

Even if you have SMD equipment,  pcbs don't like being reworked too many times.

 

If you have a permanent Serial link on your pcb,  it is worth installing a bootloader.   Then you can bury the external programmer.

 

If you want to use an external programmer-debugger e.g. ATMEL-ICE,  it is wise to use JTAG header.   And be very careful not to disable JTAGEN fuse.

 

Regarding your Lock Bits.

In AS7.0 Device Programming->Memories tab tick the [Erase device before programming]

 

This ensures that the Lock Bits are cleared.   Or select the [Erase Now] button.

 

David.

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

david.prentice wrote:
If you want to use an external programmer-debugger e.g. ATMEL-ICE,  it is wise to use JTAG header

If your chip has debug capability, it is folly not to give access to it!

 

Why tie your hands behind your back?!

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The Arduino MEGA2560 uses the JTAG pins as Analog A4-A7 and so it disables JTAGEN fuse.

 

It depends very much on what the OP wants to do.   If it is running Arduino sketches,  it seems wise to buy a MEGA2560 clone board.   Cheaper than making your own board.

 

David.

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

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

Dear guys,

I am programming another my board for 2 years like same fuse settings and i have no problem with atmel ice ISP.But now i try 3 board and 3 atmega2560 chip all of them are working first programming no problem.But when i try second programming it does not recognize my chip.It reads target voltage 5 volts but when i press read button of device signature it gives fault.

I try that without external 16mhz crystal.

I try R8 0 ohm instead of 22 ohm.

The other big board has got same schematic.It is working.

Now last time i try that just place atmega,crystal,c4,c5,c7,c8,c9,c10,r3,c3 and 5 volt power supply.I dont use the other compnents of the board everything is empty.I want to localized problem that hardware or software.But same thing occurs first programming everything is ok second one it is broken i think.When i place new chip  its working just one time.I dont understand.Please help me. it is working like disposable chip :)

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

R11 decreases the crystal oscillator's safety factor.

edit :

AVR042: AVR Hardware Design Considerations

 

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

Last Edited: Mon. Nov 4, 2019 - 03:53 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

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

But i use R11 for 2 years my the other board same system.It is working.

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

gchapman wrote:

R11 decreases the crystal oscillator's safety factor.

edit :

AVR042: AVR Hardware Design Considerations

 

Now i place 0 ohm instead of 27r .Still it does not recognize my chip

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

david.prentice wrote:

Regarding your Lock Bits.

In AS7.0 Device Programming->Memories tab tick the [Erase device before programming]

Have you used [Erase] ?

 

Your schematic looks fine to me.  I doubt if R11 = 22R would make any difference.

However some crystals may be less active than others.   Older AVRs are generally pretty good to oscillate.

I would try with 8MHz RC or with a real 16MHz External Clock Signal.

 

David.

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

Programming once, with fuses set to external xtal, and then not able to program, or read sig, means your xtal is not oscillating!  Why, there are many reasons, poor soldering, bad xtal, wrong caps(mfd,nfd,instead of pfd).

you can recover by injecting an external clock into xtal1 pin, and resetting fuses back to default values.

this also proves no clock above.  Check your soldering, if using water soluable flux, wash the board, the flux is conducive and must be removed by washing and drying the board.

hope this helps.

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...

 

 

 

 

Last Edited: Mon. Nov 4, 2019 - 05:02 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

david.prentice wrote:

david.prentice wrote:

Regarding your Lock Bits.

In AS7.0 Device Programming->Memories tab tick the [Erase device before programming]

Have you used [Erase] ?

 

Your schematic looks fine to me.  I doubt if R11 = 22R would make any difference.

However some crystals may be less active than others.   Older AVRs are generally pretty good to oscillate.

I would try with 8MHz RC or with a real 16MHz External Clock Signal.

 

David.

i cant use ERASE it also gives fault because it is not recognized my chip.just  read a target voltage. I try 2 different xtal one of them RALTRON 16mhz the other one is WÜRTH 16 mhz.Same result :(

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

Search in tutorals forum here for how to unbrick your AVR, for how to recover, but it's the same advise as #20 above!

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

ki0bk wrote:

Search in tutorals forum here for how to unbrick your AVR, for how to recover, but it's the same advise as #20 above!

Jim

 

It is not a problem unbrick my chip.I can replace it easily.But i have to find real problem.Why  can i  program the chip just one time? why second time it gives a fault?

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

cimalt wrote:

why second time it gives a fault?


it quite simple, you changed the chips clock source, but the new source is not working!

Why, see reasons above, but common reasons have already been discussed.

we can not see your set up, at least you have not provided a clear picture, so you will need to research each possible cause and eliminate each one.  Most likely a soldering error or bad component.

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

According to your schematics, the Reset capacitor is 18 pF (same as the crystal caps), which might not be sufficient for reliable ISP.

Normally 100 nF are recommended.

 

Or the given 18 pF are simply a copy&paste mistake in your schematics ...

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

ki0bk wrote:

Search in tutorals forum here for how to unbrick your AVR, for how to recover, but it's the same advise as #20 above!

Jim

That would be:

 

https://www.avrfreaks.net/forum/...

 

If you follow my advice there then if you supply a clock and can do ISP again then before you reset fuses, read the current setting back which might explain why the chip had become un-contactable.