Cartridge slots

for bbc micro/electron hardware, peripherals & programming issues (NOT emulators!)
Post Reply
jregel
Posts: 88
Joined: Fri Dec 20, 2013 6:39 pm
Location: Gloucestershire
Contact:

Cartridge slots

Post by jregel » Fri May 18, 2018 10:38 am

I’ve been thinking about about the cartridge slots provided on the Electron (with Plus 1) and the Master, specifically in the different ways they have been used.

Generally speaking, the cartridge slots on the Master seem to primarily be used for adding sideways RAM/ROM. On the Electron, they are used for all sorts of hardware add-ons: AP3/4 disk interfaces, AP5 ports, Jaffa E2P second processor, serial cartridges, sound expansion etc.

While most of these add-ons are used to bring the Electron up to BBC/Master functionality, it does suggest that the cartridge slots can do a lot more in the Master than have typically been used.

Which led to to wonder a bit more about what could actually be achieved through the cartridge slots. Do they sit on the 2Mhz(?) data bus? Are they limited in what they can do, or could they be used to add (for example) another user port, or a Pi co-processor in a cartridge? Does the cartridge slot provide any advantage over hanging devices off the 1Mhz bus?
BBC Master Turbo
Retroclinic External Datacentre
VideoNuLA
PiTubeDirect with Pi Zero

User avatar
jms2
Posts: 2017
Joined: Mon Jan 08, 2007 6:38 am
Location: Derby, UK
Contact:

Re: Cartridge slots

Post by jms2 » Fri May 18, 2018 11:02 am

Do they sit on the 2Mhz(?) data bus?
Yes they do.

I'm not very familiar with the 1MHz bus, so I'm sure others can do a better job of explaining, but the cartridge slots provide access to the processor's address and data buses, plus Phi0, IRQ and NMI lines etc.

I think this makes the cartridge interface more "low level" than the 1MHz bus.

User avatar
hoglet
Posts: 7448
Joined: Sat Oct 13, 2012 6:21 pm
Location: Bristol
Contact:

Re: Cartridge slots

Post by hoglet » Fri May 18, 2018 11:08 am

jregel wrote: Which led to to wonder a bit more about what could actually be achieved through the cartridge slots. Do they sit on the 2Mhz(?) data bus? Are they limited in what they can do, or could they be used to add (for example) another user port, or a Pi co-processor in a cartridge? Does the cartridge slot provide any advantage over hanging devices off the 1Mhz bus?
I can talk specifically about our experiences trying to use a cartridge slot in the Master for a Pi Co Processor.

Electrically, they could be used to add Pi Co Processor, indeed one of Myelin's boards does just this (as an option).

See: Myelin's FX2 Tube/Cartridge Adapter - Development and Support

The problem is merely one of software and addressing. Because of the chip selects available, it's only possible to map hardware devices into page &FCxx or &FDxx, not &FExx. So on the Master, the tube host software that's built into the MOS isn't going to work. And even if it were possible to map hardware into page &FExx, that would conflict with the in-built tube hardware.

The other thing of note is that when accessing page &FCxx or &FDxx on the Master, the system will insert one wait state (using RDY), so in effect accesses will be at 1MHz rather than 2 MHz.

So with some custom tube host software it would be possible to use the Master cartridge slot for a Pi Co Pro, but the interface would be slightly slower. Given there are better options on the Master, we haven't pursued this.

An interesting project you could do that would work well would be a modern cartridge version of the Music 5000.

Dave

User avatar
geraldholdsworth
Posts: 382
Joined: Tue Nov 04, 2014 9:42 pm
Location: Inverness, Scotland
Contact:

Re: Cartridge slots

Post by geraldholdsworth » Fri May 18, 2018 11:15 am

Going back to the Electron - I've often wondered why use the Plus 1 cartridge slots, and not the expansion bus on the back of the main machine?
Gerald Holdsworth
Repton Resource Page
www.reptonresourcepage.co.uk

User avatar
danielj
Posts: 6486
Joined: Thu Oct 02, 2008 4:51 pm
Location: Manchester
Contact:

Re: Cartridge slots

Post by danielj » Fri May 18, 2018 11:26 am

If you had a plus 1 plugged in, there wasn't a "through" expansion connector. That and it was also neater than extending further and further backwards I guess?

http://lionels.orpheusweb.co.uk/CompNyb ... ctron.html (just missing a plus 3 there :D)

d.

User avatar
davidb
Posts: 2151
Joined: Sun Nov 11, 2007 10:11 pm
Contact:

Re: Cartridge slots

Post by davidb » Fri May 18, 2018 11:55 am

geraldholdsworth wrote:Going back to the Electron - I've often wondered why use the Plus 1 cartridge slots, and not the expansion bus on the back of the main machine?
It gives you two expansion interfaces for the price of one, especially since a lot of add-ons were made in cartridge form rather than use the bus directly.

User avatar
myelin
Posts: 430
Joined: Tue Apr 26, 2016 9:17 pm
Location: San Francisco, CA, USA
Contact:

Re: Cartridge slots

Post by myelin » Fri May 18, 2018 4:31 pm

The cartridge slot interface is a little easier to work with, for most things you'd want to do. It provides the /INFC and /INFD signals that go low when the machine is accessing &FCxx and &FDxx, and a /ROMOE signal that goes low when the machine is accessing the ROM in each individual cartridge.

The rear expansion connector just brings out the processor bus, power, sound, and a couple of clocks, so you need to add logic to detect sideways bank access, not clash with the BASIC and keyboard ROM areas, etc. Also there's no concept of a bus ID, so if you have several expansions plugged in and they all want to respond on ROM 4, they'll all clash with each other, whereas cartridges can just look at the /ROMOE signal.

Cartridges can also just be a single circuit board, which is very cheap, whereas rear expansions need a soldered connector.
SW/EE from New Zealand, now in Mountain View, CA, making BBC/Electron hardware projects for fun.
Most popular: fast serial port, FX2+PiTubeDirect Tube/Cartridge adapter, USB cart interface.

User avatar
myelin
Posts: 430
Joined: Tue Apr 26, 2016 9:17 pm
Location: San Francisco, CA, USA
Contact:

Re: Cartridge slots

Post by myelin » Fri May 18, 2018 4:38 pm

jregel wrote:Are they limited in what they can do, or could they be used to add (for example) another user port, or a Pi co-processor in a cartridge? Does the cartridge slot provide any advantage over hanging devices off the 1Mhz bus?
Responding specifically to this... a cartridge slot provides signals that are nearly equivalent to the 1MHz Bus plus two ROM sockets, with some caveats.

The big one is that the clock provided to the cartridge slot is the same as the CPU clock, so it varies between 1MHz and 2MHz depending what's going on with the CPU. The 1MHz bus provides a nice stable 1MHz clock. This probably causes issues if you try to add a new 6522 VIA chip, although MartinB's EUP cartridge does this, so it's definitely possible. I'm not sure if he just used the CPU clock or if he divided the cartridge port's 16MHz clock down to generate a 1MHz clock for the VIA.

On the Master, the /INFC and /INFD lines are partly controlled by the ACCCON register; depending what you poke in there, 1MHz Bus accesses either go to the internal 1MHz Bus, the external 1MHz Bus, or the cartridge slots.

As Hoglet said, you can put a Pi coprocessor in a cartridge (I can send you a PCB that will do this if you like :)) but it requires modified TubeHost code and the interface won't run at 2MHz, so this only really makes sense on an Electron; if you have a Master 128, it's much easier to use the Tube port.
SW/EE from New Zealand, now in Mountain View, CA, making BBC/Electron hardware projects for fun.
Most popular: fast serial port, FX2+PiTubeDirect Tube/Cartridge adapter, USB cart interface.

User avatar
MartinB
Posts: 4908
Joined: Mon Mar 31, 2008 9:04 pm
Location: Obscurity
Contact:

Re: Cartridge slots

Post by MartinB » Fri May 18, 2018 6:11 pm

myelin wrote:This probably causes issues if you try to add a new 6522 VIA chip, although MartinB's EUP cartridge does this, so it's definitely possible. I'm not sure if he just used the CPU clock or if he divided the cartridge port's 16MHz clock down to generate a 1MHz clock for the VIA.
Yes, in order to ensure that the 6522 always has a stable, non-stretched 1MHz clock to (a) maintain accurate timing, even when the VIA is ticking 'offline' and (b) to align with the Beeb constant 1MHz clock implementation, I used a VIA-access-switched mixture of a divided 16MHz clock and the Elk Phi2.

Post Reply