News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_Prox

very simple Expansion Interface (new to CPC)

Started by Prox, 21:11, 04 March 19

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

TotO

My pictures are only attached files and not inserted into the post.
"You make one mistake in your life and the internet will never let you live it down" (Keith Goodyer)

LambdaMikel

Quote from: TotO on 19:50, 08 March 19
That remember me when I have worked on the CTC-AY! ;D


Yes, breadboard prototyping is fun... and necessary. Maybe some people are good enough by now that they no longer need to prototype and can do the PCB directly...  :)
I still use the breadboard, and then the PCB.

LambdaMikel

Your kit is assembled. Shipping on Monday - I am including a free LambdaBoard such that you can get started with MX4-compatible boards as well. Enjoy and happy prototyping / breadboarding!

TotO

Nice, because I'm currently out of MotherX4 and ribbon cable/connectors to help him.
"You make one mistake in your life and the internet will never let you live it down" (Keith Goodyer)

LambdaMikel

It's in the mail by now. I really dislike USPS postages... 24 $ unregistered to Germany...  :(

Prox

Quote from: LambdaMikel on 06:08, 10 March 19
Your kit is assembled. Shipping on Monday - I am including a free LambdaBoard such that you can get started with MX4-compatible boards as well. Enjoy and happy prototyping / breadboarding!
Quote from: LambdaMikel on 06:08, 10 March 19Your kit is assembled. Shipping on Monday - I am including a free LambdaBoard such that you can get started with MX4-compatible boards as well. Enjoy and happy prototyping / breadboarding!




Thank you kind sir!


though what is the LambdaBoard/MX4? i assume MX4 is some kind of Expansion Card standard, and the LambdaBoard looks like a few Expansion slots..


does this basically mean you can have IBM PC like Expansion cards?




LambdaMikel

#31
Quote from: Prox on 03:19, 12 March 19
though what is the LambdaBoard/MX4? i assume MX4 is some kind of Expansion Card standard, and the LambdaBoard looks like a few Expansion slots..

does this basically mean you can have IBM PC like Expansion cards?
Yes, but much better than IBM PC because it is for a computer with character and personality of course  ;)

Check out some expansion cards for the CPC here on the board:
They all plug in the "Mother 4X" expansion board originally from @TotO 
It became a de-facto standard.

Prox

I see


but one thing i noticed, the MX4 slots seem to be 50 pin like the Expansion slot itself


that would mean that all Decoding has to be done by the card. which can be good and bad in some cases.


but i'll see how it works.

LambdaMikel

Quote from: Prox on 06:00, 12 March 19
I see


but one thing i noticed, the MX4 slots seem to be 50 pin like the Expansion slot itself


that would mean that all Decoding has to be done by the card. which can be good and bad in some cases.


but i'll see how it works.
Right, it is just the CPC expansion bus on a wire  :)

TotO

The MotherX4 had been able to hanle a primary decoding stage to redure the I/O port to 8bit in example, but it is not realy possible on CPC, because unlike others Z80 computers, 16bit I/O are used for all kind of usages.
"You make one mistake in your life and the internet will never let you live it down" (Keith Goodyer)

Prox

ok so now i got an actual functional adapter to connect something from my breadboards to the CPC (thanks again to LambdaMikel)


i've been using the wiki to build the ROM Board and got down to the very basics


to write to the D Flip-Flop which stores the ROM Number i just need to check for A13, RD, and IORQ to be 0.


to read from ROM once it's selected i just need to check for A15 and A14 to be 1, and check for RD, MREQ and ROMEN to be 0. (which should also set ROMDIS to 1 which means it can just be hooked up to the inverted CS of the external ROM)


now the thing i don't really get is that the wiki says this:


"A14 doesn't need to be decoded since there is no ROM at 8000h..BFFFh, only at C000h..FFFFh."

which makes little sense, if you only check A15 to be 1 to enable your ROM that would mean that it would take up the upper 32kB of Address space instead of the 16kB it's meant for. so you have to check for both A14 and A15 to be 1.
or do you?



TotO

You got the answer... Because the CPC require 16K banks, you have to decode A14 AND A15 (#C000).

"You make one mistake in your life and the internet will never let you live it down" (Keith Goodyer)

00WReX

Quote from: Prox on 12:56, 08 March 19
ok, sadly this project is gonna be on ice for a while. because the Edge adapter i made crashes the CPC whenever i insert it.



PICTURE


i've checked all connections with my multimeter and there is nothing missing and no wrong/unwanted connections, so i have no idea why it's doing this to my poor CPC.


either way i think i'll just order some custom PCB instead of doing it myself with protype boards, though i have no idea how to design and order PCBs but i'll figure it out someday.


I'm still very thankful for all the help i've gotten on here. as soon as i can continue to work on this i will update the thread
Just wondering if you could post a picture of the underside of your adapter board.

I did a hand made one (before I had PCBs made up) and it was very messy (but worked).Interested to see how yours looks?


Cheers,
Shane
The CPC in Australia...
Awa - CPCWiki

Prox

it looks like this:

https://i.imgur.com/LyAMBbq.jpg


basically i cut up a ~10mm² flexiable wire and used the indivitual strands to connect the Edge connector pins to the pin headers. after i was done with half of them i put a strip of electrical tape over them and did the second half.


as said before my multimeter says all of them are working perfectly fine, but the CPC doesn't think so

00WReX

#39
Hi Prox,

Thanks for the photo.

Plugging this in with nothing attached should not lock up the computer (I honestly think you must have a short).
A short is unlikely to show up on a basic continuity test, if you are just testing between two pins (one at each end).

I understand you indicated you continuity tested each connection, but testing for a short requires a slightly different approach.
I'm not calling myself an expert, and others may have a different technique.
So what I do is to test the connections to either side of the path I require.

So for example, If I was testing for shorts, I would hold one of the meter probes on a Pin at one end of the cable.
And at the other end of the cable move the second probe between the expected pin on the other end, and then move to the pins directly next to it (on each side).  I hope that makes sense.  It can take a bit of time to test on a 50 pin connector.

There is also another issue, but only if you intended to plug an existing 'MX4 standard' board on you adapter, or make boards in the future.
For your testing it would be OK, but this would not work as desired for any existing boards.

If I refer to the expansion numbering here,

http://www.cpcwiki.eu/index.php/File:ExpansionPortEdge.gif

If for example you plugged a current ROM board onto that adapter, the pins would not align.

Pin 1 would either go to pin 2 if the board was top of the board was facing the CPC or
pin 1 to 50 if the solder side of the board was facing the CPC.

I hope I made sense, it's been a long day and I'm ready for bed (in Australia).

If anybody else can explain better please do (or shoot me down in flames if they disagree  :D ).


Cheers,

Shane


EDIT:

Maybe a quick and dirty diagram will make more sense than my writing  ???

The black lines on the left are how I would test for a short (with the continuity tester).
The green and blue lines on the right indicate a correct connection for a standard interface board (using the MX4 standard).
The red lines are how you have it wired.

[attach=1,msg172211]
The CPC in Australia...
Awa - CPCWiki

Prox

Quote from: TotO on 21:28, 20 March 19
You got the answer... Because the CPC require 16K banks, you have to decode A14 AND A15 (#C000).


well so the wiki is wrong since it says you don't need to decode A14? that was really just the only part that confused me.


oh well guess i now have a better plan on how to build this. gonna write again when i got something finished


Quote from: 00WReX on 11:06, 21 March 19
Hi Prox,

Thanks for the photo.

Plugging this in with nothing attached should not lock up the computer (I honestly think you must have a short).
A short is unlikely to show up on a basic continuity test, if you are just testing between two pins (one at each end).

I understand you indicated you continuity tested each connection, but testing for a short requires a slightly different approach.
I'm not calling myself an expert, and others may have a different technique.
So what I do is to test the connections to either side of the path I require.

So for example, If I was testing for shorts, I would hold one of the meter probes on a Pin at one end of the cable.
And at the other end of the cable move the second probe between the expected pin on the other end, and then move to the pins directly next to it (on each side).  I hope that makes sense.  It can take a bit of time to test on a 50 pin connector.

There is also another issue, but only if you intended to plug an existing 'MX4 standard' board on you adapter, or make boards in the future.
For your testing it would be OK, but this would not work as desired for any existing boards.

If I refer to the expansion numbering here,

http://www.cpcwiki.eu/index.php/File:ExpansionPortEdge.gif

If for example you plugged a current ROM board onto that adapter, the pins would not align.

Pin 1 would either go to pin 2 if the board was top of the board was facing the CPC or
pin 1 to 50 if the solder side of the board was facing the CPC.

I hope I made sense, it's been a long day and I'm ready for bed (in Australia).

If anybody else can explain better please do (or shoot me down in flames if they disagree  :D ).


Cheers,

Shane


EDIT:

Maybe a quick and dirty diagram will make more sense than my writing  ???

The black lines on the left are how I would test for a short (with the continuity tester).
The green and blue lines on the right indicate a correct connection for a standard interface board (using the MX4 standard).
The red lines are how you have it wired.

 



the ironic thing is i did test like that, i connected one of my multimeter's probes to one pin and then moved it across all other pins with the second probe, it only beeped where the corresponding pin was.


but maybe i missed one.


i also only plan on not pulling out the current lamba card, because of 2 reasons


1. it's a passthrough so i can just stick cartridges onto the Lamba board
2. one of the Edge contacts on the CPC is somewhat loose and constantly plugging stuff in and out is just gonna break it off one day.

GUNHED

The CPC uses 16 bit I/O, so please everybody always decode all 16 bits. If not, one expansion is not compatible to others, in the worst case the CPC could crash.


Sure sometimes it's hard to do a fully decoding (missing pins, whatever), but in this case be very careful what you do.  :)
http://futureos.de --> Get the revolutionary FutureOS (Update: 2023.11.30)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2021.12.26)

TotO

#42
Quote from: GUNHED on 17:58, 21 March 19
The CPC uses 16 bit I/O, so please everybody always decode all 16 bits. If not, one expansion is not compatible to others, in the worst case the CPC could crash.
Sure sometimes it's hard to do a fully decoding (missing pins, whatever), but in this case be very careful what you do.  :)
When peoples use a CPLD and lack of I/O for doing the full decoding, it is easy to add something like a N-inputs NAND gates IC or a 688 magnitude decoder to save them.
"You make one mistake in your life and the internet will never let you live it down" (Keith Goodyer)

Prox

#43
Quote from: GUNHED on 17:58, 21 March 19
The CPC uses 16 bit I/O, so please everybody always decode all 16 bits. If not, one expansion is not compatible to others, in the worst case the CPC could crash.


Sure sometimes it's hard to do a fully decoding (missing pins, whatever), but in this case be very careful what you do.  :)


I mean you could just predecode Expansion Slots, that would allow you to have cards work perfectly fine even if they use the same IO Ports.


something like using the upper 4 bits of the IO Address would allow for 16 Expansion slots and still leave 16384 Ports per Slot. downside is that the Card that splits the expansion port into multiple slots would require some logic on it and probably a ROM Chip that hosts some routines or commands to access the correct card. this would also allow you to use multiple of the same card without them interfering with eachother.

TotO

#44
Will not work, because A15-A12 are used for the CPC hardware. At less, they must be set to 1, so you got #Fxxx to be safe.
Next, you have to deal with exiting expansions on this addresses range... (except for ROM/RAM standard expansions)
"You make one mistake in your life and the internet will never let you live it down" (Keith Goodyer)

Prox

oh i see, right. some IO Addresses are also used by the CPC itself. also only A12-A15? so A0-A11 is free for external devices? so theoretically, you could use up one IO Address for an 8 bit D Flip-Flop that stores the Address of the Expansion Slot to be accessed. so each slot can still use the same IO Addresses and you just need to write to an external Register to specify what card you want to access... kinda like selecting expansion ROMs except with IO Ports.


even if only the lower 8 bit IO Addresses were free to use that would still be 256 Ports per card. which should be more than enough for basically anything you could connect up to the CPC.

rpalmer

Prox,

Not all lower 8 bits are available (for example bit 7 on the disc interface is for floppy motor control).

see http://www.cpcwiki.eu/index.php/I/O_Port_Summary for more information about the I/O ports available.

rpalmer

TotO

Quote from: Prox on 21:05, 21 March 19even if only the lower 8 bit IO Addresses were free to use that would still be 256 Ports per card. which should be more than enough for basically anything you could connect up to the CPC.
Sure. i.e. the MSX interface board for CPC decode #FFxx, where xx are the 256 I/O from this computer.
Just, you can't use other expansions on the #FFxx range, but it is not a real problem... Each users have to know what they can use together.
"You make one mistake in your life and the internet will never let you live it down" (Keith Goodyer)

LambdaMikel

Quote from: GUNHED on 17:58, 21 March 19
The CPC uses 16 bit I/O, so please everybody always decode all 16 bits. If not, one expansion is not compatible to others, in the worst case the CPC could crash.


Sure sometimes it's hard to do a fully decoding (missing pins, whatever), but in this case be very careful what you do.  :)
Indeed, I second that! It is considered very rude and egoistic if a card does partial encoding only and grabs a whole block of IO addresses that could be used potentially by other cards, only in order to save a couple of (CPLD) logic gates or lines in the design. 

Prox

#49
Quote from: TotO on 23:25, 21 March 19
Sure. i.e. the MSX interface board for CPC decode #FFxx, where xx are the 256 I/O from this computer.
Just, you can't use other expansions on the #FFxx range, but it is not a real problem... Each users have to know what they can use together.


but there are still a lot of Io Ports free to use right? aren't all of those enough for a single expansion card/device?



Quote from: TotO on 23:25, 21 March 19
Sure. i.e. the MSX interface board for CPC decode #FFxx, where xx are the 256 I/O from this computer.
Just, you can't use other expansions on the #FFxx range, but it is not a real problem... Each users have to know what they can use together.


yes but that could "easily" be solved.


basically something like this:

Spoiler: ShowHide

Spend like a solid hour drawing this...


I hope this gets the idea across better, you just write to a specific Port to select the Card you want to enabled, all the other ones will be blocked off. this allows you to connect multiple of the same card or cards that use the same IO Ports to your CPC without them interfering with eachother. I don't understand why this wouldn't be useful. only downside Cards cannot directly "talk" to eachother.
Data and Address are obvious, Misc is just the rest of the Lines from the Expansion port.

here are the Colors:
Spoiler: ShowHide
Purple on the left: Edge connector (female)
Purple on the right: Edge connector (male)
Pink-ish: MX4 Slots (for all kind of expansion cards)
Red: Bus Transceivers (for controlled bi-directional data transfer)
Orange: Bus Buffers (for controlled pass through of the Address lines and other lines which are output only)
Yellow: 3-8 Binary Decoder (could technically be replaced with an 8-256 binary decoder, but 8 ports are enough, plus 8-256 don't exist as their own IC)
Green: 8 bit D Flip-Flop (used to store the Expansion Slot number that is supposed to be enabled)
Blue: CPLD or a cluster of Logic gates (used for the decoding of the IO Address of the D Flip-Flop. technically this could be changeable with an 8 bit DIP Switch so the user can choose what Port to write to to set the active Card)

Extra:

+5V and GND go straight to each Slot. only the other 48 pins are being "cut" off from the card via the Buffers and Transceivers. otherwise RAM Cards would loose their data, and ROM Cards would "forget" what ROM bank was selected, and that would be useless.

Powered by SMFPacks Menu Editor Mod