Hello Everyone. For the first time I tried using all 8 portb's as inputs to switches. The are all held low with a 47K resistor network. The switches all have a common +. When I attempt to use them as inputs, my PIC goes crazy. It activates when no buttons are pressed, and activates intermittently when buttons are pressed. When I duplicated everything and switched porta with portb, using porta as inputs and portb as the outputs as shown below, everything works perfectly. Any suggestions would be appreciated. Thank you.

OSCCON = $60 'set int osc to 4mhz using PIC16LF818 at 3VDC
adcon1 = 7 ' set inputs to digital
@ DEVICE MCLR_OFF, INTRC_OSC, WDT_ON, LVP_OFF, BOD_OFF, PWRT_ON, PROTECT_ON
TRISA = %11111111 'PORTA INPUT SWITCHES (THIS WORKS PERFECTLY)
TRISB = %00000001 'ALL PORTB OUTPUTS EXCEPT RB0 (NEED HIGH IMPEDANCE STATE)
PORTB = %00000000 'PORTB OUTPUTS LOW
Pause 100 'SETTLE DOWN

START:
NAP 0
IF PORTA.1 = 1 Then OFF1
IF PORTA.0 = 1 Then ON1
IF PORTA.7 = 1 Then OFF2
IF PORTA.6 = 1 Then ON2
IF PORTA.2 = 1 Then OFF3
IF PORTA.3 = 1 Then ON3
IF PORTA.4 = 1 Then OFF4
IF PORTA.5 = 1 Then ON4
GoTo START