DWEN

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

If I am using the AVRISP MkII in ISP mode and enable DWEN so that I can actually see what the hardware is doing inside the micro will this lock out the chip from being able to program again? I get a warning before I enable the DWEN bit that says doing so will make the ISP interface inaccessible. Is that permanently or just while I'm debugging?

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

The DWEN bit still permits the chip to be reprogrammed through the debugwire interface. However, IIRC, you cannot change the other fuses. You can reenable ISP from within debugwire though, so not to worry.

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

The AVRISP MkII can't talk debugWIRE. You'll need something like a AVR dragon or an JTAGICE MKII. Once you have programmed DWEN you can't reset the fuse with the AVRISP MKII again because the chip has now no RESET pin anymore which is required for ISP programming.

Regards
Sebastian

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

As Sebastian says you are going to be right royally stuffed if you use AVRISPmkII to enable DWEN and then don't have a DebugWire device to switch it back as the ONLY way back (apart from HVPP on an STK500/ST600) is to start a debug session with a dW capable device then use the "switch back" option on the bottom of the Debug menu but this is ONLY available once you start a dW debug session with a dW capable device (Dragon, JTAGICEmkII or ARV One!). If you don't have one of those buy a new AVR and be more careful with the next one!

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

Fortunately I do, I have AVR Dragon and AVRISP MKII. I am using an ATMega88P, at the time I don't think the dragon supported the 88 series, about a year ago. But Atmel noted that future support was planned. I'll have to check and see if the dragon supports the ATMega88P with the latest firmware. Thankfully I didn't sell my dragon as I was going to cause I didn't use it any more!

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

I just checked atmel's support documentation, with the current firmware and version of studio the ATMega88P is supported with ISP and debugWire. I'll have to whip up a cable and header for it. However I didn't see support listed for the 88PA, but from what I understand the PA is simply a process/efficiency improvement, so there are no architectural changes, do you think the 88PA would function correctly as well then? I normally plan to use the 88PA, but am currently using the 88P due to the 88PA's being out of stock everywhere when I ordered the micro's.

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

Quote:
I didn't see support listed for the 88PA, but from what I understand the PA is simply a process/efficiency improvement, so there are no architectural changes, do you think the 88PA would function correctly as well then?
Yes!

When using debugWIRE there are few things to consider:
- Do NOT connect any capacitor to the RESET pin
- The external pullup resistor on the RESET pin must have 10 kOhm or more. (Sometimes it happend to me that my dragon had lost communication when I used a 10kOhm pullup. But since I'm using 15k Ohm I never had any issues anymore.)
- To Re-enable ISP press Cntrl + O in AVR Studio and click on "Disable debugWire" while a debug session is active.

Regards
Sebastian