[MZ-80 K] Serial interface through I/O ports $F8-$FF

Post Reply
dat-alex
Posts: 4
Joined: Tue Dec 04, 2018 7:18 am

[MZ-80 K] Serial interface through I/O ports $F8-$FF

Post by dat-alex » Tue Dec 04, 2018 12:01 pm

Hi to all you out there!

I have a question about MZ I/O address range:

I want to experiment with a DIY serial interface using 167c550 for MZ80K.
I have examined carefully the MZ80k service manual and designed the folloing schematic :
schema.jpg

ΝΟΤΕ: this circuit HAS NOT been tested yet!

My question is I want to use IORQ pin of the expansion . What is the IORW address range I can use in MZ80K memory map?
As I have already connected A0-A7 the range will be $F8-$FF. Is it accessible or not?

Thank you in advance as I could not find a specific memory map for the MZ80K.
(* I want the interface to be accessed via basic)

Alex

hlide
Posts: 209
Joined: Thu Jan 25, 2018 9:31 pm

Re: [MZ-80 K] Serial interface through I/O ports $F8-$FF

Post by hlide » Tue Dec 04, 2018 3:51 pm

I move this post into its own topic because the one where it was posted was about I/O memory port through /MREQ.

And I think this post can legitimately have its own topic.

hlide
Posts: 209
Joined: Thu Jan 25, 2018 9:31 pm

Re: [MZ-80 K] Serial interface through I/O ports $F8-$FF

Post by hlide » Tue Dec 04, 2018 4:03 pm

from

Code: Select all

	// i/o bus
#if defined(SUPPORT_MZ80AIF)
	io->set_iomap_range_rw(0xd8, 0xdb, fdc);
	io->set_iomap_range_w(0xdc, 0xdd, mz80aif);
#elif defined(SUPPORT_MZ80FIO)
	io->set_iomap_range_rw(0xf8, 0xfb, mz80fio);
#endif
	io->set_iomap_range_rw(0xfe, 0xff, printer);
We can see $F8-$FF are used for floppy disk drives and a printer.

There is a Japanese page which shows a lot of I/O port mapping for existing expansions, but it may take some time to retrieve it.

hlide
Posts: 209
Joined: Thu Jan 25, 2018 9:31 pm

Re: [MZ-80 K] Serial interface through I/O ports $F8-$FF

Post by hlide » Tue Dec 04, 2018 4:14 pm

If your DIY project only concerns the MZ-80K, everything below 0xF8 should be safe.

EDIT: I believe MZ-80AIF is for MZ-80 A and MZ-80FIO for MZ-80 K.

dat-alex
Posts: 4
Joined: Tue Dec 04, 2018 7:18 am

Re: [MZ-80 K] Serial interface through I/O ports $F8-$FF

Post by dat-alex » Wed Dec 05, 2018 6:43 am

Thank you hlide for your quick response.

A detailed i/o map usage and memory map would be usefull . I have not find a complete list yet.

About my experiment: I understand that you can only access IORQ trough IN & OUT commands only not with POKE & PEEK.
As I would also prefer to access serial interface via simple basic loaded from external eprom -also- maybe I will try mapping via MREQ so I can access
the interface through upper memory FE00 - FFFF where there is no interface , memory , etc !

hlide
Posts: 209
Joined: Thu Jan 25, 2018 9:31 pm

Re: [MZ-80 K] Serial interface through I/O ports $F8-$FF

Post by hlide » Wed Dec 05, 2018 10:11 am

Beware! $F000-$FFFF are used for ROM like floppy disk drives.

On MZ-80 K, $Ex00-$Ex27 is the I/O memory mapping, so you can get an unused /CSEy signal where its address range is [$Ex00 + y*4, $Ex03 + y*4]. 'x' means whatever the hexadecimal digit in place, you'll get a mirror of $E000-$E027.

Since you need to access 8 registers, you'll need two /CSEx. Let us say you use /CSE8 ($E020) and /CS9 ($E024). So you will get $E020-$E027.

However, if you keep your IC3A as such, it will turn the address range for your device into $E0F8-$E0FF, which is outside.

That's an issue indeed. On the other end, having /CSE on IC47 #16 should be enough.

Connect /CSE (IC47 #16) instead of /IORQ to CS2~ (IC2 #14). An active /CSE already includes an active/MREQ.

Your IC3A output connected to CS1 (IC2 #13) and A7 connected to CS0 (IC2 #12) will constrain the address range to $E0F8-$E0FF which sounds perfect for me.

The schematic comes from here: http://www43.tok2.com/home/cmpslv/Mz80k/EnrMzk.htm.
sch1.png
sch1.png (25.69 KiB) Viewed 530 times
Notes:
- Z80 RESET is active on low level! So be sure IC2 wants a /RESET and not RESET!
- If you can grab the /CSE which isn't accessible through the extension bus, the rest is a piece of cake.

hlide
Posts: 209
Joined: Thu Jan 25, 2018 9:31 pm

Re: [MZ-80 K] Serial interface through I/O ports $F8-$FF

Post by hlide » Wed Dec 05, 2018 10:50 am

Revised my last post as I made a big mistake in the way to handle /CSEx. In the end, using /CSE should be enough.

dat-alex
Posts: 4
Joined: Tue Dec 04, 2018 7:18 am

Re: [MZ-80 K] Serial interface through I/O ports $F8-$FF

Post by dat-alex » Wed Dec 05, 2018 12:34 pm

I had been informed about this decoding scheme but with your clear explanation I finally understand it. Thank you.

But , as I want to use only expansion port without the need of soldering inside I can use the MREQ with the following address decoding acording the new schematic below:
mz-serial_MREQ.jpg
Beware! $F000-$FFFF are used for ROM like floppy disk drives.
I know this ,but as I am not going to use a FD I think this sould be fine.
- Z80 RESET is active on low level! So be sure IC2 wants a /RESET and not RESET!
I think this is not a problem either as according to your (perfect) page link as you can notice expansion port is feeded with a logic high OUTPUT RESET signal , isn't it?
reset.jpg
reset.jpg (66.98 KiB) Viewed 517 times

hlide
Posts: 209
Joined: Thu Jan 25, 2018 9:31 pm

Re: [MZ-80 K] Serial interface through I/O ports $F8-$FF

Post by hlide » Wed Dec 05, 2018 1:46 pm

RESET: you're lucky! :) I didn't check it and wasn't sure because in numerous schematics or tables about SHARP MZ you can read some signals named without negative marks while they are active negatively. So always double check as you did ;).

hlide
Posts: 209
Joined: Thu Jan 25, 2018 9:31 pm

Re: [MZ-80 K] Serial interface through I/O ports $F8-$FF

Post by hlide » Thu Dec 06, 2018 10:05 am

dat-alex wrote:
Wed Dec 05, 2018 12:34 pm
Beware! $F000-$FFFF are used for ROM like floppy disk drives.
I know this ,but as I am not going to use a FD I think this sould be fine.
it seems you are lucky:

Code: Select all

	IPL.ROM		$0000-$0FFF
	FDIF.ROM	$F000-$F3FF (MZ-80FIO Boot ROM)

Post Reply