PIC18F46J11-I/PT PORTA RA6 RA7 problem
Posted: Sun May 03, 2015 12:43 pm
I need to develop an industrial application that has to drive RA6 and RA7 as output pins.
Datasheet:
Table 9-3:
PIN_____________Func___TRIS___I/O___I/O Type___Description
OSC2/CLKO/RA6__OSC2____x_____O_____ANA_____Main oscillator feedback output connection (HS mode).
________________CLKO____x_____O_____DIG______System cycle clock output (FOSC/4) in RC and EC Oscillator modes.
________________RA6_____1_____I_____TTL______PORTA<6> data input.
________________________0_____O_____DIG______LATA<6> data output.
OSC1/CLKI/RA7___OSC1_____1_____I_____ANA_____Main oscillator input connection.
________________CLKI_____1_____I_____ANA_____Main clock input connection.
________________RA7_____1_____I_____TTL_____PORTA<6> data input.
________________________0_____O_____DIG_____LATA<6> data output.
This should correspond in boostc with:
trisa.6 = 0; //configure pin RA6 as output
trisa.7 = 0; //configure pin RA7 as output
/* and */
lata.6 = 0; //send false to RA6
lata.7 = 0; //send false to RA7
/* or */
lata.6 = 1; //send true to RA6
lata.7 = 1; //send true to RA7
and should be the same as with using OUT in Flowcode.
My osc configuration is INTOSCPLL that as per datasheet:
REGISTER 25-3: CONFIG2L: CONFIGURATION REGISTER 2 LOW (BYTE ADDRESS 300002h)
010 = INTOSCPLL, internal oscillator with PLL software controlled, port function on RA6 and RA7
My CONFIG2L word is: %01010010
The problem is that:
1. If I enable RA6 and send true, the port will later stay in true forever.
2. If I enable RA7 and send true, nothing will happen
Flowcode version is 5.5.2.1
I might be missing something obvious ... I am sorry to bother you all, but maybe someone can push me on the right path.
Thank you.
Datasheet:
Table 9-3:
PIN_____________Func___TRIS___I/O___I/O Type___Description
OSC2/CLKO/RA6__OSC2____x_____O_____ANA_____Main oscillator feedback output connection (HS mode).
________________CLKO____x_____O_____DIG______System cycle clock output (FOSC/4) in RC and EC Oscillator modes.
________________RA6_____1_____I_____TTL______PORTA<6> data input.
________________________0_____O_____DIG______LATA<6> data output.
OSC1/CLKI/RA7___OSC1_____1_____I_____ANA_____Main oscillator input connection.
________________CLKI_____1_____I_____ANA_____Main clock input connection.
________________RA7_____1_____I_____TTL_____PORTA<6> data input.
________________________0_____O_____DIG_____LATA<6> data output.
This should correspond in boostc with:
trisa.6 = 0; //configure pin RA6 as output
trisa.7 = 0; //configure pin RA7 as output
/* and */
lata.6 = 0; //send false to RA6
lata.7 = 0; //send false to RA7
/* or */
lata.6 = 1; //send true to RA6
lata.7 = 1; //send true to RA7
and should be the same as with using OUT in Flowcode.
My osc configuration is INTOSCPLL that as per datasheet:
REGISTER 25-3: CONFIG2L: CONFIGURATION REGISTER 2 LOW (BYTE ADDRESS 300002h)
010 = INTOSCPLL, internal oscillator with PLL software controlled, port function on RA6 and RA7
My CONFIG2L word is: %01010010
The problem is that:
1. If I enable RA6 and send true, the port will later stay in true forever.
2. If I enable RA7 and send true, nothing will happen
Flowcode version is 5.5.2.1
I might be missing something obvious ... I am sorry to bother you all, but maybe someone can push me on the right path.
Thank you.