Page 1 of 1
Character Display directly on bus or through VIA?
Posted: Fri Apr 23, 2021 1:00 pm
by Gurft
As I look across different 6502 projects I see two different methods of connectivity for Character LCD displays. Some projects show them hanging off the ports of a VIA and some projects have them directly on the system bus with the enable being driven by address decoding.
I plan on using a 4 x 20 character display that I have here in a drawer, standard 4 bit interface, nothing fancy. In my mind if I have the address space (or granular control of the address space) it would be more efficient to put the display right on the bus vs. on a VIA and be able to keep that VIA port available for other uses but not sure if I'm missing on a benefit of leveraging the VIA?
Thoughts, comments, is it really just a preference thing?
Re: Character Display directly on bus or through VIA?
Posted: Fri Apr 23, 2021 1:07 pm
by BigEd
Check the datasheet, if you have it. I think there's a chance the LCD will be quite slow, which is fine if you drive it from a VIA, but means you need to deal with RDY or with clock-stretching if you drive it directly off the bus.
Re: Character Display directly on bus or through VIA?
Posted: Fri Apr 23, 2021 6:39 pm
by GARTHWILSON
I've done both; but I've only put it directly on the bus, as Ed says, in a computer that ran intentionally very slow to save battery power. It spent most of its time at 170kHz IIRC, and I kicked it up closer to 1MHz when there was a string of floating-point operations to perform, so the user wasn't left waiting. The whole computer, including the LCD, took only a couple of mA. I'd have to review the data sheets again; but I think having the LCD directly on the bus is going to limit you to 1MHz or less, unless you have a lot of wait states.
Re: Character Display directly on bus or through VIA?
Posted: Fri Apr 23, 2021 7:08 pm
by Dr Jefyll
[....] and be able to keep that VIA port available for other uses
Even with the LCD attached you may still be able to attach other device(s) to the same 4 port lines. As a simple (though perhaps unlikely) example, you could attach *two* LCD's.
Of course, the VIA would also have to provide a Strobe or Write signal to each LCD, and these signals would have to be unique to each LCD, not shared. But the total number of pins for two LCD's would be 4+2 = 6 port lines -- not 4+1 + 4+1 = 10. I hope that explanation makes sense!

It would also be possible to attach a device driving data in the other direction, using the 4 VIA lines as
inputs.
Just thought I'd mention these possibilities. I'm not saying you ought to multi-task some of the VIA port lines, but the idea may be appealing, depending on your own priorities.
-- Jeff
Re: Character Display directly on bus or through VIA?
Posted: Fri Apr 23, 2021 7:41 pm
by GARTHWILSON
...continuing on what Jeff said above: You can hang an awful lot of stuff off a single VIA if you work it right. As I put in the I/O ICs page of the 6502 primer, I have eight things on VIA #1 of my workbench computer:
- LCD
- 5-key keypad
- beeper
- printer port
- T1 interrupts for software real-time clock and calendar with 1/100th-second resolution
- I²C port
- triggering the A/D converter (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
connected as shown in the diagram on that page, which is from my 3x5" mini ring binder. Since the tiny page is so full, some of the info I would like to have here is on other pages. The main thing I wanted to show however is how the printer, LCD, and keypad are connected.
The point is that connecting an LCD through a VIA does not require dedicating a whole VIA or even half of one.
Re: Character Display directly on bus or through VIA?
Posted: Fri Apr 23, 2021 9:34 pm
by BigEd
Acorn's BBC Micro also does a lot with one of the VIAs:
- joystick button inputs, and lightpen strobe
- ADC completion signal
- two bits to control video's memory map
- * TMS5220 speech chip (optional)
- * sound chip
- * keyboard scanning and control
- 2 keyboard LEDs
- vertical sync indication (for a per-frame interrupt)
The three marked with * sit on an 8 bit databus which uses the A port. On the B port, four bits are used as inputs to a 74LS259 which gives (I think) 8 bits of set/reset control, which are in part used as chip selects and write enables for devices on that slow bus.
The keyboard itself is a bit complex, and includes an 8 bit readable DIP switch for boot options.