I want to control a simple LCD (calculator screen like) NOT THE MODULEwith an ATMEGA328p uC.NOT ARDUINO, only the microcontroller. What code do I need to write in order to get something like a number displayed? What external parts do I need?
If it's a simple seven-segment style glass display with all the segment connections and the common plane brought out to the connector, it should be possible to control it with an MCU.
The common electrode must be toggles high and low at something between 25 - 100Hz.
Segments that should be off must be set to the level as common; segments that should be on must be set to the opposite level.
eg. If there is no difference between the individual segment and common, the segment is off. If the two voltages are different, the segment is on.
They have to alternate continuously to prevent electrolysis or breakdown of the materials in the display, so the drive is in effect AC. You probably also need a resistor divider between the common drive and half supply so you can vary the amplitude, as that will control the display contrast.
More complex LCDs with too many segments or pixels for individual wiring use a matrix system, which requires multiple levels on every connection, so it's not practical to drive them direct.
Just an example, some processors have onchip the capability of all the timing and step
V generation required to manage a segment LCD with commons. This is single chip solution,
very little of the overall chip resources used, see last window.
I want to control a simple LCD (calculator screen like) NOT THE MODULEwith an ATMEGA328p uC.NOT ARDUINO, only the microcontroller. What code do I need to write in order to get something like a number displayed? What external parts do I need?
If it's just bare glass, then you really need an LCD driver - and a few PIC devices have this built-in, and so can directly control a bare glass LCD display. No idea if there's any AVR's that do?, but the 328 doesn't.
Or presumably you could use an external driver chip between 328 and glass?.
Optoelectronics Circuits Manual is a useful single-volume guide specifically aimed at the practical design engineer, technician, and experimenter, as well as the electronics student and amateur. It deals with the subject in an easy to read, down to earth, and non-mathematical yet comprehensive...
books.google.co.uk
This is an example of the type of display that can be driver like that - no multiplex, just overall common backplane and a pin per segment: