Raspberry Pi to 1MHz bus interface

for bbc micro/electron hardware, peripherals & programming issues (NOT emulators!)
iainjh
Posts: 338
Joined: Mon May 14, 2012 11:18 am
Contact:

Re: Raspberry Pi to 1MHz bus interface

Post by iainjh » Thu Apr 11, 2019 10:04 pm

Hi

This looks very very interesting, congrats!

If any are available, please could I buy two kits if possible- one for me and one for thecorfiot out in Greece.

Thanks in advance

Hope the request is ok

Iain

User avatar
trixster
Posts: 896
Joined: Wed May 06, 2015 11:45 am
Location: York
Contact:

Re: Raspberry Pi to 1MHz bus interface

Post by trixster » Fri Apr 12, 2019 5:46 am

Any chance I could go on the list for one kit please? :)
A3020 | A3000 | A420/1 | BBC B | Master Turbo | ZX48K | NeoGeo
Atom | Amiga A4000 | A3000 | A1200 | A500 | PC Engine | Enterprise
Falcon | Saturn | PS1 | SNES | CPC6128 | C64 | 3DO | MD | Jaguar | X68000 | CD32

andrewvideo
Posts: 93
Joined: Fri Mar 08, 2019 3:18 pm
Contact:

Re: Raspberry Pi to 1MHz bus interface

Post by andrewvideo » Fri Apr 12, 2019 10:31 am

What sort of price we talking about>?

User avatar
BeebMaster
Posts: 2830
Joined: Sun Aug 02, 2009 4:59 pm
Location: Lost in the BeebVault!
Contact:

Re: Raspberry Pi to 1MHz bus interface

Post by BeebMaster » Fri Apr 12, 2019 1:23 pm

Have I missed these? I thought I put down for some early on.
Image

andrewvideo
Posts: 93
Joined: Fri Mar 08, 2019 3:18 pm
Contact:

Re: Raspberry Pi to 1MHz bus interface

Post by andrewvideo » Fri Apr 12, 2019 5:29 pm

I would be interested if it’s easy to use and some guide.

Would be great if it could replace the Datacentre.

Do you think it’s possible to emulate the ADFS, Music 500 and other things at the same time ?

Would be great if we get access to files over network.

Love to see a demo of it.

dp11
Posts: 951
Joined: Sun Aug 12, 2012 8:47 pm
Contact:

Re: Raspberry Pi to 1MHz bus interface

Post by dp11 » Fri Apr 12, 2019 5:41 pm

No one has missed out.

I haven't shipped any yet. This project should still be considered in Beta.

If early people would like to PM me their details that would be great.

Yes you can have an ADFS harddisc ( 512Mbytes), 480Mbytes of JIM RAM, and a M5000 at the same time. Currently if you do a ADFS access while M5000 is playing the playing will be interrupted, but then resumes.

Current Readme file, needs work but here it is
# Raspberry Pi to Beeb 1MHz interface

This project enables a Raspberry Pi to emulate a number of existing Beeb peripherals plus some new ones:

* ADFS Harddisc
* Music 5000 / 3000
* Expansion RAM (480Mbytes for a PiZero)

A simple Level shifter is required to connect the 1MHz port to the beeb. A Pizero and level shifter can sit under a Beeb or Master.

PiZero and PiZeroW are treated as the same. Pi3B+ is also supported via a cable as it won't fit under the computer. Pi3A+ should also work but hasn't been tested.

## setting up

You will need a PiZero or Pi3B+ with a cable, SDCARD and level shifter and some means of powering the Pi ( a bit of wire from the beeb)

Copy the contents of the firmware directory to the root of your SDCARD. If you want a prepared ADFS harddisc you can copy https://www.domesday86.com/wp-content/u ... UN_2_5.zip to the root of the SDCARD otherwise you can find out more details on creating an ADFS LUN at : https://www.domesday86.com/?page_id=400

Insert the SDCARD into the pi. Attach the level shifter to the pi and insert into the 1MHz bus socket of the beeb. Take extra care to ensure that it is connected correctly. You will also need to take +5v from somewhere to power the pi, this can be the user port or Tube for example.

## ADFS Harddisc Emulation

ADFS harddisc emulation is based on BeebSCSI. For more information goto : https://www.domesday86.com/?page_id=400 .If you have a Master then you will have ADFS already in ROM. If you have a beeb you will need ADFS. It is possible if the computer boots very fast and the SDCARD is slow that the computer boots faster than the Pi in this case an extra CTRL-BREAK will be required.

Read speed appears to be about 100K/sec.

## Music 5000 / 3000 Emulation

The emulation can play sounds through the computers internal speaker. If you are using the pi3B+ you can use the headphone jack. Currently if an ADFS access occurs while playing music the musics will be interrupted briefly.

See the command.txt section for various configuration options

## Expansion Ram Emulation

Two types of JIM expansion ram are supported:

* Byte mode : 16Mbytes http://www.sprow.co.uk/bbc/ramdisc.htm
* Page mode : 480Mbytes for Pizero, 992Mbytes RPI3B+

Byte mode uses the registers &FC02, &FC01, &FC00 to select the byte and FC03 to read and write the memory.

Page mode uses the registers &FCFD &FCFE FCFF to select the page for FD00--FDFF

The first page of JIM ram is preloaded with build information. This can be accessed by doing PRINT $FD00. This is RAM so can easily be over written.

If a file called "JIM_Init.bin" exists it will be loaded starting at the beginning of JIM onwards ( NB over writes build info). This enables future very large programs which, with clever programming could all run in JIM RAM.

## Internal status and control

&FCCA selects the command/status address
&FCCB is the return status / command write.

Addresses currently defined
* &00 : Readonly : JIM RAM size in 16Mbyte steps

## Command.txt options

*LED override : depending on the pi use either bcm2708.disk_led_gpio=xx or bcm2709.disk_led_gpio=xx where xx is the pi GPIO number
*M5000_BeebAudio_Off=1 to turn off Audio out of the Beeb and enable stereo on the headphone jack of Pi3B+
*M5000_Gain=xxxx : Over rides default gain of 16. Add 1000 to disable auto scaling as well. Auto scaling reduces the gain if the signal clips

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

Re: Raspberry Pi to 1MHz bus interface

Post by hoglet » Fri Apr 12, 2019 6:01 pm

Dominic,

Would you mind if I posted some photos - I assume the board hasn't changed since the send me a couple of prototypes a few weeks ago.

I'm planning to do some more testing this weekend.

Dave
Last edited by hoglet on Fri Apr 12, 2019 6:01 pm, edited 1 time in total.

dp11
Posts: 951
Joined: Sun Aug 12, 2012 8:47 pm
Contact:

Re: Raspberry Pi to 1MHz bus interface

Post by dp11 » Fri Apr 12, 2019 6:03 pm

Happy for you to post away.

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

Re: Raspberry Pi to 1MHz bus interface

Post by BigEd » Fri Apr 12, 2019 6:08 pm

Great project Dominic!

dp11
Posts: 951
Joined: Sun Aug 12, 2012 8:47 pm
Contact:

Re: Raspberry Pi to 1MHz bus interface

Post by dp11 » Fri Apr 12, 2019 7:04 pm

Use real Adobe Acrobat read to see a 3d view of the PCB and parts
Attachments
Job2.PDF
(954.24 KiB) Downloaded 102 times

dp11
Posts: 951
Joined: Sun Aug 12, 2012 8:47 pm
Contact:

Re: Raspberry Pi to 1MHz bus interface

Post by dp11 » Fri Apr 12, 2019 7:13 pm

Costs :

PCBs £2
Kit of bits £2 ( except connectors and cable for 5v to the board and Pi) NB the 40way connector is currently made up of two 20way connectors and these need a little bit sanding off the side ( 0.5mm)

Postage £1 for UK

I'm not trying to make a profit from the above, but it you'd like to make an extra donation to cover the Pis I have bought you are most welcome.

iainjh
Posts: 338
Joined: Mon May 14, 2012 11:18 am
Contact:

Re: Raspberry Pi to 1MHz bus interface

Post by iainjh » Sat Apr 13, 2019 9:12 am

Will pm now and arrange to send funds! Thank you again :)

cr12925
Posts: 3
Joined: Sat Mar 09, 2019 9:31 pm
Contact:

Re: Raspberry Pi to 1MHz bus interface

Post by cr12925 » Sat Apr 13, 2019 4:46 pm

I'd be very grateful for one of the kits - please can you let me know what I'll need to do to obtain one?
Master 128, Viglen floppy drives, former purveyor of BBS software...

dp11
Posts: 951
Joined: Sun Aug 12, 2012 8:47 pm
Contact:

Re: Raspberry Pi to 1MHz bus interface

Post by dp11 » Sun Apr 14, 2019 6:44 pm

Demand has exceeded supply !!! I have spare PCBs and resistors, but not diodes and connectors. I'll order some more

User avatar
simoni
Posts: 484
Joined: Wed May 25, 2016 6:18 pm
Contact:

Re: Raspberry Pi to 1MHz bus interface

Post by simoni » Mon Apr 15, 2019 5:15 am

Is there a link to the PCB schematic and the source code?

I don't like to plug anything new into my Acorn's unless I can see some schematics first :)

Nice to see you've built upon my BeebSCSI code; I'm quite interested in how you did the CPLD part on the Pi; I'd been thinking about doing some Pi bare-metal stuff recently, but haven't found the time, so a reference would be really useful.

dominicbeesley
Posts: 827
Joined: Tue Apr 30, 2013 11:16 am
Contact:

Re: Raspberry Pi to 1MHz bus interface

Post by dominicbeesley » Mon Apr 15, 2019 8:43 am

dp11 wrote:
Sun Apr 14, 2019 6:44 pm
Demand has exceeded supply !!! I have spare PCBs and resistors, but not diodes and connectors. I'll order some more
Did you get my pm? I would be happy with a bare board

D

dp11
Posts: 951
Joined: Sun Aug 12, 2012 8:47 pm
Contact:

Re: Raspberry Pi to 1MHz bus interface

Post by dp11 » Mon Apr 15, 2019 11:56 am

Just doing a final stock count before saying yes to extra people. I've just shipped out orders in order people requested them from the beginning of the thread.

dp11
Posts: 951
Joined: Sun Aug 12, 2012 8:47 pm
Contact:

Re: Raspberry Pi to 1MHz bus interface

Post by dp11 » Mon Apr 15, 2019 12:37 pm

simoni wrote:
Mon Apr 15, 2019 5:15 am
Is there a link to the PCB schematic and the source code?

I don't like to plug anything new into my Acorn's unless I can see some schematics first :)

Nice to see you've built upon my BeebSCSI code; I'm quite interested in how you did the CPLD part on the Pi; I'd been thinking about doing some Pi bare-metal stuff recently, but haven't found the time, so a reference would be really useful.
Its coming :)

Hardware wise it is a simple level shifter just a resistor and diode on each signal.

Software wise : ( look away now if you don't like assembler !) There is a FIQ handler which deals with the 1MHz bus. This FIQ handler sits at the FIQ vector and is triggered on FRED or JIM access. It filters out the glitches and if it beeb is performing a read outputs the data from an array which holds data to be read for each address. Optionally a callback is done if the address was a read sensitive location. Writes latach the data and call a callback to handle the data.

The main code is then relatively simple in C each emulated device provides an init function. This function is call at power up and on reset ( BREAK).
The init function registers callback functions for each address in FRED and JIM it is interest in. It can also register a polling function as well ( for basic cooperative multitasking.)

From BeebSCSI point of view filesystem.c was largely unchanged except from removing ATMEL processor specific functions I think these ended up being #defined to NULL. FCODE stuff is now also only built if #define FCODE is set, as FCODE makes no sense here and the UART is already in use. It had some bug fixes and tidy ups which you know about. It also was tweaked to pass more of cppcheck checks ( these are minor).

hostadaptor.c got renamed to harddisc_emulator.c (to match the standard xxx_emuator.c ) and had the new world functions to emulate the CPLD added. This file has changed from your world, but is based on it. During debugging I ended up simplifying all the invertions. I haven't revisited the file since I hacked in support , so it needs a lot of tidying work, but you should get the idea.

FIQ.S ( called .txt as forum doesn't support upload of .s files) and harddisc_emualtor.c attached so you can see how it works
Attachments
FIQ.txt
(4.01 KiB) Downloaded 25 times
harddisc_emulator.c
(10.93 KiB) Downloaded 15 times

dominicbeesley
Posts: 827
Joined: Tue Apr 30, 2013 11:16 am
Contact:

Re: Raspberry Pi to 1MHz bus interface

Post by dominicbeesley » Tue Apr 16, 2019 1:06 pm

dp11 wrote:
Mon Apr 15, 2019 11:56 am
Just doing a final stock count before saying yes to extra people. I've just shipped out orders in order people requested them from the beginning of the thread.
Fair enough, I thought I was early in the requests but I see I'm not!

D

markrwj
Posts: 16
Joined: Fri Aug 26, 2016 1:18 pm
Contact:

Re: Raspberry Pi to 1MHz bus interface

Post by markrwj » Tue Apr 16, 2019 2:15 pm

I would also like one if any are still available. Very interested in the Music 500 / 5000 emulation.

User avatar
sirmorris
Posts: 773
Joined: Wed Feb 11, 2009 12:18 pm
Location: oxfordshire uk
Contact:

Re: Raspberry Pi to 1MHz bus interface

Post by sirmorris » Tue Apr 16, 2019 2:27 pm

Peripheralmon. Gotta catch them all...

Is there a PCB I could buy please?

Stewie66
Posts: 23
Joined: Sun Jan 16, 2011 2:44 am
Location: Sydney
Contact:

Re: Raspberry Pi to 1MHz bus interface

Post by Stewie66 » Wed Apr 17, 2019 12:19 pm

I’d like to put my name down for a pcb and also parts if there is another batch being produced

Cheers
Stewie

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

Re: Raspberry Pi to 1MHz bus interface

Post by hoglet » Wed Apr 17, 2019 3:28 pm

Here's a couple of photos of the actual interface.
IMG_1629.JPG
IMG_1630.JPG
No active components, just 1N4148 diodes and 100R resistors.

Dave
Last edited by hoglet on Wed Apr 17, 2019 3:32 pm, edited 2 times in total.

User avatar
fordp
Posts: 1026
Joined: Sun Feb 12, 2012 9:08 pm
Location: Kent, England
Contact:

Re: Raspberry Pi to 1MHz bus interface

Post by fordp » Wed Apr 17, 2019 5:07 pm

My kit arrived today, many thanks. Looks like all the diodes point the same way? Is there a GitHub project?
FordP (Simon Ellwood)
Time is an illusion. Lunchtime, doubly so!

User avatar
simoni
Posts: 484
Joined: Wed May 25, 2016 6:18 pm
Contact:

Re: Raspberry Pi to 1MHz bus interface

Post by simoni » Wed Apr 17, 2019 5:33 pm

Using diodes and resistors as a bidirectional level converter is a fairly standard trick (with caveats around pull-down):

http://www.hobbytronics.co.uk/schottky- ... conversion

The advantage of the approach is that it's cheap; the disadvantage is that it skews the signal edges and doesn't work well over longer cable runs or high-speed clock I/O. By keeping the interface signal runs short (i.e. getting the Pi as close as possible to the 1 MHz bus port) it will work fine provided the ICs in the Beeb are up to scratch. It's also recommended that the 1MHz bus has terminating resistors; again that helps prevent signal distortion over longer cable runs. If I could build a board I could use this high-end professional scope on my workbench and provide some feedback on how close to tolerance the design is.

The main issue I have is that, without a schematic, I can't tell the pin-to-pin mapping; otherwise I could make a PCB in 15 minutes. Not sure what the big secret is; if the schematics and code were on github, others could help out. Projects are never 'finished' unless they are closed source - just make the repo as 'beta/in progress' :)

RobC
Posts: 2670
Joined: Sat Sep 01, 2007 9:41 pm
Contact:

Re: Raspberry Pi to 1MHz bus interface

Post by RobC » Wed Apr 17, 2019 5:40 pm

Mine arrived today too - many thanks.
fordp wrote:
Wed Apr 17, 2019 5:07 pm
Looks like all the diodes point the same way?
I've not built mine yet but the PDF that was posted earlier in the thread shows how the components should be placed. All the diodes appear to go the same way with the cathodes (black line end) connected to the square pads.

dp11
Posts: 951
Joined: Sun Aug 12, 2012 8:47 pm
Contact:

Re: Raspberry Pi to 1MHz bus interface

Post by dp11 » Wed Apr 17, 2019 7:20 pm

simoni wrote:
Wed Apr 17, 2019 5:33 pm
Using diodes and resistors as a bidirectional level converter is a fairly standard trick (with caveats around pull-down):

http://www.hobbytronics.co.uk/schottky- ... conversion

The advantage of the approach is that it's cheap; the disadvantage is that it skews the signal edges and doesn't work well over longer cable runs or high-speed clock I/O. By keeping the interface signal runs short (i.e. getting the Pi as close as possible to the 1 MHz bus port) it will work fine provided the ICs in the Beeb are up to scratch. It's also recommended that the 1MHz bus has terminating resistors; again that helps prevent signal distortion over longer cable runs. If I could build a board I could use this high-end professional scope on my workbench and provide some feedback on how close to tolerance the design is.

The main issue I have is that, without a schematic, I can't tell the pin-to-pin mapping; otherwise I could make a PCB in 15 minutes. Not sure what the big secret is; if the schematics and code were on github, others could help out. Projects are never 'finished' unless they are closed source - just make the repo as 'beta/in progress' :)
It is designed to be under the beeb. I have actually been testing with 0.5M cable to make probing with the scope easier. You may actually find it works better with very long cables as it better matches the impedance off ribbon cable.

No big secret just life getting in the way.

dp11
Posts: 951
Joined: Sun Aug 12, 2012 8:47 pm
Contact:

Re: Raspberry Pi to 1MHz bus interface

Post by dp11 » Wed Apr 17, 2019 7:32 pm

Circuits attached.
Attachments
Circuits.PDF
(297.4 KiB) Downloaded 85 times

User avatar
simoni
Posts: 484
Joined: Wed May 25, 2016 6:18 pm
Contact:

Re: Raspberry Pi to 1MHz bus interface

Post by simoni » Wed Apr 17, 2019 7:46 pm

Perfect, thanks! The BBC Master is my usual go-to machine, and these boards don't usually fit underneath. Whilst the converter is fine for the Model B, mounting on a Master might be a little more tricky from a signal quality perspective which is why I wanted to take a look at it. I'll put the design in KiCAD and etch a PCB and share any results.

dp11
Posts: 951
Joined: Sun Aug 12, 2012 8:47 pm
Contact:

Re: Raspberry Pi to 1MHz bus interface

Post by dp11 » Wed Apr 17, 2019 7:51 pm

simoni wrote:
Wed Apr 17, 2019 7:46 pm
Perfect, thanks! The BBC Master is my usual go-to machine, and these boards don't usually fit underneath. Whilst the converter is fine for the Model B, mounting on a Master might be a little more tricky from a signal quality perspective which is why I wanted to take a look at it. I'll put the design in KiCAD and etch a PCB and share any results.
I've tested both beeb and a Master with 0.5M cable. My layout is is small so it does fit under a master. It was designed to also have PiTube direct connected to the same computer
Last edited by dp11 on Wed Apr 17, 2019 8:26 pm, edited 1 time in total.

Post Reply