Select Page

FLOATING-POINT CALCULATOR USING GRAPHICS DISPLAY

Problem Statement
Design a user interface calculator to read the inputs from and display the result on Kentec
QVGA touch screen graphics display using TIVA C series launchpad.
Resources

  • Kentec QVGA Touch Screen Graphics Display.
  • TIVA C Series Microcontroller (TM4C123GH6PM)
  • Code Composer Studio IDE.
  • GCC
  • Project Overview
    In this project we designed the LCD interface with multiple touch buttons on each panel.
    There are six panels in the LCD:
    1. Home Panel
    2. Standard Panel
    3. Trigonometric Panel
    4. Data Converter Panel
    5. Age Calculator Panel
    6. All Function Panel
    Home Panel
    This is the first panel. It contains Five touch buttons:
    1. STANADARD
    2. TRIGONOMENTRIC
    3. DATA CONVERTER
    4. AGE CALCULATOR
    5. ALL FUNCTIONS
    Pressing these buttons will lead to that panel. Image of the home panel is as below:

Figure1: Home Panel

 

 

 

 

 

 

 

 

 

 

 

Standard Panel
This is the second panel. Clicking on the STANDARD button on the Home panel will clear the
existing screen and calls the OnNext function and displays the STANDARD panel.

It containsbasic arithmetic operations like addition, subtraction, multiplication, and division. Among
these operation Multiplication and division is given high precedence over addition and
subtraction. We can evaluate multiple operations at a time. Clicking on buttons in this panel
invokes ‘OnButtonPress_1’ function. Till an ‘=’ is pressed, the expression entered is stored in
a character array ‘char_pressed’. Pressing ‘=’ calls two functions ‘processing and ‘calculation’,
where the expression is first sorted into operands and operators and then calculated based on
the precedence. ‘Back’ button in each panel other than the Home pane

Figure 2: Standard Panel

 

 

 

 

 

 

 

 

 

 

 

Trigonometric Panel
This the Third panel. Clicking on the TRIGONOMETRIC button on the Home panel will clear
the existing screen and calls the OnNext function and displays the TRIGONOMETRIC panel.
It contains trigonometric functions, and, in this panel, we can also perform all arithmetic
operation of trigonometric functions. It has a feature Degree mode or Radian’s mode we can
change these modes using the degree button on the panel. After a button is pressed,
OnButtonPressed_2 function is called, disp_array and char_pressed arrays are updated. On
pressing buttons with trigonometric functions, trig_function is called such that the function is
applied on the last operand. Similar to STANDARD panel, processing and calculation
functions are called after ‘=’ button is pressed and result is updated. An image of Trigonometric
panel evaluating an expression is shown below:

Figure 3: Trigonometric Panel

 

 

 

 

 

 

 

 

 

 

 

Data Converter Panel
This is the Fourth panel. Clicking on the button on the Home panel will clear the existing screen
and calls the OnNext function and displays the DATA CONVERTER panel. It can perform
decimal to binary, binary to decimal, decimal to Hex, and Hex to decimal conversions. Clicking
on a function modifies the DataConv_func and enables the respective inputs that can be
accepted for that input radix. Input entered is stored in char_pressed_3 character array through
OnButtonPress_3 function and when ‘=’ is pressed, respective conversion functions are called
for evaluation on input and the result is displayed. An image of converting an input from binary
to decimal is shown below:

Figure 4: Data converter Panel

 

 

 

 

 

 

 

 

 

 

Age Calculator Panel
This is the Fifth panel. Clicking on the button on the Home panel will clear the existing screen
and calls the OnNext function and displays the AGE CAL panel. In this panel, entering the user
Date of birth and current date will give age of that person by calling OnButtonPress_4 function
after each button is pressed and data_process function after an ‘=’ is pressed. The Age
Calculator Panel image is shown below.

Figure 5: Age Calculator

 

 

 

 

 

 

 

 

 

 

 

All Function Panel
This is the Sixth panel. Clicking on the button on the Home panel will clear the existing screen
and calls the OnNext function and displays the ALL FUNCTIONS panel. It contains all
arithmetic operations and other functions like power, logarithmic, ceil, floor, inverse, etc. Like
STANDARD panel, after an ‘=’ is pressed, the input expression in char-pressed character array
is evaluated using the ‘processing’ and ‘calculation’ functions. An image of All Functions
panel evaluating an expression is shown below:

Figure 6: All Functions Panel

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Description

1.Power supply to Display.
2.Ground to Display.
3.Reset.
4.SPI clock input for LCD.

5. Chip select signal input for LCD.
6. SPI data input for LCD.
7. Resistive touch screen data input for micro-controller.
Understanding GLCD interfacing
Introduction
The BOOSTXL-K350QVG-S1 Kentec QVGA Display BoosterPack is an easy-to-use plug-in
module with a touch-screen colour display. We can use this BoosterPack to start developing
applications using the 320×240-pixel TFT QVGA display with resistive touch screen.It uses
SPI for communication.
Key Features
1. Kentec TFT LCD (part number: K350QVG-S1)
1. 3.5-inch QVGA (320×240 resolution)
2. SPI communication
3. 4-wire resistive touch screen
4. White LED backlight
2. LED backlight driver circuit
3. Complies with the BoosterPack standard for use with 20- and 40-pin
LaunchPads.

The following are the images of GLCD Display, micro-controller, and their interface.

Figure 7: LCD mounted on controller

 

 

 

 

 

 

 

Figure 8: Removing the R9 and R10 registers

 

 

 

 

 

 

 

 

 

 

 

 

 

Future work

1.Evaluating algebraic equations
2.Panel to perform matrix operations
3.Operations on complex numbers
Reference
BOOSTXL-K350QVG-S1 QVGA Display Booster Pack™ Plug-in Module
http://www.ti.com/lit/ug/slau601a/slau601a.pdf

TivaWare™ Graphics Library(User’s Guide) –
http://www.ti.com/lit/ug/spmu300d/spmu300d.pdf

TivaWare ™ Graphics Library Display Drivers –
http://www.ti.com/lit/an/spma055/spma055.pdf
BoosterPack (BOOSTXL- K350QVG-S1)
– http://www.kentecdisplay.com/uploads/soft/Products_spec/BOOSTXL-

Example of grlib: https://github.com/yuvadm/tiva-c/tree/master/boards/dk-
tm4c129x/grlib_demo

Demo: https://youtu.be/1zgZ4mkyLns