User Interface

Published Mon, Jul 27 2009 11:13

Strictly speaking, the EPCS main function of toggling valves at set intervals doesn't require any user input, and it's likely to be quite some time before an algorithm is embedded to provide real-time results, so a display is also not necessary, but a device without a user interface is an inflexible one. The development and debugging process will also be greatly eased by an integrated display.

I did some looking around on Digi-Key for a small inexpensive LCD panel, but what impressed me most about all of them is that the documentation was utter garbage. Then I stumbled across an entire front panel on fire sale. Ok, it isn't perfect, I could have wished for 20 characters across and a backlight, more pushbuttons, or a green LED, but it's more than adequate and the price was ideal. The seller's comment "I can't begin to make such an item for this price." is, if anything, an understatement.

Experience has taught me that electronics tend to fail during development (most circuits deal in at least a few votlages that are higher-than-absolute-maximum-rating for something else and with loose wires, incorrect cable pinouts, or short circuits induced by multimeter probes... use a little imagination) and I've learned the value of immediately-available spares, so I've been accumulating enough of each component to build two units  Actually I would much have preferred two complete units plus a spare of each component, but with free samples (often necessary to get around minimum quantity requirements) you take what you can get, which is usually two. For the front panel I ordered yet two extra for a total of four; this price point doesn't cause me much pain and I'm sure I'll find a home for them before too long).

Anyway, the supporting circuitry for this front panel module turns out to be really minimal, but that wasn't immediately evident. Here are the issues I considered, addressed in order of fewest dependencies:

  • LEDs: The front panel has them wired in a common cathode configuration which is not my preference and the discussion is too long to fit here comfortable.
  • Momentary Pushbuttons: The front panel has four, with one contact of each grounded and the other floating, the perfect configuration for small numbers of buttons. Add a pull-up resistor and the floating contact becomes a nice logic-level signal, ready to feed logic. The ADuC7025 GPIO pins have internal 100k pull-up resistors so we could wire up the buttons directly and be done with it. I've chosen instead to use the MAX6818 de-bouncer IC, not so much for the de-bouncing which can be provided easily in software, but for the 15kV ESD protection and overvoltage protection, which can't. The Change-of-State output is nice for generating an interrupt, even if the active state is wrong for direct use as an ADuC7025 external interrupt request line. I see two ways to overcome this: one of the unused channels of the hex inverter used for LED current sourcing, or the method I've chosen, the interrupt-generation capability of the ADuC7025's integrated Programmable Logic Array. This is the more complex route, but enables tricks like automatic inhibition of the button-press interrupt while the shared data bus is in use talking to another peripheral. For this reason any output-enable signals will be placed on PLA input pins.
  • Character LCD: This has been just a tad frustrating. The front panel uses an original Hitachi HD44780 requiring a 5V supply, but the internet seems to only have the datasheet for the newer HD44780U which supports 3.3V supply as well. That's ok for getting data back to the ADuC7025, which has 5V-tolerant GPIOs, but raises a question about whether the 2.4V high output voltage of the ADuC7025 (probably nearer 3V when run with a 3.3V supply, still less than 0.7VCC) will be considered logic high or an intermediate unstable high-current level. Anything above 2.2V is clearly ok for the HD44780U when run from a 5V supply, but what about the older model? Luckily someone posted the relevant parts of the datasheet and its threshold is also 2.2V. This means there is no need to increase the voltage with either common-drain configured GPIO and power-wasting pull-up resistors, or a bidirectional level translator such as the CD74ACT623 or SN74LVC4245A (another translator would have been needed for the control signals).
  • Shared data bus: We save pins by using the same data bus for the pushbuttons and LCD, but a compatibility check is in order. The bus has three devices, the ADuC7025, MAX6818, and HD44780. Do all have tri-state outputs? Yes. Are all tolerant of 5V signals from the HD44780? ADuC7025: Yes. It's tempting to ignore the MAX6818 because it will be tri-stated, but this would be a mistake because the absolute maximum ratings would have been exceeded unless a 5V supply is chosen. The pushbuttons are fine at 5V, and 2.4V on the EN pin is still sufficient to be considered high. Alles ist in Ordnung.

Phew.

Leave a Comment

(required) 
(required) 
(optional)
(required)