Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

GPS and GSM using Atmega 8

Status
Not open for further replies.

djc

Advanced Member level 1
Joined
Jan 27, 2013
Messages
402
Helped
3
Reputation
6
Reaction score
2
Trophy points
1,298
Location
India
Activity points
4,554
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.
 

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
 

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.
 

Hi,

* one software UART
* and one hardware UART

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

Klaus
 

@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.
 

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
 

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.
 

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.
 

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.
 

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.
 

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.
 

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.
 

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.
 

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.
 

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

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

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.
 

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
 


Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top