Hello all, I'm having a problems waking up a 12c509 OTP (internal RC, WDT_ON, 3 volt LI cell supply, Normal temperatures) from sleep. Below is a sample of the code which was compiled using MPASM v1.4 and programmed with a PIC-1A programmer. It's supposed to wakeup every so often and flash some lights and supply a discrete to a music IC. In situ it never wakes up from the first sleep instruction. Can someone help me out? Thankyou, Dave TITLE "Christmas Ornament Project" SUBTITLE "Controlling LED's and Melody IC" ;*************************************************************************** ****************************** ;Abstract: This program is written to control led's and a melody IC on a ;simple Christmas ornament. Approximately every half hour the ornament will ;play a tune and flash some led's. THIS PROGRAM IS WRITTEN FOR A 4 MHZ CLOCK ;FREQUENCY. ; ; Program Name: orn.asm ; ; Revision History: ; ; Revision Date: 28 Nov 1997 Original ; Written by: David & Sarah Ebsen ;*************************************************************************** ****************************** ; PROCESSOR 12509-04 ; RADIX DEC EXPAND ; __IDLOCS H'DEAD' ; __CONFIG H'000E' INCLUDE "ORN12.H" __FUSES _MCLRE_OFF & _CP_OFF & _WDT_ON & _IntRC_OSC ORG RESETVECTOR GOTO START1 ORG INTVECTOR GOTO START1 ;*************************************************************************** ****************************** ; Main Program ;*************************************************************************** ****************************** START1: BTFSS TO ;SEE IF THE WDT EXPIRED. GOTO TIMER CLRF LOW8 ;Clear timer variables. CLRF UPPER8 CLRF STATUS MOVLW 0xCF OPTION ;SET 1:128 PRESCALE TO WDT CLRW TRIS GPIO ;Set all to outputs CLRF GPIO CLRWDT ;*****************Troubleshooting stub **************************** BSF LED2 MOVLW 255 ; Good here CALL MSEC_DELAY BCF LED2 ;********************************************************************** CALL PLAY_SONG ;Processor executes PLAY_SONG but SLEEP ;never wakes up from this sleep. TIMER: ;*****************Troubleshooting stub **************************** BSF LED1 MOVLW 255 ;This never happens!! CALL MSEC_DELAY BCF LED1 ;********************************************************************** INCFSZ LOW8, F SLEEP ;*****************Troubleshooting stub **************************** BSF LED2 MOVLW 255 ;This never happens!! CALL MSEC_DELAY BCF LED2 ;********************************************************************** INCF UPPER8 MOVLW 3 SUBWF UPPER8, W BTFSS Z SLEEP CLRF UPPER8 CLRF LOW8 CALL PLAY_SONG SLEEP