On Thu, 28 Aug 1997 09:56:55 +0000 Lawrence Lile writes: >PIC-nikkers: > >What happens to the OSCCAL number when you UV erase a windowed >PIC12C508? Is the OSCCAL even programmed into windowed parts in the >first place? It is erased. The cal value is merely a MOVLW instruction in the highest program address. (The MPLAB/PICSTART software doesn't allow storing an instruction there, but physically the EPROM is continuous.) After a reset, the 12-bit core sets the PC to all ones, which causes the MOVLW to be exectuted first. The PC then rolls over to all zeros, where the first user instruction is stored. Without the cal value instruction, the W register would be undefined after reset, so assuming it has a cal value will cause unpredicatble results. As part of the manufacturing process, the factory determines the correct value and programs it into the EPROM, leaving the rest of the EPROM blank just as if it were a plastic chip. Everything about a window chip is exactly the same as an OTP one except the package, and additional testing so it is qualified for all oscillator settings. Before erasing the chip the first time, read the factory's value out and remember it for future reprogrammings.