dual uarts

Status
Not open for further replies.

baftab

New Member
hi
i was working on this project of mine...using at8c51, which has a built in UART, was using it to comm my rfid reader

no i need it to comm it to my pc as well...using serial port
but as 89c51 has one serial port which is already occupied...am confused

i hav heard the there our other uart ics available tht can be interfaced to 89c51

are there???? help please
 

I dont use the 89C series, but it should be possible to write a 'software' UART,
bit switching. I suspect there is an example for the PIC in Nigel's tutorials.

Look here:
https://www.electro-tech-online.com/custompdfs/2007/10/software_uart.pdf

http://www.avocetsystems.com/company/articles/magazine/auart.htm
 
Last edited:
ericgibbs said:
I dont use the 89C series, but it should be possible to write a 'software' UART,
bit switching. I suspect there is an example for the PIC in Nigel's tutorials.

There is, it's failry trivial to do, and should be for any processor - for those who remember back that far?, the Commodore VIC20 used a software UART - supposedly because they ran out of money to use a hardware one.
 
aright....thanks

but now i think i would need to change my controller as i need more ports...
i miscalculated the requirements before i began working on it

so..tellme about some other controller tht has built in uarts, not one but 2 and more than 4 I/O ports
 
baftab: I've been using the MAX3100 on a project I'm doing... nice hardware UART with FIFO and interrupts. PIC have some CPU's with 2 UARTs, not sure if they have more (a parametric search option on their site will tell you.)

P.
 
baftab said:
out some other controller tht has built in uarts, not one but 2 and more than 4 I/O ports


The need for 4 hardware UART's is a little over kill for most applications heh. I would suggest you have a look at using a higher language so that software UART is as easy as;

Code:
Include "SUART.bas"

SUART.SetBaudrate = sbr9600

Data = 0
While True
     Inc(Data)                         // Increment the data regiester
     SUART.SetTX = PORTB.0
     SUART.WriteByte(Data)
     SUART.SetTX = PORTB.1
     SUART.WriteByte(Data)
     SUART.SetTX = PORTB.2
     SUART.WriteByte(Data)
     SUART.SetTX = PORTB.3
     SUART.WriteByte(Data)
     DelaymS(50)
Wend
 
A note on that though - be sure to setup the default condition of all your SUART pins depending on what mode you choose (Inverted/True) or the first piece of data to be received will be corrupted (but then the software will leave it in its correct "idle" state)
 
baftab said:
you hav interfaced max3100 with 89c51??
or some other controller?

I used a PIC processor, but the MAX3100 has a simple SPI interface which will work with almost any microcontroller, even if it does not have a hardware SPI port, because SPI is easy to do in software and is *not* timing-constrained as software UARTs which need precise timing loops.

Hope this helps,
P.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…