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