David Dobbs wrote: > We have just started using the PIC 16C84 but at the moment we are > unable to get much sense out of the software. Although it compiles > and programs the switch and lamp circuit does not work. > > 1)On assembly we get the following messages: > > Message[302] F:\PIC\PROJECTS\TEST\TEST.ASM 16 : Register in > operand not in bank 0. Ensure that bank bits are correct. > Message[302] F:\PIC\PROJECTS\TEST\TEST.ASM 22 : Register in > operand not in bank 0. Ensure that bank bits are correct. > > 2)We don't seem to be able to input to porta. David: Your code will work with the following changes. OLD CODE: --------- > ORG 00 > > INIT BSF STATUS,RP0 ;Set up page 1 of registers. > MOVLW B'11111' > MOVWF TRISA ;Sets porta as an input port. > > CLRF PORTA ;Clear porta. > CLRF PORTB ;Clear portb. > > MOVLW B'00000000' > MOVWF TRISB ;Sets portb as an output port. > BCF STATUS,RP0 ;Resets page 0 of registers. > > MAIN .... NEW CODE: --------- ORG 00 GOTO INIT ORG 04 RETFIE INIT BSF STATUS,RP0 MOVLW B'11111' MOVWF TRISA^080H MOVLW B'00000000' MOVWF TRISB^080H BCF STATUS,RP0 CLRF PORTA CLRF PORTB MAIN .... The GOTO at location 0 and the RETFIE at location 4 aren't STRICTLY necessary, but they'll prevent any accidental interrupt problems. The "^080H"'s will fix the assembler warnings. The instruction re-ordering is necessary because TRISA and TRISB are on register page 1, while PORTA and PORTB are on register page 0. When you program your PICs, remember to disable the Watchdog Timer. -Andy === Andrew Warren - fastfwd@ix.netcom.com === Fast Forward Engineering, Vista, California === http://www.geocities.com/SiliconValley/2499