On Thu, Feb 28, 2002 at 12:28:47PM -0600, Pic Dude wrote: > So I read up on bank selection and added it, but still can't get port A > to be inputs. Now, if I try port C as inputs, that also does not work. > > This is what I have for port C... > > LIST P=16F872 > INCLUDE "p16f872.inc" > ERRORLEVEL -224 > __CONFIG _PWRTE_ON & _RC_OSC & _WDT_OFF & _LVP_OFF > > ORG 0 > > bcf STATUS,RP0 ; Bank0... > bcf STATUS,RP1 ; ...bank0 > clrf PORTC > bsf STATUS,RP0 ; Bank1 > movlw 0x06 > movwf ADCON1 ; Port A all digital > movlw 0x0F > movwf TRISC ; Port C -- only RC0:RC3 are inputs. > > movlw B'00000000' > movwf ADCON0 ; Turn off A/D > movwf TRISA ; Port A is all outputs > movwf TRISB ; Port B is all outputs > > loop: > movf PORTC,0 > movwf PORTB > > goto loop > > end > > > Inputs are connected to pins 11,12,13,14. LED's at all 8 RB's. > > Possibilities -- I'm missing something fundamental here. Yup. You forgot to switch back to bank 0 after doing your moves to the TRIS registers. So your loop is operating in Bank 1. > I fried the chip during one of the previous mis-configurations. > However, I tried > downloading walk.asm again and it works (though only outputs). Is it possible > to fry only part of a PIC? Yes. But that isn't your problem. Bank management is a PITA with PICs. But the bookkeeping must be done. BAJ > > Thanks, > -Neil. > > -- > http://www.piclist.com hint: The PICList is archived three different > ways. See http://www.piclist.com/#archives for details. > -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.