Hi there i'm using MPLAB (v4.0) and PIC Tutor Programmer/simulator. I can get MPLAB to simulate my coding, I compile the code to HEX without any errors. I can send the HEX to the PIC16F84 ok, but the PIC does not do anything, is this a coding problem or MPLAB problem/setup. Cheers Pic@Colindale.demon.co.uk '________________________________________ ;Project Name : Password.pjt ;Asm File : Password.asm ;Date : 10/12/1998 ;Version : 1.0 ;Purpose : To handle a 5 digit code via 7 line keypad ;Set-up ;_______________________________________________________________ ;PORTA ;0 = OUT : Power ON ;1 = OUT : Key Pressed ;2 = OUT : First Digit Entered ;3 = OUT : 5th digit entered ;4 = OUT : ;PORTB ;0 - 6 = IN : Input from keypad ;7 = Accept : Accept Code #define page1 bsf status,5 ;Page 1 #define page0 bcf status,5 ;Page 0 status equ 0x03 ;Status porta equ 0x05 ;Link to port a portb equ 0x06 ;Link to port b w equ 0 ;Working file f equ 1 ;File z equ 2 stable equ 0x08 ;Used for delay factor for debouncing inputs in equ 0x09 ;Stores the port b digit keywait equ 0x0A ;Counter for debouncing routine digno equ 0x0B ;Digit number entered (upto five) dig1 equ 0x0C ;Store digit 1 dig2 equ 0x0D ;Store digit 2 dig3 equ 0x0E ;Store digit 3 dig4 equ 0x0F ;Store digit 4 list p=16F84 #include p16f84.inc org 4 org 5 ;defaults clrf porta clrf portb page1 ;Page 1 ;set porta movlw b'00000' movwf porta ;port b movlw b'1111111' movwf portb page0 ;Reset variables clrf keywait clrf stable clrf in clrf digno clrf dig1 clrf dig2 clrf dig3 clrf dig4 ;Indicate to the outside world the the pic is running (port a,0) bsf porta,0 begin: call KeyScan ;Get input from port b ;inform the outside world that the user has realeased (port a,1) bcf porta,1 ;User has pressed a button (stored in 'in) ;Get the next digit number call getnextdigit goto begin KeyScan: ;Check to see if the any of the bits are high movlw b'00000000' xorwf portb,W btfsc status,z Goto KeyScan ;No, recheck clrf keywait movf portb,w ;Store the value of port b movwf in ;inform the outsite that a keypress event has occurred (port a,1) bsf porta,1 debounce: ;wait x times to stable input ;increase the keywait by 1 incfsz keywait,f ;is keywait=stable movf keywait,w xorlw b'00001000' btfss status,z goto debounce ;no KeyCheck: ;Wait to see if all bits are low bcf status,z ;Clear status and PORTB movlw b'00000000' xorwf portb,w btfsc status,z return ;Yes, all bits are low Goto KeyCheck ;no, wait until all bits are low goto begin getnextdigit: ;increase the digit count no by one incfsz digno,f ;check for first digit movf digno,w xorlw d'1' btfsc status,z call dig_1 return dig_1: ;inform other obhjects that the first digit has been entered bsf porta,2 ;store the value in dig1 movf in,w movwf dig1 return end