GPS Project: PIC18F26K22 or PIC18F46K22


Closed Thread
Results 1 to 40 of 69

Hybrid View

  1. #1
    Join Date
    Aug 2011
    Posts
    455


    Did you find this post helpful? Yes | No

    Default Re: GPS Project: PIC18F26K22 or PIC18F46K22

    Both of those have an NRESET input which is a low-active signal that will reset the module.
    Connect that to one of the pic's IO pins (as long as you're powering the pic at 3.3V).

    At startup, init the uart to 9600.
    Then set NRESET low, delay 1msec, and set it high. They don't have any timing specs for the NRESET input, but that should do it.

    After you get the initial sequence from the GPS then you can switch it to 38400.

  2. #2
    Join Date
    Oct 2010
    Posts
    413


    Did you find this post helpful? Yes | No

    Default Re: GPS Project: PIC18F26K22 or PIC18F46K22

    Quote Originally Posted by tumbleweed View Post
    Both of those have an NRESET input which is a low-active signal that will reset the module.
    Connect that to one of the pic's IO pins (as long as you're powering the pic at 3.3V).

    At startup, init the uart to 9600.
    Then set NRESET low, delay 1msec, and set it high. They don't have any timing specs for the NRESET input, but that should do it.

    After you get the initial sequence from the GPS then you can switch it to 38400.
    Thanks a lot, i'll do that tomorrow and i will post the result.

  3. #3
    Join Date
    Oct 2010
    Posts
    413


    Did you find this post helpful? Yes | No

    Default Re: GPS Project: PIC18F26K22 or PIC18F46K22

    I was checking the manual but at the same time the pcb board, which is an adafruit ultimate GPS. They do have an ENABLE pin but this is not coming from the GPS module but from the mic5225 3.3V legulator.

    So i guess that via EN pin on the regulator we can hold the pin to GND or LOW for a 1ms and will do the job. I think it will work. Thanks a lot once again.

    I would also like to thank you all, because i learn everyday more things step by step.

    Apologize for my limited knowlegde, i know that i cannot help you, and it is difficult for you to understand my questions in order to help me as well.

    Appreciate your patience.....

  4. #4
    Join Date
    Aug 2011
    Posts
    455


    Did you find this post helpful? Yes | No

    Default Re: GPS Project: PIC18F26K22 or PIC18F46K22

    The EN to the regulator should work as well, but since that will shut off power to the GPS you should make sure to set any IO pins that are outputs to the GPS to tri-state (ie inputs), or drive them low while you have the power off.

    For the UART TX output that means disabling the uart to get control of the IO pins.

    Also, you may need to pull EN low for longer than 1ms. When the regulator shuts off it'll probably take a while for the GPS 3.3V to drop.

  5. #5
    Join Date
    Oct 2010
    Posts
    413


    Did you find this post helpful? Yes | No

    Default Re: GPS Project: PIC18F26K22 or PIC18F46K22

    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|
    '------------------------------------------------------------------------------|
    Last edited by astanapane; - 16th July 2018 at 19:17.

  6. #6
    Join Date
    Aug 2011
    Posts
    455


    Did you find this post helpful? Yes | No

    Default Re: GPS Project: PIC18F26K22 or PIC18F46K22

    Sorry, I should have explained better.

    The PIC IO pin is fine for driving the regulator ENable input... you shouldn't need any other circuitry. Set PORTB.2 as an output low to power off the GPS, and then set it high to turn on the GPS. Leave it as an output high, otherwise the regulator may shut itself off.

    However, when you have the GPS power off you must make sure that NONE of the PIC output pins that connect to the GPS are high, otherwise the GPS could get partially powered from those logic lines that are sourcing 3.3V.

    The UART TX output pin idles high once the UART is enabled (RCSTA2.SPEN, bit 7 = 1), which I think happens during initialization. With SPEN = 0 the uart TX and RX pins are under control of the ports.

  7. #7
    Join Date
    Oct 2010
    Posts
    413


    Did you find this post helpful? Yes | No

    Default Re: GPS Project: PIC18F26K22 or PIC18F46K22

    Quote Originally Posted by tumbleweed View Post
    Sorry, I should have explained better.

    The PIC IO pin is fine for driving the regulator ENable input... you shouldn't need any other circuitry. Set PORTB.2 as an output low to power off the GPS, and then set it high to turn on the GPS. Leave it as an output high, otherwise the regulator may shut itself off.

    However, when you have the GPS power off you must make sure that NONE of the PIC output pins that connect to the GPS are high, otherwise the GPS could get partially powered from those logic lines that are sourcing 3.3V.

    The UART TX output pin idles high once the UART is enabled (RCSTA2.SPEN, bit 7 = 1), which I think happens during initialization. With SPEN = 0 the uart TX and RX pins are under control of the ports.
    Now it is clear. I did it as you advised. Thank a lot.

Similar Threads

  1. PIC18F46K22 config issue
    By LGabrielson in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 29th September 2012, 03:20
  2. Replies: 1
    Last Post: - 27th July 2008, 06:14
  3. Pic GPS project Demo
    By Art in forum GPS
    Replies: 0
    Last Post: - 28th October 2007, 03:05
  4. GPS project question
    By mjp130 in forum GPS
    Replies: 6
    Last Post: - 4th July 2007, 20:09
  5. gps project
    By chuckad in forum GPS
    Replies: 2
    Last Post: - 9th February 2007, 02:52

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts