Swapping out a display board for LCD - which module?

Thread Starter

metermannd

Joined Oct 25, 2020
343
So I have this keyboard / LED driver circuit, and I'd like to replace all this with a nice, compact 4x20 LCD and some kind of PIC (Arduino, Raspberry Pi, whatever).

I've already worked out the basics as to how I want the LCD laid out, and what to write based on the contents of the display buffer.

The display buffer has up to 8 readout digits, two test number digits, and six status LEDs (red / green / yellow / off).

There is also a 4x4 matrix keyboard involved as well.

In case it's not apparent on the schematic, here are the signals on the J1 connector:
Reset - system reset (active low, but the 8279 uses an active high reset)
R/W - read / write line (again, the 8279 prefers the one line be broken out into two)
IRQ - this is an active high line to tell the system that a key has been pressed
_CS - chip select
A00 - this tells the 8279 whether it is to act on data or to accept commands
Clk - system 1MHz clock
D0-D7 - system data bus

As for output? Easy. I2C interface to an LCD.

I don't know that much about how to select an Arduino, Pi, or whatever, so would appreciate some input...
 

Attachments

KeithWalker

Joined Jul 10, 2017
3,063
Your choice of display module will depend on how you want your display to look. You mentioned that you have that all worked out but you forgot to tell us the details. When you mention a 4 x 20 display, do you mean 4 rows of 20 characters?
 

Thread Starter

metermannd

Joined Oct 25, 2020
343
Yes, 4 rows x 20 characters.

So which Arduino would work best?
I had a Nano a while back but I gave it away after experiencing the wonder that is the 'official' Arduino forum...
 

KeithWalker

Joined Jul 10, 2017
3,063
Yes, 4 rows x 20 characters.

So which Arduino would work best?
I had a Nano a while back but I gave it away after experiencing the wonder that is the 'official' Arduino forum...
Your choice of Arduino will depend on what other functions you want to add to the circuit. For most general applications I use nano clones. They are relatively inexpensive, easy to program and don't take up much space. I have read some of the derogatory comments about cheap Arduino clones, but I have used lots of them from AliExpress and never experienced a single problem with any of them.
If you don't need extremely fast updating on the display, I recommend that you get the I2C version of the display because it uses far less Arduino data pins than the parallel interface version.
https://www.makerguides.com/character-i2c-lcd-arduino-tutorial/
 

djsfantasi

Joined Apr 11, 2010
9,156
A search for “Arduino LCD 4x20” will result in many products known to work with the Arduino family, that probably have compatible libraries. The search will also result in several how-to projects describing how to use LCD displays on the Arduino platform.

I use this technique when identifying shields (add-on boards) for the Arduino. The official Arduino web site (Arduino.cc) will also identify compatible products. Sparkfun is another good site.

As to which Arduino to use, I create a GPIO inventory for my application and choose a model accordingly. When doing this, it’s important to research what resources (pins) any shields (add-in boards) require. This step is necessary to avoid resource conflicts

Another consideration is how much memory is available to the MCU. If your application is complex, you may need extra memory. You can compile your sketch with different models selected in the IDE and see if a particular model has sufficient memory. I have one application which requires a Mega for its memory.

I hope you find this info helpful.
 

ericgibbs

Joined Jan 29, 2010
18,766
Hi mm,
This datalogger, to SD, Sketch includes code for a parallel 4*20 LCD.
Uses 6 Arduino pins for the connection.
E
Corrected: Removed two }}
 

Attachments

Last edited:

Thread Starter

metermannd

Joined Oct 25, 2020
343
The main app code uses 16 bytes for the data to be displayed (8 readout digits, 2 for test number, and 6 for LEDs), and on the keyboard side, one byte for the keyboard data to be passed back and a signal line to indicate a key has in fact been pressed.
 

Thread Starter

metermannd

Joined Oct 25, 2020
343
A Mega? That seems a bit overkill?

8 bidirectional data lines, 5 control lines (CS, mode, clock, R/W, Reset), and one IRQ output...
 

ericgibbs

Joined Jan 29, 2010
18,766
A Mega? That seems a bit overkill?
Hi,
I based my suggestion on viewing the circuit shown in the PDF by the TS and his description.

I would agree with Keith
As I mentioned in post #5, a nano should do the job unless you decide to add a lot more functionality.

At the end of the day, it's the TS's call.;)

E
 

Attachments

Thread Starter

metermannd

Joined Oct 25, 2020
343
So I could use a 74HC595 or similar to convert the data bus into a serial stream... that's an idea.

However, truth be told, if I can just get my mind around the code in the /NMI routine in the original firmware, I could just consolidate ALL the logic into a modern microcontroller, and then something like the Mega would be worthwhile to consider. I just need to find someone who understands 68xx-class code well enough to help me understand how this section of code works (it involves a LOT of math operations - even uses the MUL opcode).
 

Thread Starter

metermannd

Joined Oct 25, 2020
343
eric: Let me get the code into text format and I'll start a thread over in Programming / languages.
Within the next few days for sure.

djs: d'oh. that's right. that might be a bit of a monkey wrench, as I do need to read in keyboard data...
 

djsfantasi

Joined Apr 11, 2010
9,156

djs: d'oh. that's right. that might be a bit of a monkey wrench, as I do need to read in keyboard data...
What are you using for a keyboard? If it doesn’t have a built-in controller, you need 4 input pins and 4 output pins. The output pins could be driven by the shift register. You could even limit that to two input and two output pins by using demultiplexor ICs.

Of course, the complexity rises. Both in the need for external hardware and the software to use these techniques. My point is that there are ways of saving IO with external circuits. This saves the added cost of a Mega for your application. It all comes down to the engineering decision to balance cost and complexity to solve problems and/or eliminate constraints.
 
Top