Adding a Raspberry Pi Second Processor running PiTubeDirect using KenLowe's Level-Shifter Interface

discuss both original and modern hardware for the bbc micro/electron
User avatar
Wheel_nut
Posts: 222
Joined: Wed May 01, 2019 1:46 pm
Location: West of Scotland
Contact:

Adding a Raspberry Pi Second Processor running PiTubeDirect using KenLowe's Level-Shifter Interface

Post by Wheel_nut » Sun Mar 22, 2020 12:39 am

I am trying to find the information I need to install a Raspberry Pi (RPi) Co-Processor using:
:arrow: KenLowe's Level Shifter Interface hardware (Tube Interface or 1Mhz Bus Interface)
:arrow: Hoglet67 and BigEd's PiTubeDirect Software implementation for the Raspberry Pi (RPi)

I will come back here and add the definitive answers I receive in this thread.
Questions follow in the next Post...

EDIT 1/4/20: Thanks to Hoglet, KenLowe, BigEd and dp11 for indulging me in this thread.
Below is my abridged collation from this thread to provide a guide to Installation and Use:

You will need:
  1. A Tube Level Shifter - available from KenLowe for £12
  2. A Raspberry Pi - (I am using the RPi 1B - either 256MB or 512MB version)
  3. A MicroSD Card 8GB or higher preferably Class 6 or higher
  4. PiTubeDirect Software (latest level is Fer-De-Lance) from https://github.com/hoglet67/PiTubeDirect
  5. A 40 Pin Tube Port Extender (unless you are using a Rpi Zero which needs no extender) - More about this below
  6. And, of course a Beeb with either DFS1.2 or DFS 2.6 or MMFS which contain the Tube Software,
Preparing the Raspberry Pi 1B:
You will need to remove the Yellow Composite Video Connector as it interferes with the 40 Pin GPIO interface of the Tube Level Shifter and does not allow the RPi 1B to drop low enough into the Connector Well of the Beeb You can either de-solder it or simply cut the pins under the socket. I also removed the Ethernet Socket to gain some more clearance but this isn't essential.
20200328_143720.jpg
Making the 40 Pin Tube Extender:
With acknowledgment to KenLowe, the simplest and most compact solution is to use two of these 12mm Header Extenders
40Pin Header.jpg
plugged into one another as shown below:
20200417_152248.jpg
Step By Step Procedure:
  1. Format the MicroSD Card as FAT32 and simply copy all of the contents of the PiTubeDirect zip file into the Root Directory. Place the MicroSD Card in the RPi using a SD Card to MicroSD Card adapter if necessary.
  2. If you have or intend to have the Case Screw in place, put a small piece of insulating tape on the Tube Level Shifter at the contact point.
  3. Plug the Tube Level Shifter into the Extender and plug the Extender into the Tube Port under the Beeb.
  4. Plug the Raspberry Pi into the Tube Level Shifter taking care not to misalign the pins with the Header. The 26 Pins of the RPi 1B go into the Leftmost 26 sockets of the Tube Level Shifter (nearest the Case Wall). BE CAREFUL! Mis-plugging WILL destroy the Raspberry Pi GPIO.
    20200417_152332.jpg
  5. Carefully turn the Beeb over, and Switch On
  6. You will hear the customary Boo .... but NO Bip. This is normal
  7. You should now see this Startup Message on the Screen:
    20200328_142952.jpg
What do you use the Co-Processors for:
Taming the Beast!

The default co-processor is defined by the copro=N parameter in cmdline.txt on your SD Card, (copro=0 copro1_speed=3 copro3_speed=4 tube_delay=0 elk_mode=0)
where N is:
  • 0 for the fastest 65tube based 65C102 Co Processor
  • 1 for a 3MHz 65tube based 65C02 Co Processor
  • 2 for the lFast 65C102 Co Processor
  • 3 for 4MHz 65C102 (Acorn internal 65C102 Co Pro)
  • 4 for the Z80 Co Processor
  • 8 for the 80x86 Co Processor
  • 9 for the 6809 Co Processor
  • 11 for the PDP-11 Co Processor
  • 12 for the ARM2 Co Processor
  • 13 for the 32016 Co Processor
  • 14 for no Co Processor (to save having to power off the Pi)
  • 15 for the fastest native ARM7 Co Processor
  • 16 for the 64KB Normal 65C02 (lib6502) Co Processor
  • 17 for the 256KB Turbo 65C02 (lib6502) Co Processor
  • 20 for the OPC5LS Co Processor
  • 21 for the OPC6 Co Processor
  • 22 for the OPC7 Co Processor
My original quest was to find a way to have the Beeb boot up with Co Processor 14 so that it behaved as a “Standard” Beeb. I could then use *FX 151,230,0 to activate the 65C02 Co Processor to run TUBEELT. However, when I tried changing the cmdline.txt file on the SD Card to (copro=14 copro1_speed=3 copro3_speed=4 tube_delay=0 elk_mode=0, when switched on, the Beeb hung with a flashing Cursor which Hoglet attributed to the RPi booting slower than the Beeb. This could be recovered by a Break.

I decided to leave the RPi SD Card installation as standard and achieve my objective by changing the !BOOT file on Disc 0 of the SD Card to set up the Programmable Function Keys to give me a range of configuration options thus:
F0 Co Processor 14 (Off)
F1 Co Processor 0 (65C102)
F2 Co Processor 0 (65C102 and Start TUBEELT)
F3 Co Processor 1 (65C102 @ 3MHz)
F4 Co Processor 14 (Off and start STH Games Menu)
F5 Switch to Disk 455
F6 Switch to Disk 455
F7 Enable Floppy Drive (*OPT 5,1)
F8 Enable Floppy Drive and Disable MMFS (Useful to Format etc. Floppy Discs)
F9 Disable DFS and Start STH Games Menu (Keeps Page at &0E00)

So, to Boot to STH Games Menu: Switch On; Shift-Break; F0; Shift-Break; F4
To Boot to STH Games Menu with DFS Disabled and Page at &0E00: F9; Ctrl-Break; Shift Break; F4
To Boot to TubeELT: Shift-Break; F2

To do this you first need to Unlock Disc 0 on the SD Card:
*DIN 0
*DOP U
*RENAME !BOOT OLD!BOOT
Now create a new !BOOT File using an editor like View containing:

Code: Select all

*KEY 0 *FX 151,230,14|M
*KEY 1 *FX 151,230,0|M
*KEY 2 *FX 151,230,0|M*DIN45|M*TUBEELT|M
*KEY 3 *FX 151,230,1|M
*KEY 4 *TV255|M*/MENU|M
*KEY 5 *MMFS|M*OPT5,1|M*DIN300|M*RLOAD COP114 11|M
*KEY 6 *OPT5,0|M*DIN456|M*.|M
*KEY 7 *MMFS|M*OPT5,1|M*DISC|M*.|M
*KEY 8 *KILL10|M*KILL15|M*| Ctrl-Break
*KEY 9 *MMFS|M*OPT5,0|M*DIN0|M*KILL06|M*| PRESS F4

*|TOFF TON TELT T3MHz GAME COP 456 DFS NoMMFS NoDFS
Last edited by Wheel_nut on Fri Apr 17, 2020 5:47 pm, edited 12 times in total.
#1 BBC Model B Issue 7 + 1770 DFS + Dual TEAC Floppy
#2 BBC Model B Issue 7 + 8271 DFS + Dual Floppy + Speech + PiTubeDirect on KenLowe's Tube Level Shifter
#3 BBC Model B Issue 7 + 8271 DFS + Cumana Single Floppy

User avatar
Wheel_nut
Posts: 222
Joined: Wed May 01, 2019 1:46 pm
Location: West of Scotland
Contact:

Re: Adding a Raspberry Pi Second Processor running PiTubeDirect using KenLowe's Level-Shifter Interface

Post by Wheel_nut » Sun Mar 22, 2020 1:07 am

I am going to try to use a Raspberry Pi 1B on the Tube Interface and have now got on KenLowe's schedule for a "Under" Tube Level Shifter. I will plug the RPI into the Level Shifter and into the Tube Interface Socket on the Beeb

1) Question: Does The RPi 1B have to be the 512MB version or will the 256MB Version work?
2) I have downloaded "PiTubeDirectEggEater.zip" from Hoglet67's Github site. It contains Two Folders and Ten Files
3) Question: Do I simply copy the folders and files to a FAT32 formatted SD Card?
4) Plug the SD Card into the RPi
5) Boot up the Beeb

Question: Have I missed anything?
Question: What do I expect to see?

The Wiki says:
With this project you will have a configurable coprocessor which can be powered by the Beeb and fitted inside it, with a choice of:

274MHz 65C102 (*FX 151,230,0)
3MHz 65C102 (*FX 151,230,1) (for games compatibility)
112MHz Z80 (*FX 151,230,4)
63MHz 80286 (*FX 151,230,8)
27MHz 6809 (*FX 151,230,9)
59MHz ARM2 (*FX 151,230,12)
35MHz 32016 (*FX 151,230,13)
null co-pro (*FX 151,230,14) (to save having to power off the pi)
1000MHz ARMnative (*FX 151,230,15)

What is a simple way to test that it is working?
#1 BBC Model B Issue 7 + 1770 DFS + Dual TEAC Floppy
#2 BBC Model B Issue 7 + 8271 DFS + Dual Floppy + Speech + PiTubeDirect on KenLowe's Tube Level Shifter
#3 BBC Model B Issue 7 + 8271 DFS + Cumana Single Floppy

User avatar
KenLowe
Posts: 1170
Joined: Mon Oct 18, 2004 5:35 pm
Location: Scotland
Contact:

Re: Adding a Raspberry Pi Second Processor running PiTubeDirect using KenLowe's Level-Shifter Interface

Post by KenLowe » Sun Mar 22, 2020 1:27 am

Yup. All you need to do is copy the contents of the zip file to the root of the SD card. Pop the card into the RPi and switch on. If you're using a beeb, then the startup message should change to Acorn TUBE 6502 64K. It may take a further BREAK to get this message if the beeb boots up before the RPi has finished initialising. If you don't see the message, then you may need to install a File System ROM that has the Tube Host code included. Most Acorn file systems include it (as does MMFS, if you use that). The next thing to do is download a copy of Elite for the 2nd Processor, and try running it. Switching to a different Co-Pro (using *FX151,230,x) should get you different startup messages.

If you're using a Master, then Tube Host Code is included in the OS, so you don't need to worry about the File System ROMs. However, you may need to enter the following additional commands before you see the startup message:

*CONFIGURE EXTUBE
*CONFIGURE TUBE

User avatar
BigEd
Posts: 3095
Joined: Sun Jan 24, 2010 10:24 am
Location: West
Contact:

Re: Adding a Raspberry Pi Second Processor running PiTubeDirect using KenLowe's Level-Shifter Interface

Post by BigEd » Sun Mar 22, 2020 8:55 am

Indeed, the startup banner will tell you that the second processor is there, if you have a ROM in place with the right support code. With the second processor present, detected, and enabled, you get a single beep at power-on instead of the usual double beep.

If you haven't already got solid state storage, then getting MMFS (for example) with an SD Card dongle is a cheap and easy thing to do, and you can use a pre-loaded MMB file which contains many games as well as Tube Elite:
*DIN 45
*TUBEELT
Press Space
Press F0 to launch
For some examples of how to use the various second processors, see
Examples for each CoPro core

I'm pretty sure you can always power the Pi from the Tube interface itself. And yes, a 256MB Pi will work.

BTW, for technical reasons, it's better to

Code: Select all

*CONFIGURE INTUBE
On most Pi models, the LED will blink/flicker/toggle as you use the Tube: just hit return a few times and watch it toggle each time (if the LED is visible, of course.) I think the next release has this working on more - maybe all - models.

User avatar
KenLowe
Posts: 1170
Joined: Mon Oct 18, 2004 5:35 pm
Location: Scotland
Contact:

Re: Adding a Raspberry Pi Second Processor running PiTubeDirect using KenLowe's Level-Shifter Interface

Post by KenLowe » Sun Mar 22, 2020 9:00 am

BigEd wrote:
Sun Mar 22, 2020 8:55 am
BTW, for technical reasons, it's better to

Code: Select all

*CONFIGURE INTUBE
Ah. Okay. I'll update my Installation Notes accordingly.

User avatar
Wheel_nut
Posts: 222
Joined: Wed May 01, 2019 1:46 pm
Location: West of Scotland
Contact:

Re: Adding a Raspberry Pi Second Processor running PiTubeDirect using KenLowe's Level-Shifter Interface

Post by Wheel_nut » Thu Mar 26, 2020 8:07 pm

Firstly, I must own up to being the cause of the flurry of activity on the "Pi-based Co-Pro on the cheap - 100MHz 6502 for £10? (now 274MHz)" thread. I have been communicating with KenLowe by PM to try to get my RPi 1Bs working on his excellent Tube Level Shifter design.

The Tube Level Shifter comes with a very comprehensive Instruction Sheet which probably makes this thread unneccessary =D>

I have installed the RPi 1B "close coupled" to the Tube Level Shifter and connected the Tube Level Shifter on a short cable extender to the Tube Port of my BBC B (Issue 7). The Tube Level Shifter and RPi are powered from the Beeb (Jumper J1 in place).

I downloaded PiTubeDirect_EggEater from Hoglet's Github site and unpacked and copied the zip file contents to a FAT32 MicroSD Card.

My first attempt with a RPi 1B (256) gave just a flashing Cursor on Boot-up. On pressing Break, I sometimes get a varying length string of Characters. After checking everything, I decided to try another RPi ...

My Second attempt with a RPi 1B (512) gave just a flashing Cursor on Boot-up. On pressing Break, it just returned to the Flashing Cursor.

I also tried removing Jumper J1 from the Tube Level Shifter Board and Powering the Pi and Level Shifter externally. No difference.

After an exchange of PMs with KenLowe who coincedentaly was able to see the Flashing Cursor, I mistakenly believed that there might be a problem with the compatibility of the RPi 1B, the Tube Level Shifter and perhaps PiTubeDirect_EggEater. I WAS WRONG!

While Ken was consulting with BigEd and Hoglet on the main thread, I dug out another TWO RPis ... a 256MB and a 512MB and tried them. To my surprise, they BOTH Work!!! ...and the first two still don't. I have tried switching SD Cards to no avail. I now believe that I have TWO defective Pis which I will have to test separately using their original setup with Raspbian.

At Ken's suggestion, I have tried PiTubeDirect_FerDeLance and it works with the two Pis that work with EggEater and fails with the ywo that failed before. I now intend to use FerDeLance for all further testing.

Now, I need to learn how to play Elite!

Thanks to KenLowe, BigEd and Hoglet for this excellent piece of work and my apologies for crying Wolf.
#1 BBC Model B Issue 7 + 1770 DFS + Dual TEAC Floppy
#2 BBC Model B Issue 7 + 8271 DFS + Dual Floppy + Speech + PiTubeDirect on KenLowe's Tube Level Shifter
#3 BBC Model B Issue 7 + 8271 DFS + Cumana Single Floppy

User avatar
BigEd
Posts: 3095
Joined: Sun Jan 24, 2010 10:24 am
Location: West
Contact:

Re: Adding a Raspberry Pi Second Processor running PiTubeDirect using KenLowe's Level-Shifter Interface

Post by BigEd » Thu Mar 26, 2020 8:12 pm

If you're able to hook up the serial port debug to the two uncooperative PiB's, I expect Dave (hoglet) would be interested in seeing what diagnostics you see when you boot with Fer-de-Lance.

User avatar
Wheel_nut
Posts: 222
Joined: Wed May 01, 2019 1:46 pm
Location: West of Scotland
Contact:

Re: Adding a Raspberry Pi Second Processor running PiTubeDirect using KenLowe's Level-Shifter Interface

Post by Wheel_nut » Thu Mar 26, 2020 11:01 pm

BigEd wrote:
Thu Mar 26, 2020 8:12 pm
If you're able to hook up the serial port debug to the two uncooperative PiB's, I expect Dave (hoglet) would be interested in seeing what diagnostics you see when you boot with Fer-de-Lance.
Hi BigEd, If I was able to do that ... and touch type, I would be dangerous.

I have just tested the two failing RPis by booting them in Raspbian and they seem to work perfectly well. I was hoping to find a System Page on Raspbian which would give me the SOC identity and revision data but couldn't find it.

Is the Serial Port debug something that I could easily rig up and extract the data? I am happy to have a go at it but if it would be easier, I could package the two Pis and send them to any one of you by post. I am out in the sticks so fairly easy to drop in the post.

It does look to me as though it isn't a hardware fault and may be worth diagnosing before releasing FerDeLance into the long grass.

Robin
#1 BBC Model B Issue 7 + 1770 DFS + Dual TEAC Floppy
#2 BBC Model B Issue 7 + 8271 DFS + Dual Floppy + Speech + PiTubeDirect on KenLowe's Tube Level Shifter
#3 BBC Model B Issue 7 + 8271 DFS + Cumana Single Floppy

dp11
Posts: 1139
Joined: Sun Aug 12, 2012 9:47 pm
Contact:

Re: Adding a Raspberry Pi Second Processor running PiTubeDirect using KenLowe's Level-Shifter Interface

Post by dp11 » Thu Mar 26, 2020 11:19 pm

With raspbian try

cat /proc/info

This should tell us about your pi.

User avatar
Wheel_nut
Posts: 222
Joined: Wed May 01, 2019 1:46 pm
Location: West of Scotland
Contact:

Re: Adding a Raspberry Pi Second Processor running PiTubeDirect using KenLowe's Level-Shifter Interface

Post by Wheel_nut » Fri Mar 27, 2020 12:02 am

The first one is the RPi 1B (256MB) and the second one is the RPI 1B (512MB)
20200326_234334.jpg
20200326_233737.jpg
Is this what you need?

Robin
#1 BBC Model B Issue 7 + 1770 DFS + Dual TEAC Floppy
#2 BBC Model B Issue 7 + 8271 DFS + Dual Floppy + Speech + PiTubeDirect on KenLowe's Tube Level Shifter
#3 BBC Model B Issue 7 + 8271 DFS + Cumana Single Floppy

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

Re: Adding a Raspberry Pi Second Processor running PiTubeDirect using KenLowe's Level-Shifter Interface

Post by hoglet » Fri Mar 27, 2020 6:19 am

Wheel_nut wrote:
Thu Mar 26, 2020 11:01 pm
I have just tested the two failing RPis by booting them in Raspbian and they seem to work perfectly well.
I think it's still possible this is a damaged GPIO.

I have a damaged Pi 3 that behaves in exactly the same way: Raspbian will boot fine, but PiTubeDirect no longer boots at all. It got damaged when I plugged it into the level shifter mis-aligned by one row.

(This has now been repurposed as my Kodi Box)
Wheel_nut wrote:
Thu Mar 26, 2020 11:01 pm
I am happy to have a go at it but if it would be easier, I could package the two Pis and send them to any one of you by post. I am out in the sticks so fairly easy to drop in the post.
I'd be happy to take a look.

I'll send you a PM.

Dave

User avatar
KenLowe
Posts: 1170
Joined: Mon Oct 18, 2004 5:35 pm
Location: Scotland
Contact:

Re: Adding a Raspberry Pi Second Processor running PiTubeDirect using KenLowe's Level-Shifter Interface

Post by KenLowe » Fri Mar 27, 2020 7:15 am

hoglet wrote:
Fri Mar 27, 2020 6:19 am
Wheel_nut wrote:
Thu Mar 26, 2020 11:01 pm
I am happy to have a go at it but if it would be easier, I could package the two Pis and send them to any one of you by post. I am out in the sticks so fairly easy to drop in the post.
I'd be happy to take a look.
Dave,

I'm thinking it might be appropriate for me to send you one of my tube level shifters to test this with. If you would like one, can you let me know if you'd prefer an underside version, or one that will work remotely with a ribbon cable (I need to put a different connector on the level shifter depending on which option you go for).

Regards
Ken.

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

Re: Adding a Raspberry Pi Second Processor running PiTubeDirect using KenLowe's Level-Shifter Interface

Post by hoglet » Fri Mar 27, 2020 10:50 am

Hi Ken,
KenLowe wrote:
Fri Mar 27, 2020 7:15 am
I'm thinking it might be appropriate for me to send you one of my tube level shifters to test this with.
There's no hurry here. Let me test them first with the level shifter that I already have.

I'm not expecting the issue is in any way related to the level shifter. I'm expecting to find one or more of the GPIOs is damaged. It's surprising easy to damage a Pi with static.

Dave

User avatar
Wheel_nut
Posts: 222
Joined: Wed May 01, 2019 1:46 pm
Location: West of Scotland
Contact:

Re: Adding a Raspberry Pi Second Processor running PiTubeDirect using KenLowe's Level-Shifter Interface

Post by Wheel_nut » Fri Mar 27, 2020 12:39 pm

Hi Guys,

Thank you all for your attention and time spent on this. While I cannot recall having mis-plugged the RPI into the Level Shifter, it is highly probable that I have done so.

I am currently using a makeshift Pin extender to plug the RPi 1B directly under the Beeb, and fiddling with it in confined space and light leads me to hold up my hand and take responsibility for mis-aligning the extender.

I have PM'd Dave to say that since the two failing units are displaying the same symptoms as his one, let's stop wasting time and effort on further investigation. I can re-purpose those units back to running Raspbian for my daughter's School club when that resumes after the current moratorium.

I am waiting for parts to arrive to make a short (27mm) Female to Male 40 Pin Extender which will sit between the Tube Port and the Level Shifter in the access well under the Beeb, The RPi 1B (with the Composite Video Spout and Ethernet Socket removed) will then directly plug into Ken's Level Shifter and sit neatly within the height afforded by the Case Feet. I will post pictures here when I have the finished project.

Stay safe, Robin
#1 BBC Model B Issue 7 + 1770 DFS + Dual TEAC Floppy
#2 BBC Model B Issue 7 + 8271 DFS + Dual Floppy + Speech + PiTubeDirect on KenLowe's Tube Level Shifter
#3 BBC Model B Issue 7 + 8271 DFS + Cumana Single Floppy

User avatar
KenLowe
Posts: 1170
Joined: Mon Oct 18, 2004 5:35 pm
Location: Scotland
Contact:

Re: Adding a Raspberry Pi Second Processor running PiTubeDirect using KenLowe's Level-Shifter Interface

Post by KenLowe » Fri Mar 27, 2020 1:31 pm

hoglet wrote:
Fri Mar 27, 2020 6:19 am
Wheel_nut wrote:
Thu Mar 26, 2020 11:01 pm
I have just tested the two failing RPis by booting them in Raspbian and they seem to work perfectly well.
I have a damaged Pi 3 that behaves in exactly the same way: Raspbian will boot fine, but PiTubeDirect no longer boots at all. It got damaged when I plugged it into the level shifter mis-aligned by one row.
Dave
I've got a growing collection of RPi Zeros with similar user initiated damage. I'm wondering if that's why there's currently a world shortage of PI Zeros. My worst faux pas was plugging one of my RPi Zeros into a level shifter, 180 degrees out of orientation. Don't ask! That caused a bit of smoke to appear! Yesterdays jumper issue is coming a close second, but that didn't actually cause any damage, so I'm not sure it counts.

User avatar
Wheel_nut
Posts: 222
Joined: Wed May 01, 2019 1:46 pm
Location: West of Scotland
Contact:

Re: Adding a Raspberry Pi Second Processor running PiTubeDirect using KenLowe's Level-Shifter Interface

Post by Wheel_nut » Fri Mar 27, 2020 5:16 pm

I take strength from your accounts which tell me that I am not the only one making stupid mistakes! So here's a bunch of what may be stupid questions:

1) *CONFIGURE INTUBE - Does this only apply to the Master and not necessary for the Beeb?

2) How do I revert to a "Normal" Beeb without removing the Raspberry Pi? Is it *FX 151,230,14 ? Is there a *NOTUBE equivalent for the Beeb?

3) Can I configure the Tube Co-Processor to Boot up as a "Normal" Beeb and let me then activate the Co-Processor using e.g. *FX 151,230,1 ? If so. How?

3) Is there an Elite Manual in PDF form somewhere? I need to study for my Pilot's Licence!

4) Besides runnine Tube Elite, what applications are you using the Co-Processors for? A brief descripition if what they do and where to find them would be a great help.

5) Is there any way to use the Graphics Processor on the Raspberry Pi Co-Processor? (Yes, I'm a dreamer ... but I hope I'm not the only one!)

6) I see that some of you are installing Raspberry Pis on the Tube and 1MHz Bus ports concurrently. Why? and what is the benefit? How do you tame the beasts?
#1 BBC Model B Issue 7 + 1770 DFS + Dual TEAC Floppy
#2 BBC Model B Issue 7 + 8271 DFS + Dual Floppy + Speech + PiTubeDirect on KenLowe's Tube Level Shifter
#3 BBC Model B Issue 7 + 8271 DFS + Cumana Single Floppy

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

Re: Adding a Raspberry Pi Second Processor running PiTubeDirect using KenLowe's Level-Shifter Interface

Post by hoglet » Fri Mar 27, 2020 5:46 pm

Some quick fire answers....
Wheel_nut wrote:
Fri Mar 27, 2020 5:16 pm
1) *CONFIGURE INTUBE - Does this only apply to the Master and not necessary for the Beeb?
This is Master only.
Wheel_nut wrote:
Fri Mar 27, 2020 5:16 pm
2) How do I revert to a "Normal" Beeb without removing the Raspberry Pi? Is it *FX 151,230,14 ? Is there a *NOTUBE equivalent for the Beeb?

Code: Select all

*FX 151,230,14
Wheel_nut wrote:
Fri Mar 27, 2020 5:16 pm
3) Can I configure the Tube Co-Processor to Boot up as a "Normal" Beeb and let me then activate the Co-Processor using e.g. *FX 151,230,1 ? If so. How?
You can set copro=14 in cmdline.txt:

Code: Select all

copro=14 copro1_speed=3 copro3_speed=4 tube_delay=0 elk_mode=0
Wheel_nut wrote:
Fri Mar 27, 2020 5:16 pm
3) Is there an Elite Manual in PDF form somewhere? I need to study for my Pilot's Licence!
https://openretro.org/file/37a540d37634 ... b46dfb7fe4
Wheel_nut wrote:
Fri Mar 27, 2020 5:16 pm
4) Besides runnine Tube Elite, what applications are you using the Co-Processors for? A brief descripition if what they do and where to find them would be a great help.
Ed posted some ideas here:
https://github.com/hoglet67/PiTubeDirec ... CoPro-core

See also this thread:
viewtopic.php?f=2&t=15974
Wheel_nut wrote:
Fri Mar 27, 2020 5:16 pm
5) Is there any way to use the Graphics Processor on the Raspberry Pi Co-Processor? (Yes, I'm a dreamer ... but I hope I'm not the only one!)
Not currently, though it's technically possible to make use of the Pi's frame buffer.

There is a very old verion of PiTubeDirect that we use on the Acorn Atom as a Hi Res Graphics Card/Accelerator. Roland has continued to this develop:
viewtopic.php?f=44&t=11220
Wheel_nut wrote:
Fri Mar 27, 2020 5:16 pm
6) I see that some of you are installing Raspberry Pis on the Tube and 1MHz Bus ports concurrently. Why? and what is the benefit? How do you tame the beasts?
They serve different purposes:
- the Tube (PiTubeDirect) emulates a multitude of old and new second processors
- the 1MHz Bus (Pi1MHz) emulates several useful peripherals: a BeebSCSI hard disk, a large RAM disk, and a Music 5000.

Dave

User avatar
KenLowe
Posts: 1170
Joined: Mon Oct 18, 2004 5:35 pm
Location: Scotland
Contact:

Re: Adding a Raspberry Pi Second Processor running PiTubeDirect using KenLowe's Level-Shifter Interface

Post by KenLowe » Fri Mar 27, 2020 5:53 pm

Hoglet has beaten me to it, but here's my quick fire answers:
Wheel_nut wrote:
Fri Mar 27, 2020 5:16 pm
1) *CONFIGURE INTUBE - Does this only apply to the Master and not necessary for the Beeb?
Correct.
Wheel_nut wrote:
Fri Mar 27, 2020 5:16 pm
2) How do I revert to a "Normal" Beeb without removing the Raspberry Pi? Is it *FX 151,230,14 ? Is there a *NOTUBE equivalent for the Beeb?
Correct. *FX151,230,14 drops you back to a normal beeb. The IntegraB add on board provides *NOTUBE / *CONF. TUBE OFF commands. Some other utility ROMs may provide something similar, but I'm not sure about that.
Wheel_nut wrote:
Fri Mar 27, 2020 5:16 pm
3) Can I configure the Tube Co-Processor to Boot up as a "Normal" Beeb and let me then activate the Co-Processor using e.g. *FX 151,230,1 ? If so. How?
You can set the default Co-Pro by modifying the cmdline.txt file on the SDCard. See here.
Wheel_nut wrote:
Fri Mar 27, 2020 5:16 pm
3) Is there an Elite Manual in PDF form somewhere? I need to study for my Pilot's Licence!
You have two question 3's! I'm sure there will be a PDF manual somewhere, but I don't know where. Someone else will be able to advise.
Wheel_nut wrote:
Fri Mar 27, 2020 5:16 pm
4) Besides running Tube Elite, what applications are you using the Co-Processors for? A brief descripition if what they do and where to find them would be a great help.
Lots of things. How about emulating a ZX81, or a ZX Spectrum or Jupiter Ace (you also need a VideoNula for some of those to work). But the most important reason is to be able to run Zork.
Wheel_nut wrote:
Fri Mar 27, 2020 5:16 pm
5) Is there any way to use the Graphics Processor on the Raspberry Pi Co-Processor? (Yes, I'm a dreamer ... but I hope I'm not the only one!)
I don't think so, but hoglet will be able to answer that question better.
Wheel_nut wrote:
Fri Mar 27, 2020 5:16 pm
6) I see that some of you are installing Raspberry Pis on the Tube and 1MHz Bus ports concurrently. Why? and what is the benefit? How do you tame the beasts?
The 1MHz level shifter makes it easier to emulate 1MHz devices. Currently SCSI HDD, Music5000 & RAM Disk are emulated. A SCSI drive makes it easier to run an Econet network.

User avatar
Wheel_nut
Posts: 222
Joined: Wed May 01, 2019 1:46 pm
Location: West of Scotland
Contact:

Re: Adding a Raspberry Pi Second Processor running PiTubeDirect using KenLowe's Level-Shifter Interface

Post by Wheel_nut » Mon Mar 30, 2020 6:05 pm

Thank you Hoglet and KenLowe for your very informative answers and the linkies which have given me plenty of reading material. :)

I am now using FerDeLance and will report any issues that I may encounter.

I would prefer to boot up the Beeb as a "Standard" Beeb so have edited the cmdline.txt on the SD Card to
"copro=14 copro1_speed=3 copro3_speed=4 tube_delay=0 elk_mode=0"

When the Beeb Boots, it shows just a flashing Cursor and needs a Break to display the normal startup messages.
Question 1: Should this be a Ctrl-Break (which Clears Function Key Settings) or is just a Break OK?

Question 2: With Tube Co-Processors 0 or 1 enabled, the "Ready" Prompt changed from > to * and Star commands can be entered without another Star. Why is this? ... and are non Star commands invalid? Do I have to type *Basic to get back to a > Prompt?

Question 3: Can the standard games on the Beeb.MMB compendium be run with Co-Processor 0 or 1 enabled? If so, How?

Question 4: This is more of a WIBNI ... but wouldn't it be nice if the Beeb had the equivalent of an Autoexec.bat which would run EXEC commands or files to do things like set up the Red Function Keys and set Default Drive and Disc Number. The !BOOT is only invoked by the Shift-Break or by *EXECing it so doesn't quite do the same thing.

I miss the reassuring BooBip! :(

Robin
#1 BBC Model B Issue 7 + 1770 DFS + Dual TEAC Floppy
#2 BBC Model B Issue 7 + 8271 DFS + Dual Floppy + Speech + PiTubeDirect on KenLowe's Tube Level Shifter
#3 BBC Model B Issue 7 + 8271 DFS + Cumana Single Floppy

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

Re: Adding a Raspberry Pi Second Processor running PiTubeDirect using KenLowe's Level-Shifter Interface

Post by hoglet » Mon Mar 30, 2020 6:32 pm

Wheel_nut wrote:
Mon Mar 30, 2020 6:05 pm
When the Beeb Boots, it shows just a flashing Cursor and needs a Break to display the normal startup messages.
Question 1: Should this be a Ctrl-Break (which Clears Function Key Settings) or is just a Break OK?
Either should be fine.

(It's a shame this case now hangs on a Model B on power up. It's down to how quickly the Pi boots compared to the Beeb. The Pi Foundation firmware blob as got more complex over time, which has resulted in slower boot times.)
Wheel_nut wrote:
Mon Mar 30, 2020 6:05 pm
Question 2: With Tube Co-Processors 0 or 1 enabled, the "Ready" Prompt changed from > to * and Star commands can be entered without another Star. Why is this? ... and are non Star commands invalid? Do I have to type *Basic to get back to a > Prompt?
Are you doing a Ctrl-BREAK after *FX 151,230,0?

If you do this, you should get a > prompt.
Wheel_nut wrote:
Mon Mar 30, 2020 6:05 pm
Question 3: Can the standard games on the Beeb.MMB compendium be run with Co-Processor 0 or 1 enabled? If so, How?
No they can't, and as far as I know, the only solution is to disable the second processor.
Wheel_nut wrote:
Mon Mar 30, 2020 6:05 pm
Question 4: This is more of a WIBNI ... but wouldn't it be nice if the Beeb had the equivalent of an Autoexec.bat which would run EXEC commands or files to do things like set up the Red Function Keys and set Default Drive and Disc Number. The !BOOT is only invoked by the Shift-Break or by *EXECing it so doesn't quite do the same thing.
You can use one of the keyboard link switches to invert the sense of SHIFT-BREAK (so it will always invoke !BOOT, unless the shift key is pressed). That's the only way I can think to run something automatically on power up.

Dave

User avatar
Wheel_nut
Posts: 222
Joined: Wed May 01, 2019 1:46 pm
Location: West of Scotland
Contact:

Re: Adding a Raspberry Pi Second Processor running PiTubeDirect using KenLowe's Level-Shifter Interface

Post by Wheel_nut » Mon Mar 30, 2020 7:20 pm

hoglet wrote:
Mon Mar 30, 2020 6:32 pm
Wheel_nut wrote:
Mon Mar 30, 2020 6:05 pm
When the Beeb Boots, it shows just a flashing Cursor and needs a Break to display the normal startup messages.
Question 1: Should this be a Ctrl-Break (which Clears Function Key Settings) or is just a Break OK?
Either should be fine.

(It's a shame this case now hangs on a Model B on power up. It's down to how quickly the Pi boots compared to the Beeb. The Pi Foundation firmware blob as got more complex over time, which has resulted in slower boot times.)
Amazing that 1980's tech boots quicker than 2010's Technology! :roll: When I get around to it, I might increase the 555 Timer delay on the Beeb to overcome this quirk, now that I know what it is.
Wheel_nut wrote:
Mon Mar 30, 2020 6:05 pm
Question 2: With Tube Co-Processors 0 or 1 enabled, the "Ready" Prompt changed from > to * and Star commands can be entered without another Star. Why is this? ... and are non Star commands invalid? Do I have to type *Basic to get back to a > Prompt?
Are you doing a Ctrl-BREAK after *FX 151,230,0?

If you do this, you should get a > prompt.
OK, Ctrl-Break gets me a > Prompt. Am I correct that the *FX 151,230,n is only activated after the Ctrl-Break?
Wheel_nut wrote:
Mon Mar 30, 2020 6:05 pm
Question 3: Can the standard games on the Beeb.MMB compendium be run with Co-Processor 0 or 1 enabled? If so, How?
No they can't, and as far as I know, the only solution is to disable the second processor.
OK, Understood
Wheel_nut wrote:
Mon Mar 30, 2020 6:05 pm
Question 4: This is more of a WIBNI ... but wouldn't it be nice if the Beeb had the equivalent of an Autoexec.bat which would run EXEC commands or files to do things like set up the Red Function Keys and set Default Drive and Disc Number. The !BOOT is only invoked by the Shift-Break or by *EXECing it so doesn't quite do the same thing.
You can use one of the keyboard link switches to invert the sense of SHIFT-BREAK (so it will always invoke !BOOT, unless the shift key is pressed). That's the only way I can think to run something automatically on power up.

Dave
I hadn't thought of that. Another thing to play with when it gets to the top of my list...

Thank you Dave and stay safe, - Robin
#1 BBC Model B Issue 7 + 1770 DFS + Dual TEAC Floppy
#2 BBC Model B Issue 7 + 8271 DFS + Dual Floppy + Speech + PiTubeDirect on KenLowe's Tube Level Shifter
#3 BBC Model B Issue 7 + 8271 DFS + Cumana Single Floppy

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

Re: Adding a Raspberry Pi Second Processor running PiTubeDirect using KenLowe's Level-Shifter Interface

Post by hoglet » Mon Mar 30, 2020 7:36 pm

Wheel_nut wrote:
Mon Mar 30, 2020 7:20 pm
OK, Ctrl-Break gets me a > Prompt. Am I correct that the *FX 151,230,n is only activated after the Ctrl-Break?
That's not quite correct.

The Pi can't tell whether Ctrl is pressed or not, so it will switch to the new Co Pro regardless of the break type.

However, the Beeb OS only transfers the langauge (i.e. BASIC) to the Co Pro on a Ctrl-BREAK.

So, if you just press break you get the new Co Pro but without any language running, hence the * prompt (which comes from the Co Pro's CLI).

Dave

User avatar
Wheel_nut
Posts: 222
Joined: Wed May 01, 2019 1:46 pm
Location: West of Scotland
Contact:

Re: Adding a Raspberry Pi Second Processor running PiTubeDirect using KenLowe's Level-Shifter Interface

Post by Wheel_nut » Mon Mar 30, 2020 8:02 pm

hoglet wrote:
Mon Mar 30, 2020 7:36 pm
Wheel_nut wrote:
Mon Mar 30, 2020 7:20 pm
OK, Ctrl-Break gets me a > Prompt. Am I correct that the *FX 151,230,n is only activated after the Ctrl-Break?
That's not quite correct.

The Pi can't tell whether Ctrl is pressed or not, so it will switch to the new Co Pro regardless of the break type.

However, the Beeb OS only transfers the langauge (i.e. BASIC) to the Co Pro on a Ctrl-BREAK.

So, if you just press break you get the new Co Pro but without any language running, hence the * prompt (which comes from the Co Pro's CLI).

Dave
OK, Got it! that explains exactly what I am seeing. I hadn't attributed the * Prompt to the Co Processor's CLI.

Robin
#1 BBC Model B Issue 7 + 1770 DFS + Dual TEAC Floppy
#2 BBC Model B Issue 7 + 8271 DFS + Dual Floppy + Speech + PiTubeDirect on KenLowe's Tube Level Shifter
#3 BBC Model B Issue 7 + 8271 DFS + Cumana Single Floppy

Kazzie
Posts: 1591
Joined: Sun Oct 15, 2017 8:10 pm
Location: North Wales
Contact:

Re: Adding a Raspberry Pi Second Processor running PiTubeDirect using KenLowe's Level-Shifter Interface

Post by Kazzie » Sun Apr 19, 2020 12:28 pm

hoglet wrote:
Mon Mar 30, 2020 6:32 pm
(It's a shame this case now hangs on a Model B on power up. It's down to how quickly the Pi boots compared to the Beeb. The Pi Foundation firmware blob as got more complex over time, which has resulted in slower boot times.)
I've been playing with my new Pi Zero hanging off the tube port, and I've likewise found that setting copro=14 (no coprocessor present) leaves me needing to press break to get my Beeb to boot, whereas the default copro=0 (6502 coprocessor) boots straightaway.

This seems a little counter-intuitive to me, as I'd expect the Pi to boot quicker if it didn't have to impersonate a coprocessor, but it turns out the reverse is true. What am I missing here?
BBC Model B 32k issue 7, Sidewise ROM board with 16K RAM
Archimedes 420/1 upgraded to 4MB RAM, ZIDEFS with 512MB CF card
Acorn System 1 home-made replica

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

Re: Adding a Raspberry Pi Second Processor running PiTubeDirect using KenLowe's Level-Shifter Interface

Post by hoglet » Sun Apr 19, 2020 1:07 pm

Kazzie wrote:
Sun Apr 19, 2020 12:28 pm
This seems a little counter-intuitive to me, as I'd expect the Pi to boot quicker if it didn't have to impersonate a coprocessor, but it turns out the reverse is true. What am I missing here?
The problem is the boot time of a Pi (to the point of the Kernel Starting) is now ~800ms, where as the Beeb boots in ~200ms.

So nothing we can do in software in the PiTubeDirect Kernel can help.

The reason Co Pro 0 etc don't hang is because OS 1.20 will wait indefintely for the reset message from a Co Pro.

The core problem is the combination of:
- the OS 1.20 tube detection code is very simple - if &FEE0 bit 0 = 1 then it dives into the Tube Host Code
- most level shifers will return &FEE0 bit 0 = 1, even before the Pi has booted

A pull-down resistor on D0 = GPIO8 = Pin 24 (e.g. 10K) on the Pi Connector will resolve this, but most level shifters don't have this.

See this post:
viewtopic.php?p=208474#p208474

The down side of this mod is that none of the other Co Pros will be detected on first boot either (because the PiTubeDirect kernel is not running at that point, so can't actively drive D0).

Dave

Kazzie
Posts: 1591
Joined: Sun Oct 15, 2017 8:10 pm
Location: North Wales
Contact:

Re: Adding a Raspberry Pi Second Processor running PiTubeDirect using KenLowe's Level-Shifter Interface

Post by Kazzie » Sun Apr 19, 2020 1:56 pm

Right, so (as I understand it), the Beeb is detecting that there's something electrically connected to the Tube port, and waiting for the Tube Processor to start communicating with it. Because this always happens quicker than the Pi boots, it's not possible for the Pi to change the voltage on its GPIO in time for the Beeb to think that there's nothing connected to it. That's not a problem for the other copro options, because the Beeb will wait for the coprocessor to respond, but it's too late for the Pi to get away with trying to pretend it's not there, as it does on copro=14.

The 10K pull-up approach will probably work fine for me, as I want a solution that lets the Beeb behave as a normal Model B when other family members turn it on, and still let me play with a co-processor without having to unplug and replug the Pi Zero on a regular basis.

With thinking cap on, is there scope for an alternative solution, namely for the Pi to erase any evidence of its existence, then reset the Beeb? Something along the lines of:
  • Beeb boots, detects device connected to Tube port, waits
  • Pi boots, notes from the copro=X seting that it's not meant to be enabled
  • Pi responds as a Tube Processor (just on first boot)
  • Pi issues tube commands to the Beeb/host to clear the interrupt enable register of the System VIA (which is how the Beeb knows whether it's just been powered up?) and JMP to the reset vector
  • Pi immediately pulls the relevant GPIO pins low, so that the Beeb won't detect it
  • Beeb does a second cold-boot, but doesn't get a response from the Tube this time, and disables the Tube interface
Is that as ill-thought-out as I should expect it to be on a Sunday afternoon, or is it worth further consideration?
BBC Model B 32k issue 7, Sidewise ROM board with 16K RAM
Archimedes 420/1 upgraded to 4MB RAM, ZIDEFS with 512MB CF card
Acorn System 1 home-made replica

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

Re: Adding a Raspberry Pi Second Processor running PiTubeDirect using KenLowe's Level-Shifter Interface

Post by hoglet » Sun Apr 19, 2020 2:06 pm

Kazzie wrote:
Sun Apr 19, 2020 1:56 pm
Right, so (as I understand it), the Beeb is detecting that there's something electrically connected to the Tube port, and waiting for the Tube Processor to start communicating with it. Because this always happens quicker than the Pi boots, it's not possible for the Pi to change the voltage on its GPIO in time for the Beeb to think that there's nothing connected to it. That's not a problem for the other copro options, because the Beeb will wait for the coprocessor to respond, but it's too late for the Pi to get away with trying to pretend it's not there, as it does on copro=14.
Yes, that's exactly it.
Kazzie wrote:
Sun Apr 19, 2020 1:56 pm
With thinking cap on, is there scope for an alternative solution, namely for the Pi to erase any evidence of its existence, then reset the Beeb? Something along the lines of:
  • Beeb boots, detects device connected to Tube port, waits
  • Pi boots, notes from the copro=X seting that it's not meant to be enabled
  • Pi responds as a Tube Processor (just on first boot)
  • Pi issues tube commands to the Beeb/host to clear the interrupt enable register of the System VIA (which is how the Beeb knows whether it's just been powered up?) and JMP to the reset vector
  • Pi immediately pulls the relevant GPIO pins low, so that the Beeb won't detect it
  • Beeb does a second cold-boot, but doesn't get a response from the Tube this time, and disables the Tube interface
Is that as ill-thought-out as I should expect it to be on a Sunday afternoon, or is it worth further consideration?
Something like that might well be possible.

It could, I guess, mostly be implemented in 6502 assembler as a custom tube ROM for the 6502 Co Pro.

(Something extra would be needed to ensure it only does this on first boot)

This is a use-case that's specific to the Model B, because Acorn improved the Tube detection code in MOS 3.20. So it might also have to detect the machine type. Or, it's down to the user to disable this behaviour on a Master.

Dave

User avatar
BigEd
Posts: 3095
Joined: Sun Jan 24, 2010 10:24 am
Location: West
Contact:

Re: Adding a Raspberry Pi Second Processor running PiTubeDirect using KenLowe's Level-Shifter Interface

Post by BigEd » Sun Apr 19, 2020 2:18 pm

we now have slots for up to 32 flavours of second processor - could this be a special different type of null processor?

Kazzie
Posts: 1591
Joined: Sun Oct 15, 2017 8:10 pm
Location: North Wales
Contact:

Re: Adding a Raspberry Pi Second Processor running PiTubeDirect using KenLowe's Level-Shifter Interface

Post by Kazzie » Sun Apr 19, 2020 2:36 pm

BigEd wrote:
Sun Apr 19, 2020 2:18 pm
we now have slots for up to 32 flavours of second processor - could this be a special different type of null processor?
That was my thinking - have another null-processor, leaving copro=14 as it is.
BBC Model B 32k issue 7, Sidewise ROM board with 16K RAM
Archimedes 420/1 upgraded to 4MB RAM, ZIDEFS with 512MB CF card
Acorn System 1 home-made replica

User avatar
Wheel_nut
Posts: 222
Joined: Wed May 01, 2019 1:46 pm
Location: West of Scotland
Contact:

Adding a Raspberry Pi Second Processor running PiTubeDirect using KenLowe's Level-Shifter Interface

Post by Wheel_nut » Sun Apr 19, 2020 2:54 pm

Like Kazzie, I would like the Beeb to boot as a standard Beeb and then let me turn on the Co-Processors as required. I have now edited the first post in this thread to show my work-around for this but BigEd's proposition looks good if it is easily do-able.

I did consider slugging the startup Reset timer by adding a 0.47uF capacitor in parallel with C8 to slow the Beeb's bootup time to about a second.

Currently, with the solution as per my first post, my startup sequence to get to the normal Games Menu is:
Switch On - Beeb Boots with Co-Processor active ...
Shift-Break
F0
Ctrl-Break
Shift-Break
F4 ... >>> Games Menu
#1 BBC Model B Issue 7 + 1770 DFS + Dual TEAC Floppy
#2 BBC Model B Issue 7 + 8271 DFS + Dual Floppy + Speech + PiTubeDirect on KenLowe's Tube Level Shifter
#3 BBC Model B Issue 7 + 8271 DFS + Cumana Single Floppy

Post Reply

Return to “8-bit acorn hardware”