Skip to content

UART Replacement

Robin Verhagen-Guest edited this page Jan 24, 2020 · 24 revisions

UARTReplacement is a configurable plugin for the CSpect emulator.

The plugin replaces the internal CSpect emulated ESP. The replacement UART writes binary bytes to the serial port, whereas the internal CSpect UART constrains bytes to ASCII characters 0x00..0x3f. This doesn't matter so much for sending AT commands to the ESP-01, but programming the ESP with low-level SLIP commands requires a binary UART.

THe UART dynamically responds to baud rate changes written to the Next's UART I/O ports, using prescaler calculations taking into account the current video timing.

Installation

You must be running CSpect version 2.12.1, or newer. The latest version of CSpect is always available to download here.

The latest tested version of the plugin is always available at the releases page.

Download the CSpectPlugins.zip file, then extract the UARTReplacement.dll and UARTReplacement.dll.config files. Exit CSpect, then copy these into your CSpect directory (the one which contains CSpect.exe).

CSpect is supplied with some plugins preinstalled. If your CSpect installation already has these two files, skip to the Configuration section unless you wish to update to the latest plugin version.

Restart CSpect to enable the plugin.

Uninstallation

To uninstall, exit CSpect and delete the UARTReplacement.dll file from the CSpect directory.

Configuration

The plugin can be configured by editing the UARTReplacement.dll.config file in your favourite text editor. Always restart CSpect after changing the configuration. You may configure these settings:

PortName

Set this to the name of the serial port you are using on your host operating system, for example COM5 or /dev/ttyS0.

The default value is COM1.

Baud Rate

The routine for the prescaler baud calculations does an integer division: clock rate / prescaler value, using truncation instead of rounding. For example, using HDMI timings the plugin calculation for 115200 baud is 27000000 / 234 = 115384 baud.

In practice, this is what is most likely to work, as the ESP-01 effectively uses a similar calculation in its divider chain circuit. Issuing the AT+UART_CUR? command at startup returns 115384.

Clone this wiki locally