list p=16F1455 ; list directive to define processor #include "p16F1455.inc" ; processor specific variable definitions __CONFIG _CONFIG1, _FOSC_INTOSC & _WDTE_OFF & _PWRTE_OFF & _MCLRE_ON & _CP_OFF & _BOREN_ON & _CLKOUTEN_OFF & _IESO_ON & _FCMEN_ON __CONFIG _CONFIG2, _WRT_OFF & _CPUDIV_NOCLKDIV & _USBLSCLK_48MHz & _PLLMULT_3x & _PLLEN_DISABLED & _STVREN_ON & _BORV_LO & _LPBOR_OFF & _LVP_ON errorlevel -302 , -207 ; suppress message 302 from list file banksel OSCCON movlw B'00111110' banksel TRISC clrf TRISC banksel TRISA movlw h'FF' movwf TRISA banksel LATC clrf LATC loopy1: banksel PORTA btfsc PORTA, 0 call buttonpress goto loopy1 buttonpress: banksel LATC incf LATC btfsc LATC, 4 clrf LATC buttonup: banksel PORTA btfsc PORTA, 0 goto buttonup return end