hi
I m working on PIC18F4685
Its 6 & 7 bits of port Ais used in main oscillator . can any one know how to use them as normal I/O pins.
I am using C compiler for programming..
void main()
{
PORTA = 0; // Initialize PORTC
TRISA = 0; // Configure PORTC as output
while(1) {
PORTA = ~PORTA; // toggle PORTC
Delay_ms(1000); // one second delay
}
}
All pins are working except 6th and 7th ...
plz let me know what i m missing ?
11xx = External RC oscillator, CLKO function on RA6
101x = External RC oscillator, CLKO function on RA6
1001 = Internal oscillator block, CLKO function on RA6, port function on RA7
1000 = Internal oscillator block, port function on RA6 and RA7
0111 = External RC oscillator, port function on RA6
0110 = HS oscillator, PLL enabled (Clock Frequency = 4 x FOSC1)
0101 = EC oscillator, port function on RA6
0100 = EC oscillator, CLKO function on RA6
0011 = External RC oscillator, CLKO function on RA6
0010 = HS oscillator
0001 = XT oscillator
0000 = LP oscillator
As you can see to use A6 and A7 as I/O you have to set the configuration bits to 1000. You can do it by setting the appropriate #FUSES or in the programmers software (some programmers require as you do it in their control software).