Pi-based Co-Pro on the cheap - 100MHz 6502 for £10? (now 290MHz)

discuss both original and modern hardware for the bbc micro/electron
User avatar
hoglet
Posts: 9820
Joined: Sat Oct 13, 2012 7:21 pm
Location: Bristol
Contact:

Re: Pi-based Co-Pro on the cheap - 100MHz 6502 for £10? (now 290MHz)

Post by hoglet »

BeebMaster wrote:
Fri Sep 18, 2020 4:29 pm
Same with the 6502 Tube.
I'm not sure what you mean by "6502 Tube"?
BeebMaster wrote:
Fri Sep 18, 2020 4:29 pm
With the Winchester plugged in and switched on this doesn't happen, everything works normally, it's only when it is plugged in but powered off.
Most of the control lines on the 1MHz bus (like R/W) are unbuffered. An unpowered 1MHz Bus device can significantly load these lines, affecting the operation of the Beeb and other devices. I'm actually surprised it boots at all!

I would not run for a prolonged period with anything unpowered connected to the 1MHz bus - it actually risks damaging the Beeb and/or the Device. Older TTL devices are fairly robust. But anything modern is much more at risk, and especially anything using a Xilinx CPLD!

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

Re: Pi-based Co-Pro on the cheap - 100MHz 6502 for £10? (now 290MHz)

Post by BeebMaster »

6502 Tube as in "*FX 151,230,0". Actually I think it is a cable length thing, because the problem hadn't gone away even with the Winchester disc on, I still got FFs in RAM I'd just cleared to zero.

I've taken away the intermediate 3ft. extension cable, so it's only my short 12" extension cable which goes underneath and comes out at the back so I can sit my Pi 1MHz SCSI on top of the Master, connected to the Winnie's own 3ft. cable, and there is no memory corruption when doing that.

I noticed that the host adapter inside this Winchester disc has had its terminating resistor packs removed, could that be part of the problem?
Image
User avatar
hoglet
Posts: 9820
Joined: Sat Oct 13, 2012 7:21 pm
Location: Bristol
Contact:

Re: Pi-based Co-Pro on the cheap - 100MHz 6502 for £10? (now 290MHz)

Post by hoglet »

BeebMaster wrote:
Fri Sep 18, 2020 5:06 pm
I've taken away the intermediate 3ft. extension cable
:shock:

I would suggest it's probabably a cable thing as well!
User avatar
BeebMaster
Posts: 3862
Joined: Sun Aug 02, 2009 5:59 pm
Location: Lost in the BeebVault!
Contact:

Re: Pi-based Co-Pro on the cheap - 100MHz 6502 for £10? (now 290MHz)

Post by BeebMaster »

Strange though that it has this RAM-corrupting effect only on the external second processor. Or is that to be expected? I'll have to try it with an actual cheese wedge, I reckon the Tesco Cheese Biscuits Wedge is due for a new photo session.
Image
User avatar
BeebMaster
Posts: 3862
Joined: Sun Aug 02, 2009 5:59 pm
Location: Lost in the BeebVault!
Contact:

Re: Pi-based Co-Pro on the cheap - 100MHz 6502 for £10? (now 290MHz)

Post by BeebMaster »

I thought I'd well and truly had my comeuppance with my custom build with 256MB ARM Native co-pro and ARMBASIC built in - I was trying to image my Rodime Winchester with a 32MB data buffer and it fell over whilst trying to clear the buffer. Nothing happened, and when I pressed BREAK the whole of Pi Tube was gone - I was back to the internal co-pro!

I soon figured out it is because the kernel lives at &1F00000, so my memory clear loop was wiping it! I wasn't sure how easy it might be to move the kernel. Just changing kernel_address in config.txt didn't work, but then I found that all I needed to do was alter the address in rpi.ld as well. So now I've got the kernel loading at &13000000 and I really do have 256MB of useable RAM for the Native ARM. I think.

I wonder if a relocated kernel could be considered for the next release (maybe including ARM BASIC as well). I just signed up on Git Hub today, shall I talk about it on there?
Image
User avatar
hoglet
Posts: 9820
Joined: Sat Oct 13, 2012 7:21 pm
Location: Bristol
Contact:

Re: Pi-based Co-Pro on the cheap - 100MHz 6502 for £10? (now 290MHz)

Post by hoglet »

BeebMaster wrote:
Sat Sep 19, 2020 9:57 pm
So now I've got the kernel loading at &13000000 and I really do have 256MB of useable RAM for the Native ARM. I think.
Some of that RAM might be quite slow....

Currently the Pi cache is setup as follows:
- 0 - 63MB is L1 and L2 cached
- 64MB - 127MB is L2 cached only
- 128MB onwards is uncached

This is controlled by constants in cache.h:
https://github.com/hoglet67/PiTubeDirec ... rc/cache.h

These values are largely historic, but there are a couple of other gotchas:
- the Pi Property Interface (used to talk to the GPU) uses a small buffer at UNCACHED_MEM_BASE (128MB)
- the block of ARM vectors is placed just below L2_CACHED_BASE (64MB)

So these need to be changed as well.

Dominic has done this work in the Pi 1MHz project; so we could look at pulling that across.
BeebMaster wrote:
Sat Sep 19, 2020 9:57 pm
I wonder if a relocated kernel could be considered for the next release (maybe including ARM BASIC as well). I just signed up on Git Hub today, shall I talk about it on there?
By all means create one (or more issues) in github describing the enhancements you would like to see.

The only problem I see is that these changes will break compatability with the 256MB Pi models, meaning we would have to have seperate (large memory) kernels. Then there is the debate as to which should be the default, as I don't think the Pi config.txt file supports conditional filters based on memory size. If it did, then the problem goes away.

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

Re: Pi-based Co-Pro on the cheap - 100MHz 6502 for £10? (now 290MHz)

Post by dp11 »

I think the startup code should ask the gpu how much memory there is. In Pi1MHz this is done in C for PiTubeDirect I think it can be done in assembler before the stacks and vectors are positioned. I'd sort of like not to go down the route of too many different kernels. Pi4 users would then want 1, 2, 4GB versions (NB 8GB is a lot of work as everything is 32bit)
User avatar
BeebMaster
Posts: 3862
Joined: Sun Aug 02, 2009 5:59 pm
Location: Lost in the BeebVault!
Contact:

Re: Pi-based Co-Pro on the cheap - 100MHz 6502 for £10? (now 290MHz)

Post by BeebMaster »

It's highly unlikely I'd ever find a use for 256MB of RAM - so I'd be very happy with a 128MB limit if it meant keeping compatibility with all Pis. The only real use for anything like this amount of memory is to read whole Winchester discs into RAM at once, I don't think there are many vintage Winnies much bigger than 64MB anyway.
Image
User avatar
Wheel_nut
Posts: 509
Joined: Wed May 01, 2019 1:46 pm
Location: West of Scotland
Contact:

Beeb won't Boot with PiTubeDirect and Gotek as Boot Drive

Post by Wheel_nut »

It's been very quiet in here for a while 8)

I have one of KenLowe's Tube Level Shifters and a RPi1 on the Tube and a Gotek on the Disk Drive port.

I have to Power Off the Gotek to allow the Beeb to Boot with the RPi Co-Processor active. Once the Beeb Boots to the Co-Processor Start-up message, I can switch the Gotek On and then Shift Break to boot the !BOOT file on the Gotek.

If the Gotek is powered when the Beeb is booted, it hangs with a flashing Cursor in the Top LHS of the screen.

Needless to say, once Booted, everything works perfectly!

Robin
#1 BBC Model B Issue 7 + 1770 DFS + Dual TEAC Floppy
#2 BBC Model B Issue 7 + 8271 DFS + Dual Floppy + Speech
#3 BBC Model B Issue 7 + 8271 DFS + Cumana Single Floppy + PiTubeDirect on KenLowe's Tube Level Shifter
markdryan
Posts: 195
Joined: Sun Aug 20, 2017 11:37 pm
Contact:

Re: Pi-based Co-Pro on the cheap - 100MHz 6502 for £10? (now 290MHz)

Post by markdryan »

I've got a quick question about the Native ARM mode of PiTube direct. What would be the best address to load and execute an absolute binary from? Ideally, I'd like to maximise the available memory but not corrupt anything. If I understand correctly, I should avoid the RiscOS start address of &8000, but I can't quite figure out what value to use instead.
User avatar
dudleysoft71
Posts: 142
Joined: Tue May 26, 2020 6:56 pm
Contact:

Re: Pi-based Co-Pro on the cheap - 100MHz 6502 for £10? (now 290MHz)

Post by dudleysoft71 »

markdryan wrote:
Sun Nov 22, 2020 10:18 pm
I've got a quick question about the Native ARM mode of PiTube direct. What would be the best address to load and execute an absolute binary from? Ideally, I'd like to maximise the available memory but not corrupt anything. If I understand correctly, I should avoid the RiscOS start address of &8000, but I can't quite figure out what value to use instead.
All of my binaries load at &F000, this seems to work fine, I'm not sure if addresses higher than &10000 will cause issues if you try to use DFS rather than ADFS as your file system, but &F000 is definitely safe to use.
markdryan
Posts: 195
Joined: Sun Aug 20, 2017 11:37 pm
Contact:

Re: Pi-based Co-Pro on the cheap - 100MHz 6502 for £10? (now 290MHz)

Post by markdryan »

dudleysoft71 wrote:
Mon Nov 23, 2020 9:35 am
All of my binaries load at &F000, this seems to work fine, I'm not sure if addresses higher than &10000 will cause issues if you try to use DFS rather than ADFS as your file system, but &F000 is definitely safe to use.
Thanks. I'll give this a go.
dominicbeesley
Posts: 1403
Joined: Tue Apr 30, 2013 12:16 pm
Contact:

Re: Pi-based Co-Pro on the cheap - 100MHz 6502 for £10? (now 290MHz)

Post by dominicbeesley »

I've finally got round to getting my PiTubeDirect plugged in, I'm hoping to do a bit of tube tinkering and would like to play about in the ARM Native version. I'm having a few problems:

BASIC135: The version on MDFS.net doesn't seem to want to run unless I *LOAD then *GO, I found Hoglet's version upthread - is that now the canonical version?
CLOCKSP: On My PiZeroW I get division by zero - it's just too fast? Is there a fixed version of CLOCKSP?
BASIC135: PAGE seems to default to &8F00 (both versions) as BASIC itself is at Fxxx that can't be right can it?
BASIC135: Seems to have a built in assembler - I'm guessing the code will not be runnable on the native copro? I tried a simple MOVS PC,R14 and it of course hung...I'm guessing the ABI is way different? Am I best just sticking to C?

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

Re: Pi-based Co-Pro on the cheap - 100MHz 6502 for £10? (now 290MHz)

Post by hoglet »

dominicbeesley wrote:
Wed Dec 02, 2020 12:01 am
BASIC135: The version on MDFS.net doesn't seem to want to run unless I *LOAD then *GO, I found Hoglet's version upthread - is that now the canonical version?
CLOCKSP: On My PiZeroW I get division by zero - it's just too fast? Is there a fixed version of CLOCKSP?
BASIC135: PAGE seems to default to &8F00 (both versions) as BASIC itself is at Fxxx that can't be right can it?
I would suggest switching to the latest gecko develoment build. This has a version of BASIC135 included. I'll upload a dev snapshot to github later.

And yes, the Native ARM Co Pro is so fast the standard version of CLOCKSP break. A work around is to add:

Code: Select all

 45 A%=A%*100
515 A%=A%*100
dominicbeesley wrote:
Wed Dec 02, 2020 12:01 am
BASIC135: Seems to have a built in assembler - I'm guessing the code will not be runnable on the native copro? I tried a simple MOVS PC,R14 and it of course hung...I'm guessing the ABI is way different? Am I best just sticking to C?
The assembler will generate 26-bit ARM v1/v2, which is not compatible with the native 32-bit ARM v6 on the Pi.

Whether moving to C is the right answer depends on what you are trying to do.

Dave
dominicbeesley
Posts: 1403
Joined: Tue Apr 30, 2013 12:16 pm
Contact:

Re: Pi-based Co-Pro on the cheap - 100MHz 6502 for £10? (now 290MHz)

Post by dominicbeesley »

Thanks hoglet

I'll give it a go. I updated to fer de lance I didn't spot any files other than the pi SD card stuff on the release am I looking in the wrong place?

I'm looking at how to do faster transfers using the blitter pseudo DMA hopefully for file transfers in time but initially will be hacking at RobC's Doom port.

I'm guessing that on the native core there are no tube registers as such on the client side but that the client os directly does all the tube magic rather than emulating hw registers?

First up will just be to see how quickly I can pull from reg1 on the host side without exhausting the fifo. I'm just feeling my way at the minute but it looks like the doom code on the client just pushes screen updates in a fast loop and the host pulls blindly as fast as it can. If I use DMA then I'll be pulling at a rate of up to 1MHz.

It would be good to make a file transfer mode that is quicker. I got Linux working on Sprow's arm2 board years ago but lost interest as file transfers were just too slow to make it fun a 10x speed increase may be possible but would require a hacked fs and client.

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

Re: Pi-based Co-Pro on the cheap - 100MHz 6502 for £10? (now 290MHz)

Post by hoglet »

dominicbeesley wrote:
Wed Dec 02, 2020 9:32 am
I'll give it a go. I updated to fer de lance I didn't spot any files other than the pi SD card stuff on the release am I looking in the wrong place?
Fer-De-Lance doesn't have the in built ARM BBC BASIC.

I've just made a first release candidate available for Gecko:
https://github.com/hoglet67/PiTubeDirec ... /gecko-rc0

Give this a try.

There is now a built-in command *ARMBASIC.

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

Re: Pi-based Co-Pro on the cheap - 100MHz 6502 for £10? (now 290MHz)

Post by hoglet »

dominicbeesley wrote:
Wed Dec 02, 2020 9:32 am
I'm guessing that on the native core there are no tube registers as such on the client side but that the client os directly does all the tube magic rather than emulating hw registers?
All the tube data transfer is implemented in a fast-interrupt handler (written in C) that is functionally the same as Co Pro client ROM interrupt handler. This directly calls the low level tube ULA emulation code, so there's no need for any tube registers in the memory map.

All the appliction sees is a set of SWI based API, like in RISCOS.

In fact, these were very much inspired by (and compatible with) those provided by Sprow's ARM-7 Co Pro, and described here:
ARM coprocessor supported OS calls

I've only implemented a sub-set of these.

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

Re: Pi-based Co-Pro on the cheap - 100MHz 6502 for £10? (now 290MHz)

Post by hoglet »

Hi all,

Happy Christmas all :D

I'm pleased to announce a (hopefully) final release candiate for the Gecko Release of PiTubeDirect:
https://github.com/hoglet67/PiTubeDirec ... /gecko-rc1

Changes since Fer-De-Lance include:
- Added Dossytronics 65816 Co Po (Co Pro 18)
- Added ReCo 65816 Co Po (Co Pro 19)
- Added Ferranti F100 Co Processor (Co Pro 28)
- 6502 Co Pro: CALL &2000 lists the available Co Processors (#71, from MinceBert)
- 6502 Co Pro: Fix interrupt issue that causes Acornsoft Chess to crash (#75)
- 32016 Co Pro: Fix disassebly of shift operations
- Native ARM Co Pro: Reorganise the memory map so 216MB is available (#78)
- Native ARM Co Pro: added *HELP COPROS (#83)
- Native ARM Co Pro: added *ARMBASIC command (BAS135 built in) (#79)
- Native ARM Co Pro: avoid &8000-&BFFF getting trashed by language transfer
- Native ARM Co Pro: several other minor bug fixes (#73,#74, #76, #77)
- GPU: Workaround a clock noise issue with some level shifters ( #70 )

If there are no major issues found, this will become the final Gecko release just before the end of the year.

And on a different note, PiTubeDirect gets a mention in Issue 101 of the MagPi Magazine (page 26/27)
https://magpi.raspberrypi.org/issues/101/pdf/download

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

Re: Pi-based Co-Pro on the cheap - 100MHz 6502 for £10? (now 290MHz)

Post by BigEd »

Fame at last Dave! Nice article there. And lots of good new things in this release - excellent!
User avatar
KenLowe
Posts: 1630
Joined: Mon Oct 18, 2004 5:35 pm
Location: UK
Contact:

Re: Pi-based Co-Pro on the cheap - 100MHz 6502 for £10? (now 290MHz)

Post by KenLowe »

Nice to see this project getting a good write up. Well done to you and Dominic =D> =D> =D>.
User avatar
Wheel_nut
Posts: 509
Joined: Wed May 01, 2019 1:46 pm
Location: West of Scotland
Contact:

Re: Pi-based Co-Pro on the cheap - 100MHz 6502 for £10? (now 290MHz)

Post by Wheel_nut »

Well done Dave and Dominic and some well deserved kudos for your work. It is nice to find out a little bit about you. I often wonder what you guys do/did in prime time with all the skill and innovation that you use here.

Have a Happy Christmas and let's hope that it's a Good New Year when it comes. - Robin
#1 BBC Model B Issue 7 + 1770 DFS + Dual TEAC Floppy
#2 BBC Model B Issue 7 + 8271 DFS + Dual Floppy + Speech
#3 BBC Model B Issue 7 + 8271 DFS + Cumana Single Floppy + PiTubeDirect on KenLowe's Tube Level Shifter
User avatar
fordp
Posts: 1111
Joined: Sun Feb 12, 2012 9:08 pm
Location: Peterborough, England
Contact:

Re: Pi-based Co-Pro on the cheap - 100MHz 6502 for £10? (now 290MHz)

Post by fordp »

hoglet wrote:
Thu Dec 24, 2020 11:21 am
And on a different note, PiTubeDirect gets a mention in Issue 101 of the MagPi Magazine (page 26/27)
https://magpi.raspberrypi.org/issues/101/pdf/download

Dave
I read this, very good. It would have been cool however if it had mentioned:
1) The Model A and Model B of the Raspberry Pi came from the BBC Model A and Model B.
2) The ARM in the Pi is emulating the very first ARM product.
3) The Idea for using a Pi a Copro was actually inspired by the MagPi magazine issue with a free Raspberry Pi Zero as a cover gift.
FordP (Simon Ellwood)
Time is an illusion. Lunchtime, doubly so!
dominicbeesley
Posts: 1403
Joined: Tue Apr 30, 2013 12:16 pm
Contact:

Re: Pi-based Co-Pro on the cheap - 100MHz 6502 for £10? (now 290MHz)

Post by dominicbeesley »

Looking forward to giving this a look over. The Ferranti F100 looks interesting - was this a "because it's there" thing or was there a beeb connection BITD?

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

Re: Pi-based Co-Pro on the cheap - 100MHz 6502 for £10? (now 290MHz)

Post by BigEd »

The F100 is a kind of resurrection project: it was a big deal back in the day that the UK had a micro, and a 16 bit one, but it's sunk into history. Rich and I happened to spot some trace of it when visiting MOSI, and Rich especially has done a lot of work digging up references and creating a model of it. (As a consequence of doing all the work, creating a mini-site and eventually writing and delivering a paper, there's now a nice Wikipedia article, courtesy of a helpful contributor.)
Revaldinho
Posts: 31
Joined: Sun Aug 02, 2015 10:08 pm
Contact:

Re: Pi-based Co-Pro on the cheap - 100MHz 6502 for £10? (now 290MHz)

Post by Revaldinho »

There is a slightly tenuous link between the F100-L and the Beeb: the CPU was built in the same bipolar CDI technology as the Ferranti ULAs deployed in the Beeb and Elk and including the Tube chip itself.

The F100-L CPU came out in the very late 70s so was certainly around in time for the Beeb, and it's mildly intriguing to think that there might have been a second processor unit made from all-Ferranti silicon.

Sadly, despite the CPU being having a 16-bit architecture it was hamstrung by a bit-serial implementation. In the end it didn't really offer anything in performance or memory addressing capabilities compared with the familiar 8/16 bit CPUs, and being radiation hard wasn't high up on the list of requirements for 80s home computers.
User avatar
hoglet
Posts: 9820
Joined: Sat Oct 13, 2012 7:21 pm
Location: Bristol
Contact:

Re: Pi-based Co-Pro on the cheap - 100MHz 6502 for £10? (now 290MHz)

Post by hoglet »

Hi all,

I'm pleased to announce the Gecko Release of PiTubeDirect:
https://github.com/hoglet67/PiTubeDirec ... /tag/gecko

Changes since Fer-De-Lance include:
- Added Dossytronics 65816 Co Po (Co Pro 18)
- Added ReCo 65816 Co Po (Co Pro 19)
- Added Ferranti F100 Co Processor (Co Pro 28)
- 6502 Co Pro: CALL &2000 lists the available Co Processors (#71, from MinceBert)
- 6502 Co Pro: Fix interrupt issue that causes Acornsoft Chess to crash (#75)
- 32016 Co Pro: Fix disassebly of shift operations
- Native ARM Co Pro: Reorganise the memory map so 216MB is available (#78)
- Native ARM Co Pro: added *HELP COPROS (#83)
- Native ARM Co Pro: added *ARMBASIC command (BAS135 built in) (#79)
- Native ARM Co Pro: avoid &8000-&BFFF getting trashed by language transfer
- Native ARM Co Pro: several other minor bug fixes (#73,#74, #76, #77, #111, #112)
- GPU: Workaround a clock noise issue with some level shifters ( #70 )

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

Re: Pi-based Co-Pro on the cheap - 100MHz 6502 for £10? (now 290MHz)

Post by BeebMaster »

Great work, I've just upgraded to the new release as I wanted to test something odd that was happening with the version I already had installed (the Gecko dev release) I just noticed yesterday on Station 201, which is a Master 512 with real internal 80186 co-pro, real MOS 3.50 ROM, but also a couple of ROM overlay boards which switch in ROMs into some of the MOS slots and also the cartridge slots.

So it's a pretty unusual machine and it doesn't get on very with with PiTubeDirect. Basically, BASIC doesn't load:
capture66.png
Quite often that happens on a real external 6502 cheese wedge and needs a CTRL-BREAK to copy BASIC to the second processor, but here I have to issue *BASIC after a reset:
capture68.png
But the next CTRL-BREAK does this, and there's no way out of it without a power-off:
capture69.png
It's possible this is something which may have been happening for a long time, but I don't think I've used my PiTubeDirect on Station 201 before, but I had to move it temporarily last night from Station 114 as I'd run out of host processor memory when doing the HTML gen of a 52-picture set, and Station 114's TV was in use as I was watching "The War Games" at the time.

A separate point - should I be able to read the current co-pro number with OSBYTE 150, or is the information lost after a reset? It always returns &7F in Y.
Image
User avatar
BeebMaster
Posts: 3862
Joined: Sun Aug 02, 2009 5:59 pm
Location: Lost in the BeebVault!
Contact:

Re: Pi-based Co-Pro on the cheap - 100MHz 6502 for £10? (now 290MHz)

Post by BeebMaster »

Update on that...it seems to be BASIC 4r32 in MOS 3.50 that's the problem. If I unplug it and load the standard BASIC 4 into SRAM and use that for the configured language then it works as normal.
Image
User avatar
BeebMaster
Posts: 3862
Joined: Sun Aug 02, 2009 5:59 pm
Location: Lost in the BeebVault!
Contact:

Re: Pi-based Co-Pro on the cheap - 100MHz 6502 for £10? (now 290MHz)

Post by BeebMaster »

Edit (1.50r) doesn't work either - just sits there with a flashing cursor or returns to the BASIC prompt if invoked from BASIC (but has effectively crashed as no keyboard input is accepted afterwards). Possibly an issue with the language relocator introduced in MOS 3.50?
Image
Post Reply

Return to “8-bit acorn hardware”