Alan Nickerson wrote: > Since I am rather new to this stuff. I have a simple questions > regarding the 16C84 and the STATUS register bit RP0, The bit used to > control which register bank is being access. > > I am a littel confused about it's use. Do I always have to use it or > only when addressing a register (file or other) indirectly. In other > words, If I only access registers in the immeditate mode do I need > to use the STATUS registor RP0 bit? Alan: The RP0 bit is a "don't care" when you're accessing registers indirectly through the FSR. When accessing registers directly, the RP0 bit must be clear ("0") for accesses to registers on page 0 (register addresses between 00 and 7F), and set ("1") for accesses to registers on page 1 (register addresses between 80 and FF). For example: EX1: MOVLW PORTA ;Load the FSR with the address MOVWF FSR ;of a page-0 register. MOVF INDF,W ;Read it. RP0 is a "don't care". EX2: MOVLW TRISA ;Load the FSR with the address MOVWF FSR ;of a page-1 register. MOVF INDF,W ;Read it. RP0 is a "don't care". EX3: BCF RP0 ;Make sure we're on register page 0. MOVF PORTA,W ;Read a page-0 register. EX4: BSF RP1 ;Make sure we're on register page 1. MOVF TRISA^080H,W ;Read a page-1 register. The ;"^080H" masks off the hi bit ;of the register's address; this ;is necessary in order to avoid ;warnings from the assembler. If you look closely at the output of the assembler, you'll see that the "MOVF PORTA,W" and the "MOVF TRISA^080H,W" assemble to exactly the same opcodes; the RP0 bit is all that tells the PIC which register should be accessed. -Andy Andrew Warren - fastfwd@ix.netcom.com Fast Forward Engineering, Vista, California http://www.geocities.com/SiliconValley/2499