Problem 4: PIC works partially, does not start, or stops at any time, works only if I approach my hand or a screwdriver, or resets at any time.
A: CONFIGURATION FLAGS are not fitted to your hardware.
Check
with your programmer your configuration flags : they may be set correctly in your project settings, but not included in your .HEX file, and then not be written in the PIC.
Check your
OSCILLATOR FLAG : it must fit to your hardware.
Here is a little summary of most common oscillator configurations (some of them may be not available on your PIC !) : LP : low power, use a low frequency crystal (32.768 Khz for example) XT : crystal or resonator, up to 4 Mhz HS : high speed crystal, up to 20 Mhz (PIC12 & PIC16) and up to 10 Mhz (PIC18) EXTRC : external RC connected to Fin, Fout is oscillator output EXTRCIO : external RC connected to Fin, Fout is PORT I/O INTRC : internal RC, Fin and Fout are reserved to oscillator INTRCIO : internal RC, Fin and Fout are available for PORT I/O EC : external clock, connect an oscillator to Fin, Fout is oscillator output ECIO : external cloc, connect an oscillator to Fin, Fout is PORT I/O PLL suffix : PIC internal 4x PLL is enabled (for example : HSPLL, ECPLL...)
Check your
BROWN OUT DETECT & VOLTAGE : if enabled, the brown out voltage must be higher than normal operation voltage
Check your
MASTER CLEAR enable bit : If set, the /MCLR pin must be connected to a
reset circuit or tied to the Vcc. If not set, /MCLR is an INPUT only pin.
Check your
LOW VOLTAGE PROGRAM enable bit : If set, you can't use PGM
, PGC and PGD pin
s as I/O pins, they are reserved for programming the chip. If not set, you can use PGM
, PGC and PGD pin as I/O pin
s, but you can't use low voltage programming.