Marcel Duchamp wrote: > Maybe the osc clocks the program counter before the programmer gets > started? Yes this is likely what's happening. Most PIC programming specs have a warning that the MCLR pin must be raised from 0 to Vpp within 1uS to avoid the clock starting and advancing the program counter. My USBProg definitely does that, but this is still happening. It's also strange that it happens with the crystal oscillator selected since that has a 1024 cycle minimum startup before it runs the PIC at all. Basically Microchip has a bug. For now the workaround is to force the external oscillator low during programming. I can get my test setup to work fine just be removing the crystal. By the way, the problem is during readback of program memory, not during writing. With the crystal out, I can write random values to all of program memory and read them all back correctly with the config word set to 3FBAh. If I then put the crystal back, program memory reads one word shifted. Removing the crystal causes it to read correctly again. I'm pretty sure that with the crystal connected and that oscillator mode, the PC is somehow getting clocked once on a reset. That would make the programmer think it's reading 0 when the PIC is really sending 1, etc. This doesn't apply to the config address space because a special instruction gets there, not a device reset. It doesn't effect writing since program memory is written with the erased config word, not the value from the HEX file. ******************************************************************** Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products (978) 742-9014. Gold level PIC consultants since 2000. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist