Newsgroups: comp.sys.transputer
From: raw@stardust.sj.unisys.com (Bob Wipfel)
Subject: Re: Is it feasable to implement a software UART on a T225?
Organization: Unisys Open Systems Group, San Jose
Date: 15 Aug 1994 16:48:28 GMT
Message-ID: <32o68s$5sc@ctnews2.sj.unisys.com>

In article <174@autro1.UUCP>, teig@autro1.UUCP (Oyvind Teig) writes:
|> DUART IMPLEMENTED IN OCCAM IN T225 - FEASABLE?
|> 
|> I am looking at implementing a (double) UART in occam in a T225.
|> The transputer will in addition to being a DUART, handle the serial
|> line protocol, and do some other minor A/D etc.
|> 
|> I consider an UART software to be fairly easy, the way I'm thinking of
|> doing it is to (over)sample an input-port at a constant speed, independent
|> of baud-rate, and note the time of each transsition. Later on, in another
|> process, I will extract the bits, knowing the speed, also filter a little. 
|> The reason for all this is that I must implement auto-baud detect, and 
|> *use* the first character received - so a hardware UART is impossible(?)
|> to use.
|> 
|> Some UARTS have separate I/O-pins in addition to the TxD and RxD. It is
|> then possible to combine the software UART and a hardware UART, but then the
|> hardware UART isn't necessary.
|> 

There is a DUART called SCN6281 with these pins. We had a board with a T414,
a SCN2681 DUART, and a number of other devices (clock, keyboard interface, ROM,
FLASH ROM etc. used as the console device for an X-Windows workstation).
 
I was autobauding the serial line in order to program the DUART later.
This works pretty well, and you should be able to implement the entire protocol
in software by sampling the RxD pin. I was sampling at twice the maximum
baud rate I ever expected to see, measuring the width of the start bit (or was
it the stop bit). Anyway, seems it could only cope with odd ASCII characters
since this ensured a least significant bit of one and therefore a one bit period
between negative edge, and then the positive edge. Similar code was used to
implement an IBM PC style keyboard interface which has a similar line protocol.
 
You should be able to get a T225 to drive the serial line, but not more than
19.2K baud (52us per bit).
 
The code was written in OCCAM, with a continuous hi-priority loop and an ALT
TIMER input, there was another channel ALT'ed on to abort the autobaud. The code
of the loop just sampled the pin (by reading from a memory mapped PORT).

Cheers,
Bob W.

-- 
|--------------------------\---------------------------------------------------|
| Bob Wipfel                \  Ski and Parapente the Wasatch Front             |
|                            \                                                 |
| UNISYS Corporation          \  Internet: raw@unislc.slc.unisys.com           |
| Distributed O/S Group        \  UUCP:    ...!{sun!sequent!ctnews}!unislc!raw |
| Scalable Parallel Processing  \  Phone:  +1 (801) 594 6281                   |
|--------------------------------\---------------------------------------------|

