PDA

View Full Version : ZX Spectrum+2: Free IO address or bust



Christoffer
March 26th, 2015, 01:14 PM
Hey! Thought I'd do a small hardware project for my ZX spectrum+2 by making a parallel IO interface. Really rudimentary; databus to a tri-state buffer and a 8 bit latch,
write to latch read from buffer etc. to connect to some switches and led's, that could be accessed by the IN/OUT basic commands. just as proof of concept.

I found a design achieving exactly that, by only decoding one address line. This ofcourse isn't very efficient, and furthermore: Looking through various documentation,
I can't seem to locate any free I/O addresses. Anyone here who've messed with this before? what addresses would be good, and should I go for the full 16 bit address decoding?

Thanks!

--Christoffer

DaveH
March 27th, 2015, 04:09 PM
Hey! Thought I'd do a small hardware project for my ZX spectrum+2 by making a parallel IO interface. Really rudimentary; databus to a tri-state buffer and a 8 bit latch,
write to latch read from buffer etc. to connect to some switches and led's, that could be accessed by the IN/OUT basic commands. just as proof of concept.

I found a design achieving exactly that, by only decoding one address line. This ofcourse isn't very efficient, and furthermore: Looking through various documentation,
I can't seem to locate any free I/O addresses. Anyone here who've messed with this before? what addresses would be good, and should I go for the full 16 bit address decoding?

Thanks!

--Christoffer

Hi, yes there must be IO space as I did a home brew serial port, ADC and DAC sometime in the 80's . As you say the IO space on the Z80 is 16 bits wide so even with spectrum only doing a partial decode on what it uses there had got to be still a lot available, I will see if I can find my notes from the time.
Cheers
DaveH

DaveH
March 27th, 2015, 07:31 PM
Hi, I found the box with all my specy bits in it and some notes, I was using 001F, 011F, 0217, 031F, 003F AND 013F, this looked a bit odd and more digging turned up the "Spectrum Hardware Manual" , I was correct, the specy does a VERY simple decode, uses A0 thu A5 internally with no actual decode, A0=ULA, A1=printer, A2 aparently not used , A3+4 for microdrives and A5 for the Rs232. All are active low.
I did my decode using A 74139, feeding it with IORQ bar, A5 and A6, this gave me the CS bar for the two chips I was using , a motoralo 6822 PIA and an ACIA. I also used A8,9,10 and 11 into the PIA.
So if you stay above xx1F you should be ok, but make sure the lower 5 address lines are ALLWAYS high or at least A0 and 1 or you will select the ULA or the printer and its gonna crash.
The hardware manual may be useful to you, Amazon uk has it at a SILLY price but you may find a down load somewhere. Iv not had the Specy powered up for years. It was my second computer, the first being a ZX81, the specy got "retired" when I built my 6809 system, the one Im bring back to life at the moment, see my thread in this forum.

Good luck and have fun
DaveH

PS Just noticed that you are using the Spectrum +2, mine was an original Spectrum so there may be differences but hope this will help anyway

Christoffer
March 28th, 2015, 09:05 AM
Thanks a LOT, I'll need to try that! I think the only real difference between the original ZX spectrum and the +2 is the 128K ram, and probably a bigger ROM. IO addressing should be similar. I'll post back here if i get it working, for future reference

--Christoffer

JohnElliott
March 31st, 2015, 12:57 PM
The 128k Spectrums use A2 for the 128k peripherals -- memory paging (7FFD), the sound chip (FFFD / BFFD) and (on the +3) more memory paging (1FFD), the floppy controller (2FFD / 3FFD) and Centronics port (0FFD).