Hardware - Expansion port etc.

Discuss the new Altair 8800 Micro

Hardware - Expansion port etc.

Postby hideki » Aug Thu 18, 2011 12:27 pm

Hihi

There appears to be no hardware questions section so I'm just posting this here.

How would I go about attaching a device to the expansion header, I know how to do address decoding and so on but what I don't understand is how this type of I/O works, for example if I put something on port $1F how would it be possible to design the electronics so INP reads the 8 inputs but accesses to RAM at the same address aren't affected?

I have a rough idea of how memory mapped I/O works but as this isn't it, I'm at a bit of a loss (want to design a joystick/basic audio board that can be plugged into that connector, loosely based on the Kempston spectrum interface and something simple and PIC based for basic monophonic audio that won't stop the CPU, ideally I'd like to use the same port for both, so writes to 31 are audio commands, reads from it are 7 bits of joystick data (enabling the use of the cheap megadrive/genesis pads DX have) and perhaps 1 bit of audio playing flag), I'd probably add a MAX232/233 too so real serial devices could be used but that's easy enough (yes, I'm aware that would remove the ability to load from SD).

Any help/pointers would be appreciated, I know most of what I'm doing so small words etc. aren't needed :>

Thanks ^^
Adam <hideki.adam AT gmail.com> http://www.adamcolley.co.uk
hideki
 
Posts: 20
Joined: Aug Wed 17, 2011 5:27 pm

Re: Hardware - Expansion port etc.

Postby jsissom » Aug Thu 18, 2011 3:42 pm

http://www.8085projects.info/page/8085- ... iques.aspx

This page has information on interfacing I/O to the bus. It should get you started. The 8085 bus is very similar to the 8080 bus. These signals should all be on the IO connector.
jsissom
 
Posts: 66
Joined: May Tue 04, 2010 10:52 pm

Re: Hardware - Expansion port etc.

Postby garryj » Aug Thu 18, 2011 4:51 pm

hideki wrote:Hihi
How would I go about attaching a device to the expansion header, I know how to do address decoding and so on but what I don't understand is how this type of I/O works, for example if I put something on port $1F how would it be possible to design the electronics so INP reads the 8 inputs but accesses to RAM at the same address aren't affected?

The short answer is that the current CPU firmware can't do I/O to external devices. The emulated 8080 IN and OUT instructions are mapped only to its internal devices -- the "Sense" switches (A15..A8) at port 255 decimal (IN only), and the built-in terminal serial interface -- port 16 (IN only) for Rx/Tx ready status (bit1 set if Tx buffer ready for character, bit0 set if Rx buffer has character waiting), and port 17 (IN/OUT) for Rx/Tx data.

In the next firmware update, the emulated 8080 IN/OUT instructions will be able to address external devices, but since the ATMega 8515 MCU does not have enough I/O pins to duplicate all of the 8080 CPU signals, there are quite a few caveats. Among the missing 8080 CPU signals are WAIT (output) and READY (input), so there is no direct way for external devices to know when the CPU is waiting for data, or to signal when they have data available -- i.e. you can't simply build an interface to 8080 specs and have it work :(.

But the general idea is this:
When an 8080 IN/OUT instruction is executed, the port# is placed on the address bus (port# to low-order byte and duplicated in the high-order byte), and at the same time the expansion bus I/O signal (pin# 15) will be asserted (active high). If it is an OUT instruction, the contents of the accumulator will be placed on the data bus, and the expansion bus /RW signal (pin# 10) will be asserted (active low). You then have an ~18-20us window to read and process the data bus byte. If it's an IN instruction, you have the same ~18-20us window to "jam" one data byte to the data bus before the data bus contents are read into the accumulator. The choice of a 20us window is somewhat arbitrary -- it's pretty much based on what it took to implement reliable I/O for the upcoming Memory/RAMDisk expansion's disk controller interface...

So it will be up to your device hardware to decode whatever port# you want to use (the RAMDisk controller interface emulates the Altair 88-DCDD controller, so it uses ports 8, 9 and 10 (decimal)) and to have its IN/OUT data written/read to the CPU data bus within the allotted time window. If you can design an interface that meets this criteria, it should work just fine, but that 20us window limits it pretty much to slow speed devices -- without WAIT and READY signals available, IMO options to make I/O any faster, and still keep it "generic", are rather limited.

Getting 8080 interrupts functional is an even tougher nut to crack, and again it's because the lack of 8080 CPU signals makes designing the external circuitry really problematic -- much more so than IN/OUT. Designing interrupt-based interfaces for the original 8080 was enough of a bear that Intel created support ICs that were specific to the task.
garryj
----------
garryj
 
Posts: 147
Joined: Aug Sun 15, 2010 12:26 pm

Re: Hardware - Expansion port etc.

Postby hideki » Aug Fri 19, 2011 8:56 pm

Hrm, see my reply here last night disappeared into the void that is a 500 error (oddly the one in the other thread made it)

It's a bit unfortunate that it's not doable yet but I'm sure I can wait until the new firmware appears, even with the limitations you describe it should be very useful (although the 20us window is a bit concerning)

Port decoding, realise that, looked at the pinout again and see the pins for the signals you mention, thanks, makes a bit more sense now as to how it has two independent address spaces on the one bus...

The interrupt issue isn't really one as I was planning on just polling anyway -.o;

Kempston joystick should be easy enough even with those limitations since it'll just set/clear the bits depending on the position so when it's read it'll be fine, wouldn't need to use one at all but the keyboard reading is seriously limited (INPUT), even if I were able (in assembly or by accessing the channel directly) to read the keyboard, the terminal based nature of it would present other problems for games (although it'd probably be fine for non-game apps)

Given the limitations you mention, audio might be more of an issue, the audio playing bit would be fine as like the joystick it'd be set or clear when it's read as needed, actually getting commands to the chip for the audio is going to be troublesome if the value output is set only for 20us though, I have no idea if a PIC is even fast enough for that -.-, would quite like an SP0256-AL2 as well as the monophonic audio (perhaps as an option) for speech old school style :> but I have no idea if it'll be possible to read the data fast enough, some damn tight assembly might be required, lol

One other minor issue is the serial, will there be a way to disconnect the on board serial once the system is running so it'd be possible to for example load basic from SD then switch control to the TTL lines on the expansion header, to use a real terminal for example? (not that I have any left, I had like 6 DEC VT102s and they were lost in a move -.-)

At least the caveats make things tricky but not impossible, should be doable given I'll be designing for the micro rather than the original Altair...

Anything I do produce will be in the form of an open design anyway, not being John Kortink I have no intention of actually selling things at a profit, lol, but making an interface or few for this machine will be a good starting point before designing a computer from scratch (as I intend to one day -.o;), while I've been programming for many years (started doing Basic and Z80 on a 1K ZX81), the electronics is somewhat more recent.

Thanks for your help! much appreciated :)
Adam <hideki.adam AT gmail.com> http://www.adamcolley.co.uk
hideki
 
Posts: 20
Joined: Aug Wed 17, 2011 5:27 pm

Re: Hardware - Expansion port etc.

Postby galaga » Aug Fri 19, 2011 9:01 pm

cool garryj
i just looked up the mos sid chip and 20us is the right speed :) so most 80's chip should run fine :)
http://www.waitingforfriday.com/index.p ... _Datasheet

as for irq, my idea for the 8515 to emulate the irq was
before it looks at the next op code
test bit pin 12
if 1 then goto :irq
else read next op code

i hope it makes cents
User avatar
galaga
 
Posts: 62
Joined: Feb Fri 18, 2011 8:29 pm

Re: Hardware - Expansion port etc.

Postby garryj » Aug Fri 19, 2011 11:36 pm

galaga wrote:as for irq, my idea for the 8515 to emulate the irq was
before it looks at the next op code
test bit pin 12
if 1 then goto :irq
else read next op code

i hope it makes cents

Yep, it makes sense, but the emulation side is the easy part :wink:. The sticky part is trying to come up with a straight forward way to generate an external interrupt acknowledge signal so the interrupting device knows when to jam the interrupt instruction onto the data bus. And if there is more than one device generating interrupts, how do you figure out which one pulled the trigger? On the real 8080, your circuitry had to read the CPU "status word" (the Status LEDs of the front panel) that briefly appears on the data bus at the start of (most) every machine cycle, and latch the bits that were important to you -- in this case, INTA. Problem #1 is that this circuitry doesn't exist on the Altair Micro main board. Problem #2 is that, for speed reasons, the status word is never put onto the data bus when the CPU is in RUN mode.

So in the end, it's a bit of a double whammy :(.
garryj
----------
garryj
 
Posts: 147
Joined: Aug Sun 15, 2010 12:26 pm

Re: Hardware - Expansion port etc.

Postby garryj » Aug Fri 19, 2011 11:54 pm

hideki wrote:One other minor issue is the serial, will there be a way to disconnect the on board serial once the system is running so it'd be possible to for example load basic from SD then switch control to the TTL lines on the expansion header, to use a real terminal for example? (not that I have any left, I had like 6 DEC VT102s and they were lost in a move -.-)

This is already implemented. Ctrl-F7 will toggle off/on the integrated serial port. Care has to be taken as on RESET the serial port has to start up again so it knows when the CPU wakes up, so you want to be sure to disconnect before RESET. Search posts made by "wd5gnr" and you should find some info on that.
garryj
----------
garryj
 
Posts: 147
Joined: Aug Sun 15, 2010 12:26 pm

Re: Hardware - Expansion port etc.

Postby galaga » Aug Thu 25, 2011 4:29 am

thanks garryj
I have been looking around for info to explain this irq thing..
I'm looking at the space invaders (it has a 60hz irq) coming from a 6502 camp its a lot to learn :roll:
i see how the space invaders work it, using 74ls153 to load some data on the bus.. not easy :shock:
but i think we can get the INTE off the led (u10 pin12) but as you say theres more to it :(
could the CP/M 8515 emu the irq's??? or is it geting to much?
thanks matt
User avatar
galaga
 
Posts: 62
Joined: Feb Fri 18, 2011 8:29 pm

Re: Hardware - Expansion port etc.

Postby galaga » Oct Sun 23, 2011 6:00 pm

has any one with (5.1) tried to hook up a i8255 etc and blink some leds??
User avatar
galaga
 
Posts: 62
Joined: Feb Fri 18, 2011 8:29 pm

Re: Hardware - Expansion port etc.

Postby garryj » Oct Sun 23, 2011 9:59 pm

galaga wrote:has any one with (5.1) tried to hook up a i8255 etc and blink some leds??

In the mid '80s I bought the General Instrument SP0256-AL2 speech synthesizer and the companion CTS256A-AL2 processing chip from Radio Shack. Never did get around to using them then, but dug them out while working on the (soon to be) 5.1 firmware:

Image

Here's a link to a folder that has an MP3 file sample of the output:
https://skydrive.live.com/redir.aspx?ci ... 10008A!151

The speech has phrases uttered by two of my favorite sci-fi film computers. It's on the slow side because the input buffer of the SP0256 is really small and I was getting data overruns. I used the parallel interface with a single OUT port. Tried to get it to work with an external RAM buffer, but didn't have any luck (it's the un-wired chip at the bottom left on the breadboard). The documentation implied in one section that external RAM worked with the parallel interface, but in another section it read like it was an option only when the serial interface was used :?
garryj
----------
garryj
 
Posts: 147
Joined: Aug Sun 15, 2010 12:26 pm

Re: Hardware - Expansion port etc.

Postby galaga » Oct Mon 24, 2011 5:36 pm

"Legen — wait for it......Dary!"! i'm hopeing to put a SC-01A in

ok cool but i need to know if irq is going to be supported (one day). Cos i'm in two mind's about get the C/PM upgrade i need to know if it will do all my needs..

but wow that is so cool.. "would you like to play a game" is my favorite
User avatar
galaga
 
Posts: 62
Joined: Feb Fri 18, 2011 8:29 pm

Re: Hardware - Expansion port etc.

Postby hal2710 » Oct Tue 25, 2011 11:03 am

@galaga "How about a nice game of Chess ?"

This would be so cool, I would love it if I could get it to "Speak"

"I'm afraid I can't let you do that.....Mick"

LOL
User avatar
hal2710
 
Posts: 50
Joined: Jun Mon 14, 2010 12:54 pm
Location: Liverpool, UK

Re: Hardware - Expansion port etc.

Postby galaga » Nov Wed 02, 2011 5:45 pm

was at http://www.s100computers.com/
time to think of an IO card..

i was thinking
sound ay-3-8910 1 or 2?? will give some IO as well
uart 16550 or 6850/1??
for me a sid mos6581or 8580 best sound chip ever
some voice chip (SC-01A Speech Synthesizer) or (SP0256-AL2 ) or jetspeak.
maybe a Intel 8259 (will need to talk to garryj about it first)
anyone have a request!!

thanks all
matt
User avatar
galaga
 
Posts: 62
Joined: Feb Fri 18, 2011 8:29 pm

Re: Hardware - Expansion port etc.

Postby hal2710 » Nov Thu 03, 2011 4:28 am

I have been really interested in this thread.

Maybe Vince has already done some ground work for use with his Multi I/O board for the Replica 1

To quote Vince :-

"The multi I/O board is an all-in-one solution that gives the user 2 8 bit bi-directional ports with 4 handshaking lines, a true RS232 serial port with speeds up to 19,200 BAUD, and a 8K EEPROM programmer to store data or programs. There is a socket to add your own speakjet voice chip that works in conjunction with the serial port to make your replica 1 or apple 1 speak! The speakjet is not included but can be purchased here.(http://www.speechchips.com/shop/)"

I know this is for the Replica 1, but it is a neat solution and shows that it CAN be done.

HTH Mick
User avatar
hal2710
 
Posts: 50
Joined: Jun Mon 14, 2010 12:54 pm
Location: Liverpool, UK

Re: Hardware - Expansion port etc.

Postby galaga » Dec Wed 07, 2011 5:18 am

so ppl is there a wish list of chips for an i/o card????

i found some ay-3-8910's

http://www.bigdaddy-enterprises.com/ele ... /e_ics.htm
http://www.arcadechips.com/index.php?cPath=27_22

still not sure 16c550 or 6850 or 6551
User avatar
galaga
 
Posts: 62
Joined: Feb Fri 18, 2011 8:29 pm

Next

Return to Altair 8800 Micro

Who is online

Users browsing this forum: No registered users and 3 guests

cron