LC7981/HD61830 Driver for EL Backlit Samsung LCD
I’ve found the time to post this LC7981/HD61830 driver (only graphics mode implemented) and some images of this Samsung LCD I’m using. I bought the LCD off of ebay ( http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&rd=1&item=230070938443 ) and shortly after I wrote the driver for it from scratch. I finished this driver about a month and a half ago, but I have just been too busy lately to post anything about it till now.
This is will eventually be a part of my GPS project, which I will get into later next week.
For now, here are the specs: an EL backlit 160×80 monochrome graphics LCD that supports text and graphics mode (I just coded for graphics mode and found a font/character pixel set online), controlled by an ATMega32. The LCD is driven by an LC7981/HD61830 controller (easy parallel interface). I’ll try to get the pinout up, including the EL connections with the inverter as soon as possible.
Pictures (no, I’m not running linux, the linux penguin just happened to be a convenient pixmap to demonstrate):
![]()
![]()
![]()
![]()
And the free source, currently coded for the ATMega32 but can be easily adapted to other uCs: avr-lc7981.tar.gz.
Alternatively, feel free to browse the images and source here: http://www.frozeneskimo.com/samsunglcd/.

stue Said,
January 20, 2008 @ 2:16 am
I have the same LCD, probably i got it from the same guy on ebay,
but never done with it anything, because couldn’t find EL backlight specs and inverter, where you got ours?
vsergeev Said,
January 20, 2008 @ 3:02 am
stue,
The guy on ebay mentioned the inverter in the product description, so I searched around for it online. I remember it was almost impossible to find, but it turned out that it was packaged with this $10 16×2 EL character LCD from http://www.neonixie.com, which I ended up buying. I can’t find the character LCD on the neonixie store now… I guess the product went out of stock or they just pulled it completely. The pinout for the INV-TH-202 is pretty straight forward (in, out, ground).
best of luck,
~vsergeev
Bert Said,
April 4, 2008 @ 2:43 am
Hello,
every time i try to compile your sources with WinAVR i get the following Errors. Here the error-File and the makefile
Thanks Bert
——– begin ——–
avr-gcc (GCC) 4.2.2 (WinAVR 20071221)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Compiling C: LC7981.c
avr-gcc -c -mmcu=atmega128 -I. -gdwarf-2 -DF_CPU=16000000UL -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=./LC7981.lst -std=gnu99 -Wundef -MMD -MP -MF .dep/LC7981.o.d LC7981.c -o LC7981.o
Compiling C: draw_penguin.c
avr-gcc -c -mmcu=atmega128 -I. -gdwarf-2 -DF_CPU=16000000UL -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=./draw_penguin.lst -std=gnu99 -Wundef -MMD -MP -MF .dep/draw_penguin.o.d draw_penguin.c -o draw_penguin.o
draw_penguin.c: In function ‘draw_penguin’:
draw_penguin.c:2: warning: implicit declaration of function ‘lcd_graphics_plot_pixel’
draw_penguin.c:2: error: ‘PIXEL_ON’ undeclared (first use in this function)
draw_penguin.c:2: error: (Each undeclared identifier is reported only once
draw_penguin.c:2: error: for each function it appears in.)
make.exe: *** [draw_penguin.o] Error 1
> Process Exit Code: 2
> Time Taken: 00:01
Makefile:
# MCU name
MCU = atmega128
# Processor frequency.
# This will define a symbol, F_CPU, in all source code files equal to the
# processor frequency. You can then use this symbol in your source code to
# calculate timings. Do NOT tack on a ‘UL’ at the end, this will be done
# automatically to create a 32-bit value in your source code.
# Typical values are:
# F_CPU = 1000000
# F_CPU = 1843200
# F_CPU = 2000000
# F_CPU = 3686400
# F_CPU = 4000000
# F_CPU = 7372800
# F_CPU = 8000000
# F_CPU = 11059200
# F_CPU = 14745600
# F_CPU = 16000000
# F_CPU = 18432000
# F_CPU = 20000000
F_CPU = 16000000
# Output format. (can be srec, ihex, binary)
FORMAT = ihex
# Target file name (without extension).
TARGET = LC7981
# Object files directory
# To put object files in current directory, use a dot (.), do NOT make
# this an empty or blank macro!
OBJDIR = .
# List C source files here. (C dependencies are automatically generated.)
SRC = $(TARGET).c draw_penguin.c graphics.c
Abraham Said,
April 25, 2008 @ 12:30 am
hey man! Awesome Job! can you upload some of the circuits of how you connected the Atmega and the LCD? or some schematics?
Thanks!
Abe Said,
April 25, 2008 @ 1:29 pm
hey man, can you upload some the circuitry of how you connected your LCd to the Atmega?
Richard ROwell Said,
July 3, 2008 @ 12:43 pm
I have an old Hitachi LMG7402 with a 240×128 and I’ve been looking for a nice clean driver to hook it up to my AVR… Looks like I found it! Thanks for the code, I can’t wait to try it!
vsergeev Said,
July 4, 2008 @ 12:50 am
ALL,
I’ve updated the archive to include a Makefile to compile this driver and driver test. The Makefile can also be found in the folder at http://www.frozeneskimo.com/samsunglcd/avr-lc7981-v1/Makefile .
lc7981.c, lc7981.h, graphics.c, and graphics.h have also been updated to smooth out compilation. The code remains the same, but the includes at the top have been fixed up a bit to fix compilation with the new Makefile…
—
Bert,
almost ok, except that draw_penguin.c should not be compiled separately, it is included in lc7981.c and used in the main() function of lc7981.c…
—
Abraham,
(as i sent you earlier in private) here is a quick overview of the connections
LCD pins:
1-vcc
2-gnd
3-to lcd 17
4- control signal
5- control signal
6- control signal
7 to 14 - LCD’s data pins, connected to PORTB
15-gnd
16-vcc
17-to lcd 3
18-nc
19-to the backlight inverter out
20-gnd
–
Richard,
cool, glad to hear it, I hope everything works out…
—
best of luck,
~vsergeev
youtuber Said,
July 9, 2008 @ 1:14 pm
Looks cool, now rig it so you can stream a standard line out analog video signal from a video game system, id like to see a GTA (Grand theft Auto) Game displayed on one of these
cornwallav8r Said,
August 20, 2008 @ 6:35 pm
Did you ever finish your gps project, and did you interface the 4-wire touch screen, I would love to see the code. Thanks