What i did, is to have all ports low, until the LCD is powered up. Then i set one of the PIC's port to high to enable the GPS's regulator.
That's all and it works up to now fine. Should i leave the PIC's pin to high? Or should i add a transistor and use it as a switch to control the EN pin of the regulator? So setting the PIC's pin to high, close the transistor EC to GND, and the EN pin is set to 0. Then release the PIC pin to LOW, and the same time open the EC from the transistor, and enable the GPS.
But with this method i will have one more component in my final circuit and couple of resistors at B and E.
EDITED:....................
I did make the portb.2 as an input after i powered up the GPS. It seems that works the same.
Code:
'------------------------------------------------------------------------------|
' [ GPS HOLD ON RESET for a bit ] |
'------------------------------------------------------------------------------|
high portb.2 ' we set high the ENABLE pin at GPS |
' -----------------------------------------------------------------------------|
' [ GPS Initialization ] |
'------------------------------------------------------------------------------|
' When the GPS Module is POWERED ON, then the following sentenses are received.
HSERIN2 [wait("PMTK011,MTKGPS*08")]
HSERIN2 [wait("PMTK010,001*2E")]
HSERIN2 [wait("PMTK010,002*2D")]
HSEROUT [$73,$01,$03,$00,$ff,$ff,"GPS is ENABLED",$00]
Hserin [wait(6)]
pause 1500
HSEROUT [$45] ' clear the LCD
Hserin [wait(6)]
'------------------------------------------------------------------------------|
input portb.2 'release the pic's pin and the ENABLE pin of the GPS's regulator|
'------------------------------------------------------------------------------|
Bookmarks