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.

How to interface two serial comm. devices to a uc

Status
Not open for further replies.

siva_2smart

Newbie level 6
Joined
May 8, 2008
Messages
11
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,373
external bus interface to serial

Hi !!!
I need to inteface a gps receiver and gsm modem to a single at89c52 microcontoller.But my microcontroller has single rxd and txd pins. Can anyone tell me how to do this...

HELP NEEDED URGENTLY... thanks in advance
 

interfacing two devices to 8051

One way to do this is to use mux-demux for the Tx/Rx signals.
 

lpc2000 noisy environment

That is a little strange. As you mentioned the 89C52 has only one UART, so the hardware has to be modified. Whether that is by adding a multiplexing scheme or by an external 2x UART that you can address either through the external bus or by bitbanging. Either way, a gps receiver and a gsm modem running at the same time could be A LITTLE too much to handle for a regular 8051 type device. At 24 MHz you execute approx. 1.5 MIPS all 8-bit data. So if incoming data are wider than 8-bit the speed will come to a crawl.

There are a few options:
Depending on the package you are using there could be a replacement device that is very close in signals and has 2 UARTs. It is called LPC952 from NXP. There are some differences though from a hardware standpoint.
1. Reset is active low
2. The LPC is a 3V device, the 89C52 a 5V device
3. It is a 2-clock core, 6x faster than the original 8051. At 16 MHz it is actually 4x faster than the 89C52 running at 24 MHz.
4. Flash programming algorithms are different

As you need to change the hardware, you might as well use a better micro!?

As for software, changes will be minimal, both are 51-based and can use the same tools to generate a program.

Other options with enough horsepower and 2 serial interface could be
STM32 low-end
LPC2103

Both ARM based 32-bit micros similar pricing to 89C52 but much more powerful and with 2 serial interfaces.

Hth, Bob
-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Need a consultant with thorough understanding of LPC, Cortex or ARM7
-> Let me know!
http://www.lpc2000.com has contact information
-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 

I thought of using a relay. As it is an electronic switch .Here gps only needs rx pin of microcontroller and if we use a relay fr rx pin between gps receiver and gsm modem . But my problem is whether we can do it like that or otherwise will there be a loss of data by using relays.
 

bobsanjose said:
That is a little strange. As you mentioned the 89C52 has only one UART, so the hardware has to be modified. Whether that is by adding a multiplexing scheme or by an external 2x UART that you can address either through the external bus or by bitbanging. Either way, a gps receiver and a gsm modem running at the same time could be A LITTLE too much to handle for a regular 8051 type device. At 24 MHz you execute approx. 1.5 MIPS all 8-bit data. So if incoming data are wider than 8-bit the speed will come to a crawl.

There are a few options:
Depending on the package you are using there could be a replacement device that is very close in signals and has 2 UARTs. It is called LPC952 from NXP. There are some differences though from a hardware standpoint.
1. Reset is active low
2. The LPC is a 3V device, the 89C52 a 5V device
3. It is a 2-clock core, 6x faster than the original 8051. At 16 MHz it is actually 4x faster than the 89C52 running at 24 MHz.
4. Flash programming algorithms are different

As you need to change the hardware, you might as well use a better micro!?

As for software, changes will be minimal, both are 51-based and can use the same tools to generate a program.

Other options with enough horsepower and 2 serial interface could be
STM32 low-end
LPC2103

Both ARM based 32-bit micros similar pricing to 89C52 but much more powerful and with 2 serial interfaces.

Hth, Bob
-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Need a consultant with thorough understanding of LPC, Cortex or ARM7
-> Let me know!
http://www.lpc2000.com has contact information
-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
89ls52 could be use on 3 volts
 

How can we assign two addresses to two devices in at89c51 microcontroller...???
 

The question is rather how can I design two addresses to ONE hardware device that has hardware fixed addresses for the SFRs. There could be an option for chip selects, which might work if the 51 is a send only device. But receiving from two different sources and making sure that there is no data corruption involves a bit more than 2 virtual addresses.

Bob
-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Need a consultant with in depth LPC2000 knowledge? -> Let me know!
http://www.lpc2000.com
-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 

Multiplexing can be done if you're not needing to be doing things at the same time or very terribly fast.

What update rate are you trying to achieve with the GPS?
Is there any requirements to be GPSing and GSMing at the same time?

Renesas has several controllers with multiple uarts.
 

shingadaddy said:
Multiplexing can be done if you're not needing to be doing things at the same time or very terribly fast.
Most systems can not guarantee that one event comes after the other. So, what if both, the GPS and the GSM start sending at the same time. No matter how slow it is, there is a problem that needs a higher layer protocol to resolve.
If both communication channels are triggered by the 51, it can be done, provided the bandwith and real-time capabilities of the 51 are sufficient.

shingadaddy said:
Renesas has several controllers with multiple uarts.
So has pretty much every other vendor. The LPC95x is probably as close to the device in use as a BMW 5 to a BMW 5M while the Renesas device would be more like a Cadillac and a BMW. Meaning, he should first try to find something very similar.


Bob
-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Need a consultant with in depth LPC2000 knowledge? -> Let me know!
http://www.lpc2000.com
-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 

I dont communicate with the two devices at a time ... So cant i use a relay ...


my question is CAN I USE A RELAY
 

you can use a relay try not using a solenoid relay ... use a cmos switch relay....
while transferring data.....
 

siva_2smart said:
I dont communicate with the two devices at a time ... So cant i use a relay ...
my question is CAN I USE A RELAY
If you are referring to a relay just as a switch, sure you can use a switch but that switch should rather be a logic gate as there is no need to drive any significant amount of current.

Asking for a relay to be used as switch in serial communication makes me wonder...

A relay is NOT the switch of choice in such an environment and if it is only for the potential noise it generates.

Bob
 

most of the people say Multiplexing
I once used multiplexing when you use two different frequency signal on multiplexer data is corrupted if you do not use proper decoupling
other way is to bit-bang (software UART)
whichi way you may find best
 

iftikhar_abid said:
dear u can use a simpl trick just use 2 addresses to enable one at a time......but in this way u will b able to access one at a time.

for further help u can mail me.
iftikhar_abid(at)yahoo.com

Regards,
Iftikhar Abid


Hi all,
I know another solution other than the multiplexing. It consist in simulating the Serial protocol. I tried it for a PIC 16F877 and I got 2 serial busses.

@ Iftikhar Abid

Do you mean Multiplexing or you talk about another technique ?
If, so , could you please elaborate it a little bit.

Thanks.
 

siva_2smart said:
Hi !!!
I need to inteface a gps receiver and gsm modem to a single at89c52 microcontoller.But my microcontroller has single rxd and txd pins. Can anyone tell me how to do this...

HELP NEEDED URGENTLY... thanks in advance

The dallas 8051 microcontroller series has 2 rs232 ports.. I think buying one dallas chip is the best solution.
:) :) :) :) :)
 

Hi all,
Use multiplexing and switching, is the best solution (sn74lv4052, nc7sv157). I use 4+1 different serial busses on a single usart uc port: bluetooth, gsm, gps nmea, gps sirfbin and external com port. Software usart port is a solution but use 100% processor time.

Regards,
Stephan
 

Hi all,
PIC16F877 with CCS compiler is the best way for it. and also easy way too. Please try PIC or other wise you have to go with two uart controller.

regards,
Anand.A
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top