LCD Serial Terminal using PIC16F84

Summary of LCD Serial Terminal using PIC16F84


This project describes a self-contained serial terminal built using a PIC16F84 microcontroller, an intelligent 4x20 LCD display, and a matrixed keypad. It supports full-duplex communication via RS-232, allowing users to type characters that appear on the screen or loop back data for testing. The system features configurable key mapping with primary and secondary codes, programmable key repeat, and cursor movement functions like backspace and carriage return.

Parts used in the LCD Serial Terminal:

  • PIC16F84 microcontroller chip
  • Inexpensive LCD character display (4 line by 20 character)
  • Matrixed keyboard or keypad (up to 5 rows and 4 columns)
  • RS-232 cable
  • Small PC board
  • Hi-Tech PICC compiler (or free PICLITE version)

LCD Serial Terminal

Introduction:
In the 1980s a serial terminal was a big thing with a picture tube and keyboard. You used it to communicate with a computer by RS-232 cable or with a modem. In this century, we still sometimes have need for a serial terminal, and we’ll typically use a personal computer running a terminal program (Hyperterminal, bundled withWindows, is a terminal program). This project is a self-contained serial terminal using a PIC16F84 microcontroller chip, an inexpensive LCD character display, a keypad, and very little else. It is full-duplex, meaning keypresses cause RS-232 output, and RS-232 input makes characters appear on the LCD. If you connect the RS-232 output to the input you can see the keys as you press them, without connecting to anything else (that’s called “looping back”).

LCD Serial Terminal

Project Description:
The picture above doesn’t show the electronics, just a keypad and LCD display. The electronics is on a small board behind the LCD. This LCD is a 4 line by 20 character intelligent LCD display. Displays from 1×8 to 4×20 or 2×40 and pretty much anything in between are compatible. I paid less than US$10 for this display from All Electronics. The keyboard you use should be a matrixed keyboard or keypad with up to 5 rows and 4 columns (20 keys maximum).

This small PC board is the terminal itself. Someday I will document a PC board design, but currently I am only making available the schematic diagram, source code for the PIC16F84, and compiled hex code for a typical configuration so you can quickly test it out. The source code is in C and very easily configured for different baud rates, LCD and keypad configurations. The program should be compiled with Hi-Tech PICC. A free version supporting the PIC16F84 called “PICLITE” is available and works fine.

The mapping of the keys is fully configurable, and each key can also be configured for one of four different modes. Each key is allowed to have a primary code and a secondary code. Depending on what mode is chosen, the secondary code might be sent when the key is released, or when the key is held more than one second, etc. Key repeat is also programmable, and each key can have a different mode.

Many cursor movement features are implemented, all the standard ones (backspace, carriage return etc.) and if you tell the program your LCD format, text will flow from line to line.

For more detail: LCD Serial Terminal using PIC16F84

Quick Solutions to Questions related to LCD Serial Terminal:

  • What is the main function of this device?
    It acts as a self-contained serial terminal that displays RS-232 input on an LCD and sends keypresses as RS-232 output.
  • Can I use different LCD sizes with this project?
    Yes, displays ranging from 1x8 to 4x20 or 2x40 are compatible.
  • How many keys can the keypad have?
    The keypad should be a matrixed keyboard with up to 5 rows and 4 columns, totaling a maximum of 20 keys.
  • Is it possible to test the terminal without connecting to another computer?
    Yes, you can connect the RS-232 output to the input to see keys as you press them, known as looping back.
  • Can I configure how specific keys behave?
    Yes, each key has fully configurable mapping with four different modes and can send primary or secondary codes based on release time or hold duration.
  • Does the program support text wrapping between lines?
    Yes, if you specify your LCD format, text will flow automatically from one line to the next.
  • Which software is recommended to compile the source code?
    The program should be compiled with Hi-Tech PICC, though the free PICLITE version works fine for the PIC16F84.
  • What standard cursor movements are implemented?
    The implementation includes all standard features such as backspace and carriage return.

About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter