Hi all, I borked the microcontroller in my project a few weeks back by programming the fuse bits wrong. Since I have zero money right now, I'm rather interested in reviving it so I can continue development.
I have an Arduino Leonardo that I've been using as an ISP programmer, so I searched to see if I could use it as a high voltage programmer, and I came across Scratch Monkey, which is supposed to emulate an STK500 in ISP, HVSP, or HVPP modes. Unfortunately, I can't get it to do
anything, so I decided that since I just need to reprogram three fuse bytes, I'd just manually drive all the pins and essentially bit-bang the HVPP protocol.
So far, I've not gotten it to work, and I'd like some help debugging.
First off, is this even feasible? How precise does timing have to be for HVPP? Is 1uS between commands too slow?
I'm also confused about actually writing the bytes. The datasheet says that writing 1 clears a bit, and 0 programs it. Does that mean that I have to send, say, 0xE2 as 1110 0010 or do I need to invert it? I'm fairly sure I'm supposed to put the most significant bit on D7, is that correct?
I've noticed that on the PWM pins, when you hold it high or low (which one it is depends on the pin), it seems to actually put a PWM value there instead of hard on or off. I worked around that by writing a 255 or 0 PWM value, but has anyone else noticed this behavior, or is there something wrong?
If this turns out to be possible, I might make the code nice and allow for variable byte inputs, but for now it's just a long, long string of digitalWrites with hardcoded values