Programmers

All on one SLOW page
Serial Port
Parallel Port
Smart Programmers
Serial Loaders

Projects

ATmega8 Serial LCD
ATtiny2313 Serial LCD
ATtiny4313 Serial LCD
ATmega328 SIRC
ATtiny2313 SIRC
40-pin Dev Board
28-pin Dev Board
AVR PS/2 Keyboard
AVR MAX232 RTS/CTS
AVR Dual RS232 Ports

Minimal Circuits

ATmega16
ATmega32
ATmega644
ATmega1284
ATmega8515
ATmega8535
ATmega8
ATmega48
ATmega88
ATmega168
ATmega328
ATmega162
ATmega128
ATtiny13
ATtiny2313
ATtiny4313
ATtiny24
ATtiny84
ATtiny25
ATtiny45
ATtiny85

Other Stuff

ATtiny13 vs ATtiny85
ATmega8 vs ATmega88
ATmega16 vs ATmega164
ISP and SPI
MAX232 Arduino
A small FAQ
Hardware Info

Atmel ATmega8 Serial Terminal with LCD and PS/2 Keyboard

Page:1 2

LCD displays are available in either 8-bit parallel, 4-bit parallel, or very expensive serial. I needed a serial LCD for a project. If I'm going to have the expense of serial, I should also have some functionality over and above that of the cheaper parallel interface displays. Unfortunately, those expensive serial displays do not offer any more functionality than their parallel counterparts. It seems like rolling your own serial LCD is a reasonable alternative that allows you to add some value. The value I had in mind was the addition of a keyboard to make the display into a complete tiny terminal.

Design

It's hard to talk about a design without having a use in mind. I have a need for a terminal for debugging. I can't always get to the PC when I need to run screen, or my new favorite, "cutecom" (they needed to give a little more thought to the name). I need a serial terminal I can hook to the board under test. The terminal doesn't need to be too fancy, it just needs to be able to send keyboard data and display output. To this end, an ATmega8 driving a 16 x 2 LCD and a PS/2 keyboard work nicely. The LCD displays ASCII characters, and the keyboard scan codes are decoded into ASCII characters and sent back on the serial line.

The real beauty is that it requires no external hardware to interface a PS/2 style keyboard to an ATmega8. The LCD requires just a little bit - a transistor to power the LED backlight for dimming, and a pot to set the contrast of the LCD itself. A separate power supply powers the terminal unit, which in turn provides power to the keyboard. The regulator gets hot providing around 60 mA for the LCD backlight, plus the power required by the keyboard.

So, features:

Parts List

The parts list for the terminal is short:

Junk box parts:

Assembly

Assembly is like anything else. The wires for the LCD barely fit in the case. Like an overstuffed suitcase, if I sit on it to put the screws in, everything fits. Other than that, it turned out great!

Hint: If you get a row of solid rectangles (each a character with all pixels on), the display has done it's own power up initialization, but your configuration routine has not worked properly. You should have a couple of lines of text when it comes up. You may have to adjust the contrast to see the characters.

I picked up a small, cheap ($17.09 because it was returned) mini USB keyboard, USB to PS/2 adapter($1.99) and a keyboard extension cable($3.99) at Frys. The extension cable was made into a pigtail. The adapter and keyboard plug into the pigtail cable, and the whole thing makes a nice compact serial terminal.

I used an FTDI USB to TTL cable to connect the ATmega8 USART to the PC, and CuteCom to emulate an AVR. Anything sent via CuteCom wound up on the LCD display, and anything typed on the terminal's keyboard wound up on the CuteCom screen. There are a couple of options that are compile-time that I need to get hooked up to a key combination - the LCD backlight brightness and the toggle for display of control characters, chiefly the line feed. The code takes about 1900 bytes of the ATmega8's 8192 Bytes of flash memory.

UPDATE:
I used a MOSFET for switching the cathodes to control the brightness. The one I chose was the IRF510, because I have a drawer full of them. It may not be the best choice. Since it takes 4 V to turn it on, and the power supply for the board is 5 V, the MOSFET may be operating in the linear region, using relatively high power. On subsequent versions of this project I have used the IRF7470 MOSFET. It has a Vgs(th) of 2 V, so it is definitely on when you turn it on.

Page:1 2