News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu

CPC6128 - expansion board address decoding

Started by Wawavoun, 12:46, 25 April 23

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Wawavoun

Hi All,

I try design a Intel C8231 based floating point unit for my CPC6128.

The following schematic shown the basic idea which is very simple : see attachment 1.
 
All the signals required are on the CPC expansion port. The only difficult will be to made 12 V (required by the C8231) from 5 V supply.

The FPU is selected by the Y output of the LS138 (choose between Y0 to Y1) and selected by A1/A2/A3, if A7 high and A5/A6 both low.

The question : Is the proposed address decoding here adapted to the CPC6128 where I/O are addressed by 16 bits address and not by 8 bits address like generally on Z80 system.

I found these explanations : see attachment 2 but they are unclear (at least for me).

Is the "Address" column corresponding to b0-b7 ?

Fo example if I use Y0 on the LS138 the address will be $40 for r/w "data" and $41 for write "command" or read "status". In this case what will be the IN / OUT Z80 instructions I should use for send receive data from the fpu ?

Thanks for help and advice.

Philippe
If you think adventure is dangerous try routine, you'll see it's deadly!

McArti0

#1
You MUST use A10 line Z80. Only when A10=0, Y and CS can be 0.

ps.
LD B, #FB ;ADDRES b15-b8 as 1111 1011 ; only b10 work.
LD C, LoADR ; When use line A0-A7.
LD A, DATA
OUT (C), A ; (ADDRES)<--DATA ,  C is ignored in CPC system, if You use for Adres, line A0-A7, You must not use reg. C as DATA.

IN (C), D ; DATA <--(ADDRES)  DATA in A,D,E,H.L or C* ;When don't use line A0-A7

ps2. In simple world you can A10 join to CS and pray that no one sends more than one 0 in reg B (address) in OUT, when B10 (A10). is 0
CPC 6128, Whole 6128 and Only 6128, with .....
NewPAL v3 for use all 128kB RAM by CRTC as VRAM
TYPICAL :) TV Funai 22FL532/10 with VGA-RGB-in.

Wawavoun

#2
On the 74LS138 truth table :

G1 = A7
G2 = G2A + G2B = A6 + A5
A3 = C
A2 = B
A1 = A

A10 has nothing to do with Y output selection at least into the schematic of the board... May be inside the CPC ?

Can you explain please ?

Thanks.
Philippe

ps I should mention that I am not very familiar with Z80 assembly language and with IN / OUT instructions. I come from 6502 world...
If you think adventure is dangerous try routine, you'll see it's deadly!

McArti0

Without using A10, all firmware and CPC firmware when using IN C,(C) will randomly use your 8231 and short circuit with CPC. Failure ready.
CPC 6128, Whole 6128 and Only 6128, with .....
NewPAL v3 for use all 128kB RAM by CRTC as VRAM
TYPICAL :) TV Funai 22FL532/10 with VGA-RGB-in.

McArti0

#4
ps3. Use A8 instead of A0

ps4. and Y7=CS

G2=A10
A =A11
B =A13
C =A14
G1=A15
CPC 6128, Whole 6128 and Only 6128, with .....
NewPAL v3 for use all 128kB RAM by CRTC as VRAM
TYPICAL :) TV Funai 22FL532/10 with VGA-RGB-in.

Wawavoun

#5
Thanks !

G2 is a OR between two inputs G2A and G2B. So A10 for G2A and for G2B ?

No need to use A9 and A12 ?

If I put A12 to G2B then this give 4 bytes that will activate CS : $E8 --> $EB. $E8 or $EA for data and $E9 or $EB for command...
What will be then IN / OUT instructions for read/write into the fpu ?

Philippe
If you think adventure is dangerous try routine, you'll see it's deadly!

McArti0

#6
We don't need this OR. We join them.

What will happen if we send the command IN A,(C) ;where B=0 ?

All devices in the CPC will turn on and respond by sending a byte!

If we use only A10, A8 without LS138 our i8231 resending byte too.

without LS138 ,  IN A,(C) ;where B=0 is dangerous.

instr Z80 IN reg, (C)    really means  IN reg, (BC)

instr Z80 OUT (C),reg    really means  OUT (BC), reg ;our A15-A8 we write to reg B   LD B, adr

ps. A12 is only for Printer port. He is write only.
CPC 6128, Whole 6128 and Only 6128, with .....
NewPAL v3 for use all 128kB RAM by CRTC as VRAM
TYPICAL :) TV Funai 22FL532/10 with VGA-RGB-in.

McArti0

CPC 6128, Whole 6128 and Only 6128, with .....
NewPAL v3 for use all 128kB RAM by CRTC as VRAM
TYPICAL :) TV Funai 22FL532/10 with VGA-RGB-in.

Wawavoun

#8
Okay, I start to understand... I think.

Let me try :

Using Y7 as cs means

A15    G1      1
A14    C        1
A13    B        1
A12    -         x (assume 1)
A11    A        1
A10   G2       0
A9      -         x (assume 1)
A8      C/D    0 for data - 1 for command
A7 --> A0 not involved (assume 1)

So if I have understand I should IN or OUT to address $FAFF and $FBFF. Right ?

For example IN A,(BC) with B=$FA and C=$FF ?
If you think adventure is dangerous try routine, you'll see it's deadly!

McArti0

A7 not involved

BUT in assembler you writing IN A,(C) and OUT (C),A  ; without B , in CPC , C is arbitrary.
CPC 6128, Whole 6128 and Only 6128, with .....
NewPAL v3 for use all 128kB RAM by CRTC as VRAM
TYPICAL :) TV Funai 22FL532/10 with VGA-RGB-in.

Wawavoun

Yes IN A,(C) I have understand that.

But is my address calculation right ?
If you think adventure is dangerous try routine, you'll see it's deadly!

McArti0

YES!  :D

now you can change ADR simple and fast INC B; DEC B
CPC 6128, Whole 6128 and Only 6128, with .....
NewPAL v3 for use all 128kB RAM by CRTC as VRAM
TYPICAL :) TV Funai 22FL532/10 with VGA-RGB-in.

Wawavoun

Great thanks !!!

I will keep the forum informed about the progress on this board.

Philippe
If you think adventure is dangerous try routine, you'll see it's deadly!

Rabs

Quote from: Wawavoun on 19:03, 25 April 23A7 --> A0 not involved (assume 1)


Hi, I am currently building some PIO, CTC and DART boards and did not realise that A7 low is used to select the disk controller. A6 and A5 also appear to be reserved but not sure why.

Available adresss ranges for expansion cards according to one book I have read, The Ins Aand Outs of the Amstrad, are;

F8E0 — F8FE
F9E0 — F9FF
FAE0 — FAFF
FBE0 — FBFF

See also https://www.cpcwiki.eu/index.php/I/O_Port_Summary

pelrun

You'll want to look at https://www.cpcwiki.eu/index.php/Default_I/O_Port_Summary - a serial adapter on A5 has native firmware support used by CP/M. A6 isn't used by internal hardware at all, only third party devices.

McArti0

#15
OMG !!! very bad news !!!

   
#FA7E%xxxxx0x0 0xxxxxxxFloppy Motor Control (for 765 FDC)-Write
#FB7E%xxxxx0x1 0xxxxxx0765 FDC (internal) Status RegisterRead-
#FB7F%xxxxx0x1 0xxxxxx1765 FDC (internal) Data RegisterReadWrite

on 6128, F8-F9, FA-FB have conflict with Internal Flopy !!!

I have to apologize to line A7.     B input LS138 connect to A7 ( in 6128 is more important than A13)
CPC 6128, Whole 6128 and Only 6128, with .....
NewPAL v3 for use all 128kB RAM by CRTC as VRAM
TYPICAL :) TV Funai 22FL532/10 with VGA-RGB-in.

Wawavoun

Hi,

These addresses need A7 to 0.
If I keep A0 --> A7 to 1 these addresses will not be selected ?
If you think adventure is dangerous try routine, you'll see it's deadly!

McArti0

We must NOT selected 8231 when Firmware of floppy use floppy device

we need test A7 and when it's 0 don't use 8231.
CPC 6128, Whole 6128 and Only 6128, with .....
NewPAL v3 for use all 128kB RAM by CRTC as VRAM
TYPICAL :) TV Funai 22FL532/10 with VGA-RGB-in.

Wawavoun

Yes. Now I understand why.

I will use G2A and G2B (may be with the help of a LS04 if needed) to do that.
If you think adventure is dangerous try routine, you'll see it's deadly!

McArti0

 B input LS138 connect to A7 ( in 6128 is more important than A13)
CPC 6128, Whole 6128 and Only 6128, with .....
NewPAL v3 for use all 128kB RAM by CRTC as VRAM
TYPICAL :) TV Funai 22FL532/10 with VGA-RGB-in.

Rabs

I can share with you later the schematics for my small boards, which have full strict address selection, while allowing the adress to be selectable via jumpers.

Initially I did not consider A7 and started to see &80 on an IN instruction which is a bit of a giveaway because this is the status from the disk controller.

I now use F8E0 or F8F0 with A0 and A1 selecting the device registers. The jumpers also allow F9XX, FAXX or FBXX ranges to be selected.

Currently waiting on fixed boards from the PCB manufacturer, so hopefully they work.

You cannot view this attachment.

Rabs

So just bear in mind, I am new to this and these are my first boards, so quite happy for someone to suggest a better approach.

This is what I have assumed, taken from "The Ins and Outs of the Amstrad" book.

A15 low is the Gate Array
A14 low is the CRT
A13 low is the Expansion ROM
A12 low is the printer
A11 low is the PPI
A10 low is the expansion bus*
A7  low is the disk controller
A6  low is a reserved function
A5  low is a communication channel

F8FF also has special meaning, calling all expansion devices to reset.

So the addresses available are;
F8E0 - F8FE
F9E0 - F9FF
FAE0 - FAFF
FBE0 - FBFF

I use a pair of 74138s and some logic gates to select the correct address. One 74138 for the high byte address and one for the low byte. There are probably better ways but I have a lot of 74138s. I also created a pair of excel sheets to model the outputs from the 74138s (you can have these if you want them).

I use the logic NAND gates to ensure that A15-A12 are high and connect this to G2A and G2B on one of 74138s. I then connect A11 to G1, so A15-A11 must be high. I then use the outputs from the 74138 where A10 is low (F8 to FB).

I repeat a similar process with the with the low byte but only select those outputs from the 74128 where A7-A5 are high (selecting E0 or F0). I then combined the outputs from the two 74138s.

Hope this makes sense and hope in works? I should find out in a couple of weeks when the PCBs arrive, although limited testing on a prototype seems ok.

You cannot view this attachment.You cannot view this attachment.

You cannot view this attachment.

genesis8

Wawavoun, what use do you have in mind for a FPU ? Just curious.
____________
Amstrad news site at Genesis8 Amstrad Page

Wawavoun

#23
Hi,

When I was young I do a lot of scientific calculations with 8 bits computers.

It was just the the beginning of the 16 bits "workstations" and their price was incredible...

The slowness of 8 bits computers in floating point operations traumatized me and now I put math coprocessors everywhere : my Junior Computer has one, my Apple II also, now Amstrad CPC !

Regards.
Philippe 
If you think adventure is dangerous try routine, you'll see it's deadly!

Wawavoun

#24
At the end I will do that for address decoding.


You cannot view this attachment.


I can do everything with 7 components, no surprise !

When the dip switch programmed address (AB0 excluded)  come the LS00 ouput go low.

AB0 is reserved for switching between data and and control register so not is use in this part of the schematic.

Regards.
Philippe
If you think adventure is dangerous try routine, you'll see it's deadly!

Powered by SMFPacks Menu Editor Mod