That has been an idea I've been toying around with for quite some time. Recent firmware revisions of the JTAG ICE mkII feature a mode where the ICE can be turned into a standard ISP device, so the user who bought the expensive JTAG ICE doesn't also have to buy a relatively cheap AVRISP in addition.
Alas, the AVR067 documentation didn't prove to be a big help here. In retrospect, I think the only thing it's been right in was that the command code for the encapsulated ISP command is 0x2F, and that the command somehow encapsulates AVRISP mkII commands. In short, this is a mix of using the JTAG ICE mkII communication protocol but actually perform the operations as defined in the AVRISP mkII. Thus, the jtagmkII.c and stk500v2.c modules had to be glued together, somehow. This required to publish some of the interfaces from jtagmkII.c that used to be private so far. A glue layer had to be added to encapsulate the commands, and convert the results. All in all, it hasn't been much work. Using this mode is basically the official way to return a target AVR from debugWire mode. For this to work, the device needs to be connected through the JTAG-to-ISP adapter. Normal JTAG communcation doesn't work though, as setting the /DWEN fuse effectively disables the /RESET pin. I did have some difficulty understanding the official procedure around that, but finally managed to implement it in AVRDUDE. First, the ISP connection attempt fails. AVRDUDE will notice that, and try turning the ICE into debugWire mode. Then, as special reset command has to be sent to the ICE, and the program needs to sign off from the ICE (which will in turn cause the ICE signing off from USB). If the procedure succeeded, it will leave the target AVR in a state where normal ISP connections are accepted. So typically, the same command just needs to be retried later on. -- cheers, J"org .-.-. --... ...-- -.. . DL8DTL http://www.sax.de/~joerg/ NIC: JW11-RIPE Never trust an operating system you don't have sources for. ;-) _______________________________________________ avrdude-dev mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/avrdude-dev
