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.

Prox

Greetings! I recently bought a CPC 464 in fully working condition and i'm looking into some kind of simple Interface with the Floppy/Expansion port so that i can basically hook up any kind of 8 bit device (RAM, ROM, Character LCD, Serial Interface, etc)


I have a good understanding of Logic, Computers, and the Z80 itself so i should be able to build the circuit myself.


the problem i have though is that i barely know something about the CPC 464.


for example are there empty places in the Memory map where i could put ROM/RAM into, or any free IO Ports that could be used?


does the BASIC v1.0 even have commands to use the ROM/RAM/IO Devices? (so that i could for example load BASIC or ASM Programs from ROM or a Serial Connection). and if not how would i go about upgrading the ROM, i only got a few 8kB EEPROMs and 512kB FLASH chips lying around.


and lastly, is it even that easy to hook something up to it?
since the pinout on the wiki indicates that all important Pins from the Z80 are directly on the port (A0-A15,D0-D7,RD,WR,MREQ,IORQ,CLK)

TotO

Welcome!

Here some I/O port informations: http://www.cpcwiki.eu/index.php/I/O_Port_Summary
About ROM/RAM ... You should found informations into the wiki too.
"You make one mistake in your life and the internet will never let you live it down" (Keith Goodyer)

Prox

yes i saw that page but I'm aparently not smart enough to actually understand it.


what confuses me is that they mostly use 16b addresses, as far as i know the Z80 uses 8b addresses (A0-A7) for IO Devices. so i cannot really tell which addresses are free to use.


and i didn't really find anything useful/understandable for RAM/ROM expansions.

rpalmer

Prox,

the Z80 uses 16Bit I/O address via register BC.

The use of the lower bits only was due to programmers and not a hardware limitation.

The BC register was issued to the I/O space where the B register was used as a counter with such instructions as OUTIR, INIR to make loops easier.

rpalmer

TotO

Exactly. The CPC has a 16bit I/O port and most of the MSB are used with partial decoding using only one line for the internal hardware (A15, A14, A13, A12).
About standard memory expansion, you have to locate RAM at #7Fxx (512KB) and ROM at #DFxx (and handle yourself the page banking) to be compatible.
Here the standard ports used: http://www.cpcwiki.eu/index.php/Default_I/O_Port_Summary

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

TotO

#5
Quote from: Prox on 21:11, 04 March 19i'm looking into some kind of simple Interface with the Floppy/Expansion port so that i can basically hook up any kind of 8 bit device (RAM, ROM, Character LCD, Serial Interface, etc)
I think, the more easy to start is to build your own ROM board using your 512KB flash chip (Winbond or SST ?) and some logic gates ...

- 512KB (4Mb) flash IC
- 74*374 or 74*574 to store the bank config and generate the extra address lines (RA14 to RA18)
- some other IC logic gates
- 1 diode (4148) + 1 resistor (1k) for ROMDIS
- some decoupling capacitors

A13, /WR, /IORQ are required to set the bank number
A14, A15, /MREQ are required to select the external ROM (and disable the internal ROM)

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

Prox

#6
Quote from: TotO on 22:22, 04 March 19I think, the more easy to start is to build your own ROM board using your 512KB flash chip (Winbond or SST ?) and some logic gates ...- 512KB (4Mb) flash IC- 74*374 or 74*574 to store the bank config and generate the extra address lines (RA14 to RA18)- some other IC logic gates- 1 diode (4148) + 1 resistor (1k) for ROMDIS- some decoupling capacitorsA13, /WR, /IORQ are required to set the bank numberA14, A15, /MREQ are required to select the external ROM (and disable the internal ROM)Have fun!



that was kind of the plan for a first little project. it should be easy enough


are those "74*374 or 74*574" Buffers or D-Flip flops?



i assume D-Flip flops so they can store the ROM Bank information.


that also answered one of my questions below.

Quote from: rpalmer on 21:56, 04 March 19
Prox,

the Z80 uses 16Bit I/O address via register BC.

The use of the lower bits only was due to programmers and not a hardware limitation.

The BC register was issued to the I/O space where the B register was used as a counter with such instructions as OUTIR, INIR to make loops easier.

rpalmer



ok so if i understand that correctly if i want to write to the gate array (0x7FXX) i would need to have C = 0x7F and B doesn't matter?


Quote from: TotO on 22:09, 04 March 19
Exactly. The CPC has a 16bit I/O port and most of the MSB are used with partial decoding using only one line for the internal hardware (A15, A14, A13, A12).
About standard memory expansion, you have to locate RAM at #7Fxx (512KB) and ROM at #DFxx (and handle yourself the page banking) to be compatible.
Here the standard ports used: http://www.cpcwiki.eu/index.php/Default_I/O_Port_Summary



ok there is a lot of Space in the IO Range, so i could just use 00XX-7EXX without any problems in the standard CPC464? neat.
also a bit looking around on the wiki i found a memory map

the manual itself mentions ROM Banking in detail (as far as i could understand it i need to use a FAR CALL if i want to run a program from any Expansion ROM? basiclaly RST 3 <Address> 0-251 to select ROM)
plus why did you say that ROM had to start somewhere from 0xDF00 to 0xDFFF? the memory map indicates that expansion ROMs can start from 0xC000.
also another thing that still confuses me is how the Computer selects ROM Banks, i don't really see any extra pins on the Expansion Port that would allow for banking. like how does the CPC know which of the ~251 External ROMs are actually there and how does it select between them?


I'm really sorry for my ignorance, it's just that i know barely anything about this Computer and i'm very bad and finding and reading Documentation. but i gotta start somehow.

.

on another note i'm not a fan of the formatting on this site. it's so easy to accidentally make everything tiny or make some text not be the same size as other text

TotO

Quote from: Prox on 22:50, 04 March 19
ok there is a lot of Space in the IO Range, so i could just use 00XX-7EXX without any problems in the standard CPC464? neat.
also a bit looking around on the wiki i found a memory map

the manual itself mentions ROM Banking in detail (as far as i could understand it i need to use a FAR CALL if i want to run a program from any Expansion ROM? basiclaly RST 3 <Address> 0-251 to select ROM)
plus why did you say that ROM had to start somewhere from 0xDF00 to 0xDFFF? the memory map indicates that expansion ROMs can start from 0xC000.

Don't confuse I/O map (/IORQ) and memory map (/MREQ) ! ;)
"You make one mistake in your life and the internet will never let you live it down" (Keith Goodyer)

LambdaMikel

Quote from: Prox on 21:11, 04 March 19
I have a good understanding of Logic, Computers, and the Z80 itself so i should be able to build the circuit myself.


the problem i have though is that i barely know something about the CPC 464.


Since you are German -

Mein Tipp - einmal

http://www.cpcwiki.eu/index.php/Das_Schneider_CPC_Systembuch

durchblaettern, sparrte ne Menge (unnoetige) Diskussion hier
;)

Prox

#9
Quote from: LambdaMikel on 23:14, 04 March 19


Since you are German -

Mein Tipp - einmal

http://www.cpcwiki.eu/index.php/Das_Schneider_CPC_Systembuch

durchblaettern, sparrte ne Menge (unnoetige) Diskussion hier
;)


I'm already looking into this one: http://www.cpcwiki.eu/imgs/d/d3/CPC_464_intern.pdf


Quote from: TotO on 23:03, 04 March 19
Don't confuse I/O map (/IORQ) and memory map (/MREQ) ! ;)


oh wow i'm an idiot. so i just write to IO Port DF and can ignore whatever the lower byte is, also which way around is it, is DF in Register B or C? since i would assume B-C <-> DF-XX



ok this makes a bit more sense now http://www.cpcwiki.eu/index.php/Upper_ROM_Bank_Number


still don't fully understand it but i'm getting there.


for example what still confuses me is that there are already 2 banked 16k sections there, the RAM and the BASIC ROM. i assume those are enabled via the ROMEN/DIS and RAMEN/DIS on the Expansion port? (except there only is a RAMRD and not RAMEN like ROM has the ROMEN, i assume any writes to ROM automatically go to RAM and unless RAMRD is used it would autoamtically read from ROM?)


Prox

Quote from: TotO on 22:22, 04 March 19
I think, the more easy to start is to build your own ROM board using your 512KB flash chip (Winbond or SST ?) and some logic gates ...

- 512KB (4Mb) flash IC
- 74*374 or 74*574 to store the bank config and generate the extra address lines (RA14 to RA18)
- some other IC logic gates
- 1 diode (4148) + 1 resistor (1k) for ROMDIS
- some decoupling capacitors

A13, /WR, /IORQ are required to set the bank number
A14, A15, /MREQ are required to select the external ROM (and disable the internal ROM)

Have fun!


btw it's SST


i got a very, very, very crude and quick circuit done. though i don't really know how to do the decoding to disable the internal ROM so i just used D7 of the D-FF to dsiable it. i'm also just checking for A13 = 0 for the ROM Selection (aka DFXX)

PIC
i forgot to draw the /OE of the D-FF. but it should probably just be grounded

LambdaMikel

#12
Quotei forgot to draw the /OE of the D-FF. but it should probably just be grounded


edit: oh, you mean the flip flop. just ignore  ;D
what is the dip switch for in your drawing? to select bank?

LambdaMikel

#13
This might also be interesting, because it shows all the involved signals for RAM / ROM

http://www.cpcwiki.eu/imgs/d/da/Schneiderware_SRAM_and_EPROM_Schematic.png
http://www.cpcwiki.eu/index.php/Schneiderware_Pseudo_ROM
PS A couple people here besides ToTO also designed ROM / RAM expansion here (I didn't), so I guess you should get good feedback and help with your project. Best of luck!

TotO

Sure, I will.

About /OC, yes you can ground it.
"You make one mistake in your life and the internet will never let you live it down" (Keith Goodyer)

Prox

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

Bryce

Have you done a continuity check between all pins?

Bryce.

TotO

Think about cleaning the edge port too!
"You make one mistake in your life and the internet will never let you live it down" (Keith Goodyer)

Bryce

I think he's saying that it crashes without any expansion connected to it, so edge dirt shouldn't make a difference, only a short could cause it.

Bryce.

LambdaMikel

#19
Here is a link:
https://oshpark.com/shared_projects/3yA33GYO
And another one if you want to connect the CPC to a breadboard via a ribbon cable(that's like a RPi breakout header for the breaboard if you know what I mean):
https://oshpark.com/shared_projects/tGXq3u2F

LambdaMikel

PS If you sent me 30 $ (USD), I can send you a kit consisting of the expansion port connector, a 50 pin ribbon cable, and the CPC breadboard breakout header such that you can directly work on the breadboard for your experiments (fully assembeled) This includes 17 $ USPS postage to Germany  ;) (I am paying 5 USD $ myself for the SCSI ribbon cable... and then there are the PCBs and IDC headers and edge connector ...) 

Prox

Quote from: Bryce on 13:37, 08 March 19
Have you done a continuity check between all pins?

Bryce.



Yes i did. i thought i said that in the post too. there was no unwanted connection between 2 pins. and all connections were working correctly


Quote from: Bryce on 14:59, 08 March 19
I think he's saying that it crashes without any expansion connected to it, so edge dirt shouldn't make a difference, only a short could cause it.

Bryce.



no i didn't mean it like that. only when i insert the self made Edge connector i showed in the pic does it instantly crash, without it it runs perfectly fine (though the internal speaker does some strange humming sound which isn't present on the TV sound)


Quote from: LambdaMikel on 17:14, 08 March 19
PS If you sent me 30 $ (USD), I can send you a kit consisting of the expansion port connector, a 50 pin ribbon cable, and the CPC breadboard breakout header such that you can directly work on the breadboard for your experiments (fully assembeled) This includes 17 $ USPS postage to Germany  ;) (I am paying 5 USD $ myself for the SCSI ribbon cable... and then there are the PCBs and IDC headers and edge connector ...) 


you mean something like this:
https://www.youtube.com/watch?v=iQ-iDxdE5d0 ?


that would be really amazing actually. thanks for the offer! how would i send it though, IBAN? PayPal?

LambdaMikel

Quote from: Prox on 18:39, 08 March 19
you mean something like this:
https://www.youtube.com/watch?v=iQ-iDxdE5d0 ?


that would be really amazing actually. thanks for the offer! how would i send it though, IBAN? PayPal?


Right, that was my first "project" when I started CPC tinkering 2 years ago  :) 
I'll send you paypal in a PM.... check your messages.

TotO

That remember me when I have worked on the CTC-AY! ;D
"You make one mistake in your life and the internet will never let you live it down" (Keith Goodyer)

Prox

#24
Quote from: LambdaMikel on 18:55, 08 March 19

Right, that was my first "project" when I started CPC tinkering 2 years ago  :) 
I'll send you paypal in a PM.... check your messages.


hmm i never received any PM. strange


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


say how do you people insert images that don't take up the entire screen? i cannot seem to find any resize feature for inserted images like you would find on some other forums



do you see this. i wish i could resize images on here so i wouldn't have to use external Links.
Damn you Modern Phone Cameras and your's +12MP

Powered by SMFPacks Menu Editor Mod