General purpose asynchronous buffered receiver/transmitter. Transfers data between Logisim and host system through a socket.
- Download jar file from latest release
- In Logisim,
Project > Load Library > JAR Library
- Then you get new library
Network I/O
withUART
component
Port
- listen port
clk
- clock signal, inputrd/wr'
- read/write, selects operation mode, inputen
- enable, when low disables read/write operation, inputdt
- data available, high if there is some data in RX buffer, outputcon
- connection, high if there is active connection, outputRX
/TX
- data pins, output/input
en | clk | rd/wr' | Operation |
---|---|---|---|
0 | ↓ | x | No-op |
x | ↑ | x | Fetch |
1 | ↓ | 1 | Read |
1 | ↓ | 0 | Write |
- ↑ - rising edge
- ↓ - falling edge
- x - either 1 or 0
When en
is low, falling edge of clk
has no effect
On rising edge of clk
, contents of RX buffer are fetched from network connection and con
pin status is updated.
RX
pin outputs a value of the first byte of buffer.
When en
is high, rd/wr'
is high, falling edge of clk
drops the first byte of buffer and shifts all other bytes.
Updates RX
pin.
When en
is high, rd/wr'
is low, falling edge of clk
reads current value of TX
and sends it.
Each instance of terminal opens a new socket on a port specified by Port
property.
If two instances have the same port, the behaviour is undefined.
To use this library as Telnet terminal you need some Telnet client.
For example, you can use:
- Windwos: PuTTY or Microsoft telnet
- Linux:
telnet
command - MacOS:
telnet
frombrew
package manager
In order connect to an instance of UART
, set IP to 127.0.0.1
and port to one that you specified in properties of Logisim component.
Example: telnet 127.0.0.1 7241
Note that you need to handle Telnet control messages yourself.
This library doesn't really enforce any protocol, so you can connect to instance just like to regular socket and transfer binary data.
For example, you can use netcat
to send some data from terminal. Another way is to write a program in your favorite language that connects to socket.
Socket opened by UART
instance acts as a server, so it can't directly connect to other sockets.
If you want to transfer data between instances, you need some program on your host system that will connect to those instances and do all necessary routing.
If you get this message as status, that means that specified Port
is occupied, so it can't be bound.
To resolve this, you can either choose another port or free up current port, for example by finding and closing program that uses it.
If you get undefined behaviour, hanged up sockets or error
in status, you can try to restart Logisim, it will close unused sockets and try to reopen used ones.
On some systems you might need to wait up to minute for hanged up sockets to close. That is sometimes the case for port in use
status.