CBM 610 (B128) IEC adapter

Started by carlsson, April 13, 2009, 08:44 PM

Previous topic - Next topic

0 Members and 4 Guests are viewing this topic.

Steve Gray

Quote from: Michau on October 01, 2010, 07:30 AM
Well, I must support the B256, since I have myself upgraded my 610 to 256kB RAM and BASIC 256 ;) But I guess that the P500 could easily be omitted.

I find the 256K ram nice, but I prefer the 128K BASIC ROM. You are of course free to use the 128K BASIC ROM with 256K RAM...  this gives two full banks free to do whatever you want without worrying about BASIC overwritting your data, and the commercial software runs fine. BASIC won't use the extra banks but, realistically, how much space do you need for variables? Your BASIC program will still be limited to 64K.

I wrote an "un-assembler" that took any code and created an assembler file by loading the code into bank3. I wrote a music player for C64 Master composer files by reading the song into the unused bank and having the playback code in bankf. I wrote a file copier that simply read files into bank3 and wrote them back after swapping disks.

Steve

Michau

This is the second cartridge revision. It should support automatic device type discovery. So now it is possible to use IEEE and IEC devices at the same time!

SYS 24586 - disable IEC
SYS 24589 - enable IEC/IEEE

How does it work? When a device is first accessed (by KERNAL routines TALK and LISTEN), the cartridge tries to find it on the IEEE bus, by trying to open some file on it. If opening the file does not yield the error "Device not found", the device is thought to be present on the IEEE bus. Otherwise the device is supposed to be found on the IEC bus.

The device status is cached in memory at $F03FF. The first 4 bits contain the device number (4-15), and bit 7 indicates IEEE status (0 - device is IEEE, 1 - device is IEC).

All subsequent accesses to this device will look at this cached status variable and choose appropriate routines (IEEE or IEC). This way device status needs not to be rechecked every time.

There is also another status variable at $F03FE, which holds status of the previous device. This way, for example, you can copy files from one drive to another, and the cartridge remembers status of both devices without the need of constant rediscovery. Only when you try to access a third device, the first status is thrown away - so the cartridge always remembers the status of two last accessed devices. This speeds up operations that require using two devices at the same time.

This scheme may have an unplasent side effect - if you try to access a nonexistent IEEE device, the cartridge remembers its status as IEC. So even after you plug it in, it still will be inaccessible because the cartridge will look for it on the IEC bus according to the cached status. You can clear the statuses, for example, by trying to access two other devices (like 14 & 15) so that status variables are cleared. This is something I will need to look at in the future (for example, by attempting discovery also on the IEC bus).

I have checked the cartridge briefly with my 8250LP and 1581. It works fine - I can access both devices at the same time, without the need of any manual configuration! I can open files on both drives simultaneously, read/write from them etc. I would like to hear about your experience, and what drives you were using.

Note: variable at $F03FD is used as a temporary scratchpad for the routines. Also, I have no idea how the autodiscovery routine would work on IEEE printers, as they differ significantly from disk drives. I don't have any IEEE printer to test.

Now I am going to work on autostart routines. Plus buy an EPROM eraser, as I used my last EPROM on this one ;)

carlsson

Great work! I should burn myself a cartridge and test it a little.

Michau

Would be great to know how it works with different devices. Especially the IEEE detection routine, as I've never seen before anybody doing such thing so I don't know whether I got it right :)

Michau

Looks like nobody has the courage to test this code :P

I have been debugging it extensively yesterday. I removed a bug in the IEC code causing first IEC device access to fail. Unfortunately, the autodiscovery routine does not work with my IEC 1581, so I made some other workarounds to detect drives that don't exist on both buses. This removes the need to clear the device cache after connecting a new IEEE device.

I also added some settings variable to facilitate forcing all devices to be lEEE or IEC (thus disabling autodiscovery). All printers are IEEE by default, this also can be disabled.

The autostart cartridge code is also almost ready. It does not work on P500, as I don't have one to test, and VICE does not support it. I will release the code after Christmas, when I have some free time to polish it.

Steve Gray

Courage I have... time... not so much ;-)   I have plenty of EPROMS and an eraser, so i'm willing to test when I can. Glad to hear you are making improvements!

Steve

Steve Gray

#81
Ok, so I burned an EPROM and did a quick test. Yes, I noticed the error on first IEC access.
It works with my MSD-SD2 as device 8 on IEEE, and the uIEC as device 10 on IEC! Nice.

It's actually funny... since my "cassette to IEC adapter cable" is plugged into the B machine and the uIEC uses the cassette connector as power I ended up using a 64C simply to power the uIEC.... I may have to add a +5V tap on the the adapter ;-)

Which, brings up a question.. what exactly do we call this "cassette to IEC adapter cable"? It needs a nifty name... Should we settle on C2N2IEC ? Or, perhaps C2IEC, CX1541 or XC1541?


image uploader

Steve

carlsson

I agree with Steve. I would have tested the most recent version a week ago if it wasn't for lack of time.

By the way, as you have seen from earlier pictures I hacked my uIEC/SD right away to fit a female IEC connector. Actually that connector came loose on the side with my C2N232I that I once bought from Marko/Nicolas. I brought the whole uIEC/SD/IEC adapter to Germany in August 2009 and the first thing Nicolas said was that he recognized the female IEC connector that he once sourced for the C2N232I. Apparently they were a bit difficult to find for a good price.

Hopefully I'll get around to test this one in the weekend or over the Christmas holidays.. well, one can always hope.

Michau

Quote from: Steve Gray on December 17, 2010, 03:25 AM
It works with my MSD-SD2 as device 8 on IEEE, and the uIEC as device 10 on IEC! Nice.

This is great news - it means that autodiscovery works even with non-Commodore IEEE drives! Better than I expected ;)

Quote from: Steve Gray on December 17, 2010, 03:25 AM
Which, brings up a question.. what exactly do we call this "cassette to IEC adapter cable"? It needs a nifty name... Should we settle on C2N2IEC ? Or, perhaps C2IEC, CX1541 or XC1541?

I'd opt for C2IEC for short... I don't like overly long acronyms, and the cable isn't just for 1541 :)

Michau

Quote from: carlsson on December 17, 2010, 06:13 AMBy the way, as you have seen from earlier pictures I hacked my uIEC/SD right away to fit a female IEC connector. Actually that connector came loose on the side with my C2N232I that I once bought from Marko/Nicolas. I brought the whole uIEC/SD/IEC adapter to Germany in August 2009 and the first thing Nicolas said was that he recognized the female IEC connector that he once sourced for the C2N232I. Apparently they were a bit difficult to find for a good price.

I have been looking for these connections for many hours over the Internet. Finally I found a shop which sold them. They were very cheap actually, I can try to locate it again for you if you need. I bought two for myself, so I also have one free.

Michau

Ladies and gentlemen, this is the first official release of the automagic & autostart IEC cartridge :)

The cartridge now installs IEC routines on boot, and displays an appropriate message. No setup / SYS calls necessary, just Plug&Play ;)

The variables were moved into the top of screen memory, as I have a feeling that they're less likely to be overwritten there. So there go:

$FD7FF - status of current device (bit7=0 - present on IEEE bus, bit6=0 - present on IEC bus, bit5=1 - device status was overridden, bits4-0 - device number).
$FD7FE - status of previous device
$FD7FD - temporary variable
$FD7FC - bus overriding (bit7=1 - override autodetection, then bit5=1 - all devices are IEC, bit5=0 - all devices are IEEE, bit6=1 - all printers (device4&5) are IEEE).

If both bits 7 and 6 of device status are 1, then the device was not found on any bus. The device status will then be rechecked on next access. This allows hot-plugging of devices.

There's also a bonus for Steve, a fast RAM check on power on ;)

Steve Gray

I must say I'm slightly jealous... you have the ultimate B-series machine, which is something I've been trying to make for a while now. Congrats! Very nice job. I'm going to have to try to assemble my own BX720D ;-)

I look forward to the new IEC features you are working on. Oh, and thanks for the fast RAM check!!!

Steve

carlsson

#87
I haven't yet had the opportunity to try the latest firmware, but I'm on my way. At least I have set up my 610 as a standalone workstation:

http://www.geting.se/viewimage/image/287778-cbm610-corvus-setup.jpg

The Philips monochrome monitor has the option to toggle between green-on-black or black-on-green. The camera with its flash doesn't do the monitor justice, but I prefer black-on-green.

I suppose I might reconfigure my uIEC/SD to device #10 as the Corvus currently is #8 and the 2031 is #9. But more on that later...