I just included the code up to the point of setting TRISA. Afterwords, I clear the RP0 bit to go back to bank0. When I'd try to set this bit to a 1 in the TRISA register, the "Special Function Registers" window in MPLAB IDE showed TRISA to have a zero in this bit after excecuting the command to "movwf TRISA". Later in the code, I tried to read the bit from PORTA in bank0 and it was zero after Firing the asynchronous toggle to set it high. I ended up giving up on this pin for now, but I really like the idea of doing the timeslicing that rtstofer uses. Thanks for all the suggestions from everybody. Tom --- In , "Stephen D. Barnes" <stephendbarnes@h...> wrote: > According to what you state below, you are attempting to > read the TRISA register. Read Chad Russel's reply and make > sure you are reading PORTA, bit 5 and not TRISA, bit 5. > > Regards, > Stephen D. Barnes > > That would be fine and my plan, but how do i set pin 5 up > to receive > the input? No matter what I do, TRISA bit 5 stays 0 and > stimuli > applied to pin 5 in simulator do not affect the state that > is being > polled? It's as if something is locking it out from being > an input > port. > > Thanks, > Tom > > --- In , "rtstofer" <rstofer@p...> > wrote: > > > > RA5 is not a bidirectional I/O pin - see Table 5-1. In > your > > __CONFIG you turned off MCLR' so the pin is a digital > input. > > > > > > --- In , "tom_bihn" <tbihn@n...> > wrote: > > > I'm using the following line to configure the bits in > the pic: > > > __CONFIG _INTRC_OSC_NOCLKOUT & _WDT_OFF & _PWRTE_ON & > _CP_OFF & > > > _BODEN_OFF & _MCLRE_OFF > > > > > > Here is the code used up to the point that I'm writing > TRISA reg. > > > > > > clrf PORTA > > > clrf PORTB > > > movlw 0x07 > > > movwf cmcon > > > bsf STATUS,RP0 > > > movlw 5 > > > movwf OPTION_REG > > > movlw 0x20 > > > movwf TRISA > > > > > > After the last command listed, the TRISA register is > clear. I > > can't > > > seem to locate any information on why RA5 would not go > to a 1. > The > > > spec sheet did specify that it would default as a "1" > in TRISA > no > > > matter what, but when I tried a btfss PORTA,5 and > simulated an > > > asynchronous toggle in mplab simulator, it was > indicated as > clear > > > regardless of the state of the stimulus input. > > > > > > Thanks, > > > Tom > Yahoo! Groups Sponsor > > to unsubscribe, go to http://www.yahoogroups.com and > follow the instructions > > Your use of Yahoo! Groups is subject to the Yahoo! Terms > of Service. |