PDA

View Full Version : Powering and reset PIC16LF88 problem



harryweb
- 27th March 2012, 08:59
HI,

I'm working on a GPS project. The pic16lf88 may be powered from 1 or/and 2 sources (GPS)


OSCCON =100000

TRISA =010000
TRISB =000101

ANSEL =010000 'an4 analog not used at this time

PORTA = 0
PORTB = 0

clear

led var porta.0
way1 var portb.0
way4 var portb.2
X VAR WORD


pause 10
HIGH PORTA.3 ' powering antenna

mainloop:

X = X + 1

IF X = 10000 then
toggle PORTA.0 'led
X = 0
endif


IF way1 = 1 and way4 = 1 then
low PORTB.4
HIGH PORTB.7
goto mainloop
endif

if way4 = 1 then
PORTB.4 = 1
PORTB.7 = 0
endif

if way1 = 1 then
PORTB.7 = 1
PORTB.4 = 0
endif

goto mainloop


When my pic is powered from
way1 = ok
way2 = ok
way1 + way2 = ok
way1 + way2, then cutting power from way2 = ok
way1 + way2, then cutting power from way1 = NOT OK PORTA.3 (antenna) becomes LOW !!!
I have tried to play with BOREN without success. When enabled the circuit doesn't work at all.

Simulation works great with ISIS, not with real circuit.

Can someone help ?


6367

Charlie
- 27th March 2012, 09:28
Note this diagram does not actually show power connections to the PIC.
This looks unnecessarily complex, and it appears the PIC can choose it's own power for some reason. If you want to power a PIC from either of 2 sources, why not simply throw out this entire circuit except for D3/D4 with the anode of D3 connected to WAY1 and the anode of D4 to WAY4? (Common Cathode to VDD).

harryweb
- 27th March 2012, 10:05
Hi Charlie,
Note this diagram does not actually show power connections to the PIC.
Yes it is because of the ISIS software (hiden powering rails). But power connection is from D1+D2 (common cathode)
(D3+D4 is used for powering RF and control circuit: not on this shematic)

Cannot change this... PCB's already made !

Regards

Charlie
- 27th March 2012, 14:05
What supply voltages are you using? (And if the answer is 5V, remove the zener diodes and try again to see if it works.)