Page 3 of 4
Re: Monster Decoding Logic
Posted: Wed Sep 27, 2017 12:03 pm
by Michael
Is an LCD 'backpack' out of the question? Lots of possibilities (I2C, SPI, Serial, custom).
Here's a design that drives the LCD in 8-bit interface mode while using a 2-pin interface to the host.

Re: Monster Decoding Logic
Posted: Wed Sep 27, 2017 12:11 pm
by Alarm Siren
Hmm. Yes, switching out to an SPI based interface would work, I've already got an SPI bus going on the board and I do have a spare SPI CS pin. Obviously it'd be slower than directly writing to the chip, but that is a possible solution certainly.
Re: Monster Decoding Logic
Posted: Wed Sep 27, 2017 12:33 pm
by GARTHWILSON
(at 5MHz) handles the LCD (plus five other things) through the first VIA
I only have one VIA and there isn't enough pins left on it to drive the LCD screen. I would very much rather not add a second VIA to the system if I can avoid it as VIAs are not cheap components, and they take up a lot of space (relatively speaking compared to a couple of logic gates).
I use a single VIA for:
- LCD
- 5-key keypad
- beeper
- printer port
- T1 interrupts for software real-time clock, calendar, and alarms with 1/100th-second (10ms) resolution
- I²C port
- triggering the A/D convertor (which puts the data on another VIA)
- "Abort" button (like Reset but less drastic)
- and a synchronous serial port for things like my analog oscilloscope raster-graphics display
all at the same time.
As for room, you can put other ICs under the VIA:
ICs under ICs are slightly visible in this photo also:
But really, for the amount of work you're going to put into it, the price of a second VIA is peanuts. Using the LCD in its 4-bit interface is easy, and probably won't be any less efficient than trying to manage it through other parallel logic which may slow your maximum clock speed down anyway, and certainly won't be as slow as doing it through SPI if you have to bit-bang it (although I do like SPI, even bit-banged!). Michael's idea using the '595 could be pulled off with the VIA's serial port, shifting at half the phase-2 rate without the processor having to bit-bang. In fact, I've done the following to get well over a hundred output bits from the VIA's SR (shift register):
Similarly, you can also use the VIA's SR for tons of input bits:
or even both inputs
and outputs on the same VIA SR, at the same time, using a 74xx126 section to stop the final 165's output when you're outputting to the 595's, to prevent contention.
It's all in the
6502 primer.
If I seem a little feisty, it's because a rather new tire with no apparent previous damage blew out on our son's van a few hours ago on the freeway and he fishtailed and rolled the van over and over. It's a total loss. Fortunately he's not hurt.
Re: Monster Decoding Logic
Posted: Wed Sep 27, 2017 12:47 pm
by Alarm Siren
I use a single VIA for:
[snip]
all at the same time.
I know one
can, unfortunately in this case, its not a matter of being unable to, I just don't
want to.
As for room, you can put other ICs under the VIA:
Not with an SMD VIA.
But really, for the amount of work you're going to put into it, the price of a second VIA is peanuts. Using the LCD in its 4-bit interface is easy, and probably won't be any less efficient than trying to manage it through other parallel logic which may slow your maximum clock speed down anyway, and certainly won't be as slow as doing it through SPI if you have to bit-bang it (although I do like SPI, even bit-banged!). Michael's idea using the '595 could be pulled off with the VIA's serial port, shifting at half the phase-2 rate without the processor having to bit-bang. In fact, I've done the following to get well over a hundred output bits from the VIA's SR (shift register):
[snip pic]
Similarly, you can also use the VIA's SR for tons of input bits:
[snip pic]
or even both inputs and outputs on the same VIA SR, at the same time, using a 74xx126 section to stop the final 165's output when you're outputting to the 595's, to prevent contention.
Well, the parallel logic design above which introduces waitstates should only slow down the processor when its actually accessing the screen, and it will make the software a lot simpler - no bit-banging of any kind. I think there's pros and cons to both approaches.
I'm already using the VIA SR in exactly this manner to drive the keypad and status lights. I would rather not overload it with having to manage the screen as well.
Perhaps it might surprise you to learn I have read your entire primer multiple times. Not to mention several other parts of your website. I cannot describe how useful they've been. Nevertheless I am a relative newbie to all this and I like to get other people's opinions on things before I spend vast quantities of money getting PCBs made. Earlier in this topic with Jeff's help we got the decoding logic down from 10 chips and a 5-chip large prop delay to 3 chips and a 2-chip prop delay, so it was clearly worth it.
If I seem a little feisty, it's because a rather new tire with no apparent previous damage blew out on our son's van a few hours ago on the freeway and he fishtailed and rolled the van over and over. It's a total loss. Fortunately he's not hurt.
I am very sorry to hear that, but I am glad he is OK. I can definitely sympathise, having had my fair share of crashes, scars included.
Re: Monster Decoding Logic
Posted: Wed Sep 27, 2017 7:50 pm
by whartung
Glad everyone is OK Garth.
Re: Monster Decoding Logic
Posted: Fri Sep 29, 2017 5:36 am
by BigDumbDinosaur
If I seem a little feisty, it's because a rather new tire with no apparent previous damage blew out on our son's van a few hours ago on the freeway and he fishtailed and rolled the van over and over. It's a total loss. Fortunately he's not hurt.
Yikes! Good to hear he's okay.
Re: Monster Decoding Logic
Posted: Sun Oct 01, 2017 3:12 pm
by Michael
There's been mention in the past of using a ROM or RAM chip for address decoding but I haven't seen it used. Could this be a viable decoder solution for lower speed systems? Could a 55-nS Parallel Flash chip decode fast enough for a 4-MHz system?
Cheerful regards, Mike
PS: Happy to hear your son is ok, Garth.
Re: Monster Decoding Logic
Posted: Sun Oct 01, 2017 3:40 pm
by Alarm Siren
In that circuit, there's nothing to mask off the A14-A16 lines from the RAM when accessing the Standard RAM area. You'd need a multiplexer controlled by the decoder ROM, or perhaps sacrifice three of the I/O chip selects in order to "pass through" the A14-A16 lines when appropriate (there's some spare address inputs on the decoder ROM so it could be done). Also I've not come across ROM chips that are that quick, but I assume they must exist.
How are you making these diagrams? they're absolutely beautiful

Re: Monster Decoding Logic
Posted: Sun Oct 01, 2017 4:07 pm
by Michael
Sorry! The memory map insert was incorrect. That drawing is for your design with two RAM chips so the 128K RAM is only selected when the 6502 addresses the $8000-BFFF block.
* Drawings are from Microsoft Excel
Re: Monster Decoding Logic
Posted: Sun Oct 01, 2017 4:23 pm
by Michael
As you noted, supporting a single 128K RAM chip instead of two RAM chips would require giving up some of the decoder I/O chip select outputs...
Re: Monster Decoding Logic
Posted: Sun Oct 01, 2017 8:35 pm
by Alarm Siren
Such decadance I have to try. Pray explain how Excel can be coaxed into making such images.
Re: Monster Decoding Logic
Posted: Mon Oct 02, 2017 12:37 am
by BigDumbDinosaur
Also I've not come across ROM chips that are that quick, but I assume they must exist.
I use 55ns UV-erasable EPROMs in my POC units. Atmel makes a 45ns OTP ROM, which I've also used in my POC units. I believe that is currently the fastest ROM available from production stock.
Re: Monster Decoding Logic
Posted: Mon Oct 02, 2017 5:37 pm
by Martin A
You can get 45ns, 5v flash from Microchip, provided you don't mind using PLCC parts.
Re: Monster Decoding Logic
Posted: Tue Oct 03, 2017 2:19 pm
by Michael
Still fleshing out ideas. I wonder if anyone other than Jeff (Dr Jefyll) recognizes the bank select method in the crude design below?
reference:
Ultra-fast output port using 65C02 illegal instructions
Re: Monster Decoding Logic
Posted: Tue Oct 03, 2017 5:12 pm
by Alarm Siren
I recognise it. I did very seriously consider using something like it, but I decided that it was important that the bank bits be readable as well as writable so that subroutines / interrupts can save and restore them. For your CLKGEN is that a PIC?