Emulated UART Demo using a periodic timer to clock logic.

This demo uses JavaScript. process1() is run every 200ms, to simulate the CPU clock of microprocessors.

  window.setInterval("process1()",200);

[textA]- - - [A] - - - - [B] - - - [textB]       
The A reads a character from textA and sends it to to B. [A] looks for GA in what it sends, and slows down [B] looks for GA in what it receives and speedsup its typing. If there is a pause, send an "Are you there?"
device A:

[textA]

[uartA] [wordA]

device B:

[uartB] [wordB]

[textB]

TX: communicates RX: using the UART.

This is summarised as a TX and RX register and two flags TxEmpty and RxFull.

Emulated CPU - UART:-

  A write to TX resets TxEmpty.
  A read from RX resets RxFull.

UART - Host:-

  A read from TX sets TxEmpty.
  A write to RX sets RxFull.

If you have a FIFO then there need to be changes.

 TxEmpty may need to be TxSpaceAvailable 
 RxFull becomes RxAvailable

Automated Typing demo - InterConnected Terminals.

Two automated terminals type at each other. They can see the text the other end is typing.

Try and get each to type at each other. If the other one is typing, do not type at the same time.

This is not supposed to do AI on the text, use simple rules.

[ A ] - - - - [ B ]

Send one character each tick.

The other end receives it and buffers it.

A UART has a TX buffer, and TX buffer and flags.

Flags:
	TXbuffer
	TXempty
	RXfull
	RXbuffer

[ A ] analyses the buffered text.
if last text was GA\n reduce holdoff typing.
if last text was space hold off typing until timeout.

if holdoff times out resume typing.
if [A]'s next char is a space, you need a rule.