Just generic 74 at this point, but most likely HC or AHC, depending what's in stock. The DROM will work at 3.3 to 5v, and I calculate at maybe three megahertz - I won't know for certain until I build one - so I'm looking at a 1.8MHz system to keep the UART simple.
Worst case through the decode with AHC is under 15ns, I think. ...
Ah, I was looking at the 74HC138 datasheet. Digikey has through hole 74AHC138 in active status. Yes, at 3.3V the AHC is worst case 15ns on the high select under 15pF load capacitance, 13.5ns on the low selects and 13ns on the addresses ... faster at 5v, under 12ns even under 50pF load capacitance.
With three rows, as you pointed out, you need to clear two LED positions.
At least, someone with an eight digit LED panel would do ... someone with a six digit LED panel would be fine.
Three bytes can be saved by using the self-executing vector trick ... which, since it involves the BRK vector can almost never actually be employed. In this context, it means giving up the use of a BRK instruction for the micro-monitor for the code punched in before the FlashROM has been brought up:
Code: Select all
...
BMI exec ; the GO function has been parsed
...
org fffc
dw start
exec: dw $0200
... where the first byte of the vector is a BRK opcode, and it is sitting in the IRQ/BRK location, so the BRK jumps to $0200. So no "JMP $0200" code is required, saving three bytes. Having bit7 be "/Press" rather "Press" would save another two bytes. Since the raw code is stored in leds, "STZ leds+6 : STZ leds+7" would suffice.
If this trick is used, I guess an explicit JMP ($FFFC) would become the "micromonitor break point", edited into three NOPs to move onto the next.
It would take the lower three bits, rather than two, from the '138 decoder, and two bits from the diodes/nor gate encoder, final bit 7 could be diodes.
Neil
I wouldn't know, but I'd be guessing wiring the OR with diodes is not as bad in this case due to the speed and the fact that only one line will be high?
A 3-nor encoder which makes the d7 high flag "/Pressed" does save two bytes in the code, but OTOH doing the key encoding with diodes seems more Paleolithic.
In a system that runs faster out of DROM mode, it seems that with non-keypresses encoded as a high bit set, a single triple 3-input NOR could do all of the key encoding, with d3 encoded from NOR(row1,row3), d4 encoded from NOR(row1,row2), and d7 encoded from NOR(row1,row2,row3).
All in all, the general utility of having 8 command keys available when running in FlashROM mode would incline me toward the 8col x 3row layout, but having the encodings available from either five diodes or one '37 is also a strong argument (though not the same encoding, so that is a pre-DROM soldering choice to make -- "I've got to edit a BPL to a BMI, time to do some desoldering").
Perhaps a Schmitt-Trigger NOR would also be a useful in debouncing the keyboard ... but browsing makes those look mostly like automotive parts, which are SMD. Anyway, three lines means debouncing could be done with the eight pin LS18-P debounce chip.