# RC2014 USB UART

## Using supplied UART

```
[   43.140568] usb 3-2: new full-speed USB device number 4 using xhci_hcd
[   43.281499] usb 3-2: New USB device found, idVendor=3171, idProduct=0034, bcdDevice= 2.10
[   43.281508] usb 3-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[   43.281510] usb 3-2: Product: USB to UART Adaptor (5v)
[   43.281513] usb 3-2: Manufacturer: 8086 Consultancy
[   43.281514] usb 3-2: SerialNumber: 0948
[   43.287686] user.info: Apr 20 13:37:03 mtp-probe: checking bus 3, device 4: "/sys/devices/pci0000:00/0000:00:14.0/usb3/3-2"
[   43.287966] user.info: Apr 20 13:37:03 mtp-probe: bus: 3, device: 4 was not an MTP device
[   43.302148] cdc_acm 3-2:1.0: ttyACM0: USB ACM device
[   43.302175] usbcore: registered new interface driver cdc_acm
[   43.302177] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
[   43.302361] usbhid 3-2:1.2: couldn't find an input interrupt endpoint
[   43.302404] usbcore: registered new interface driver usbhid
[   43.302407] usbhid: USB HID core driver
```

Module: `cdc_acm` (not available on Alpine/PostmarketOS)

Pins on I/O board:

1. `GND`
2. `!CTS`
3. `5V`
4. `TX`
5. `RX`
6. `!RTS`

Connect: `sudo tio /dev/ttyACM0`

Consider adding your user to `dialout` group for sudo-less access: `sudo usermod -aG dialout $USER`.

## Sending files with A:DOWNLOAD.COM

Use delay on sending data with `tio /dev/ttyACM0 -o 1` (if it gets stuck try higher number than 1, but upload take more time).

The `btc` program can be compiled to create encoded data for upload: [https://github.com/RC2014Z80/RC2014/tree/master/CPM/File%20Uploader](https://github.com/RC2014Z80/RC2014/tree/master/CPM/File%20Uploader).

Paste it's output to the terminal. It will start `A:DOWNLOAD <file name>` command and rest of the data will be interpreted by it. If all goes well it prints `OK`.

There is also `UPLOAD.COM` program that can be sent to the device to encode local files the same way: [https://github.com/RC2014Z80/RC2014/tree/master/CPM/UPLOAD.COM](https://github.com/RC2014Z80/RC2014/tree/master/CPM/UPLOAD.COM).

The `UPLOAD.PKG` file is already encoded so you can just paste it to the terminal.

### Sending longer files

Use tio to boot and navigate to target drive.

Then use `CTRL-T` followed by `Q` to quit tio.

Pipe btc output to tio:

```
btc <file> | tio /dev/ttyACM0 -o 1
```