Replacing a display circuit with an LCD / 8279 to Arduino or similar - Page 1
Forum section: electronics / projects

author: metertech58761
author_rank: Frequent Contributor
timestamp: October 27, 2021, 12:32:46 pm
content: So I have this display circuit that I want to replace with a 4x20 LCD.10 7-segment displays (2 to indicate the test number and 8 for the data readout) and six LEDs, along with a 4x4 matrix keyboard.All this centers on an ancient 8279 LED / keyboard controller.I've already worked out the specific layout of the LCD, and if all 4x20 LCDs have the same memory layout, which locations I need to write and with what for the various statuses.I have a data sheet explaining the various lines needed to manipulate the 8279, and know where in the firmware the routines are that directly control the 8279 to display the data or to retrieve keyboard data.My next step is to identify which Arduino (or equivalent) would be the most suitable, and which software libraries I can use as a starting point.

author: metertech58761
author_rank: Frequent Contributor
timestamp: November 18, 2021, 07:13:45 am
content: Anybody?I want to get an idea as to which microcontroller would be suitable so's I can start the design...

author: Ian.M
author_rank: Super Contributor
timestamp: November 18, 2021, 08:37:50 am
content: See8279 datasheetfor the read and write cycle times. You are going to need *either* a very fast MCU *or* one with a latched and preferably FIFO buffered parallel slave port, to respond within the max. 300ns from /RD going low to data valid. Similar problems exist with the write cycle timing.The first thing you need to do is to scope the /WR, /RD, /CS and A0 timing in your application circuit with its existing 8279 to see if you may be able to relax the datasheet timing constraints any.I wouldn't expect ordinary AVR based Arduinos to be fast enough.

author: metertech58761
author_rank: Frequent Contributor
timestamp: November 19, 2021, 10:02:07 am
content: The system clock is only 1MHz, and the data sheet says that the 8279's internal clock is 100kHz... and that's too fast for an Arduino??Okay.I guess I want to find another chip like the 8279 but one that drives an LCD then.

author: coromonadalix
author_rank: Super Contributor
timestamp: November 19, 2021, 10:49:40 am
content: You have teensies who clock very high, maybe they could do the job ?https://www.pjrc.com/store/teensy41.html

author: Ian.M
author_rank: Super Contributor
timestamp: November 19, 2021, 11:55:06 am
content: As a ballpark estimate, when using a MCU to emulate logic without the assistance of a slave bus interface peripheral, expect to need two orders of magnitude more instruction cycles per second than the logic clock speed. Coromonadalix's suggestion of a Teensy should be capable of doing the job.However, the display output of an 8279 has considerably relaxed timing vs its CPU interface, with each multiplexed digit valid for 490us after the rising edge of /BD, so if you keep the 8279, and capture its A0:3, B0:3 and S0:3 outputs in an ISR triggered by /BD rising edge, just about any MCU can do the job. You don't actually need all of S0:3 as you just need to detect the first digit in the multiplexing sequence, so if you are short of MCU pins, monitor S0 for decoded mode, and S3 transitioning high to low for encoded mode, which brings it within reach of an ordinary Arduino Uno or Nano, with an I2C LCD.

author: metertech58761
author_rank: Frequent Contributor
timestamp: November 20, 2021, 01:01:50 am
content: I should clarify that the display isn't updated every Nth fraction of a second; it is only updated when starting a test or updating as required by the code.The rest of the time the display is pretty much static.Here's the steps for the 'get key' and 'refresh display' subroutines:Keyboard:Poll the EIRQ line (reading the PIA and waiting for one bit to change before continuing)Send command (0x50) to the 8279 requesting keyboard data (the 8279 command port is wired to appear at 0x4000; CS low, A0 high)Read key data byte from the data port (the 8279 data port is wired to appear at 0x4001; CS low, A0 low)Process and save the key data byte to RAM (the CS and A0 lines go high in the meantime, taking the 8279 offline)Subroutine endsDisplay:Send command (0x90) to the 8279 telling it to get ready for the display dataThen a loop whereby the 16 bytes of data is read from the display buffer and written to the 8279 data port in a predetermined order:(readout LSB...readout MSB; test no. units / tens; Relay A - Relay D LED status; Install LED; then test status)The process ends with a second command (0x80) is sent to the 8279 telling that we're done writing to the display bufferSubroutine endsI'll check out the Teensy models to find something that might be suitable.

author: metertech58761
author_rank: Frequent Contributor
timestamp: November 20, 2021, 01:37:45 pm
content: Ian: Fortunately, A0:A3 are unused so that's only 9 pins that need to be measured.However, one MASSIVE challenge in trying to capture waveform data in the original unit is that it has a dangerous floating (LIVE!!!) ground because of the transmit power supply (I went with a different, SAFER design in my version!!!).So, anyway, my USB logic analyzer wentwhen I hooked it up to the original unit.If I go with a Teensy, then I need to see how to 'level shift' between 3.3 and 5V signals, and I'm sure a diligent forum search will tell me what I need to know.

author: Ian.M
author_rank: Super Contributor
timestamp: November 20, 2021, 03:28:55 pm
content: If you are totally replacing the 8279, I would suggest an octal level translating bidirectional buffer for the data bus. e.g.74LVC4245AYou'll still need unidirectional level translation for various control signals, (as Teensy pins are not 5V tolerant) and simple resistive dividers probably wont work as they will load the host signals excessively. Any 5V tolerant 74LVC gates or buffers should do.Drive the 74LVC4245A's /OE (output enable) and DIR signals with logic driven by the host's 8279 /RD, /WR and /CS signals to guarantee you release the host data bus quickly enough to avoid contention. Put 330R resistors in series with the data lines between the 74LVC4245A and the Teensy, to protect them from damage due to bus contention due to any software bugs or latencies when changing data direction.However I still reckon its easier to allow a genuine 8279 to handle the bus interface and only need to capture its output as I described earlier. You can then use an ordinary 5V AVR based Arduino, and avoid all need for level translation.The isolation problem *SUCKS*! I assume you got lucky and didn't blow your PC's USB port? Buy yourself a USB isolator, and in future always check voltage from 0V to Ground before connecting scopes, logic analyzers or other grounded test equipment. If you suspect the voltage is due to capacitive leakage currents, connect a 39K 3W wirewound resistor in parallel with the voltmeter, and see if it drops by at least an order of magnitude.