• Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Multiplexing 8051 UART

Status
Not open for further replies.
Hi.. I want to interface a GPS & a GSM module with my 8051. But since it only has one UART, this is a problem.. Can anyone pls explain how to this? & is it actually practically feasible?
 

Jon Wilder

Active Member
Do you HAVE to use a 51.... Can you get hold of the 52 version? The 52 has two RS232 ports
I'm not aware of the "standard" 8052 having two UARTs...unless it's a special derivative of some sort.

That being said, I'm guessing that the GPS module communicates with the UART in real time so there's really no way to multiplex the UART. Best to find a MCS-51 derivative that has two UARTs on chip.
 

WTP Pepper

Active Member
Write your own UART. I managed 4 @9600 on a 68HC11 using timers.
Use a -ve input to generate a timer interrupt. Once triggered, use the timers to sample the input every bit period. You do not need anything like 16x oversampling over a piece of wire.

Enable interrupt
-ve triggers interrupt. This will be the start bit.
Set time to sample 1.5x bit rate (this will ensure the first sample is in the middle of bit 0)
Set the timer to measure 1 x bit rate for the next 7 samples.
Shift each bit into a variable.

I can post asm but it will be in C for 6811 but the principle is the same.
 

rushi53

Member
Hi.. I want to interface a GPS & a GSM module with my 8051. But since it only has one UART, this is a problem.. Can anyone pls explain how to this? & is it actually practically feasible?
Hi Twisted_transistor,
What do you want to do with GSM module ? what is your application?
Do you want only to send sms or want to read sms as well ?

If you want to send sms then you can use 8051,
Connect TX pin of 8051 to the RX pin of GSM modem
and connect RX pin of 8051 to the TX pin of GPS modem
but by this method you won't be able to read sms
 
Initially I thought of using ARM 7 LPC2148.. But I've never used ARM before so it's a bit of a problem..
So can anyone suggest a controller with 2 UARTs & an I2C controller? Coz i'm also using a MEMS sensor.. MMA7660FC
This is a final year proj.. so pls help!!:)
 

WTP Pepper

Active Member
Hi Twisted_transistor,
What do you want to do with GSM module ? what is your application?
Do you want only to send sms or want to read sms as well ?

If you want to send sms then you can use 8051,
Connect TX pin of 8051 to the RX pin of GSM modem
and connect RX pin of 8051 to the TX pin of GPS modem
but by this method you won't be able to read sms
Yes you can. There is a subset of AT commands dedicated to reading and sending SMS over GSM. The precise commands are modem specific.

http://tinyurl.com/cqgg4kb for a start. Page 69
 
Last edited:
Status
Not open for further replies.

Latest threads

EE World Online Articles

Loading
Top