From: Ethan Dicks (ethan.dicks_at_gmail.com)
Date: 2007-05-22 23:03:01
On 5/22/07, Antitrack@networld.at <Antitrack@networld.at> wrote: > I still don't know how to "select", in my circuirty, what memory location my > cartridge ought to use. What if I want to build a cart that uses memory from > $deb6 to $deba? And how does the cart "know" when I poke something in these > memory locations to do something? After re-reading your query, let me try a less abstract example... With TTL... When the 6510 reads/writes any location between $DE00 and $DEFF, there's a line on the cartridge port (if I've remembered the port correctly), that is "asserted" or goes to 0V (you have to check the port assignment to see what logical True and logical False are, but commonly, with TTL, True is 0V). If you run just that signal to your chip, it will appear at any address between $DE00 and $DEFF. Since you want five specific addresses that's aren't on any even boundary (are you _sure_ you have 5 registers to read/write, not 4 or 8?), it'll be a bit tricky. Let's try $DEB0 to $DEBF to put things cleanly on a powers-of-two boundary. To decode $xxB0 to $xxBF, what you are saying is that you will be hooking A0 through A3 to your peripherals, giving you 16 different bytes to read/write, so you need to decode A4-A7 to be exactly $B, or A4 on, A5 on, A6 off, A7 on. You can either build a nest of 2-input logic gates to match that exact set of conditions (A4 + A5 + /A6 + A7) or you could use a single 74LS154 attached to A4-A7 and then tap the 12th output of 16, then invert it (to match the sense of your $DExx select), then OR it with your $DExx line to get your (low-true) select... I'll try this in a 4-line block of text since I think an ASCII art table will get skewed... $DExx select = 1 (false) OR '154 line 12 = 1 (false) is 1 (false) $DExx select = 1 (false) OR '154 line 12 = 0 (true) is 1 (false) $DExx select = 0 (true) OR '154 line 12 = 1 (false) is 1 (false) $DExx select = 0 (true) OR '154 line 12 = 0 (true) is 0 (true) So by hanging a '154 off of 4 address bits you want to decode, then inverting the select (since address bits are high true), and ORing it with your low-true block select, you get a select line that is only asserted (low-true) when any of those 16 addresses appear on the address bus. The same goes for a '138, but it's 3 address lines decoded and 32 selected address lines. You can also pipe $DExx and A0-A7 into single 16V8 GAL and by coding the GAL equations right, have your output select trigger on just about any combination of address lines you like (and change your cards address later by changing the equations), but you'd need a GAL programmer to do that. The chips are cheap - the last batch of 16V8s I bought was no more than $1.25 per chip and you only need one socket and a small amount of board space. You can also employ address comparators like the 74LS688 to compare up to 8 address bits on the bus to 8 DIP switches to have a user-selectable address. The '688 was commonly used in ISA peripherals to map the ISA card to anywhere in a block of addresses on the bus. If the card needed 8 addresses, then A3-A10 would be routed to the '688 and the user could put the card anywhere inside a chunk of 2048 addresses, aligned to an 8-byte boundary (i.e., $xxx0 or $xxx8). - ('688 pinout at http://www.xs4all.nl/~ganswijk/chipdir/giicm/74688.txt) Hope this clears things up. -ethan Message was sent through the cbm-hackers mailing list
Archive generated by hypermail pre-2.1.8.