0% found this document useful (0 votes)
20 views17 pages

3.5 Seven Segment Display Interfacing With ARM Controller

The document outlines a course module on interfacing a Seven Segment Display with an ARM Controller, specifically the LPC2148. It includes an overview of microcontroller architectures, programming techniques, and a detailed algorithm for displaying numbers and letters on the display using GPIO pins. The document also provides example code and explanations for setting up the display and controlling it via the ARM microcontroller.

Uploaded by

athmika04nagaraj
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views17 pages

3.5 Seven Segment Display Interfacing With ARM Controller

The document outlines a course module on interfacing a Seven Segment Display with an ARM Controller, specifically the LPC2148. It includes an overview of microcontroller architectures, programming techniques, and a detailed algorithm for displaying numbers and letters on the display using GPIO pins. The document also provides example code and explanations for setting up the display and controlling it via the ARM microcontroller.

Uploaded by

athmika04nagaraj
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 17

22EE602 - MICROCONTROLLERS

Module 3: ARM Controller


Seven Segment Display Interfacing with ARM
Controller
by
Dr. R. Sumathi
Professor
Department of Electrical and Electronics Engineering

www.skcet.ac.in Dr. R. Sumathi, Professor/EEE, SKCET [email protected] 1


SYLLABUS
Module 1: 8051 Microcontroller 15 Hrs
Overview of Microprocessors - 8051: Functional block diagram - Instruction set -
addressing modes – Interrupt structure - Timer – I/O ports – Serial Communication,
Simple programming - Key board and display interface – DC motor control - Stepper
motor control.
Module 2: PIC Microcontroller 15 Hrs
PIC18FXXX: Architecture - Data and program memory organization - Addressing modes -
Instruction set - Move / Copy instructions, Arithmetic instructions, Logic instructions,
Branches instructions, Bit Manipulation instructions, Table Read/Write instructions,
Machine Control instructions – Timers – Interrupt, ISR, priority - Speed Control of
Induction Motor.
Module 3: ARM Controller 15 Hrs
ARM7TDMI: Features – Block diagram – Architecture – Addressing modes – Instruction
set – Thumb instructions - Data processing instructions, Data transfer instructions, Branch
and control instructions, Register load and store instructions, Multiple register load and
store instructions, Status register access instructions, Coprocessor instructions - Seven
Segment Display Interfacing with ARM Controller.
Dr. R. Sumathi, Professor/EEE, SKCET 2
Course Outcomes
C602.1 - Illustrate the architecture of 8051 Microcontroller [U].

C602.2 - Develop assembly language programs using 8051 for various


applications [AP].

C602.3 - Analyze the architecture of PIC Microcontroller and Construct the


simple programs [A].

C602.4 - Infer the architecture of ARM controller[A].

C602.5 - Construct the simple programs using ARM [C].

Dr. R. Sumathi, Professor/EEE, SKCET 3


TEXT BOOKS
1. Kenneth Ayala, “The 8051 Microcontroller”, Cengage Learning
Publications, 2nd Edition, 2017.
2. John.B.Peatman , “ Design with PIC Microcontroller , Prentice hall, 2012.
3. Subrata Ghoshal, 8051 Microcontroller Internals, Instructions,
Programming and Interfacing, Second edition, Pearson Education Asia,
2014.
4. Myke Predko, “Programming and customizing the PIC microcontroller”,
Tata McGraw Hill Publishing Company Limited, Third Edition, 2015.
5. Steve Furber, ‟ ARM System –On – Chip architecture“, Addision Wesley,
2015.
Dr. R. Sumathi, Professor/EEE, SKCET 4
REFERENCE BOOKS
1. Muhammad Ali Mazidi, Janice Gillispie Mazidi, Rolin McKinlay, ‘The 8051
Microcontroller and Embedded Systems using Assembly and C’, Prentice
Hall Publications, 2nd Edition, 2008.
2. Krishna Kant, ‘Microprocessor and Microcontrollers’, Eastern Company
Edition, Prentice Hall of India, New Delhi, 2nd edition,2013.
3. Joseph Yiu , ‘The Definitive Guide to the ARM Cortex-M0’ Newnes –
Elsevier, 2011.
4. Muhammad Tahir and Kashif Javed, ‘ARM Microprocessor Systems -
Cortex-M Architecture, Programming, and Interfacing’, CRC Press, 2011.

Dr. R. Sumathi, Professor/EEE, SKCET 5


Seven Segment Display
Interfacing with ARM Controller

Dr. R. Sumathi, Professor/EEE, SKCET 6


Interfacing 7 Segment with LPC2148 ARM
• Seven segment displays are the output display device that
provides a way to display information in the form of images or text
or decimal numbers.
• It is widely used in digital clocks, basic calculators, electronic
meters, and other electronic devices that display numerical
information.
• It consists of seven segments of light-emitting diodes (LEDs)
which are assembled like numerical 8.
• There are two types of LED 7-segment display called: Common
Cathode (CC) and (CA). The difference between the two displays,
as their name suggests, is that the common cathode has all the
cathodes of the 7-segments connected directly together and the
common anode has all the anodes of the 7-segments connected
together and is illuminated as follows.
Dr. R. Sumathi, Professor/EEE, SKCET 7
Interfacing 7 Segment with LPC2148 ARM
• In the common cathode display, all the cathode connections of the LED
segments are joined together to logic “0” or ground. The individual
segments are illuminated by application of a “HIGH”, or logic “1” signal via
a current limiting resistor to forward bias the individual Anode terminals (a-
g).

Dr. R. Sumathi, Professor/EEE, SKCET 8


Interfacing 7 Segment with LPC2148 ARM
• In the common anode display, all the anode connections of the LED
segments are joined together to logic “1”. The individual segments are
illuminated by applying a ground, logic “0” or “LOW” signal via a suitable
current limiting resistor to the Cathode of the particular segment (a-g). In
general, common anode displays are more popular as many logic circuits
can sink more current than they can source.

Dr. R. Sumathi, Professor/EEE, SKCET 9


Interfacing 7 Segment with LPC2148 ARM
• The LPC2148 is part of the ARM7 family, and it uses the GPIO (General
Purpose Input/Output) pins for controlling LEDs.

Dr. R. Sumathi, Professor/EEE, SKCET 10


Interfacing 7 Segment with LPC2148 ARM
Algorithm:
• The task is to display all numbers (0-9) and alphabets (A-E) on seven segment display.
• Connect the 7-segment display's segments (A-G) to the GPIO pins (P0.0 to P0.7) of the
LPC2148, using appropriate current-limiting resistors. use a common cathode type display.
• Configure the GPIO pins as output pins in the program. The a, b, c, d, e, f and g terminals
of display are connected to P0.0 to P0.6 respectively. Common terminal is connected to
P0.7.
• Create a lookup table or an array to represent the bit patterns for digits 0-9 and for the
alphabets.
• Write a program to send the corresponding bit patterns to the 7-segment display to show
each digit.
• Implement delays between digit changes to allow for visible display of each number.
• Load the program into the LPC2148, and verify the 7- segment display shows the
alphabets and numbers 0-9 sequentially.
Dr. R. Sumathi, Professor/EEE, SKCET 11
Interfacing 7 Segment with LPC2148 ARM

Dr. R. Sumathi, Professor/EEE, SKCET 12


Interfacing 7 Segment with LPC2148 ARM

Dr. R. Sumathi, Professor/EEE, SKCET 13


Interfacing 7 Segment with LPC2148 ARM

#include <lpc214x.h> // Header file for LPC devices

void delay(unsigned int); // Function for delay

// Segment patterns for 0-9 and A-F (common cathode)

const unsigned char seg[ ] = { 0x3F, 0x06, 0x5B, 0x4F, 0x66, 0x6D, 0x7D,

0x07, 0x7F, 0x6F, 0x77, 0x7C, 0x39, 0x5E, 0x79, 0x71 };

Dr. R. Sumathi, Professor/EEE, SKCET 14


Interfacing 7 Segment with LPC2148 ARM
int main() {
IODIR0 = 0x000000FF; // Set P0.0 to P0.7 as output
while (1) // Infinite loop
{
for (int i = 0; i < 16; i++) {
IOPIN0 = seg[i]; // Display the current character
delay(50); // Wait for 50 ms
}
}
return 0;
}
void delay(unsigned int t) {
unsigned int j, k;
for (j = 0; j < t; j++)
for (k = 0; k < 5000; k++); // Delay loop
}
Dr. R. Sumathi, Professor/EEE, SKCET 15
Interfacing 7 Segment with LPC2148 ARM
Details of Code:

• The seg array defines the binary patterns for each hexadecimal digit (0-F)
in a common cathode configuration. Each bit in the pattern corresponds to
a segment on the seven-segment display (a-g and the decimal point).
• IODIR0 = 0x000000FF; sets the lower 8 bits of Port 0 (P0.0 to P0.7) as
output to drive the display segments.
• IOPIN0 register is used to send data to be displayed on the pins of Port 0.
• The while (1) loop runs infinitely, iterating through all 16 hexadecimal
patterns.
• The delay() function is used to introduce a specific delay between the
displayed digits/characters.
Dr. R. Sumathi, Professor/EEE, SKCET 16
THANK YOU

Dr. R. Sumathi, Professor/EEE, SKCET 17

You might also like