Hi Roman, > After checking all my hardware I realised there > was a software bug, caused by Microchip's shoddy > documentation (Grrrrr!) > > With the 16c505 the FSR register bit7 CANNOT be > cleared. Unlike other PICs. This is not mentioned > in the datasheet anywhere, I found it with the > simulator. Very nasty, the first thing I do on > startup is clear all ram registers, using the > typical FSR loop, and while I know FSR is only a > 7 bit register (bit7 is unused), but whenever you > read it to see where it is up to bit7 reads > as 1. What you've discovered is a part of the low-end PICmicro MCU architecture that *everybody* seems to learn the hard way. In my datasheet, Bit 7 is marked as always being "1" on power up and different processor resets - it doesn't indicate that it can never be reset. ALL low-end PICmicro MCUs will always have the MSB or more MSBs set in the FSR at all times, depending on how many register banks are built into the device. This means that the PIC12C50x, PIC16C505, PIC16C5x will all have one or more FSR bits always set. But, the PIC12C67x, PIC16C55x are mid-range architected parts and the FSR can have all its bits reset to zero. > Very nasty, I don't mind software bugs when they > are my fault, but that annoys me a lot... > I have put big red notes on all the > applicable pages in my 16c505 datasheet. :o( Also make sure you mark the PIC12C50x datasheets as well. myke -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.