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
BeebMaster
Posts: 3733
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 274MHz)

Post by BeebMaster » Sun Jul 12, 2020 10:37 pm

I tried that already (see "workaround" waffle above) but it doesn't quite work:
capture23.png
You can't get past it printing the first four characters of the error message:
capture24.png
However, if you start BASIC first:
capture25.png
It does work, and I can start ARMBASIC from the additional command I added:
capture30.png
6502 BASIC has been copied at &8000
capture31.png
But, after this it's OK because the next CTRL-BREAK does the "This" bit again, and pressing BREAK gets back to the Supervisor prompt (or ARMBASIC in my hack) so any program already in Native ARM RAM isn't overwritten.
Image

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

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

Post by hoglet » Mon Jul 13, 2020 7:03 am

The hang on "This is not a language" looks like a a bug (very likely a missing transition from the tube state machine):
https://github.com/hoglet67/PiTubeDirec ... -isr.c#L96

I created a github issue for it a couple of days ago:
https://github.com/hoglet67/PiTubeDirect/issues/73

I'm mid-way through a bout of decorating, so I'm not going to be able to look at this for a few days.

Dave

User avatar
zolbatar
Posts: 48
Joined: Sat Sep 22, 2018 1:12 pm
Location: Nottingham, UK
Contact:

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

Post by zolbatar » Mon Jul 13, 2020 9:01 am

An out of nowhere question, is there an ARM assembler with VFP available for the co-pro? Even something written in BASIC would work well enough for what I need.

I'm trying to port over some code I did for RISC OS using the inline assembler. I don't want to cross-assemble from my Linux machine, I want to assemble on the M128 itself.
Master 128 with DataCentre and RPi co-pro.
RPi B+ & 3B+ both running RISC OS.
Poorly A4000 (battery damage, partially repaired).

User avatar
BeebMaster
Posts: 3733
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 274MHz)

Post by BeebMaster » Sat Jul 18, 2020 4:02 pm

I've just been looking at the BASIC source, if we alter the value of VARS in /hdr/Workspace from 8700 to, say, F800, this should move PAGE up to &10000. However I can't compile it:

Code: Select all

pi@raspberrypi:/media/BMNFS/BBC/32-Bit/BASIC Source ISW Dev/BASIC $ make
Makefile:43: AAsmModule: No such file or directory
make: *** No rule to make target 'AAsmModule'.  Stop.
pi@raspberrypi:/media/BMNFS/BBC/32-Bit/BASIC Source ISW Dev/BASIC $ 
Image

User avatar
BeebMaster
Posts: 3733
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 274MHz)

Post by BeebMaster » Sat Jul 18, 2020 4:36 pm

I think I've got to the bottom of the filing system error when loading ARM BASIC:
capture33.png
File server monitor comes in very handy. On the face of, it looks like *BASIC is being issued after ARM BASIC is loaded:
scrn0.png
However, this isn't what's happening at all:
scrn1.png
The command line interpreter isn't correctly truncating or flushing the buffer, so "BASIC" is in fact left over from "*DIR ARMBASIC". This only seems to happen with BASIC, which takes an optional parameter as part of the command line, so it's using the remnants of what is in the buffer to try to find a file to CHAIN.
Image

Muddyfunster
Posts: 30
Joined: Tue Apr 16, 2019 9:36 pm
Contact:

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

Post by Muddyfunster » Fri Sep 11, 2020 11:26 pm

Hi all,

I currently have a PiZero connected internally on my master but I want to connect up my pi3b. What ribbon cable would I need?

Is it just a regular 40 Pin GPIO Ribbon Cable ? (https://thepihut.com/products/40-pin-gp ... -gertboard)

Appreciate any guidance :)

User avatar
BigEd
Posts: 3542
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 274MHz)

Post by BigEd » Sat Sep 12, 2020 8:06 am

Not answering your question exactly, but I have a pi4 inside my master and it fits fine on the same adapter board. Is there an obstacle to doing the same with a pi3b?

(You're right to ask about a cable, I think, in the sense that you do need to be very careful that it connects the right way around and doesn't short everything together. I think you might need one made up for the purpose.)

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

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

Post by KenLowe » Sat Sep 12, 2020 8:39 am

Muddyfunster wrote:
Fri Sep 11, 2020 11:26 pm
Is it just a regular 40 Pin GPIO Ribbon Cable ? (https://thepihut.com/products/40-pin-gp ... -gertboard)
That male to female ribbon cable will work fine. The important thing is to not just use a standard ribbon cable with female both ends and then stick a set of header pins in one end of the cable in an attempt to make your own male to female cable. This will swap the upper and lower row of pins when compared to proper male to female ribbon cable and will cause the problems that BigEd has mentioned. I guess you could use two female / female ribbon cables with 2 sets of headers. The second cable and header would correct the pin translation that happens in the first cable. It's not something I've tried.

User avatar
BeebMaster
Posts: 3733
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 274MHz)

Post by BeebMaster » Sat Sep 12, 2020 10:14 am

I can't compete on prices, as I don't have access to the talents of a Chinese gulag, but I can do 40-way male-female, female-female, male-male ribbon cables (also 20, 34 and 50 way) of any length. I just made up a couple of these type of cable of 3ft length, and they work fine with Ken's Pi adapter. (Actually it was plugged into my existing 12" cable, so about 4ft altogether). I haven't tried on other types of adapter and it wouldn't be suitable for a real cheese wedge where the cable length is very limited.
Image

Muddyfunster
Posts: 30
Joined: Tue Apr 16, 2019 9:36 pm
Contact:

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

Post by Muddyfunster » Sat Sep 12, 2020 2:38 pm

Thanks gents for the replies re: the cable, much appreciated.

In my Master, the PiZero goes right on to the leveller (retro clinic) no issues.
p0 (2).jpg
But the Pi3, the USB sockets get in the way, plus a cable means I wouldn't need to keep de-casing it every time.
pi3_1.jpg
Out of interest BigEd, is there much performance increase with the Pi4 vs a Zero? I mostly mess around with the 6502 cores doing mandlebrot sets and stuff like that using the Nula.

BeebMaster, appreciate the offer, My adapter is the retroclinic one, if your cable works with that I'd be happy to take one (just let me know your non-gulag price :) ). 2ft would probably be ample.

Thanks again.

User avatar
BeebMaster
Posts: 3733
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 274MHz)

Post by BeebMaster » Sat Sep 12, 2020 2:53 pm

I think the trouble with putting a ribbon cable between the Pi and the Retroclinic internal Tube adapter is that the Pi is going to be flopping about and could come into contact with the adapter or other internal parts of the Master.

I think I will try it though, I do have a Pi3 and a Retroclinic internal Tube adapter so let's see if I can make a short cable that might be suitable.
Image

Muddyfunster
Posts: 30
Joined: Tue Apr 16, 2019 9:36 pm
Contact:

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

Post by Muddyfunster » Sat Sep 12, 2020 3:06 pm

I was thinking more of keeping the pi outside the case and having a longer cable, maybe routed out via the cart slot that I don't use (I have the Nula rom sitting in the other).

User avatar
BigEd
Posts: 3542
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 274MHz)

Post by BigEd » Sat Sep 12, 2020 3:17 pm

Muddyfunster wrote:
Sat Sep 12, 2020 2:38 pm
In my Master, the PiZero goes right on to the leveller (retro clinic) no issues.

But the Pi3, the USB sockets get in the way, plus a cable means I wouldn't need to keep de-casing it every time.
Ah, I see. I've got a sundby.com adapter board which must be just a couple of millimeters different, and the USB bits just sit over the edge.
Out of interest BigEd, is there much performance increase with the Pi4 vs a Zero? I mostly mess around with the 6502 cores doing mandlebrot sets and stuff like that using the Nula.
Here are Dominic's timings from upthread:
dp11 wrote:
Fri Aug 16, 2019 12:04 pm
PiZero(w) ( ARM1176JZF-S ARMv6 1GHz )
armcode 6502 : 290MHz

RPi3A+ or RPi3B+ ( Cortex A53 ARMv8 1.4GHz ) should work but untested
armcode 6502 : 339MHz

RPi4 ( Cortex A72 ARMv8 1.5GHz )
armcode 6502 : 370MHz
So, yes, a Pi 4 should be a lot quicker, for anything which isn't limited by host I/O.

User avatar
BigEd
Posts: 3542
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 274MHz)

Post by BigEd » Sat Sep 12, 2020 3:18 pm

BeebMaster wrote:
Sat Sep 12, 2020 2:53 pm
I think the trouble with putting a ribbon cable between the Pi and the Retroclinic internal Tube adapter is that the Pi is going to be flopping about and could come into contact with the adapter or other internal parts of the Master.
I put a sheet of paper down, or put a paper envelope over the thing.

Mind you, a Pi 4 might not do well if it doesn't have some air around it.

User avatar
BeebMaster
Posts: 3733
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 274MHz)

Post by BeebMaster » Sat Sep 12, 2020 3:24 pm

Yeh, I reckon a Pi4 will go ablaze inside a Master, I have a 12V PC fan blue-tacked to the top of my Pi4.

The good news is a 3ft cable also works with the Retroclinic internal adapter (with Pi Zero).

So, externally for the internal Tube we could pass a cable through the Domesday SCSI slit at the back with a couple of folds and sit it on the top:
IMG_7583.JPG
IMG_7582.JPG
Or through the cartridge slot:
IMG_7585.JPG
Both of those would work with a 12" cable.
Image

User avatar
BeebMaster
Posts: 3733
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 274MHz)

Post by BeebMaster » Sat Sep 12, 2020 4:04 pm

So much for the tape measure! 12" is a just a bit short for coming out of the back, it won't reach the lid, but it's nice for a cartridge escape:
IMG_7587.JPG
IMG_7590.jpg
Image

Muddyfunster
Posts: 30
Joined: Tue Apr 16, 2019 9:36 pm
Contact:

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

Post by Muddyfunster » Sat Sep 12, 2020 4:20 pm

Great :)

Coming out the back might have been a bit more problematic as that's where I have my rom switcher rotary dial located on the doomsday/modem cut out.

Cartridge port seems fine, I'm planning to run a USB extension out of there too from my datacentre so I don't have to faff around adding ssd's

Please let me know how much I owe you for the cable and I can paypal you and PM you my address.

Thanks again guys :)

User avatar
BeebMaster
Posts: 3733
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 274MHz)

Post by BeebMaster » Sat Sep 12, 2020 4:20 pm

No problem, I'll PM you.
Image

Muddyfunster
Posts: 30
Joined: Tue Apr 16, 2019 9:36 pm
Contact:

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

Post by Muddyfunster » Tue Sep 15, 2020 2:21 pm

Cable works perfectly - Thanks Beebmaster.

Unfortunately my Pi3 is dead.

I hooked up the zero first of all, using the cable, turns out I didn't have the cable on 100% correctly and had missed the final row of pins. Once corrected, the Pi Zero fired up first time as normal. All good. (probably lucky here not to short anything).

Ran the timing benchmark, all good.

Connected up my Pi3b - nothing. Checked the orientation, all good.

Tried firing the Pi3b up on it's own - nothing.

Conclusion - The Pi3b is has shrugged off it's digital coil. I've had it since release so that's a few years and all kinds of odd projects with it.

Oh and in no way do I attribute the Pi3 dying to the cable. The cable is great (I'll be coming back for one for my beebsid at somepoint - once I built it).

Still, it's a reasonable wife approved (tm) excuse to upgrade to a Pi4 :P

User avatar
BeebMaster
Posts: 3733
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 274MHz)

Post by BeebMaster » Tue Sep 15, 2020 2:27 pm

You can tell her you will need a spare Pi4 as well, just in case. And it will reduce the unit postage cost, hopefully go down well with Mrs Muddy.
Image

Muddyfunster
Posts: 30
Joined: Tue Apr 16, 2019 9:36 pm
Contact:

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

Post by Muddyfunster » Tue Sep 15, 2020 2:59 pm

BeebMaster wrote:
Tue Sep 15, 2020 2:27 pm
You can tell her you will need a spare Pi4 as well, just in case. And it will reduce the unit postage cost, hopefully go down well with Mrs Muddy.
:lol:

dhester
Posts: 12
Joined: Sat Feb 29, 2020 9:45 pm
Contact:

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

Post by dhester » Tue Sep 15, 2020 9:36 pm

I did some testing earlier this year with various Pis and costed per CA point, see attached excel sheet.
Attachments
Copy of Tube Speed.xlsx
(10.85 KiB) Downloaded 24 times

dp11
Posts: 1210
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 » Tue Sep 15, 2020 10:00 pm

As the extra memory isn't used, the Pi4 can just be the cheapest ( 2Gbytes @ £35) Also some people have over clocked the Pi4 for extra performance

dp11
Posts: 1210
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 » Wed Sep 16, 2020 8:05 am

The cores written in c show the greatest performance increase with the Pi4 e.g lib6502

Muddyfunster
Posts: 30
Joined: Tue Apr 16, 2019 9:36 pm
Contact:

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

Post by Muddyfunster » Thu Sep 17, 2020 1:45 pm

Pi 4 arrived today, works fine (testing running various pi4 builds of stuff) but the Beep refuses to recognise it via the CoPro interface.

I'm using a fresh sd card with Fer-De-Lance on it. I've tried the same SD card & same software in the zero and it works fine.

I'm connecting the cable with the same orientation as I do on the Zero.

Bit puzzled.

User avatar
hoglet
Posts: 9595
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 » Thu Sep 17, 2020 2:16 pm

Muddyfunster wrote:
Thu Sep 17, 2020 1:45 pm
Pi 4 arrived today, works fine (testing running various pi4 builds of stuff) but the Beep refuses to recognise it via the CoPro interface.
First, check your configuration. If you are using PiTubeDirect on the internal Tube on a Master, and nothing on the external Tube, then it's actually best to use *CONFIGURE EXTUBE. (This setting just controls the order in which the two tube ports are probed; it's always better if PiTubeDirect is on the port that is probed last).

Second, does the LED on the Pi 4 light up at all? Try pressing ctrl-break a few times, and see if the LED flickers at all?

Dave

User avatar
KenLowe
Posts: 1501
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 » Thu Sep 17, 2020 2:32 pm

I've had similar problems in the past when using a cable between the level shifter and the RPi. I've always found it to be more reliable if the RPi is close coupled to the level shifter. However that is with the under keyboard version, not the Master internal version. I don't have a Master internal level shifter to test that with.

Muddyfunster
Posts: 30
Joined: Tue Apr 16, 2019 9:36 pm
Contact:

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

Post by Muddyfunster » Thu Sep 17, 2020 4:26 pm

Thanks guys,

Dave's suggestion worked perfectly (kicking myself for not trying it first! doh!). A couple of CTRL Breaks and all is good with the Pi4.

My Pi 3 that I thought was dead, turns out it was a bad SD card and it works again (Lazarus style! Wife is super impressed... ).

It steadfastly refuses to talk to the beeb though, using the same cable and sd card as the Pi 4. LED lights up when connected but no flicker on CTRL Break.

Not a big deal as I can use the 4 when needed and have the zero as a daily driver.

Thanks again all.

User avatar
hoglet
Posts: 9595
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 » Thu Sep 17, 2020 4:45 pm

Muddyfunster wrote:
Thu Sep 17, 2020 4:26 pm
My Pi 3 that I thought was dead, turns out it was a bad SD card and it works again (Lazarus style! Wife is super impressed... ).

It steadfastly refuses to talk to the beeb though, using the same cable and sd card as the Pi 4. LED lights up when connected but no flicker on CTRL Break.
I also have an old Pi 3B that will run Raspbian and Kodi fine, but refuses to even boot PiTubeDirect. It has a couple of damaged GPIO pins (zapped with static most likely).

Dave

User avatar
BeebMaster
Posts: 3733
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 » Fri Sep 18, 2020 4:29 pm

Here's a weird thing. I was just about to have a go using my "ADFSImager" to try to make a backup of my defect-ridden Rodime Acorn Winchester Disc, so I loaded ADFSImager from floppy with Pi Tube running (Native ARM) and I got "Bad program". Same with the 6502 Tube.

I checked, and it loads fine with no Tube or on my internal Turbo co-processor.

A bit of investigation and I found that a lot of spurious &FFs were being inserted into memory:
capture286.png
capture287.png
That looks to be something going wrong between host & Tube communication, as the test program is already there in the Tube memory at start up, but when the host is being used (via the ADT ROM *MEX command) the RAM is corrupted. Similarly transferring from host from disc to Tube was giving "Bad program" with FFs littered through it when examining the memory.

Checked all the cables, SD cards, put the fire marshal on standby etc. Then I realised - the Winchester Disc was connected to the 1MHz bus (via a couple of extension cables) but not powered on. Disconnected it and:
capture288.png
Back to normal!
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.
Image

Post Reply

Return to “8-bit acorn hardware”