On Sun, 25 Feb 2007 11:24:39 +0000 (UTC), you wrote: >Mike Harrison whitewing.co.uk> writes: > >> I just figured it out after several hours intense head-scratching - before I >> reveal what it was, I >> wonder if anyone else can guess what was causing it...? > >Read-modify-write due to ICD pins ? >Computer-produced specific electronic noise when simulating that code copling >into circuit ? Almost there with the last one... I needed to run at 3.3v, and so had to use the ICE2000 'power from target' option. The amp was fairly sensitive to steps in the power supply due to using a resistive divder to establish a mid-supply reference, and there wasn't much capacitance on the rails (there are reasons for both of these, and is not a problem normally as it is battery powered and nothing else happens during a read). The emulator was taking a small but very fast current spike when the code reached the 'problem' area. Still not sure why it did it at that particular point - wasn't at anything like an address where a lot of address bits would have been changing. The only obvious thing is it was accessing timer 1 - as the ICE2000 header has a 'T1 Osc' link, I suspect timer 1 may be implemented in ( or at least somehow connected to ) one of the chips on the header, which might explain the sudden current spike. Applying an external 3.3v supply to the emulator power pin fixed it instantly... -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist