DSPRelated.com
Forums

BF533: How to create a big-banging version of a UART

Started by Reuven Kishon August 29, 2004
Hello there,

I was wondering if anyone had tried to create a bit-banging version of
a UART for the Blackfin 533. I am working on a project where we
unforunately need to use 2 UARTs and the blackfin only has one.

Since I am not at work right now, I'll try to explain how we have
tried to go about it.

First of all we have the TX line of a UART device tied to PF7. We
start off by checking for 16 consecutive 1's at the data rate of 19.2
kbps by using timer0 to check incoming data every 50us or so. Once we
see that many ones, we stop the timer and configure PF7 to be an high
to low edge interrupt source (this is because the start bit is a
transition from high to low). After we see the start bit, we
immediately turn off programmable flag interrupts for PF7 and enable
the timer yet again (this time at half the rate of 19.2kbps because we
want to clock the data in at the middle of each bit, and the start bit
only needs half the time  to reach the middle of the bit). After the
stop bit is found, the next time the timer is called we change the
data rate back to 19.2kbps and keep storing the data bits that come
in. Once we get all 8 data bits, we look for the stop bit (indicated
by a 1), and once we receive it, we stop the timer and start the
proccess all over again by looking for a high to low interrupt on PF7.

Our problem seems to be that our timing may be off slightly because we
have been checking the values we are receiving and comparing them to
the known sequence the UART Transmitter sends (which is AT=BUSY+7),
and they dont match completely (1 or 2 bytes in error).

I don't know how much it helps without code, but I thought it may be
worth a try. Who knows, maybe someone has allready come up wiht a bit
banging version of a UART on the BF533,

Reuven
Reuven Kishon wrote:

(snip of bit banging UART)

> Our problem seems to be that our timing may be off slightly because we > have been checking the values we are receiving and comparing them to > the known sequence the UART Transmitter sends (which is AT=BUSY+7), > and they dont match completely (1 or 2 bytes in error).
> I don't know how much it helps without code, but I thought it may be > worth a try. Who knows, maybe someone has allready come up wiht a bit > banging version of a UART on the BF533,
I don't know if it helps any, but I used to use an EPSON printer with a serial port, which I believe was implemented in an Intel 8049, and connected it to a TRS-80 Color Computer with a bit banged serial port output. It seems that the Epson was very sensitive to slightly slow timing, but easily ran if the bits were shorter than desired. I would carefully check your timing, and also try varying it both ways around the proper timing. -- glen
"Reuven Kishon" <reuvenkishon@gmail.com> wrote in message
news:48465280.0408291517.7bd0e1ab@posting.google.com...
> Hello there, > > I was wondering if anyone had tried to create a bit-banging version of > a UART for the Blackfin 533. I am working on a project where we > unforunately need to use 2 UARTs and the blackfin only has one.
[deleted] ADI used a bit-banged UART on the old ADSP-2181 EZkit. You should be able to find the monitor code for that, which might help. Leon