Can't get back to program via ISP after I use set fuses DWEN

Hi,

The robot once worked. I use AVR 4, ATMega328P, AVR dragon with ISP to program. I want to use debugwire so I set DWEN fuse on in ISP mode. After that I can’t start debugging and so I can’t reset DWEN… Now I can’t get back to ISP mode again. Is there any way to solve this problem?

I read from other posts that removing C26 maybe the solution. But I’m not sure if it will affect the function of my robot after removing that. I want to make sure that removing C26 works and there will not be problems with my robot.

Thanks for reading and I’m looking forward to seeing your answer.

Zane

Hello, Zane.

I believe the posts you are referring to are here:

Here’s what I recommend trying to do:

  1. Remove C26, the capacitor on the reset line, so that the debugWIRE interface can function. (The debugWIRE interface is the only way you can hope to talk to your 3pi right now.)
  2. Make sure your 3pi’s batteries are fully charged so that nothing bad happens during programming.
  3. See if you can connect to the 3pi using the AVR Dragon and debugWIRE. If debugWIRE works, then maybe that’s good enough for you and you can stop here. But if you’d like to restore the 3pi to its previous state, then try steps 4-6.
  4. Make sure that your SPIEN fuse is set to 0 (programmed, SPI programming enabled). This is very important because the last customer who was in your situation, jef, tried to disable debugWIRE and after he did that he was unable to program his 3pi at all. I think he might have disabled SPI (aka ISP) programming, or maybe his programming software did it for him automatically when he enabled debugWIRE.
  5. Set the DWEN fuse back to 1 to disable debugWIRE.
  6. You should be able to program the 3pi in ISP mode now, using an AVR Dragon or our Pololu USB AVR Programmer.

Please note that I’ve never used an AVR Dragon or debugWIRE before and I have never touched these fuses, so there might be something I am missing here. Please be very careful, as a wrong move could permanently disable the microcontroller on your 3pi. If anything unusual happens you should probably stop and let us know.

–David

Hi, Ben:

Thanks so much. I can now programming.

Zane

I’m glad you were able to get it working! Did you do all of the steps I wrote? Did you actually have to change the SPIEN fuse or was SPI still enabled from before?

–David