Re: serial link high level protocol thoughts?

From: Marko Mäkelä (
Date: 2008-11-07 10:33:56


On Wed, Nov 05, 2008 at 01:24:13AM -0600, Jim Brain wrote:
> I am working towards enabling USB connectivity to the PC via uIEC, and 
> I've had some initial success.  Of course, now I need to work on the 
> protocol between the two endpoints.
> Although my initial thought was a low-level protocol (CMD bytes, data 
> bytes), it turns out that for most disk access, it's more efficient to 
> operate at a higher level.  I've implemented a set of commands, but I'd 
> like to solicit suggestions on something that might be standardizable, 
> or at least has merit beyond my thinking.

In the summer of 2003, around the time I became a father, I implemented
serial bus interface for the C2N232 adapter.  By December, I had it mostly
working, except that it couldn't talk to a 1541.  It would emulate up to
32 devices.  I tested by issuing LOAD, SAVE, OPEN, GET#, PRINT# commands
on the C64 or VIC-20 and by sending appropriate control/data sequences
to the modified C2N232 over RS-232.

> From a high level protocol perspective, the IEC routines can take care 
> of handling the DEV/CHAN stuff and deliver to the firmware a complete 
> command string (open "name" on channel X or open/exec "data" on channel 
> 15), data requests (fill read buffer with data, write this data to 
> storage) , or channel closure.
> Any thoughts on that?  Any particular format folks might prefer?

I made the interface very low-level.  The firmware running in the C2N232
takes care of asserting the bus or responding to ATN.  It can act as a
controller or as up to 32 devices.  (You tell it which serial bus device
numbers it will emulate.)  It will relay all commands and data over the
RS-232 link.  The software running on the PC would act as appropriate
(emulating disk drives and printers, or emulating a host that talks to
real serial bus hardware).

Because of family constraints, I didn't develop this further, but I think
I could have some time for this now.  There's no software for the PC yet,
just a terminal program.  And the ATtiny2313 firwmare can't talk to a 1541
for some reason.  It seems to work perfectly in slave mode.  Of course,
fastloaders won't work, as the serial bus protocol cannot be changed.
Like all my hobby projects, this is open source, but given that it the
controller mode does not work, I haven't released it on my web page yet.

If someone has the equipment and the skills to help me fix the problem with
the controller mode problem, I can donate a C2N232I to a good cause.
I don't have a logic analyzer or a memory oscilloscope myself.  3 channels
would be nice, but 2 channels could do if you measure CLK,DATA and ATN,CLK

Wolfgang Moser just made me aware of the sd2iec a couple of days ago.  It
feels like a good idea.  I was wondering if you could implement some tape
emulation in it.  However, that would require some user interface (LEDs or
display and some buttons) for selecting the image to read or write (virtual
tape control; play/rec/fast-forward/rewind).  Maybe not worth the trouble
and additional hardware cost.


       Message was sent through the cbm-hackers mailing list

Archive generated by hypermail pre-2.1.8.