+ Post New Thread
Page 1 of 2 1 2 LastLast
Results 1 to 20 of 24
  1. #1
    Full Member level 6
    Points: 2,756, Level: 12

    Join Date
    Jan 2013
    Location
    India
    Posts
    380
    Helped
    3 / 3
    Points
    2,756
    Level
    12

    GPS and GSM using Atmega 8

    Hello,

    I want to connect Both GPS receiver which has a TTL logic and a GSM modem to Atmega 8. I want little help regarding hardware. As to how to connect it GPS and GSM to micro controller s it has only one USART. I want to use MAX485.

    Thanx in advance.

    •   AltAdvertisement

        
       

  2. #2
    Super Moderator
    Points: 77,827, Level: 68
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    15,771
    Helped
    3590 / 3590
    Points
    77,827
    Level
    68

    Re: GPS and GSM using Atmega 8

    Hi,

    You may use soft-UART.
    *******

    Or
    read the datasheets of GSM modem and GPS if there are other interfaces available, like I2C, SPI....
    *******

    Or
    Read datasheets if both devices are pure "request-response" type, so you may multiplex one UART interface to two "slaves".
    *******

    But I wonder what benefit a MAX485 could give with this problem. It just transfers data differentially, but still there's only one UART.

    Klaus



  3. #3
    Full Member level 6
    Points: 2,756, Level: 12

    Join Date
    Jan 2013
    Location
    India
    Posts
    380
    Helped
    3 / 3
    Points
    2,756
    Level
    12

    Re: GPS and GSM using Atmega 8

    Quote Originally Posted by KlausST View Post
    Hi,
    Read datasheets if both devices are pure "request-response" type, so you may multiplex one UART interface to two "slaves".
    *******

    But I wonder what benefit a MAX485 could give with this problem. It just transfers data differentially, but still there's only one UART.

    Klaus
    GPS does sends data continuously without any request.
    Can we use software USART for two different devices? If yes then how to know that which device had sent the data.



  4. #4
    Super Moderator
    Points: 77,827, Level: 68
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    15,771
    Helped
    3590 / 3590
    Points
    77,827
    Level
    68

    Re: GPS and GSM using Atmega 8

    Hi,

    * one software UART
    * and one hardware UART

    Or two software UART, if you find this more comfortable.

    Klaus



  5. #5
    Super Moderator
    Points: 29,643, Level: 41
    andre_teprom's Avatar
    Join Date
    Nov 2006
    Location
    Brazil
    Posts
    8,863
    Helped
    1115 / 1115
    Points
    29,643
    Level
    41
    Blog Entries
    9

    Re: GPS and GSM using Atmega 8

    @djc, as for the hardware interface, the 3,3v output of the GPS is able to be read by any of the 5v TTL inputs of the uC without need of any kind of voltage level converter between,
    @Klaus, I'm not sure if the Atmega8 woud be able to comfortably deal with software uart for that application. The GPS sentences are sent coninuously at intervals of 1 second, in general at 9600bps, and some of its sentences has about 75 bytes that need a further processing to split information of interest. The suited approach in my oppinion is to multiplex the use of the only available uart. There is no need to take positioning while talking to the GSM module; anyway the working flow of the project were not yet posed, so even this last approach I mentioned could not be suited at the specific case of an accurate tracking.
    --------------------------------------------------------------------------------------------------
    Part of the world that you live in, You are the part that you're giving ( Renaissance )



  6. #6
    Super Moderator
    Points: 77,827, Level: 68
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    15,771
    Helped
    3590 / 3590
    Points
    77,827
    Level
    68

    Re: GPS and GSM using Atmega 8

    Hi,

    Input level: ATmega8 datasheet says: V_IH_min = 0.& x VCC. Means 3.0V at 5.0V VCC.
    So an unloaded LVCMOS output with VCC = 3.3V should be OK. Although the margin is not big.
    It is not TTL compatible where V_IH is about 2.0V.

    SoftUart: It depends on the OP´s requirement. If he needs to continously get the GPS data, then maybe this should be done with the hardware UART.
    Although 9600 baud is not fast, it can be done with software UART also. I´d use the capture feature.

    For sure the simplest is to multiplex the hardware UART.

    Klaus



  7. #7
    Full Member level 6
    Points: 2,756, Level: 12

    Join Date
    Jan 2013
    Location
    India
    Posts
    380
    Helped
    3 / 3
    Points
    2,756
    Level
    12

    Re: GPS and GSM using Atmega 8

    Hello,
    "The suited approach in my oppinion is to multiplex the use of the only available uart."

    Even I am thinking of multiplexing the GPS and GSM for reception. Coz there is no need to send data to GPS.



  8. #8
    Super Moderator
    Points: 29,643, Level: 41
    andre_teprom's Avatar
    Join Date
    Nov 2006
    Location
    Brazil
    Posts
    8,863
    Helped
    1115 / 1115
    Points
    29,643
    Level
    41
    Blog Entries
    9

    Re: GPS and GSM using Atmega 8

    Quote Originally Posted by djc View Post
    there is no need to send data to GPS.
    There is no relationship on this requirement with any of the proposed solutions, even if the GPS communicates unidirectionally, 2 RX on the microcontroller side are still necessary, either it is multiplexed, softcoded, or dedicated.
    --------------------------------------------------------------------------------------------------
    Part of the world that you live in, You are the part that you're giving ( Renaissance )



    •   AltAdvertisement

        
       

  9. #9
    Super Moderator
    Points: 260,240, Level: 100
    Awards:
    1st Helpful Member

    Join Date
    Jan 2008
    Location
    Bochum, Germany
    Posts
    45,443
    Helped
    13827 / 13827
    Points
    260,240
    Level
    100

    Re: GPS and GSM using Atmega 8

    GPS does sends data continuously without any request.
    Only halfway true. Many GPS modules support different interface protocols, including a query mode which sends data only on request. Looks like you didn't yet seriously check the options.

    Another option is a combined GSM/GPS module like SIM808 which communicates through a single interface.



    •   AltAdvertisement

        
       

  10. #10
    Advanced Member level 2
    Points: 3,130, Level: 13
    baileychic's Avatar
    Join Date
    Aug 2017
    Posts
    622
    Helped
    49 / 49
    Points
    3,130
    Level
    13

    Re: GPS and GSM using Atmega 8

    Only interfacing doesn't solve problems. You should have more RAM. NMEA data will take 400 to 500 bytes for 1 burst. Even if you read only one sentence of NMEA data at a time in ISR then 75 to 80 bytes of RAM is needed for GPS data reception. GSM will need 180 to 210 bytes for reading a SMS.



  11. #11
    Super Moderator
    Points: 260,240, Level: 100
    Awards:
    1st Helpful Member

    Join Date
    Jan 2008
    Location
    Bochum, Germany
    Posts
    45,443
    Helped
    13827 / 13827
    Points
    260,240
    Level
    100

    Re: GPS and GSM using Atmega 8

    More RAM than what? ATmega8 has 1 kB RAM, not much but it can be sufficient for a simple GPS/GSM application.

    I also don't agree with the calculation. NMEA packet can be decoded on the fly, requiring less RAM. Similar thing about GSM operation. Nothing's been said yet about receiving SMS of a specific size.

    Generally, one would prefer a µP with two UARTs and may be more RAM. But if you want to do the project with restricted resources for some reason, it should be possible.



  12. #12
    Full Member level 6
    Points: 2,756, Level: 12

    Join Date
    Jan 2013
    Location
    India
    Posts
    380
    Helped
    3 / 3
    Points
    2,756
    Level
    12

    Re: GPS and GSM using Atmega 8

    hello,
    Yes right now I am not thinking of going to higher end micro controller. Want to do it with limited resources as of now. Don't want to read SMS right now. When I connect GPS to PC, it starts sending data suddenly so didn't know that it could be request based. I am using CIRCOMM 600 GPS module. Right now while receiving data using micro controller, garbage data is being received. Trying to figure out whats happening.



  13. #13
    Super Moderator
    Points: 260,240, Level: 100
    Awards:
    1st Helpful Member

    Join Date
    Jan 2008
    Location
    Bochum, Germany
    Posts
    45,443
    Helped
    13827 / 13827
    Points
    260,240
    Level
    100

    Re: GPS and GSM using Atmega 8

    I see that CIRCOMM 600 GPS has no RX pin at all, so it's surely not able to send data on request. Soft UART for the GPS receiver is the next best solution. Or a mux if you can tolerate loss of some GPS packets.



  14. #14
    Full Member level 6
    Points: 2,756, Level: 12

    Join Date
    Jan 2013
    Location
    India
    Posts
    380
    Helped
    3 / 3
    Points
    2,756
    Level
    12

    Re: GPS and GSM using Atmega 8

    Hello,
    Can we connect GPS module directly to the micro controller, or do we have to use level converter like max 232. I have connected GPS directly to micro controller. Is it the reason that i am getting garbage value.



  15. #15
    Super Moderator
    Points: 260,240, Level: 100
    Awards:
    1st Helpful Member

    Join Date
    Jan 2008
    Location
    Bochum, Germany
    Posts
    45,443
    Helped
    13827 / 13827
    Points
    260,240
    Level
    100

    Re: GPS and GSM using Atmega 8

    No, the GPS module has UART RS232 output level, directly fitting a processor.



  16. #16
    Full Member level 6
    Points: 2,756, Level: 12

    Join Date
    Jan 2013
    Location
    India
    Posts
    380
    Helped
    3 / 3
    Points
    2,756
    Level
    12

    Re: GPS and GSM using Atmega 8

    No, i have GPS module without any 232 converter. I hope GPS module o/p is TTL so i connected it directly to controller.



    •   AltAdvertisement

        
       

  17. #17
    Super Moderator
    Points: 260,240, Level: 100
    Awards:
    1st Helpful Member

    Join Date
    Jan 2008
    Location
    Bochum, Germany
    Posts
    45,443
    Helped
    13827 / 13827
    Points
    260,240
    Level
    100

    Re: GPS and GSM using Atmega 8

    Sorry, I meaned to say TTL level.



  18. #18
    Full Member level 6
    Points: 2,756, Level: 12

    Join Date
    Jan 2013
    Location
    India
    Posts
    380
    Helped
    3 / 3
    Points
    2,756
    Level
    12

    Re: GPS and GSM using Atmega 8

    Ohh, ok..but still trying to figure out what is the issue behind garbage data. Can you suggest me a tutorial of how to configure UBRRL and UBRRH register for desired baud rate.



  19. #19
    Super Moderator
    Points: 77,827, Level: 68
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    15,771
    Helped
    3590 / 3590
    Points
    77,827
    Level
    68

    Re: GPS and GSM using Atmega 8

    Hi,

    Can you suggest me a tutorial of how to configure UBRRL and UBRRH register for desired baud rate.
    The datasheet.
    Formulas, explanation and a table....only one of these is sufficient.

    Klaus



  20. #20
    Super Moderator
    Points: 29,643, Level: 41
    andre_teprom's Avatar
    Join Date
    Nov 2006
    Location
    Brazil
    Posts
    8,863
    Helped
    1115 / 1115
    Points
    29,643
    Level
    41
    Blog Entries
    9

    Re: GPS and GSM using Atmega 8

    Quote Originally Posted by djc View Post
    Ohh, ok..but still trying to figure out what is the issue behind garbage data. Can you suggest me a tutorial of how to configure UBRRL and UBRRH register for desired baud rate.
    AVR Baud Rate Calculator: http://wormfood.net/avrbaudcalc.php?...000&databits=8
    --------------------------------------------------------------------------------------------------
    Part of the world that you live in, You are the part that you're giving ( Renaissance )



--[[ ]]--