New 65C02/W65C816 copro

for bbc micro/electron hardware, peripherals & programming issues (NOT emulators!)
cmorley
Posts: 158
Joined: Sat Jul 30, 2016 7:11 pm
Location: Oxford

New 65C02/W65C816 copro

Postby cmorley » Thu Aug 10, 2017 9:25 am

Hi All,

Since JK's ReCo6502 isn't available anymore I am developing a replacement. I know the enthusiastic hardware tinkerers have moved on to FPGA or PI copros but there are people who want something plug and play.

I will put a physical processor on it. 65C02 + 128KB or 65C816 + 16MB... or PCB that can do both.

I've got a few questions/choices... please wade in with your opinions.

Does anyone know who owns the IP for the parasite boot ROM for the 65C02 Acorn copro - or even if it is out of copyright now?
Is there any point doing a 65C816 copro - i.e. is there any software for it? I would put 128Mbit RAM on if so...
I could make the PCB 65C02 and 65C816 compatible (user's choice) but needless complexity is a waste of effort and pointless BOM increase... (I think a W65C816 version would be ~£5 more)

I'll probably make PCB kits available (perhaps with the PLD presoldered) for this project or fully assembled option.

Thoughts anyone?

Chris
Last edited by cmorley on Thu Aug 10, 2017 9:59 am, edited 1 time in total.

User avatar
kieranhj
Posts: 429
Joined: Sat Sep 19, 2015 10:11 pm
Location: Farnham, Surrey, UK

Re: New 65C02/W65C816 copro

Postby kieranhj » Thu Aug 10, 2017 9:42 am

Interesting project! What speed(s) were you thinking for the 65C02? Also how would the 128KB be arranged?

The 65C816 chip sounds fascinating from a "what if Acorn never invented ARM" POV but I can't imagine there would be much real use for it.

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

Re: New 65C02/W65C816 copro

Postby BigEd » Thu Aug 10, 2017 9:50 am

JohnK made a patched BBC Basic which works with the '816 to offer expanded memory: it can be done, in a fairly compatible way, especially if you can divide your needs into 64k banks.

cmorley
Posts: 158
Joined: Sat Jul 30, 2016 7:11 pm
Location: Oxford

Re: New 65C02/W65C816 copro

Postby cmorley » Thu Aug 10, 2017 9:53 am

kieranhj wrote:Interesting project! What speed(s) were you thinking for the 65C02? Also how would the 128KB be arranged?

The 65C816 chip sounds fascinating from a "what if Acorn never invented ARM" POV but I can't imagine there would be much real use for it.


Hi Kieran,

The WDC datasheet suggests 20MHz or 21MHz at 5V (14MHz at 3.3v). I'll make it software configurable. I'd be surprised if they don't OC a bit further. Not sure about the memory organisation yet... banked somehow. I'll look at prior art for that. I could put the 128MBit chip on with a 65C02 but again what is the value :S?

I tend to agree re: 65C816...

Oh and I'll add DMA so the host can read/write parasite memory in full pages without using the legacy tube ULA buffering.

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

Re: New 65C02/W65C816 copro

Postby BigEd » Thu Aug 10, 2017 10:00 am

Are you thinking this will be Tube-connected, or on the 1MHz bus, or something else?

cmorley
Posts: 158
Joined: Sat Jul 30, 2016 7:11 pm
Location: Oxford

Re: New 65C02/W65C816 copro

Postby cmorley » Thu Aug 10, 2017 10:06 am

BigEd wrote:Are you thinking this will be Tube-connected, or on the 1MHz bus, or something else?


Yep Tube connected which I think is on B, B+ and Master so it should be compatible with these 8-bit models. Does the Electron have a Tube?

User avatar
kieranhj
Posts: 429
Joined: Sat Sep 19, 2015 10:11 pm
Location: Farnham, Surrey, UK

Re: New 65C02/W65C816 copro

Postby kieranhj » Thu Aug 10, 2017 10:23 am

cmorley wrote:The WDC datasheet suggests 20MHz or 21MHz at 5V (14MHz at 3.3v). I'll make it software configurable. I'd be surprised if they don't OC a bit further. Not sure about the memory organisation yet... banked somehow. I'll look at prior art for that. I could put the 128MBit chip on with a 65C02 but again what is the value :S?

I tend to agree re: 65C816...

Oh and I'll add DMA so the host can read/write parasite memory in full pages without using the legacy tube ULA buffering.

I guess the Apple II just had two 64KB banks overlaid on top of each other to total 128KB. I can't quite tell from my investigations but it looks like you could specify separate banks for read / write operations on that machine, similar to your OS RAM module. I guess that would be an interesting feature, if a little hard to keep track of potentially (from a programming POV.) This would certainly make my PoP port easier. ;)

I still haven't had much time to dig deep into 2nd processor coding but from my small experience the Tube is the limiting factor by far so having DMA from the host would increase the value of this immensely. Of course this makes it incompatible with the other 2nd processor devices and strays from the original Tube philosophy. I wonder if there is a way to turbo-boost the Tube but still stick to Acorn's elegant design principles?

Gah, a 20MHz 6502 with 128KB DMA RAM and 4096 colour NULA - it's what the BBC Master should have been all those years ago. #-o :D

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

Re: New 65C02/W65C816 copro

Postby BigEd » Thu Aug 10, 2017 10:52 am

Tube is good because with the right DFS ROM machines will already have the code in place to talk to it. 1MHz bus might be about as good because the device is allowed to present some code on the bus which gets run at reset time, and can upload any control software it needs to.

Tube does mean that you need some kind of Tube ULA chip or a workalike.

As for the question of the Tube ROM client: it will technically be someone's copyright, but most of us suppose that nobody cares, so it won't be enforced. Same with PCB artwork and schematics.

Electron doesn't have a Tube, but one of the recent upgrade projects includes one. Same for the Atom.

cmorley
Posts: 158
Joined: Sat Jul 30, 2016 7:11 pm
Location: Oxford

Re: New 65C02/W65C816 copro

Postby cmorley » Thu Aug 10, 2017 10:58 am

Sure, two 64KB banks could be an option. Separate read & write banks would be easy to implement. Not trivial to program for though. Virtual memory mapping n KB chunks in from the physical memory would be possible too with a page table...

My basic thinking is 128KB is half the price of 64KB so that's where 128KB comes from! 256KB could be 50p more or so. 16MB would be £2.50 ish more.

The legacy Tube ULA function would be there with the DMA on top. Any functions I add could be ported to the PI copro and matchbox copros (& emulators)... so compatibility for new code on all new hardware could be maintained.

The DMA would be simple... on the host you'd specify the source/destination address and write it to the ULA. Then you'd issue LDA/STA absolute (3 bytes, 4 cycles) on the host CPU & the ULA would fetch/store and increment the pointer + loop for an arbitrary block copy. Flat out loop or unrolled (e.g. LDA,LDX,LDY) would all be fine - no wait.

cmorley
Posts: 158
Joined: Sat Jul 30, 2016 7:11 pm
Location: Oxford

Re: New 65C02/W65C816 copro

Postby cmorley » Thu Aug 10, 2017 11:05 am

BigEd wrote:1MHz bus might be about as good because the device is allowed to present some code on the bus which gets run at reset time, and can upload any control software it needs to.


I didn't know that. Interesting.

BigEd wrote:As for the question of the Tube ROM client: it will technically be someone's copyright, but most of us suppose that nobody cares, so it won't be enforced. Same with PCB artwork and schematics.


The problem is if I embed the ROM and make the things available to sell... it defeats the purpose a bit if I have to engineer it and say "find your own boot ROM". I tracked Acorn OS IP to PACE in the late 90s but no idea who has it now. It would be good to get a definitive answer if I can.

BigEd wrote:Electron doesn't have a Tube, but one of the recent upgrade projects includes one. Same for the Atom.


Are they 2MHz like the B/Master?

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

Re: New 65C02/W65C816 copro

Postby BigEd » Thu Aug 10, 2017 11:10 am

I think the "find your own boot ROM" doesn't happen much in the 8-bit Acorn world. It's not a good choice from a perspective of making a project easy to adopt.

Sorry, don't know the Tube speed of the Elk or Atom. I would expect it must be 2MHz because there are speed constraints in getting bulk transfers to work, but I don't know for sure.

User avatar
DutchAcorn
Posts: 1493
Joined: Fri Mar 21, 2014 9:56 am
Location: Maarn, Netherlands

Re: New 65C02/W65C816 copro

Postby DutchAcorn » Thu Aug 10, 2017 11:30 am

cmorley wrote:... I know the enthusiastic hardware tinkerers have moved on to FPGA or PI copros but there are people who want something plug and play....


Actually the FPGA based matchbox CoPro is even more plug and play than the original 6502 second processor. It does not need to be plugged into mains and fits directy into the Tube port (for the B/B+ anyway). Default configuration is set to 65C102.


I'd guess 95% (or more) of the people interested in a 6502 compatible copro only want it to play Tube Elite. So it would ideally run at the same speed as the original out of the box.
Paul

User avatar
Elminster
Posts: 1629
Joined: Wed Jun 20, 2012 8:09 am
Location: Essex, UK

Re: New 65C02/W65C816 copro

Postby Elminster » Thu Aug 10, 2017 12:36 pm

As an owner and frequent user of both JK internal master copro and the Pi on my master. I generally find that 16 is not much slow than the Pi running many times faster. I suspect memory or tube inerface is limiting factor on the software I am testing on. The JK version runs at 4,8,12 or 16Mhz from memory

Edit: I should have said I was refering to the Master only ReCo6502Mini which John still sells. Not the one he no longer makes.

Andrew_Waite
Posts: 34
Joined: Tue Aug 30, 2016 2:58 pm

Re: New 65C02/W65C816 copro

Postby Andrew_Waite » Fri Aug 11, 2017 2:25 am

Would the BASIC Acorn shipped with the 65816 based Communicator be suitable for the 65C816 co-pro?

http://chrisacorns.computinghistory.org ... cator.html

viewtopic.php?f=2&t=11425&hilit=816

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

Re: New 65C02/W65C816 copro

Postby hoglet » Fri Aug 11, 2017 6:29 am

Andrew_Waite wrote:Would the BASIC Acorn shipped with the 65816 based Communicator be suitable for the 65C816 co-pro?

http://chrisacorns.computinghistory.org ... cator.html

viewtopic.php?f=2&t=11425&hilit=816

If the Basic could be extracted from the Communicator ROM images, it might be possible to test it in B-Em:
65816.png

Dave

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

Re: New 65C02/W65C816 copro

Postby BigEd » Fri Aug 11, 2017 6:35 am

JGH has amassed some data and ROM dumps:
http://mdfs.net/System/ROMs/AcornMOS/Communi100/

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

Re: New 65C02/W65C816 copro

Postby hoglet » Fri Aug 11, 2017 6:59 am

BigEd wrote:JGH has amassed some data and ROM dumps:
http://mdfs.net/System/ROMs/AcornMOS/Communi100/

I just tried that it it doesn't work:
65816-2.png

The load address of 4B00 came from JGH's disassembly:
http://mdfs.net/System/ROMs/AcornMOS/Co ... /BASIC.zip

It could be that the Communicator provides a different / more comprehensive set of APIs than ReCo6502 did.

Dave

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

Re: New 65C02/W65C816 copro

Postby BigEd » Fri Aug 11, 2017 7:08 am

Indeed, I gather the Communicator OS uses COPs as SWIs and holds software in "modules" - but possibly the API could be shimmed to the MOS ABI.
http://mdfs.net/System/ROMs/AcornMOS/Co ... ModuleInfo

cmorley
Posts: 158
Joined: Sat Jul 30, 2016 7:11 pm
Location: Oxford

Re: New 65C02/W65C816 copro

Postby cmorley » Fri Aug 11, 2017 8:04 am

Good info thanks.

If there isn't a wealth of 65C816 software then a 65C02 processor seems the best direction I think.

Anyone have a compelling reason to fit more than 128KB RAM? The next logical step is 16MB (from a parts point of view) which is a lot of 80 track discs! 99% of the software will be expecting the 64KB from an Acorn 2nd proc.

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

Re: New 65C02/W65C816 copro

Postby BigEd » Fri Aug 11, 2017 8:17 am

If there's not much cost difference, the '816 isn't a bad choice, as it's very compatible with a 65C02 until or unless you execute the magic sequence to turn it into a 16 bit mode. So, if you fit an '816, you can run '02 software, but you leave the door open to bigger things.

Edit: I would say 128k should be enough for anyone.

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

Re: New 65C02/W65C816 copro

Postby hoglet » Fri Aug 11, 2017 10:22 am

I'd say definitely go for the 65C816.

As Ed says, it's compatible with the 65C02 (for example Tube Elite should run fine).

It's also more interesting, and not available anywhere else at the moment.

Dave

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

Re: New 65C02/W65C816 copro

Postby BigEd » Fri Aug 11, 2017 10:28 am

hoglet wrote:...not available anywhere else at the moment.


That's a very strong point: there's no '816 on the Pi, or the Matchbox, no HDL model. So it's a real concrete justification for a PCB+chips copro.

Edit: and again, if there's not a lot of cost difference, a super-large RAM might also be a unique advantage of this proposed co-pro. The '816 can access lots of RAM using instructions alone - even in 'c02 mode - with no need to design and document a bank-switching system.

User avatar
Elminster
Posts: 1629
Joined: Wed Jun 20, 2012 8:09 am
Location: Essex, UK

Re: New 65C02/W65C816 copro

Postby Elminster » Fri Aug 11, 2017 12:57 pm

+1 for a '816

If it was a 65C02 I wouldn't bother to get one as have loads already.

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

Re: New 65C02/W65C816 copro

Postby dominicbeesley » Fri Aug 11, 2017 1:30 pm

I made a 65816 tube board a couple of years ago: viewtopic.php?t=9975&start=60 it uses a DE0nano + tube silencer as the Tube ULA (complete overkill but it was to hand). IIRC the DE0 does some address decoding etc but very minimal. I don't think I ever got round to adding FIFOs to the tube registers but it shouldn't be too difficult.

I made a start on tweaking basic (I'll dig it out if you're interested I'd have to work out a working version!). Some things were a bit faster but not by a lot, I suspect a complete rewrite would yield better returns (rather than just tweaking what was there).


I've attached my quartus VHDL tube project, the tube ULA seems to work quite well, it's synchronous on both host and parasite sides and uses "flancters" to communicate between the two unsynchronised domains. It should translate to other hardware easily enough.

Also attached are my KiCad schematics and the libraries

I hope they're of interest

D
Attachments
tube816test-sent-stardot20170811.zip
(22.27 KiB) Downloaded 2 times
DB-kicad-libraries.zip
(92.51 KiB) Downloaded 1 time
65816-TUBE-0.6.zip
(120.65 KiB) Downloaded 3 times

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

Re: New 65C02/W65C816 copro

Postby BigEd » Fri Aug 11, 2017 1:35 pm

Thanks for sharing your files!
[For the curious: flancter]

Andrew_Waite
Posts: 34
Joined: Tue Aug 30, 2016 2:58 pm

Re: New 65C02/W65C816 copro

Postby Andrew_Waite » Fri Aug 11, 2017 1:41 pm

A very cool project for a 65C816 co-pro with a large memory would be to use part of the memory for a video framestore and attach a video circuit to the co-processor's memory. Some 65C816 assembler routines would be needed to BLIT bitmaps or sprites into the framestore.

This would be a convenient way of giving the Beeb the ability to create images at higher resolutions and colour depths than possible on the host machine - and do it on a second monitor too!

Attaching an FPGA to the 65C816 co-pro to create the video signal brings all sorts of possibilities such as a multiple buffering, hardware sidescroll, hardware BLITter, hardware sprites, multiple video layers etc........ :D :D :D

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

Re: New 65C02/W65C816 copro

Postby hoglet » Fri Aug 11, 2017 2:27 pm

The Tube ULA implementation used in the Matchbox Co Pro is also open source:
https://github.com/hoglet67/CoPro6502/t ... r/src/Tube

Dave

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

Re: New 65C02/W65C816 copro

Postby dominicbeesley » Fri Aug 11, 2017 2:29 pm

Andrew_Waite wrote:A very cool project for a 65C816 co-pro with a large memory would be...

By the time you've done all that you might as well ditch the beeb! :lol:

Here's my tube client code, BASIC and a simple debugger/monitor I started on. You will need ca65/cc65 to assemble these.

D
Attachments
MineBas4JGH-20170811-sent-stardot.zip
(102.38 KiB) Downloaded 2 times
tube65816client.zip
(12.05 KiB) Downloaded 2 times

User avatar
pstnotpd
Posts: 389
Joined: Wed Jan 20, 2010 11:05 am

Re: New 65C02/W65C816 copro

Postby pstnotpd » Sun Aug 13, 2017 8:17 am

dominicbeesley wrote:
Andrew_Waite wrote:A very cool project for a 65C816 co-pro with a large memory would be...

By the time you've done all that you might as well ditch the beeb! :lol:

I have the original ReCo6502 and while it makes the Beeb blazingly fast I wished it had the full addressable 16MB aboard.

I've been looking at these boards as they might be more cost-effective than trying to design and manufacture you own.
816-SXB
MENSCH™ Microcomputer

Again they don't have the full addressable memory, though the sxb exposes the full data and addressing bus.

As far as I'm aware the Acorn co-pro philosophy was to use the Beeb for IO and the tube for interchangeable processors doing just that, processing :).
Putting IO on the co-pro does indeed negate the purpose of the Beeb in this model.

User avatar
1024MAK
Posts: 6455
Joined: Mon Apr 18, 2011 4:46 pm
Location: Looking forward to summer in Somerset, UK...

Re: New 65C02/W65C816 copro

Postby 1024MAK » Sun Aug 13, 2017 10:55 am

BigEd wrote:Sorry, don't know the Tube speed of the Elk or Atom. I would expect it must be 2MHz because there are speed constraints in getting bulk transfers to work, but I don't know for sure.

The Elk CPU normally runs at 2 MHz except when it needs to access the main RAM (which goes via the Elk ULA).
The Atom as supplied by Acorn clocks it's CPU at 1 MHz. But an internal upgrade can increase it to 1.79 MHz.
Roland's recreated Atom 2015 can run at 1 MHz, or at 2 MHz or at 4 MHz when fitted with suitable quick chips.

Mark
For a "Complete BBC Games Archive" visit www.bbcmicro.co.uk NOW!
BeebWiki‬ - for answers to many questions...


Return to “hardware”

Who is online

Users browsing this forum: ilcook and 3 guests