Microcontroller › AVR › How to connect 2 devices to single USART?
- This topic has 11 replies, 4 voices, and was last updated 12 years, 1 month ago by
Not Telling.
-
AuthorPosts
-
October 14, 2013 at 8:54 am #2679
Krishna
ParticipantIm 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!!!
October 15, 2013 at 4:50 am #10525AJISH ALFRED
ParticipantHi 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.
October 15, 2013 at 6:40 am #10528Krishna
ParticipantOkay 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?
October 15, 2013 at 6:46 am #10529Krishna
ParticipantAnd 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?
November 15, 2013 at 6:02 am #10608Ganesh Selvaraj
ParticipantHello Mr.Krishna, you can use software uart to connect multiple serial devices to a single ATMega16 chip
November 26, 2013 at 10:05 am #10657AJISH ALFRED
ParticipantHi 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
March 3, 2014 at 5:48 am #11168Krishna
ParticipantIn 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.
March 3, 2014 at 5:49 am #11169Krishna
ParticipantAlso need code to get the coordinates for location on LCD. Please provide code for that too..
March 3, 2014 at 5:28 pm #11179Ganesh Selvaraj
ParticipantHello 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.
March 4, 2014 at 10:08 am #11183Krishna
ParticipantI’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.
March 4, 2014 at 11:30 am #11184AJISH ALFRED
ParticipantHi Krishna,
Consider subscribing to the codes and circuits.
March 7, 2014 at 7:28 am #11227Not Telling
ParticipantAs 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.
-
AuthorPosts
- You must be logged in to reply to this topic.