- This topic has 11 replies, 4 voices, and was last updated 10 years, 6 months ago by .
Viewing 12 posts - 1 through 12 (of 12 total)
Viewing 12 posts - 1 through 12 (of 12 total)
- You must be logged in to reply to this topic.
|
Microcontroller › AVR › How to connect 2 devices to single USART?
Im working on a project which requires me to connect a sim300 module and a gps module to a single atmega16 chip. Please instruct me on how to proceed. Is it possible. I need to get the gps coordinates and forward them through the gsm module. Please help.
Thank You in advance!!!
Hi Krishna,
In your project it is not such a big deal. The SIM300 always receives data and the GPS always transmits data only. So connect the SIM300 to the TX pin of the serial port and the GSM module to the RX pin of the serial port.
Okay thanks Ajish. I was thinking the same thing. I’ll follow what you said. And now if i want to interface a 3 axle accelerometer to the same chip how to do that? Is there a tutorial on that?
And one more thing. You meant the Tx of the chip to Tx of sim300 and Rx of the chip to Rx of the gps module? Or is it the other way round the Rx of the chip to Tx of sim300 and Tx of the chip to Rx of the gps module?
Hello Mr.Krishna, you can use software uart to connect multiple serial devices to a single ATMega16 chip
Hi Krishna,
The TX of MCU to RX of SIM300 and RX of MCU to TX of GPS.
If you want to add accelerometer, then you have to switch between the TX of GPS and accelerometer using an analog switch like CD4066
In have completed my interfacing by connecting the Rx of Atmega16 to the Tx of GPS Modem and the Tx of Atmega16 to Rx of sim300. Now i want to send an sms through the microcontroller. Can you please provide me with a code for that? Im really helpless.
Also need code to get the coordinates for location on LCD. Please provide code for that too..
Hello Mr.Krishna. I’ll post the code for sending sms through modem soon and regarding the co-ordinates display on LCD please go to EG LABS > AVR . You will find the code for GPS interfacing there.
I’m not able to access the code for GPS on the project you suggested. Can you please help me out? I’m done with the interfacing just need help with the code.
Hi Krishna,
Consider subscribing to the codes and circuits.
As Ajish pointed out, you got lucky in this case. However, in general I would use a couple of tri state buffers or an inverse multiplexer to solve this. You could tie the inputs to the buffers together on the Tx line of your master and the outputs together on the Rx line of your master. Then just use a few GPIO ports to select which buffer to enable/disable.