Continue to Site

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.

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

two hardware uarts on AT89Cx051

Status
Not open for further replies.

mik3ca

Member
I own an AT89C4051 and an AT89S52 and don't want to wait forever to order special parts. I do have a store nearby that sells simple logic gates and flip-flops.

Anyways, what I am trying to do is have two high-speed (56k+) UARTs running off the same chip.

I tried the software and hardware UART approach but after reading an application note, it turns out that's not a solution because the timers of both UARTs could fire at the same time and the processor won't be able to process a bit from one UART in time.

So now I feel there are two ideas:

1. Use both microcontrollers and hook both up together to pass data, but then again, (according to something) the timing of both microncontrollers could be different in which data or signals won't be recognized even if I use the same crystal speed on both? unless my source of info is wrong.

2. make an I/O bus out of 74HC125/126 for each UART device and run a hardware counter that is incremented when the 8051 timer that controls the hardware UART is overflowed then when that counter reaches 10? (full byte packet for 8N1) increment a second counter. that way I could give each device a window of time for x number of bytes to process.

That's all for the ideas I could come up with. I don't want to replace those micros with something different since I knows these micros and I made programmers for them already.

So what would be the best option for me? and if someone votes for #1, is it possible that two micros can use the exact same clock?
 
The hardware uart shouldn't require a hardware timer or interrupts. If the software one is interrupt driven then you should be able to use both at the same time.

Do you have a link to the application note you mentioned?

Mike.
 
I own an AT89C4051 and an AT89S52 and don't want to wait forever to order special parts. I do have a store nearby that sells simple logic gates and flip-flops.

Anyways, what I am trying to do is have two high-speed (56k+) UARTs running off the same chip.

I tried the software and hardware UART approach but after reading an application note, it turns out that's not a solution because the timers of both UARTs could fire at the same time and the processor won't be able to process a bit from one UART in time.

So now I feel there are two ideas:

1. Use both microcontrollers and hook both up together to pass data, but then again, (according to something) the timing of both microncontrollers could be different in which data or signals won't be recognized even if I use the same crystal speed on both? unless my source of info is wrong.

2. make an I/O bus out of 74HC125/126 for each UART device and run a hardware counter that is incremented when the 8051 timer that controls the hardware UART is overflowed then when that counter reaches 10? (full byte packet for 8N1) increment a second counter. that way I could give each device a window of time for x number of bytes to process.

That's all for the ideas I could come up with. I don't want to replace those micros with something different since I knows these micros and I made programmers for them already.

So what would be the best option for me? and if someone votes for #1, is it possible that two micros can use the exact same clock?

Man, that software UART is so inefficient. That's harsh. Even other chips of the AT89 series only go up to 60Mhz. It also looks like they all only have one hard UART as well.

Can't you just use flow control?
 
Last edited:
Or, switch to a pic with dual UARTs. If you're programming in C you won't even notice the difference.

Mike.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top