
6
CALCULATE, COMPARE & CAPTURE
In this chapter, applications will be described which illustrate the use of the
keypad, LCD display and hardware timers as well as some of the virtual in-
struments available for simulated circuit operation.
Calculator
The circuit for a calculator which will perform simple arithmetic operations in
the 16F877 MCU, using a calculator keypad and 16⫻2 LCD display, is shown
in Figure 6.1.
The keypad has 16 keys: 10 numeric buttons, 4 arithmetic operations, equals
and clear. The results obtained are displayed on the first line of the LCD
display, which receives the characters as ASCII codes in 4-bit mode (see
Chapter 4). To keep ...