The info:
Using a pic 16F819, 20MHZ crystal oscilator

What I am trying to do:

I have 4 momentary pushbuttons with coresponding lamps. One is a "power" switch / lamp, the rest are one of three (ie, push one button and its lamp comes on, the others go off).
The "one of three" part works flawlessly.

My problem lies in the "Power" button. The unit defaults with power on and one other lamp lit. When I press the power switch, I want all lamps to go out until power switch is pressed again. (Simulating turn the whole unit off). For the LIFE of me I can not figure out what is going on with my code. Its not a debounce issue, ive tried puting in delays up to 10 seconds after the button is pressed and the unit insists on going back to the power up state. here is the code:


DEFINE OSC 20 ' 20 Mhz Oscillation
OSCCON = $70 ' Oscilator Config reg.

Clear ' Clear all memory
TRISA = %00000000 ' Set port a to all out
TRISB = %00001111 ' Set Port b to i/o


Speaker Var PortA.0 ' Tone pin out
Power Var PortB.0 ' Input for power switch
Auto VAR PortB.1 ' Input for Auto Switch
Normal VAR PortB.2 ' Input for Normal Switch
Pursuit VAR Portb.3 ' Input for Pursuit Switch
Power_LED VAR Portb.7 ' Output for Power Lamp
Auto_LED Var Portb.6 ' Output for Auto Lamp
Normal_LED VAR Portb.5 ' Output for Normal Lamp
Pursuit_LED VAR Portb.4 ' Output for Pursuit Lamp

Initialize:
High Power_LED ' Power Default = ON
low Auto_Led ' Auto Defualt = OFF
High Normal_LED ' Normal Default = ON
low Pursuit_LED ' Pursuit Default = ON

Start:
If Power = 1 Then Power_Pressed
If Power_LED = 1 then ' Execute only if in ON state
If Normal = 1 Then Normal_Pressed ' Normal button pressed?
If Pursuit = 1 Then Pursuit_Pressed ' Pursuite button Pressed?
If Auto = 1 then auto_pressed ' Auto button pressed
EndIF
Goto Start ' Loop forever

'**************************SUBROUTINE AREA********************************

Auto_Pressed: ' Auto button code:
Low Pursuit_LED ' Turn off Pursuit lamp
Low Normal_LED ' Turn off Normal Lamp
High Auto_LED ' Turn on Auto Lamp
'DTMFOUT Speaker, [1] ' Send tone sound out
Goto start ' Go back to main routine

Normal_Pressed: ' Normal button code:
Low Pursuit_LED ' Turn off Pursuit lamp
Low Auto_LED ' Turn off Auto Lamp
High Normal_LED ' Turn on Normal Lamp
'DTMFOUT Speaker, [1] ' Send tone sound out
Goto Start ' Go back to main routine

Pursuit_Pressed: ' Pursuit button code:
Low Normal_LED ' Turn off Normal Lamp
Low Auto_LED ' Turn off Auto Lamp
High Pursuit_LED ' Turn on Pursuit Lamp
'DTMFOUT Speaker, [1] ' Send tone sound out
Goto Start ' Go back to main routine


Power_Pressed:
If Power_LED = 1 Then
Low Power_LED ' Turn off Power LED
Low Auto_LED ' Turn off Auto LED
Low Normal_LED ' Turn off Normal LED
low Pursuit_LED ' Turn off Pursuit LED
pause 1000 ' 1 second debounce delay
ELSE
High Power_LED ' Turn on Power_LED
High Normal_LED ' Turn on Normal_LED
Pause 1000 ' 1 Second Debounce delay
endif
Goto Start