Darwin Hawes (hawes@physics.ubc.ca) wrote: >I am using a windowed PIC16C56 with a 32kHz oscillator. The power >drawn when the window is open is a nice 15uA, but when I put a piece of >black electrical tape over the window, the current consumption rises by >a factor of 20. Does anyone have any idea why this is happening? All >unused pins are grounded or pulled high. Darwin: Aaron had a good suggestion -- it's likely that you've failed to initialize some registers, so your code isn't behaving properly when the window's covered -- but the code he showed was for the 16C57. For your 16C56, use the following: USEFSR EQU 0 FSR EQU 4 PORTA EQU 5 MOVLW PORTA ;PREPARE TO ZERO ALL REGISTERS EXCEPT MOVWF FSR ;THE FSR, RTCC, PC, AND PROCESSOR STATUS ;REGISTERS. CLRRAM CLRF USEFSR ;ZERO A REGISTER. INCFSZ FSR ;HAVE WE DONE THEM ALL? GOTO ZEROEM ;IF NOT, LOOP BACK AND ZERO ANOTHER. -Andy -- Andrew Warren - fastfwd@ix.netcom.com Fast Forward Engineering, Vista, California