IAR uses debug wire Atmel Studio dropdown only ISP

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

I have set up an IAR compiler and Atmel visual Studio ver 7.0.122

Using Atmel ICE IAR programs and debugs fine

Atmel Studio won't read the device signature but will read the voltage. 5.3vdc

Failed to enter Programming Mode

It fails after I debug with IAR but IAR continues to work.

SO it has something to do with debug fuse but I don't know how to change that fuse from IAR

and atmel studio cant connect to the chip

 

The dropdown list does not have debug wire only ISP 

I realize now the several mega 48's I thought were bricked work using IAR but no longer AVR studio

so I am happy about that.

 

Any ideas?

Programming mega48

  

 

This topic has a solution.
Last Edited: Wed. Oct 2, 2019 - 10:22 PM
This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Write an empty AS7.0 project. Select atmega48, atmel-ice, debugWIRE.
Start debug session. It will compile, upload to chip, stop at main()
Now choose disable debugWIRE and close.
Your m48 should be in regular ISP mode e.g. Tools->Device Programming.
.
As a silly question: why do you buy a £7000 IAR licence for an m48 chip?
.
David.

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

Going to answer my own question, 

I just tried it, I found IAR has a JTAGICE mkII fuse handler

When You open it it disables the dwfuse

You uncheck the box if you want it to stay disabled and write the fuses

now Atmel Studio can read the chip in ISP

 

I used AVR studio to look at the SPIEN fuse and it is set so when dwfuse is cleared it restarts ISP

Not sure what happens if SPIEN is not checked though.

 

Below from IAR web page

 

Solution

You need to think about the following when using debugWIRE:

  • The bit SPIEN should be enabled before using the "Fuse Handler" in IAR Embedded Workbench for AVR. You can use Atmel AVR Studio to enable this bit.
  • After setting the fuses, switch off the target board power and then switch it on again. Otherwise the fuses will not be set.
  • After using the "Fuse Handler", power cycle the board even though you have not made any changes in it. The "Fuse Handler" will enable the SPI interface by temporary disabling the DWEN bit.
  • In some Atmel documentation it is stated that high-voltage programming is needed to enable the ISP interface. This can be true for Atmel AVR Studio, but not for IAR Embedded Workbench for AVR, where you only need to disable the DWEN bit.

 

Last Edited: Fri. Sep 27, 2019 - 07:06 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I did not, using the 4k limited free addition

I tried IAR when my code vision stopped working on my licensed copy

I was out of programming chips for quite some time just getting back into it.

Im working on a stepper motor project to replace a clutch device on our laminator

as the clutch break is a poor design and when it fails to be tight enough

the material goes through the wrong rollers, I need a sensor and a managed wind up solution.

Also making a pulse oximeter to monitor my sleep, digikey has very nice led's dual red/uv and receivers

used in high end machines. I did build one a while back but next version will connect to my PC.

 

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

david.prentice wrote:
Write an empty AS7.0 project. Select atmega48, atmel-ice, debugWIRE.
Start debug session. It will compile, upload to chip, stop at main()
Now choose disable debugWIRE and close.

 

or if you are feeling brave, use:

atprogram.exe -i debugwire -d atmega48 dwdisable

 

and then open the device programming window and clear the DWEN fuse without touching anything else.

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

metron9 wrote:
Also making a pulse oximeter to monitor my sleep, digikey has very nice led's dual red/uv and receivers

used in high end machines.

fyi, a late-July'19 arrival at Mouser :

MAXM86161 Optical Bio-Sensor - Maxim | Mouser

...

The MAXM86161 Bio-Sensor is specifically targeted for in-ear medical applications, and is optimized to detect Heart Rate (HR), Oxygen Saturation (SpO2), and Heart Rate Variability (HRV). 

...

MAXM86161EVSYS Evaluation System - Maxim | Mouser

 

 

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

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

Wow , nice find, I may have to order one of these when they get them in. 

 

Thanks David, i will try that line of code as well

atprogram.exe -i debugwire -d atmega48 dwdisable

 

 

Last Edited: Fri. Sep 27, 2019 - 02:54 PM