New E2P development

for bbc micro/electron hardware, peripherals & programming issues (NOT emulators!)
Post Reply
iwasjafa
Posts: 32
Joined: Fri Nov 01, 2019 6:50 pm
Contact:

New E2P development

Post by iwasjafa » Fri Feb 28, 2020 10:25 pm

I don't know if anyone is interested but, with John's (jms) help and suggestions I have been developing a daughter board to fit in the RAM socket of his new board and give 8 banks of parallel RAM in a 512k device, and expanding the OS to support it. This means that up to 8 language ROMs or images can be loaded into the E2P and selected as the active one with a simple command. (I am actually reserving 1 bank for use by machine code programs so that means 7 languages can be loaded). Each language bank has its own full range of memory to work in. The bank is automatically changed when a new language is loaded and an extended HELP command shows which languages are in each bank. I had to load BASIC and VIEW a few times for the photo to fill up the banks! (VIEW and HIBASIC were loaded from disc)
download/file.php?mode=view&id=53812&si ... 5b6e88442d
download/file.php?mode=view&id=53811&si ... 5b6e88442d

John.
Attachments
IMG_20200228_215616.jpg
IMG_20200227_173421.jpg

User avatar
jms2
Posts: 2418
Joined: Mon Jan 08, 2007 6:38 am
Location: Derby, UK
Contact:

Re: New E2P development

Post by jms2 » Sat Feb 29, 2020 12:40 pm

I have been helping John with designing the daughterboard PCB for this (using my extensive Kicad skills, haha - it's only the second board I have ever designed on it!), and am building up my own 8-bank version this weekend hopefully.

So far I have got the 2-bank prototype working.

User avatar
jgharston
Posts: 3845
Joined: Thu Sep 24, 2009 11:22 am
Location: Whitby/Sheffield
Contact:

Re: New E2P development

Post by jgharston » Sat Feb 29, 2020 3:27 pm

Interesting. I'm writing up a longer post...

Code: Select all

$ bbcbasic
PDP11 BBC BASIC IV Version 0.25
(C) Copyright J.G.Harston 1989,2005-2015
>_

User avatar
walkerworks
Posts: 45
Joined: Tue Oct 22, 2019 11:03 am
Contact:

Re: New E2P development

Post by walkerworks » Sat Feb 29, 2020 3:42 pm

I have been resisting the urge to buy the new e2p since I read the thread about it some months ago, I wanted to get my Electron kitted out with some of the basics first along with copying and working through all my floppy discs. With that done and this new development would it be possible to buy an e2p board and the RAM expansion if they are available? :D

Derek

User avatar
jgharston
Posts: 3845
Joined: Thu Sep 24, 2009 11:22 am
Location: Whitby/Sheffield
Contact:

Re: New E2P development

Post by jgharston » Sat Feb 29, 2020 4:06 pm

So, is it eight banks of 64K, and you page the entire 64K? So you're sort-of switching context. The second picture made it look as though you paged in another language and then entered it, but I presume the other bank is "sleeping", and you page it in, and simple RTS off its stack back into the caller in that bank.

So... how does the code "see" one bank from another to list its contents...
Ah! I bet it doesn't, the bank listing code simply pages itself out, resulting in the very same code being paged in, but "seeing" different memory.

How do you load/save to different banks? Just switch to it, then normal load/save? So you can't *fooLOAD <filename> <bank> ?

Some recommendations.
* Acorn stuff never prefixes version numbers with a v, they are always X.YZ, eg E2P-6502 5.00 not E2P-6502 v5.00
* (or eg: E2P-6502 5.00-dev)
* Make the list of bank/pages/whatever present be via a *command, not as part of the *HELP command.
* Make *SWITCH and the listing command be something else (switch what?), that follows the standard <noun><verb> format, (eg ScreenSave, ZipCat, SrLoad, MMCList), though listing commands often follow the format <noun>s, eg *ROMS, *Modules, *Keys. The OSCLI parser in 6502Tube 1.22 and the !65Tube client makes adding extra commands easy. link
* Implement the banking API at &F803 that John K introduced.
* A clever trick would be to allow the Tube Data Transfer calls to use the full 4-byte address to select different banks, and have OSBYTE &82 return high word for the bank that's paged in.

I'm trying to think of a naming command structure, existing banking/paging/etc commands we have include:
*SRxxxx - sideways RAM/ROM, eg *SRPAGE <bank> <page> - select <page> visible in sideways <bank>
*SMxxxx - sideways modules, eg *SMList, *SMLoad, etc.
*RMxxxx - relocatable modules, eg *RMLoad, etc.
*AQRxxxx - Advanced Quartermeg RAM, eg *AQRPAGE <bank> - select <bank> of AQR
*Xxxxx - page-wide memory in JIM, eg *XLOAD, *XSAVE

It should be something like:
E2P-6502 5.00
...foobar <bank>
...foos
or
...fooLIST

Semantically, the thing that's being switched in is a bank, within a 64K window, so semantically, the command should be somethingBANKsomething.

On other 6502 systems we've already got 8x8K banks, and on 6809 and Z80 systems 16x4K banks, and on the ReCoPro 2x16K banks, so the semantics should allow for that. It shouldn't be *E2Psomething as there's nothing to stop it being implemented on other systems, such as the B2P, the "normal" 6502CoPro, etc.

Code: Select all

65xxx CoPro Memory Control API:
Address: &F803
On entry: X=action, Y=register, A=byte read or written
              X=1 write settings
              X=2 read settings
              X=&8x 65816 control

              Y=0 configuration links
              Y=1 CPU speed
              Y=2 bank enable register
              Y=3 bank numbers for banks enabled in Y=2
              Y=4 CPU type

On exit:  A=returned value from read calls
          X,Y=preserved
The existing API manipulates 16K memory windows, your extension is a 64K window. I'm trying to think of how to include that in the API.

Code: Select all

$ bbcbasic
PDP11 BBC BASIC IV Version 0.25
(C) Copyright J.G.Harston 1989,2005-2015
>_

iwasjafa
Posts: 32
Joined: Fri Nov 01, 2019 6:50 pm
Contact:

Re: New E2P development

Post by iwasjafa » Sat Feb 29, 2020 4:29 pm

walkerworks wrote:
Sat Feb 29, 2020 3:42 pm
I have been resisting the urge to buy the new e2p since I read the thread about it some months ago, I wanted to get my Electron kitted out with some of the basics first along with copying and working through all my floppy discs. With that done and this new development would it be possible to buy an e2p board and the RAM expansion if they are available? :D

Derek
Jms2 is the one to ask about the boards and BOM's and whether he can assemble them for you. I can supply a programmed PLD for the daughterboard for £2.50. I do have 3 blank daughterboards from the initial batch but I would like to keep one for my own use. The other two would be available FOC with a PLD.

By the way, the latest version is ROM only so you would need to have a facility for loading sideways ROMs into your Elk.

iwasjafa
Posts: 32
Joined: Fri Nov 01, 2019 6:50 pm
Contact:

Re: New E2P development

Post by iwasjafa » Sat Feb 29, 2020 5:09 pm

jgharston wrote:
Sat Feb 29, 2020 4:06 pm
So, is it eight banks of 64K, and you page the entire 64K? So you're sort-of switching context. The second picture made it look as though you paged in another language and then entered it, but I presume the other bank is "sleeping", and you page it in, and simple RTS off its stack back into the caller in that bank.

So... how does the code "see" one bank from another to list its contents...
Ah! I bet it doesn't, the bank listing code simply pages itself out, resulting in the very same code being paged in, but "seeing" different memory.

How do you load/save to different banks? Just switch to it, then normal load/save? So you can't *fooLOAD <filename> <bank> ?
It is 8 banks of 64k. The areas of memory reserved for language use, ie. &0000-&007F and &0400-&F7FF are switched, as well as the area &FE00-&FE7F, which is used for storing copies of the remaining zero page language area at &0080-&008F, the value of HIMEM for the language and the title string for the language. The rest of memory, ie. &0080 to &03FF, &F800 to &FDFF and &FE80 to &FFFF, are operating system areas so are not switched and are common to all languages.

The contents listing is carried out from the i/o processor. It does a tube read of the title string store in the &FE00 area and switches banks for each read, before switching the bank back to what it was.

When a *Language or *FX142 command is issued and a tube transfer commences, the tube software copies the unswitched language zero page data into the &FE00 area then selects the next available bank and copies the language into it, along with copying the values of HIMEM and the title string into the &FE00 area for that bank. It then runs the language normally. This only happens for languages. Any data or code that has a load/run address below &8000 will just load into the existing bank.

The *SWITCH command does the same housekeeping then runs the language already in the selected bank similar to a soft reset with its memory retained from the last time it was active.

John.

User avatar
walkerworks
Posts: 45
Joined: Tue Oct 22, 2019 11:03 am
Contact:

Re: New E2P development

Post by walkerworks » Sun Mar 01, 2020 9:34 am

iwasjafa wrote:
Sat Feb 29, 2020 4:29 pm
Jms2 is the one to ask about the boards and BOM's and whether he can assemble them for you. I can supply a programmed PLD for the daughterboard for £2.50. I do have 3 blank daughterboards from the initial batch but I would like to keep one for my own use. The other two would be available FOC with a PLD
Thanks, I've messaged jms2 regarding the e2p. I would like just one of the daughter boards with PLD, I'll send you a PM.

Thanks
Derek

iwasjafa
Posts: 32
Joined: Fri Nov 01, 2019 6:50 pm
Contact:

Re: New E2P development

Post by iwasjafa » Sun Mar 01, 2020 12:34 pm

jgharston wrote:
Sat Feb 29, 2020 4:06 pm
Some recommendations.
* Acorn stuff never prefixes version numbers with a v, they are always X.YZ, eg E2P-6502 5.00 not E2P-6502 v5.00
* (or eg: E2P-6502 5.00-dev)
* Make the list of bank/pages/whatever present be via a *command, not as part of the *HELP command.
* Make *SWITCH and the listing command be something else (switch what?), that follows the standard <noun><verb> format, (eg ScreenSave, ZipCat, SrLoad, MMCList), though listing commands often follow the format <noun>s, eg *ROMS, *Modules, *Keys. The OSCLI parser in 6502Tube 1.22 and the !65Tube client makes adding extra commands easy. link
* Implement the banking API at &F803 that John K introduced.
* A clever trick would be to allow the Tube Data Transfer calls to use the full 4-byte address to select different banks, and have OSBYTE &82 return high word for the bank that's paged in.
Thanks for your suggestions.
* I can easily remove the "v" prefix
* If you can recommend an acceptable command prefix I can make the bank list a *command instead of *HELP and also change the name of the *SWITCH command.
* I am unclear how to implement the &F803 API. It seems to be intended to write to registers in the 65816. What I need is a read/write flag, data, bank number and 16 bit address. I already have these implemented in a call in my code but I don't see how to incorporate the bank number and address into the API. I have looked at the various clients in the page you link to, but I do not see any that have the API code at &F803. Perhaps you could point me to one.
* I did think about osbyte &82 but I was not sure whether it would interfere with any other implementations.

John.

User avatar
jms2
Posts: 2418
Joined: Mon Jan 08, 2007 6:38 am
Location: Derby, UK
Contact:

Re: New E2P development

Post by jms2 » Sun Mar 08, 2020 6:06 pm

I have got my 512k daughterboard working now! :D (Thanks for the spare board John after I messed up with the first one!) :oops:

Can I propose "*TUBEBANK <n>" as the alternative to *SWITCH? The logic behind this is:

- Whilst it isn't specific to the E2P, the command is only for second processors, and we already have *CONFIGURE TUBE etc. And yes I realise that the E2P doesn't have a Tube ULA.
- It's not too long a command to type.

Following the same logic, maybe the bank listing command should be *TUBEBANKS?

Also John - the built-in manual still says version 4.00 at the top. I notice that you've added all the text out of the original E2P manual that I didn't have the energy to type in!

iwasjafa
Posts: 32
Joined: Fri Nov 01, 2019 6:50 pm
Contact:

Re: New E2P development

Post by iwasjafa » Sun Mar 08, 2020 10:44 pm

Thanks for the suggestions John.

I'll leave this for comment for a couple of weeks then implement them if there are no other ideas.

User avatar
walkerworks
Posts: 45
Joined: Tue Oct 22, 2019 11:03 am
Contact:

Re: New E2P development

Post by walkerworks » Wed Mar 25, 2020 8:03 pm

iwasjafa wrote:
Sat Feb 29, 2020 4:29 pm
Jms2 is the one to ask about the boards and BOM's and whether he can assemble them for you. I can supply a programmed PLD for the daughterboard
That's me up and running with both the e2p and the 512k daughter board. Thank's John & John.

Only a couple of minor chip compatibility issues on the e2p board. I bought a 65C02P4 but had to change it for a 65C02P3, an old one from back when.. and the LS245's for HCT245's also from back when.. and it's now stable.

I also found that the daughter board assembly prevents the e2p from being plugged into the near socket as it touches the rear cartridge - with hindsight I could have done away with a socket to make the whole assembly lower but not a problem.

Here's a few of photos..
Attachments
20200325_162422.jpg
20200325_154738.jpg
20200325_154708.jpg

User avatar
jms2
Posts: 2418
Joined: Mon Jan 08, 2007 6:38 am
Location: Derby, UK
Contact:

Re: New E2P development

Post by jms2 » Wed Mar 25, 2020 8:14 pm

Well done! I was wondering how you were getting on.

I think my 6502 is actually a p4, I’ll have to check.

iwasjafa
Posts: 32
Joined: Fri Nov 01, 2019 6:50 pm
Contact:

Re: New E2P development

Post by iwasjafa » Wed Mar 25, 2020 9:31 pm

Well done Derek!

As I said to you, I am successfully using a 65C02P4 so it is a pity that you can't.

I am working on the revised version of the software and hope to get it out next week.

User avatar
walkerworks
Posts: 45
Joined: Tue Oct 22, 2019 11:03 am
Contact:

Re: New E2P development

Post by walkerworks » Thu Mar 26, 2020 8:35 am

I'm sure it's just component tolerances/timings..as both of you have P4's working I'm determined to do the same :)

I'll post here if/ when I'm successful.

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

Re: New E2P development

Post by 1024MAK » Thu Mar 26, 2020 7:00 pm

Is it a real 65C02P4 chip or one purchased recently (from eBay or other trading web site)?

Only there are plenty of remarked NMOS and slower speed 65C02 chips being sold as faster CMOS parts.

Mark

User avatar
walkerworks
Posts: 45
Joined: Tue Oct 22, 2019 11:03 am
Contact:

Re: New E2P development

Post by walkerworks » Thu Mar 26, 2020 7:42 pm

Yes, bought from ebay in the last few weeks. The P3 I bought back in the 80's and works fine. Any recommendations on where I could order a 'genuine' P4?

iwasjafa
Posts: 32
Joined: Fri Nov 01, 2019 6:50 pm
Contact:

Re: New E2P development

Post by iwasjafa » Thu Mar 26, 2020 8:42 pm

walkerworks wrote:
Thu Mar 26, 2020 7:42 pm
Yes, bought from ebay in the last few weeks. The P3 I bought back in the 80's and works fine. Any recommendations on where I could order a 'genuine' P4?
All I can say is that I got mine from ebay!

https://www.ebay.co.uk/itm/124124057877 ... 4124057877

User avatar
walkerworks
Posts: 45
Joined: Tue Oct 22, 2019 11:03 am
Contact:

Re: New E2P development

Post by walkerworks » Thu Mar 26, 2020 9:54 pm

At the time of ordering there were only three places on ebay in the UK that offered the P4. Looks like I may have made the wrong choice :(

I'll give it a go from this supplier.
Thanks.

User avatar
walkerworks
Posts: 45
Joined: Tue Oct 22, 2019 11:03 am
Contact:

Re: New E2P development

Post by walkerworks » Fri Apr 03, 2020 8:33 am

I received the P4 a couple of days ago and on first appearance it worked ok. I could start the 2nd processor, load hi-basic and switch between both basic and hi-basic - all good :)

Then I thought I'd run a short loop program to continuously count down from 1000 to 0 and also count the number of loops. It'll run happily for an hour or two then crash :(

So I still have some sort of timing issue but nearly there.

User avatar
jms2
Posts: 2418
Joined: Mon Jan 08, 2007 6:38 am
Location: Derby, UK
Contact:

Re: New E2P development

Post by jms2 » Fri Apr 03, 2020 10:02 am

I found my prototype board was sensitive to timings, but it worked with an NMOS 6502A. These seem to be the most tolerant.

The new board worked straight away for me, even with a 65C02P4. I note that all my bus buffers are ALS245s which I believe are the fastest available. I don't think this is strictly necessary though - and I certainly don't think that HCTs are needed because the 65C02 is TTL compatible. Aren't HCT quite a bit slower than LS?

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

Re: New E2P development

Post by 1024MAK » Fri Apr 03, 2020 10:46 am

With any out of production semiconductor part, that appears to be available from trading sites such as eBay, buying is always a gamble. And it does not matter if the person you are buying it from is local in your own country, or elsewhere.

If the part has a date code that is within the range of the production run, it’s either a ‘pull’ (extracted from an old item of equipment/product) (most likely) or a rare find of new old stock (NOS) that someone has found (nowadays very unlikely).

If it has a date code that is newer (after the part went out of production), then it’s most likely an older part, again most likely a ‘pull’ that has been cleaned up and remarked.

Lots and lots of posts on fake chips:
Fake, too slow, of just defective?
Fake 6502As
R65C02 in a Beeb
Fake chips from China
Fake Chinese W65C02
Identifying a fake MOS6502

There are however still new 65C02 CPUs available, these are produced by Western Design Center (WDC)
They are available from Mouser and other suppliers that distribute WDC parts.

But they are NOT direct drop in replacements, as the W65C02S version has a very slightly different pin-out (some pin functions have changed). Also as it is using more modern CMOS production processes, it is far faster (14 MHz) and it’s outputs switch much quicker and it has much more powerful output drivers, so the waveform edges change state far quicker.

Mark

Tags: 6502 65C02 W65C02 W65C02S fake

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

Re: New E2P development

Post by 1024MAK » Fri Apr 03, 2020 10:57 am

jms2 wrote:
Fri Apr 03, 2020 10:02 am
Aren't HCT quite a bit slower than LS?
No.

74LS, 74HC and 74HCT are similar in terms of propagation delay (speed), although there are variations depending on which specific chip is being used. Hence some 74HC chips are slightly faster than the equivalent 74LS part.

74HC and 74HCT are far better at driving their outputs to a logic high compared to 74LS.

74HCT have TTL computable inputs. 74HC use CMOS input levels, so are not guaranteed to operate correctly when driven by TTL / 74LS outputs, especially if it is a heavily loaded bus line.

Mark

User avatar
walkerworks
Posts: 45
Joined: Tue Oct 22, 2019 11:03 am
Contact:

Re: New E2P development

Post by walkerworks » Fri Apr 03, 2020 7:46 pm

Thanks for your replies. I originally ordered what parts I needed from China but I was impatient to get the board completed so I ordered the few parts I needed from uk suppliers knowing that they're the same parts but with a large mark up on price!

Unfortunately the LS245's were one of the chip types I had to buy as I only had one original left from the mid 1980's however I did have some HCT245's. I must admit I didn't check the spec but I new they were ttl compatible. They seemed to do the job but with this recent experience possibly just not reliable enough.

I have now ordered some ALS so I'll see what happens there...real or fake we'll soon see :)

I'll take on board the tips here and be more care when ordering parts in future..

Post Reply