I need to connect my propeller to a data bus. How do I read the values?
cbmeeks
Posts: 634
Sorry, I know that sounds like a strange question.
BTW, the community has been great here. Now that I have sweetened the pot, I shall ask another question. :-)
So I am working on building a Mockingboard clone that will be an add-on card to an Apple IIe. I have built one on a breadboard using nothing but legacy parts (AY-3-8912 and 6522 VIA).
But after I found the wonderful SIDCog, AYCog and SNECog, I want to build one that uses nothing but new parts. Should bring new life into the Apple II scene if everyone can easily get modern sound cards. lol
Anyway, I need to develop a replacement for the 6522 VIA chip. The way it works is that it has an 8 bit data bus and I think 4-6 bits from the 16 bit address bus (not all pins are used).
Now, say the Apple (through some game) sends $FF to the data bus. This will of course send 5v high to 8 different pins that I plan on connecting to the propeller (through a level shifter).
But how do I determine that pins X1 - X8 should translate to 256? Or that pins X1 and X2 should be 3?
I'd like to do this in spin because I don't think something as simple as sending data to the 6522 needs asm. Sorry for being such a newbie. Surely there is an easy way to read in X number of pins?
Thanks
BTW, the community has been great here. Now that I have sweetened the pot, I shall ask another question. :-)
So I am working on building a Mockingboard clone that will be an add-on card to an Apple IIe. I have built one on a breadboard using nothing but legacy parts (AY-3-8912 and 6522 VIA).
But after I found the wonderful SIDCog, AYCog and SNECog, I want to build one that uses nothing but new parts. Should bring new life into the Apple II scene if everyone can easily get modern sound cards. lol
Anyway, I need to develop a replacement for the 6522 VIA chip. The way it works is that it has an 8 bit data bus and I think 4-6 bits from the 16 bit address bus (not all pins are used).
Now, say the Apple (through some game) sends $FF to the data bus. This will of course send 5v high to 8 different pins that I plan on connecting to the propeller (through a level shifter).
But how do I determine that pins X1 - X8 should translate to 256? Or that pins X1 and X2 should be 3?
I'd like to do this in spin because I don't think something as simple as sending data to the 6522 needs asm. Sorry for being such a newbie. Surely there is an easy way to read in X number of pins?
Thanks
Comments
Any 8 consecutive I/O pins could have been used.
In PASM, you'd need to shift the bits after capturing them (you have to capture all 32-bits in PASM). This is why it's common to start multiple pin data buses on pin 0 (you don't need to shift it).
-Phil
The first thing I need to do is simply grab a bunch of data from the address/data bus to see how the games use the card. So I should be able to use the console for that.
Are there any example programs out there that can show me how to do that? Basically, read in the bits and print to the console? IIRC, the Apple has a pin (IOSEL, I think) that basically goes low when the card is activated. After that, there is a 1Mhz (or so) clock that would probably be used to fire any reads/writes. I guess I could tie to that pin as my latch (or something similar).
Once latched, I would need to decode all 24 pins and send the data to the terminal.
Thanks for any examples.
A range of memory was decoded for the slots, which generated IOSEL when the IO range was used - I forget the size of the IO space, see if you can find a copy of the "Mapping the Apple ][" book, that was good as I recall.
I am not sure the prop can respond fast enough, waitpeq/pne take six clock cycles, then you have to decode the low address bits, and make a reply... at 100Mhz 500ns is 50 propeller clocks, so as long simple responses may be possible.
Then, when the Prop is good and ready with data on D0-D7, it can set RDY high.
-Phil