I have a strange problem trying to use the JTAG ICE 2 with a Mega640. Both are new to me, so perhaps I'm doing something stupid here.
The ICE will program the chip on the JTAG interface, no problem. Fuses, Flash, EEPROM, everything. It all verifies and I can see the program running correctly (there's a display on it). But it will not EMULATE! The ICE thinks the chip is completely erased, 0xFFFF at every location. It isn't erased - if I disconnect the ICE, the program runs again. But it won't do a damn thing with the ICE connected. Trying to reset kicks the thing into RUN, only it doesn't run, it does nothing. Breaking in always finds the program counter at 0x7FFF, gives me the disassembler view and reports that every address is 0xFFFF.
So I'm asking here if anyone else ever saw this particular problem, and whether you think it's the chip or the ICE at fault. I'm about to change out the CPU, because I can - if the ICE is broken there's not much I can do about it.