Hi Joe, Thanks for the help. I tried to use the exact code example for writing to ROM and the simulator will erase the ROM but not write data back at all. I tried fiddling with the code, but no joy so something is definitely screwy here. I've been "playing" with it for 30 hours now :-( cheers Tony On Sun, Oct 8, 2017 at 8:09 PM, IVP wrote: > Hi Tony, > > I don't like to think how many undocumented bugs I've had to sort > out for myself and tend to stay away from newly-released micros > > A couple last year involved the 18F43K20, which may be similar > silicon to your 47K40 > > I found that whilst most datasheet examples are *substantially > correct* they aren't always perfect. On occasion I've had to alter > the instruction order or insert NOPs because the silicon doesn't > react fast enough, that sort of thing > > Maybe try something like adding NOP delays to ensure that register > bits are set/cleared before the next instruction > > The first (only ?) errata I could find for the 47K40 is this one > > http://ww1.microchip.com/downloads/en/DeviceDoc/80000713C.pdf > > which doesn't mention EEPROM but does include a NOP solution > I'd already worked out for the 43K20 > > HTH > > Joe > > --- > This email has been checked for viruses by AVG. > http://www.avg.com > > -- > http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist --=20 http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .