cbscpe wrote:
Why use XMODEM, now that's very clear, there are several reasons to use it on a hardwire connection. As a transmission protocol to send data from your PC/Mac to a SBC there are many advantages
As the protocol is very simple the footprint is very small in AVR assembler and in 6502 assembler code
It requires only a simple ACIA/USART with only RX and TX
It is available in almost all terminal emulation programs
You can use any serial port
You can transmit binary files, aka ROM images
I don't know of any other method that is as simple as Xmodem to connect a PC/MAC with a SBC. And as AVR can write their own flash you don't even require a programmer once you have flashed the code to the AVR. And of course I use CRC (see discussion of serial and table driven CRC calculation)
All good arguments. However, S-records are even simpler (mo CRC calculations required) and don't require use of a terminal emulator, as the format was specifically designed by Motorola for file transfers through hardwired connections. Also, no special protocol is required, no ACK/NAK, or similar. It's a constant data stream that works between any two entities, no matter the operating environments.
I use the S-record output from the Kowalski assembler, which happens to run on Windows. Kowalski's S-record output isn't a full implementation, as it doesn't generate S0 or S5 records, but in practice, that's not a liability. The physical hardware connection to POC is through a UNIX box (which used to be my 6502 development environment), but the Windows junk runs on top of Samba on a Linux box.
In order to get the data stream over from Kowalski to POC, I save the S-record object output into a file that is constantly monitored on the Linux box—this is one of several output formats supported by Kowalski. When the script that is doing the S-record file watching sees the timestamp change to a more recent date and time, a TCP connection on a dynamic port is made via
netcat to the UNIX box, which also has netcat running as a listener. Once the connection goes live the S-record file is catted to netcat's stdin, which then passes it via the network to netcat on the UNIX box, whose stdout is directed to the appropriate serial port. From there, the data flow is to POC via the unit's auxiliary TIA-232 port. POC has an S-record loader built into the firmware to process the incoming data. As each S-record has a checksum field, error checking is inherent in the decoding process. However, I've never had a transmission error occur in some six years of using this process.
When I was initially designing POC and was working out how to transfer code to it from the assembler, I looked at several methods, XMODEM-CRC being one of them. I came to my senses when I realized that no elaborate error checking or transmission protocol was necessary on a short-range serial link, especially one using hardware handshaking.