Strangely enough, however, I seem to be unable to go back into debug mode now. I can change the fuse that enables or disables DWEN in both Atmel Studio, and avrdude, but it does not enable debugWire. What should immediately happen is that when I set DWEN, I should loose all ISP functionality, but everything is working fine, and on top of that, I cannot connect to it as a debug target. Could manually programming the fuse break it in some way...? That doesn't really make any sense to me.
I'd say you may want to perform a full erase on it, maybe using a high voltage programmer now.
how come though?
Strangely enough, however, I seem to be unable to go back into debug mode now. I can change the fuse that enables or disables DWEN in both Atmel Studio, and avrdude, but it does not enable debugWire. What should immediately happen is that when I set DWEN, I should loose all ISP functionality, but everything is working fine, and on top of that, I cannot connect to it as a debug target. Could manually programming the fuse break it in some way...? That doesn't really make any sense to me.
you would likely have used up all the write cycles.
This doesn't make a whole lot of sense to me. Changing the fuses a couple of times definitely shouldn't use up the write cycles. Plus there is other behaviour that would indicate otherwise.
Generally I'm experiencing some really confusing and intermittent behaviour:
1. Programmed the DWEN fuse to allow debugging which disabled ISP as expected. Debugged and closed, which after some bumpy behaviour swapped back to ISP
2. Was unable to re-enter debugWire even after re programming the DWEN fuse (0x9fF --> 0xDF --> 0x9F) (Which in itself is confusing as programming the DWEN fuse should have blocked any further programming, but it didn't which is super strange.)
3. After sitting for a bit, the microcontroller was all of a sudden was able to go into debugwire mode again.
4. After getting into debug wire, the chip was unable to swap back to ISP even after closing the debug session.
5. After sitting for a bit, the chip all of a sudden was back to being in ISP mode after trying to program the fuse to be 0xDF
6. The chip is now back to step 2: it is unable to re enter debug wire mode.