Thanks Bob and Drew for your responses. Bob, the documentation indicates the GPIO/TRIS registers are at register memory locations 0x05/0x85 and therefore it seems the disassembler should know which register is being addressed. To test, I modified the source code below by substituting TRISIO for the first GPIO and then assembled it and got the following hex code and Message[302]. Excerpts from POLARMD2.LST: 0019 3008 00135 ad0019 MOVLW 0x08 001A 00A1 00136 MOVWF 0x21 001B 1683 00137 BSF STATUS,RP0 Message[302]: Register in operand not in bank 0. Ensure that bank bits are correct. 001C 1205 00138 BCF TRISIO,4 ; ??? RAM Page TRISIO,4 001D 1283 00139 BCF STATUS,RP0 001E 1605 00140 BSF GPIO,4 ; ??? RAM Page TRISIO,4 001F 17A1 00141 BSF 0x21,7 0020 282E 00142 GOTO ad002E 00143 ; 0021 13A1 00144 ad0021 BCF 0x21,7 0022 0CA7 00145 ad0022 RRF 0x27,f 0023 1803 00146 BTFSC STATUS,C 0024 1205 00147 BCF GPIO,4 ; ??? RAM Page TRISIO,4 0025 1C03 00148 BTFSS STATUS,C 0026 1605 00149 BSF GPIO,4 ; ??? RAM Page TRISIO,4 0027 1721 00150 BSF 0x21,6 0028 282E 00151 GOTO ad002E Note: the comments "???RAM Page TRISIO,4" were produced when disassembling the source HEX code. Line 0x001C contains the TRISIO register and line 0x0024 contains the GPIO register. They both produce a hex code of 1205h. I think I remember that Msg [302] is not an error but a WARNING ? or at least a caution. So, when coding in assembly, which register name should one use - the register name matching the Bank or is it sufficient to use either name and preselect the correct Bank? Is TRISIO the appropriate name to use for Bank 1? Logic would say use the matching register name, but either seems to give the same result here. Is this consistent in other registers? Or am I missing something obvious? Would you elaborate? Thanks, Jess -----Original Message----- From: Bob Ammerman To: PICLIST@MITVMA.MIT.EDU Date: Saturday, March 03, 2001 8:51 AM Subject: Re: [PIC]: 12c671 - GPIO vs TRIS Reg >> This application is supposed to input analog for D/A on >> GP0 (Pin 7), GP1 (Pin 6), and GP2 (Pin 5). A/D results go to >> a PC via GP5 (Pin 2) connected to DB9 pin2 on PC and >> GP4 (Pin 3) connected to DB9 pin 3 (data). GP3/MCLR is >> connected to +5V thru 4k7 ohms, no other connections. So far >> I have not been able to communicate with the PC but looking at >> Pin 3 with an Oscope appears to show data being sent. Pin 2 >> seems to be low with noise. I have an OSCCAL value error >> which may upset the timing. > >This is very likely. > >> Comments in the following code segments are mine and may be >> in error. Electrical connections are as indicated. >> >> ad0083 MOVLW 0x07 >> MOVWF INDF >> BSF STATUS, RP0 ; Bank 1 >> BCF GPIO, 4 ; GPIO(4), Pin 3 >> >> ;GPIO(4) goes to PC RS232 pin 3 DB9 (data) >> >> BCF STATUS, RP0 ; Bank 0 >> BSF GPIO, 4 >> >> ------------------------------------------- >> >> ad00CE CLRF 0x24 >> BSF STATUS,RP0 ; Bank 1 >> BCF GPIO,3 ; GPIO (3), Pin 4, GP3/MCLR >> >> ;GPIO(3), is held high by 4k7 resistor. >> >> BCF STATUS,RP0 ; Bank 0 >> BCF GPIO,3 ; >> ; >> ad00D3 GOTO ad0094 >> ; >> >> The code >> >> BCF GPIO,3 and BCF GPIO,4 >> >> each appears twice in the above. The first instance is >> in Bank 1 and the second is in Bank 0. In looking at >> the Special Function Registers (Doc DS30561B, pg 12 >> Figure 4-2), it appears that for Bank 1, GPIO should >> really be called TRIS. >> >> Two questions: >> >> 1) what does each of the above segments accomplish? and > >The Bank 1 reference is indeed a reference to the TRIS register. It is >making the specified bit into an output. > >The Bank 0 reference is actually setting the pin to zero. > >> 2) if in fact the first instance is referring to the TRIS >> register, why isn't it called TRIS? > >Because the disassembler doesn't keep track of the current bank. > >> Other comments welcomed. Thanks for your help. >> >> Jess > > >Bob Ammerman >RAm Systems >(contract development of high performance, high function, low-level >software) > >-- >http://www.piclist.com hint: PICList Posts must start with ONE topic: >[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads > > -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics