Re: Adding ports via slotexander
On Thursday 07 June 2001 13:07, you wrote: Cool... And if so, I assume it must also be possible to use all address lines for I/O ports higher than 0xff? Yes, but you will get conflicts because all programs (including bios/basic etc) made up until now assumed that the hardware would only use the lower 8-bits and the value of the heighest 8-bits isn't used, so the programmers just ignored whatever value that could be in register B. This would mean that your 16-bit i/o address could be trigerred by accident. You have to consider the highest bit as containing random values. Ah, this topic was ages ago, but ah, I'll just reply to it. The value of register B is (when using outs and ins with register c, like out (c),r and inir) indeed output to address lines A8-A15, and it's still definately usable. Example: If you need 256 I/O spaces for some hardware you can reserve one I/O port (that is the lower 8 bits), and then check the value of the MSB (actually this is the Least Significant Byte instead of Most, but whatever). No conflicts there as only software taking the higher 8 bits into consideration will write to that port. So you can get 256 I/O addresses at the cost of only one. The VDP, PSG, MoonSound or lots of other hardware could definately have used it, no more seperate writes to specify the register number first, and then the value. Damn, why didn't they do that? Would have been s easy! (you know what, they should indeed have named the instructions out (bc),r!!! that would have solved it immediately). Ofcourse in this case memory-mapped I/O is also a good alternative since it is much faster and easier to use and also more complex operations can be performed on it (ldir and such). At the other hand, memory mapped I/O involves bankswitching, which is a downside. When using 16-bit I/O ports the number of usable instructions is a bit reduced, or at least different. Only out (c),r and in r,(c) can be used for all i/o. Otir and inir and such are actually also quite useful, they become some kind of ldir, instead of in/outputting to the same i/o port all the time they increment the MSB (which should be considered LSB) i/o address, which is imho absolutely not a bad thing, as long as the hardware is designed for it. Aha! Now OTDR en INDR appear to have a use after all (if you want to fill the upper 40 (msb-)ports...)!!! The instructions out (n),a and in a,(n) become a but unusable though... I don't know if the lower 8 bits are mirrored in the higher 8 bits, or if the higher 8 bits are simply zeroed (Zaks doesn't say anything about that), in case of the latter there might still be some use for it, if you give the i/o port with #00 as the MSB (which is actually rather a LSB :)) a more important function. And those can ofcourse still be used for 8-bit I/O ports. Alas, my story. Hope it is a bit understandable (it's late). ~Grauw -- For info, see http://www.stack.nl/~wynke/MSX/listinfo.html
Re: Adding ports via slotexander
On Thu, Jun 07, 2001 at 08:16:10AM +0200, M. J. Bethlehem wrote: The Z80 has 65536 I/O addresses, not 256. But just like its bigger cousins, the x86 series from Intel, they are not directly accesible. If I'm not mistaken you have to use the BC register to access ports above 0xff (of course you can also use it for the first 256 ports, but what use would that be if there's a smaller and faster opcode for that?). Thus, it would seem like this: LD BC, 0x1234 LD A, 0x56 OUT [BC], A For I/O ports, the address bus is used. However in the standard way the Z80 is used (like in the MSX) only the lower 8 bits of the address bus is used. In reality, when the Z80 executes an OUT (C),A the entire BC register is put on the address bus. With a different hardware design than the MSX (dunno much about hardware, correct me if I'm wrong) the full 16 bit could be used, like happens in the Spectrum. In some situations it could be advantagous. Suppose you use the high 8 bit for an keyboard row (I think this is what happens on the spectrum), then you could do something like: LD BC,0AA9h LD HL,SCANLINES INIR In one go, 10 scanlines are read. Note that the lower 8 bit is still used for the port, but the higher 8 bit are used for the keyboard row. And B is decreased every iteration of INIR. I hope that clears things up, Sean -- For info, see http://www.stack.nl/~wynke/MSX/listinfo.html
RE: Adding ports via slotexander
Oh, that is relatively easy. You need address A0-A7 decoding (with chips like 74LS138 or 688)combined with RD, WR, IOREQ, MIetc. to select a i/o address range and feed that select signal in the cip (like vdp) select input (which will put the databus of the chip from tristate to active when in read). And if the chip has more addresses then you need the A0-An feeded to the chip also. And the databus of the chip connected to the slot databus. Avoid dataline buffers,most of the time they will introduce nasty delays. And feedback to busdirif you do a read!
RE: Adding ports via slotexander
Cool... And if so, I assume it must also be possible to use all address lines for I/O ports higher than 0xff? -- For info, see http://www.stack.nl/~wynke/MSX/listinfo.html
Re: Adding ports via slotexander
On Thursday 07 June 2001 13:07, you wrote: Cool... And if so, I assume it must also be possible to use all address lines for I/O ports higher than 0xff? Yes, but you will get conflicts because all programs (including bios/basic etc) made up until now assumed that the hardware would only use the lower 8-bits and the value of the heighest 8-bits isn't used, so the programmers just ignored whatever value that could be in register B. This would mean that your 16-bit i/o address could be trigerred by accident. You have to consider the highest bit as containing random values. David Heremans -- This mail was predicted by the Nice and Accurate Prophecies of Agnes Nutter. [Terry Pratchett and Neil Gaiman, Good Omens] -- For info, see http://www.stack.nl/~wynke/MSX/listinfo.html
RE: Adding ports via slotexander
At 13:05 7-6-01 +0200, you wrote: Oh, that is relatively easy. You need address A0-A7 decoding (with chips like 74LS138 or 688) combined with RD, WR, IOREQ, MI etc. to select a i/o address range and feed that select signal in the cip (like vdp) select input (which will put the databus of the chip from tristate to active when in read). And if the chip has more addresses then you need the A0-An feeded to the chip also. And the databus of the chip connected to the slot databus. Avoid dataline buffers, most of the time they will introduce nasty delays. And feedback to busdir if you do a read! Are you going to work on a new mass-produceable project here? There could be some kind of market here, though I think little hardware producers will actually us it. GreeTz, BiFi Visit my Home Page at www.bifi.msxnet.org mail me at: [EMAIL PROTECTED] FTP: ftp.bifi.msxnet.org ICQ #36126979 -- For info, see http://www.stack.nl/~wynke/MSX/listinfo.html
RE: Adding ports via slotexander
I am working on two projects, but do not have massmarket plans! The first is an extension of the Epifiet interface as published in MCCM (for those who do not know the article: it is a cartridge with LS chips on which you connect the printer output of another msx and start a oneway communication, the extension is adding a printer port so that it becomes a twoway 8 bit datapath. The second project is a general purpose i/o board catridge, with the wellknown 8255 (there is one in every msx, although integrated in the MSX2s in the msx engines). The board will have 24 i/o lines on a 50 pens connector. The projects are now in the soldering phase, no printed circuit but hardwired on exp board. As with most hobby projects: big steps and then long times of inactivity... Are you going to work on a new mass-produceable project here? There could be some kind of market here, though I think little hardware producers will actually us it. -- For info, see http://www.stack.nl/~wynke/MSX/listinfo.html
Adding ports via slotexander
Hi How is additional port on the msx realized via the slotexpander. I think the brazilian msx vdp upgrade did this? Thanks JP
RE: Adding ports via slotexander
Hi, You have to explain what you mean with 'additional port'. A real slot expander expands a primary slot to max 4 expanded slots. In there memory can be switched to the z80 by the slot hardware. This is memory space, not i/o space as is used for i/o ports. These are limited to 256 in total whether a slot expander is used or not. All cartridges in any slot and internal devices are always 'i/o port active' at the same time. An example of a fake (not real) slotexpander is the Elektuur design which is nothing more than eight parallel wired slot connectors of which only one at a time is made active with the slot select signal. Handy to avoid replacing cartridges (and to avoid a cartridge from starting at boot time by making that slot inactive, grab ROMS!). By the way: when building this Elektuur device: add the busdir signal and remove the databus buffers. Ofcourse it is possible to add a third slot connector by getting a connector in parallel with one of the existing slot connectors and replace the slot select signal with the appropiate slot select signal out of the computer, primary (MSX1) or secundary (MSX2, where internal slots are expanded most of the time. In theory: You can have two slots completely wired in parallel, insert a only ROM based cartridge in one and only i/o based in the other. But how are you sure it is pure ROM or i/o? Not recommended, the chance of having conflicts is big. -- For info, see http://www.stack.nl/~wynke/MSX/listinfo.html
Re: Adding ports via slotexander
Hi Say for example I want to add another vdp etc and access it via a port number in() out () how is this done in hardware. JPOn 6 Jun 2001 19:15:14 +0200, [EMAIL PROTECTED] (Hans Otten) wrote: Hi, You have to explain what you mean with 'additional port'. A real slot expander expands a primary slot to max 4 expanded slots. Inthere memory can be switched to the z80 by the slot hardware.This is memory space, not i/o space as is used for i/o ports. These arelimited to 256 in total whether a slot expander is used or not. Allcartridges in any slot and internal devices are always 'i/o port active' atthe same time. An example of a fake (not real) slotexpander is the Elektuur design which isnothing more than eight parallel wired slot connectors of which only one ata time is made active with the slot select signal. Handy to avoid replacingcartridges (and to avoid a cartridge from starting at boot time by makingthat slot inactive, grab ROMS!). By the way: when building this Elektuurdevice: add the busdir signal and remove the databus buffers. Ofcourse it is possible to add a third slot connector by getting a connectorin parallel with one of the existing slot connectors and replace the slotselect signal with the appropiate slot select signal out of the computer,primary (MSX1) or secundary (MSX2, where internal slots are expanded mostof the time. In theory: You can have two slots completely wired in parallel, insert aonly ROM based cartridge in one and only i/o based in the other. But how areyou sure it is pure ROM or i/o? Not recommended, the chance of havingconflicts is big.
RE: Adding ports via slotexander
The Z80 has 65536 I/O addresses, not 256. But just like its bigger cousins, the x86 series from Intel, they are not directly accesible. If I'm not mistaken you have to use the BC register to access ports above 0xff (of course you can also use it for the first 256 ports, but what use would that be if there's a smaller and faster opcode for that?). Thus, it would seem like this: LD BC, 0x1234 LD A, 0x56 OUT [BC], A Sorry, it's been some time since I did exensive Z80 programming so I may have slipped with the example there, but I think the general idea should be clear. Greetz, Martin 'Desert Mouse' Bethlehem. -- For info, see http://www.stack.nl/~wynke/MSX/listinfo.html