I have a 16f887 PIC and I am using PortC for general output. If I toggle bits 0-7, only bits 0-6 are working. Bit 7 doesn't toggle as expected.
I am thinking that it may have something to do with my configuration, as RC7 is used for RX for serial. Maybe I haven't disabled the serial connection properly?
ADCON0 = 7 'Disable ADC
ADCON1 = 7
ANSEL=%00000000 'all analogue ports to digital
ANSELH=%00000000 'all analogue ports to digital
CM1CON0=%00000000 'disable COMPARATOR 1
CM2CON0=%00000000 'disable COMPARATOR 2
SSPCON=%00000000' disable SERIAL PORT
RCSTA=%00000000 'disable SERIAL PORT
PCON=%00000000 'disable BOR and ULPW
OPTION_REG=%00000000 'disable INTERNAL PULLUPS
WPUB=%00000000 'disable INDIVIDUAL PULLUPS
IOCB=%00000000 'disable INTERRUPT ON CHANGE
CCP1CON = 0 ' turn off CCP1 Module which affects portC
CCP2CON = 0 ' turn off CCP2 Module which affects portC
PSTRCON=%00000000 'disable PULSE STEERING MODE
T1CON=%00000000 'disable TIMER1
'All pins are outputs
trisa = 0
trisb = 0
trisc = 0
trisd = 0
Any suggestions?
Bookmarks