Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Cannot use port RA3 MCLR as Input on 12F1822
#1
I cannot get port RA3 to work as input when I change the configuration bits in my application on a 12F1822.

The configuration bits are the following:

In bootloader:


 
Code:
__CONFIG _CONFIG1, _FOSC_INTOSC & _WDTE_OFF & _PWRTE_ON & _MCLRE_ON & _CP_OFF & _CPD_OFF & _BOREN_OFF & _CLKOUTEN_OFF & _IESO_ON & _FCMEN_ON
 __CONFIG _CONFIG2, _WRT_OFF & _PLLEN_ON & _STVREN_ON & _BORV_LO & _LVP_OFF




In application:


Code:
__CONFIG(FOSC_INTOSC & WDTE_OFF & PWRTE_OFF & MCLRE_OFF & CP_OFF & CPD_OFF & BOREN_OFF & CLKOUTEN_OFF & IESO_ON & FCMEN_ON);

__CONFIG(WRT_OFF & PLLEN_ON & STVREN_ON & BORV_LO & LVP_OFF);



As you can see both LVP and MCLRE are off in my application code so RA3 should work as input, but the pic reset as soon as GND is applied.
Am I missing something?
Reply
#2
Configuration bits are set once and once only when the pic is programmed by the pickit or whatever ICSP you use.

That is why you have to set it up in the boot loader the way you want to use it in your application. 

The boot loader can not chance the configuration bits, neither can any application.  Only an ICSP can.

There is also no need to set configuration bits in you application when you are using a bootloader.
Reply
#3
Thanks for your answer, I will modify my bootloader with MCLRE off.
Reply
#4
It is always recommended to copy/move the appliation config bits to the boot loader.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)