Login
Back to forumReply to this topicGo to last reply

Posted By

Crown
on 2025-04-18
06:17:48
 Cartridge for Burst mode

Has anyone attempted yet, to design a cartridge to enable burst mode for 1570/71/81 drives?

Basic design constraints: requires IEC connector on the cart, custom ROM either in the cart, or replaced in the machine, optional parallel cable connector on the cart so that it can work with C16 as well.
Device ids would be in 12-15 the range.
MMS1
Posted By

gerliczer
on 2025-04-18
06:39:24
 Re: Cartridge for Burst mode

Burst Mode in Commodore IEC Bus parlance is a form of serial transmission driven by the hardware shift register of the *IA, AFAIK. As VIA had a shaky implementation of this feature, 1540/1541 couldn't do Burst Mode transfers reliably. Or did I misunderstand something again?
Posted By

ytm
on 2025-04-18
06:57:06
 Re: Cartridge for Burst mode

@Crown mentioned 1570/71/81, so yes it's about fast serial with hardware shift register. This can be done, but the cartridge needs CIA just for that and CNT/SP lines need to be routed back to IEC connector.
It's not difficult to program for: devices agree on the protocol using standard IEC communication and then switch to fast serial. It can be done on C64 (with h/w mod) or C128 in C64 mode too: https://a1bert.kapsi.fi/Dev/burst/

Another meaning for 'burst' would be parallel connection to 1541, but again CIA/VIA is needed because (unlike 1551) it relies on hardware handshake.
Posted By

Crown
on 2025-04-18
07:20:06
 Re: Cartridge for Burst mode

Yes it is for 1570/71/81.

Yes one possible approach is a CIA based one, there the issue could be the different clock, would the timings of the protocol work if the CIA is driven with the Plus4 clock? If not than it would need some read/write buffering mechanism to pass the data between the two differently clocked domain, but that might be way to complex.

The other solution is adapting an XUM1541 and family based solution, to interface to the Cartridge port instead of USB. This probably requires an additional power supply as well.

As for the physical connection, I see two solutions: the cartridge has an IEC port, and the drives are connected directly to this port, and the regular IEC remains for other drives.

Alternatively an IEC splitter device can be constructed which connects the drive to both the IEC port on the motherboard, and the IEC port on the cartridge.

The parallel port is an optional bonus, parallel port mods exist for each drive, and could be used here as well. And it could be used for 1541 drives without burst, in a C16 where there is no userport.
Posted By

ytm
on 2025-04-18
07:55:27
 Re: Cartridge for Burst mode

CIA would have to be clocked in a similar way how it's done for SID cartridges by about 1MHz signal.

There is already a difference between C128 (0.98... MHz PAL) and 1571/81 (1MHz exatcly) clocks, buffers are not required.

It's synchronous and timed by CIA timer. On C128 one bit is shifted in/out every 4 ticks of CIA phi2 clock. It doesn't speed up when CPU is switched to 2MHz mode.

Regarding IEC I think that having something like UltimateII+ solution would be the easiest one: two pass-through sockets on the cartridge - one for drives and one for connection with a short cable to mainboard IEC port. This way Kernal can be used to talk with all the devices.

Parallel port from CIA for 1541 burst would be a cherry on top happy.

It may seem wasteful to use CIA only for its hardware shift register, but that's exactly what C= did with plastic C128D.
Posted By

BSZ
on 2025-04-18
09:43:11
 Re: Cartridge for Burst mode

Several thoughts came to mind on the subject...

The CIA clock can probably be solved, as @ytm says. (So that everyone understands why this is interesting: the timers in the CIA run from this clock. But the clock in our machine is not constant, so the speed of the counters would also vary. Even if we don't want to use it as a timer, the operating speed of the shift register also depends on this.) However... I haven't wanted to buy of this chip yet, but I'm sure it's getting rarer/more expensive. For this reason, I would certainly not think of implementing such a CIA.

And then... Do enough people have such a floppy drive to make it worth designing hardware for it? It can be done just for fun, of course, but its usefulness is questionable. happy A conventional fastloader is faster than this, this would typically be useful for tasks that are no longer done with such retro machines. That was quite an improvement 40 years ago, but today, in 2025, we would typically expect more.

I write this as, I recently made an add-on for SD2IEC drives that would make it just fine to use. grin (@ytm: I haven't forgotten about the burst block commands, I've just been doing other things lately.) Regardless, it would be an interesting project, with few advantages in my opinion.
Posted By

SukkoPera
on 2025-04-18
12:01:27
 Re: Cartridge for Burst mode

Even if not many people have a 1581, it is easy to build one. It mostly uses common components save for a CIA and a WDC 1770/2 floppy controller and a couple of years ago many people cloned the mainboard.

... Including me! I have a working design, I never released it since I was sure it would end up on eBay in a pinch at crazy prices but if this project becomes a reality I would be happy to release it openly.
Posted By

MMS
on 2025-04-18
15:07:17
 Re: Cartridge for Burst mode

Actually the C64 owners worked out an their solution years ago for the fast serial protocol (burst mode too?). (Pasi Ojala is a well known HW guy)
Sure it uses CIA, I am curious how well it could be implemented on the 264 HW.

1581 maybe a too expensive beast (my 20pcs of assembled 1581 PCBAs lost at the Hungarian Post, ridiculous), but 1571 is rather affordable, costs only 2x more than an 1541/II, and it is MFM / CP/M capable, double sided 360KB drive, and with burst mode almost as fast as Jiffy.
Not to mention I have one, and one of the coolest looking floppy drive Commodore ever released :-D

As Jiffy realization on Plus/4 is not optimal, realizing the Fast Serial/Burst mode on 264 series would be really optimal solution for IEC bus. For the parallel bus we already have TCBM2SD :-D

I dunno if the IEC2SD is able to work in Burst mode, it would be great... happy

https://csbruce.com/cbm/hacking/hacking19.html
Posted By

ytm
on 2025-04-19
05:42:45
 Re: Cartridge for Burst mode

I played with this idea last night (I have 1581 replica too).



This looks viable. Maybe IEC sockets should point to the back instead of the sides, I'm not sure.

Clock generation and address decoding sections were stolen from ReSeed, 64K ROM taken from tcbm2sd.
ROM would have to intercept at least the LOAD vector and use Pasi Ojala's code for fast load. Ideally it would contain big chunks taken from C128 Kernal that detect slow/fast devices on IEC bus.

There is a ribbon cable socket for 1541 parallel burst cable (matching DolphinDOS cable pinout) and another one for the the second CIA port, with power - just in case. CIA has /IRQ line connected, although that's not used for burst.

TOD clock is not connected to anything. Maybe an ATTiny would fit somewhere to generate 50Hz clock from its internal oscillator.

Need to check CIA datasheet to be sure it behaves in the same way as SID regarding the CPU bus.
SukkoPera, MMS2
Posted By

MMS
on 2025-04-20
11:39:13
 Re: Cartridge for Burst mode

Nice! The fast serial protocol may give a new life to some of our beloved floppy drives.
And yes, without thae high speed the 1581 does not have too much sense at that price tag. Do not take me wrong, i like the 1581 but even the new version costs a lot after 3D printing the house, order the PCB from China assembled, not to mention getting a 3.5" floppy drive in good condition. Almost the same price as a factory 1571.

With the high speed AND big 880KB size it could be a great device even at that high price.

Comment:Still TCBM2SD is a winner is speed and size :-)
Posted By

Crown
on 2025-04-19
15:57:54
 Re: Cartridge for Burst mode

Looks very neat. Let's make this real !
Posted By

Crown
on 2025-04-20
06:33:09
 Re: Cartridge for Burst mode

There is a 2Mhz version of the CIA, what if we drive it will the full fast clock at 1.78 Mhz clock, then there is no need to align read and writes to slow clock, or implement clock stretching. I assume you just have to set up the timer with doubled values.
We don't need backwards compatibility like in the C128 for C64 mode.
MMS1
Posted By

gerliczer
on 2025-04-20
07:00:04
 Re: Cartridge for Burst mode

Does it necessarily have to be a CIA? Could a WDC VIA not work as a replacement?
Posted By

JamesC
on 2025-04-20
11:26:59
 Re: Cartridge for Burst mode

The side-facing connector may conflict with what others may have in their User Port. It should be on the end.

Since the 1570/1571/1581 all daisy-chain, only one IEC connector is necessary IMO.
MMS1
Posted By

ytm
on 2025-04-23
10:00:15
 Re: Cartridge for Burst mode

@gerliczer VIA (also WDC parts) has a bug in serial port implementation: when clocked externally it can lose bits; on forum6502 there is a remedy circuit for that, needs three more parts (buffer, latch, inverter)

@Crown When receiving data the remote end (drive) is providing the serial port clock, so clocking CIA faster won't have any effect. When sending the data C128 outputs one bit every 4 clocks (250kHz). The only explanation I've seen for why it doesn't go faster is "electrical problems" (C=hacking #3).
MMS1
Posted By

gerliczer
on 2025-04-23
15:28:23
 Re: Cartridge for Burst mode

Sheesh! You would think they corrected this ages old problem when they were re-implementing it in CMOS.
Posted By

Crown
on 2025-04-24
02:36:31
 Re: Cartridge for Burst mode

I don't want to have a faster transfer rate, that's not the point of driving the CIA at 2 Mhz. Isn't I/O chips driven in the C128 at 1Mhz, even when it is in 2Mhz mode? That is really a design decision, and the primary reason must have been to have backwards compatibility with C64 mode, and cost considerations.
But driving it in 1Mhz mode also means that you can only read and write the chip registers reliably in every second CPU cycle in 2Mhz mode. That means you either align the read write cycles in software, or have a hardware solutions which buffers the read/writes (write is easy, read is not so much), or stretch the CPU clock to take 2 cycles for the read/write operation.
This is unnecessary cruft if you can drive it at 2Mhz, like in our case where we design the solution from scratch.
MMS, Patrick2
Posted By

MMS
on 2025-04-25
01:41:38
 Re: Cartridge for Burst mode

What could be wrong with an even faster transfer rate? happy I like the idea
Posted By

ytm
on 2025-05-02
17:18:45
 Re: Cartridge for Burst mode

In the meantime I have ordered the boards and got the prototype working.

I have uploaded everything I have to https://github.com/ytmytm/plus4-burstcart
There is a KiCad project, firmware for GAL, source code for ROM that takes over LOAD vector and a lot of various documents.

Latest schematic after corrections I did on prototype is here: https://github.com/ytmytm/plus4-burstcart/blob/main/burstcart-cia/plots/burstcart.pdf

At the moment it's all in progress and experimental so I don't provide binary ROM and Gerbers - you are on your own to make them. The ROM has bugs, but at least the loader works.

I got burst loader to work with 1581, but unfortunately I have a problem with CIA.

It works:
1) only when clock comes from Phi0 or Phi2 (but not generated like for SID)
2) only when screen is blanked (fast clock)
3) only with one particular CIA chip - and it's not even 6526A (2MHz version)

Point 2) means I'm just lucky - when screen is not blanked the burst loader always gets stuck during the load. It means that CPU read status register and didn't see flag that new data arrived and CIA saw status register being read and cleared that bit.

Another CIA from the same year, from different week doesn't work, register reads/writes are just not reliable - not matter if clock was generated or if it came from Phi0 or Phi2
At the moment I don't know how to proceed with CIA to make it right.

I think I will try to make a VIA version instead. Back in 1988 someone just connected VIA to the system bus with Phi2 as the clock

https://plus4world.powweb.com/pubs/compute_mit/sa_1988-05/compute_mit_sa_1988_5.pdf (page 54)

Another problem may be that the four VIA chips I got from China all have exactly the same silkscreen with the same week and year of production. What are the chances that they work and they are in fact VIAs happy
Posted By

MMS
on 2025-05-03
06:36:23
 Re: Cartridge for Burst mode

I suppose you faced the same problem the JiffyDOS+4 creator had. The time is not enough at the side borders to freely access the memory for writing, before the TED takes is back before you could finish the stable opertation. (the very same issue causes +4 do not have FLI, just DFLI, only every second line we can modify RAM content).

So IF it is the case, I suggest what could improve JiffyDOS+4 too: JUST use only the bottom and upper border for loading. It will not effect the screen (you do not need to switch off and on again, TED automatically shuts down screen at that area)

(update sorry for the lot of typos in the previous version, I was in hurry)
Posted By

SukkoPera
on 2025-05-03
12:41:11
 Re: Cartridge for Burst mode

I already have a working design for a VIA on the +4 based on that project. I can share that and my experience with it.
MMS1
Posted By

Crown
on 2025-05-03
17:34:56
 Re: Cartridge for Burst mode

This CIA issue of status bit set but not detected and cleared, feels like an aliasing issue, try to force the CPU to slow clock and see if that works both with screen on/off.

The original C64 version of this works with screen on, at least I don't see in the code that it would turn it off, and their BAD lines don't differ from our BAD lines only in the number of available cycles.

The BIT loop takes 7 cycles to loop, which means that in fast mode one read is on even cycle and the next is on odd cycle mostly. Really it have a 50% chance to hit at the right cycle if it is the issue.
Posted By

Crown
on 2025-05-04
02:18:56
 Re: Cartridge for Burst mode

Both Phi0 and Phi2 changes when the TED switches between Fast Clock and Slow Clock, which happens on the screen area when the screen is on, and in the RAM refresh area. So even in Fast Clock and screen turned off you might get unlucky if the byte transfer finishes in the RAM refresh area.

Forcing Slow clock, would generate both a stable Phi0 and Phi2 signal, only one of these should potentially work in slow mode.

For making this work in Fast Clock mode, I think you'd need to derive clocking from MUX, that's a stable fast clock signal. The only potential issue is that signal timing alignment needs to be checked and maybe corrected, there is timing delays between Phi0/Phi2 and MUX I believe.

Also in the code, in the CIA detection code, you should set up Timer A with the value 8 if the CIA is driven with fast clock, and 4 in slow clock, this is when it sends a random value, to prove to the drive that Fast serial is working
Posted By

ytm
on 2025-05-04
11:59:42
 Re: Cartridge for Burst mode

@SukkoPera I'd love to hear about VIA project!

@Crown Today I made some experiments. Switching to slow clock (phi0 or phi2) made absolutely no difference, the enabled screen would still interfere with the loader. CIA status register is read but CPU gets wrong data.
That one working CIA is a fluke. With others I can get stable register reads, but only this particular one accepts writes.

As for the serial startup code - Pasi Ojala set the wake-up transfer clock even lower, down to 1 cycle. It would only matter if the remote end would lose clock impulses at this rate. At the moment it doesn't happen. Apart from that serial port works as input only.
At this stage, except for that one CIA, on the computer side the serial port register write is lost, so the status register bit is never set.

It's quite annoying how to get anything interfaced to C16/+4 expansion port. Since I have the register r/w part figured out for tcbm2sd I might just as well trim down existing CIA verilog implementation down to serial port only.
Posted By

Crown
on 2025-05-09
14:49:54
 Re: Cartridge for Burst mode

So if I understand correctly the timing of the various control signals are not aligned properly when driving the CIA.

There are a number of semi-recent hardware projects which interface various types of chips onto the 264 series bus, so I'm wondering, is there sort of a common wisdom knowledge repository in some way, on this type of detailed information how the timing should be of various signal lines? I know that there are github repos for the hw projects, but I'm fairly certain that not many of them go into detailed explanation on how these details work.

Shouldn't we collect that somehow together?
Posted By

SukkoPera
on 2025-05-11
08:01:53
 Re: Cartridge for Burst mode

I am the author of some of those projects, and I always try to document as much as possible, even if sometimes the information might be hidden in a GAL source, some example code, or even a post on the forum (like for the SIDcard clock signal), so make sure to poke around. :)

Sometimes a project is derived from something older, which is often undocumented, so I can't really say much about non-obvious design choices... Unless it doesn't work and I have to dig into it (SIDcard clock again...).

This might be the case with my CIA interface, which is derived from the one that already existed. It should be released soon, I have received the final PCBs the other day, now I will need to do some testing, but I have already provided ytm with the project files and I think he was able to make good use of it. Stay tuned! wink


Back to topReply to this topic


Copyright © Plus/4 World Team, 2001-2025. Support Plus/4 World on Patreon