Download Anna University B-Tech ECE 7th Sem Embedded Lab Manual Question Paper

Download Anna University B.Tech (Bachelor of Technology) ECE (Electronics And Communications Engineering) 7th Sem Embedded Lab Manual Question Paper.

1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00






?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING

VII SEMESTER - R 2013

EC6711 ? EMBEDDED LABORATORY






Name : _______________________________________
Register No : _______________________________________
Section : _______________________________________
LABORATORY MANUAL
FirstRanker.com - FirstRanker's Choice
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00






?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING

VII SEMESTER - R 2013

EC6711 ? EMBEDDED LABORATORY






Name : _______________________________________
Register No : _______________________________________
Section : _______________________________________
LABORATORY MANUAL



2 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00




is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and
training.

? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different
levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on
heart and soul
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

To impart professional education integrated with human values to the younger generation, so as to
shape them as proficient and dedicated engineers, capable of providing comprehensive solutions to the
challenges in deploying technology for the service of humanity

? To educate the students with the state-of-art technologies to meet the growing challenges of the
electronics industry
? To carry out research through continuous interaction with research institutes and industry, on
advances in communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning,
innovation and ethical practices
VISION
VISION
MISSION
MISSION
FirstRanker.com - FirstRanker's Choice
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00






?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING

VII SEMESTER - R 2013

EC6711 ? EMBEDDED LABORATORY






Name : _______________________________________
Register No : _______________________________________
Section : _______________________________________
LABORATORY MANUAL



2 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00




is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and
training.

? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different
levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on
heart and soul
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

To impart professional education integrated with human values to the younger generation, so as to
shape them as proficient and dedicated engineers, capable of providing comprehensive solutions to the
challenges in deploying technology for the service of humanity

? To educate the students with the state-of-art technologies to meet the growing challenges of the
electronics industry
? To carry out research through continuous interaction with research institutes and industry, on
advances in communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning,
innovation and ethical practices
VISION
VISION
MISSION
MISSION



3 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

PROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To provide students with a solid foundation in Mathematics, Science and fundamentals of
engineering, enabling them to apply, to find solutions for engineering problems and use this knowledge
to acquire higher education
2. Core Competence
To train the students in Electronics and Communication technologies so that they apply their
knowledge and training to compare, and to analyze various engineering industrial problems to find
solutions
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice which
enables them to find solutions for the real time problems in industry, and to design products
4. Professionalism
To inculcate professional and effective communication skills, leadership qualities and team spirit in
the students to make them multi-faceted personalities and develop their ability to relate engineering
issues to broader social context
5. Lifelong Learning/Ethics
To demonstrate and practice ethical and professional responsibilities in the industry and society in
the large, through commitment and lifelong learning needed for successful professional career


FirstRanker.com - FirstRanker's Choice
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00






?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING

VII SEMESTER - R 2013

EC6711 ? EMBEDDED LABORATORY






Name : _______________________________________
Register No : _______________________________________
Section : _______________________________________
LABORATORY MANUAL



2 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00




is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and
training.

? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different
levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on
heart and soul
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

To impart professional education integrated with human values to the younger generation, so as to
shape them as proficient and dedicated engineers, capable of providing comprehensive solutions to the
challenges in deploying technology for the service of humanity

? To educate the students with the state-of-art technologies to meet the growing challenges of the
electronics industry
? To carry out research through continuous interaction with research institutes and industry, on
advances in communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning,
innovation and ethical practices
VISION
VISION
MISSION
MISSION



3 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

PROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To provide students with a solid foundation in Mathematics, Science and fundamentals of
engineering, enabling them to apply, to find solutions for engineering problems and use this knowledge
to acquire higher education
2. Core Competence
To train the students in Electronics and Communication technologies so that they apply their
knowledge and training to compare, and to analyze various engineering industrial problems to find
solutions
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice which
enables them to find solutions for the real time problems in industry, and to design products
4. Professionalism
To inculcate professional and effective communication skills, leadership qualities and team spirit in
the students to make them multi-faceted personalities and develop their ability to relate engineering
issues to broader social context
5. Lifelong Learning/Ethics
To demonstrate and practice ethical and professional responsibilities in the industry and society in
the large, through commitment and lifelong learning needed for successful professional career


4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
PROGRAMME OUTCOMES (POs)
a) To demonstrate and apply knowledge of Mathematics, Science and engineering fundamentals in
Electronics and Communication Engineering field
b) To design a component, a system or a process to meet the specific needs within the realistic
constraints such as economics, environment, ethics, health, safety and manufacturability
c) To demonstrate the competency to use software tools for computation, simulation and testing of electronics
and communication engineering circuits
d) To identify, formulate and solve electronic and communication engineering problems
e) To demonstrate an ability to visualize and work on laboratory and multidisciplinary tasks
f) To function as a member or a leader in multidisciplinary activities
g) To communicate in verbal and written form with fellow engineers and society at large
h) To understand the impact of Electronics and Communication Engineering in the society and demonstrate
awareness of contemporary issues and commitment to give solutions exhibiting social responsibility
i) To demonstrate professional & ethical responsibilities
j) To exhibit confidence in self-education and ability for lifelong learning
k) To participate and succeed in competitive exams


FirstRanker.com - FirstRanker's Choice
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00






?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING

VII SEMESTER - R 2013

EC6711 ? EMBEDDED LABORATORY






Name : _______________________________________
Register No : _______________________________________
Section : _______________________________________
LABORATORY MANUAL



2 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00




is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and
training.

? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different
levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on
heart and soul
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

To impart professional education integrated with human values to the younger generation, so as to
shape them as proficient and dedicated engineers, capable of providing comprehensive solutions to the
challenges in deploying technology for the service of humanity

? To educate the students with the state-of-art technologies to meet the growing challenges of the
electronics industry
? To carry out research through continuous interaction with research institutes and industry, on
advances in communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning,
innovation and ethical practices
VISION
VISION
MISSION
MISSION



3 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

PROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To provide students with a solid foundation in Mathematics, Science and fundamentals of
engineering, enabling them to apply, to find solutions for engineering problems and use this knowledge
to acquire higher education
2. Core Competence
To train the students in Electronics and Communication technologies so that they apply their
knowledge and training to compare, and to analyze various engineering industrial problems to find
solutions
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice which
enables them to find solutions for the real time problems in industry, and to design products
4. Professionalism
To inculcate professional and effective communication skills, leadership qualities and team spirit in
the students to make them multi-faceted personalities and develop their ability to relate engineering
issues to broader social context
5. Lifelong Learning/Ethics
To demonstrate and practice ethical and professional responsibilities in the industry and society in
the large, through commitment and lifelong learning needed for successful professional career


4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
PROGRAMME OUTCOMES (POs)
a) To demonstrate and apply knowledge of Mathematics, Science and engineering fundamentals in
Electronics and Communication Engineering field
b) To design a component, a system or a process to meet the specific needs within the realistic
constraints such as economics, environment, ethics, health, safety and manufacturability
c) To demonstrate the competency to use software tools for computation, simulation and testing of electronics
and communication engineering circuits
d) To identify, formulate and solve electronic and communication engineering problems
e) To demonstrate an ability to visualize and work on laboratory and multidisciplinary tasks
f) To function as a member or a leader in multidisciplinary activities
g) To communicate in verbal and written form with fellow engineers and society at large
h) To understand the impact of Electronics and Communication Engineering in the society and demonstrate
awareness of contemporary issues and commitment to give solutions exhibiting social responsibility
i) To demonstrate professional & ethical responsibilities
j) To exhibit confidence in self-education and ability for lifelong learning
k) To participate and succeed in competitive exams


5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
SYLLABUS

? Learn the working of ARM processor
? Understand the Building Blocks of Embedded Systems
? Learn the concept of memory map and memory interface
? Know the characteristics of Real Time Systems
? Write programs to interface memory, I/Os with processor
? Study the interrupt performance
LIST OF EXPERIMENTS:
1. Study of ARM evaluation system
2. Interfacing ADC and DAC
3. Interfacing LED and PWM
4. Interfacing real time clock and serial port
5. Interfacing keyboard and LCD
6. Interfacing EPROM and interrupt
7. Mailbox
8. Interrupt performance characteristics of ARM and FPGA
9. Flashing of LEDS
10. Interfacing stepper motor and temperature sensor
11. Implementing zigbee protocol with ARM



? Write programs in ARM for a specific Application
? Interface memory and Write programs related to memory operations
? Interface A/D and D/A convertors with ARM system
? Analyze the performance of interrupt
? Write programmes for interfacing keyboard, display, motor and sensor.
? Formulate a mini project using embedded system
COURSE OBJECTIVES
COURSE OUTCOMES
FirstRanker.com - FirstRanker's Choice
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00






?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING

VII SEMESTER - R 2013

EC6711 ? EMBEDDED LABORATORY






Name : _______________________________________
Register No : _______________________________________
Section : _______________________________________
LABORATORY MANUAL



2 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00




is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and
training.

? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different
levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on
heart and soul
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

To impart professional education integrated with human values to the younger generation, so as to
shape them as proficient and dedicated engineers, capable of providing comprehensive solutions to the
challenges in deploying technology for the service of humanity

? To educate the students with the state-of-art technologies to meet the growing challenges of the
electronics industry
? To carry out research through continuous interaction with research institutes and industry, on
advances in communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning,
innovation and ethical practices
VISION
VISION
MISSION
MISSION



3 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

PROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To provide students with a solid foundation in Mathematics, Science and fundamentals of
engineering, enabling them to apply, to find solutions for engineering problems and use this knowledge
to acquire higher education
2. Core Competence
To train the students in Electronics and Communication technologies so that they apply their
knowledge and training to compare, and to analyze various engineering industrial problems to find
solutions
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice which
enables them to find solutions for the real time problems in industry, and to design products
4. Professionalism
To inculcate professional and effective communication skills, leadership qualities and team spirit in
the students to make them multi-faceted personalities and develop their ability to relate engineering
issues to broader social context
5. Lifelong Learning/Ethics
To demonstrate and practice ethical and professional responsibilities in the industry and society in
the large, through commitment and lifelong learning needed for successful professional career


4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
PROGRAMME OUTCOMES (POs)
a) To demonstrate and apply knowledge of Mathematics, Science and engineering fundamentals in
Electronics and Communication Engineering field
b) To design a component, a system or a process to meet the specific needs within the realistic
constraints such as economics, environment, ethics, health, safety and manufacturability
c) To demonstrate the competency to use software tools for computation, simulation and testing of electronics
and communication engineering circuits
d) To identify, formulate and solve electronic and communication engineering problems
e) To demonstrate an ability to visualize and work on laboratory and multidisciplinary tasks
f) To function as a member or a leader in multidisciplinary activities
g) To communicate in verbal and written form with fellow engineers and society at large
h) To understand the impact of Electronics and Communication Engineering in the society and demonstrate
awareness of contemporary issues and commitment to give solutions exhibiting social responsibility
i) To demonstrate professional & ethical responsibilities
j) To exhibit confidence in self-education and ability for lifelong learning
k) To participate and succeed in competitive exams


5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
SYLLABUS

? Learn the working of ARM processor
? Understand the Building Blocks of Embedded Systems
? Learn the concept of memory map and memory interface
? Know the characteristics of Real Time Systems
? Write programs to interface memory, I/Os with processor
? Study the interrupt performance
LIST OF EXPERIMENTS:
1. Study of ARM evaluation system
2. Interfacing ADC and DAC
3. Interfacing LED and PWM
4. Interfacing real time clock and serial port
5. Interfacing keyboard and LCD
6. Interfacing EPROM and interrupt
7. Mailbox
8. Interrupt performance characteristics of ARM and FPGA
9. Flashing of LEDS
10. Interfacing stepper motor and temperature sensor
11. Implementing zigbee protocol with ARM



? Write programs in ARM for a specific Application
? Interface memory and Write programs related to memory operations
? Interface A/D and D/A convertors with ARM system
? Analyze the performance of interrupt
? Write programmes for interfacing keyboard, display, motor and sensor.
? Formulate a mini project using embedded system
COURSE OBJECTIVES
COURSE OUTCOMES
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
CONTENTS
Sl. No. Name of the Experiment Page No.
CYCLE 1 ? EXPERIMENTS
1
Study of ARM evaluation system 7
2
Analog to Digital Convertor interfacing 16
3
Generation of ramp and square wave using on-Chip DAC 19
4
LED dimming using PWM 22
5
Interfacing real time clock and serial port 25
6
Interfacing keypad and LCD 28
7
Interfacing EPROM and interrupt 31
CYCLE 2 ? EXPERIMENTS
8 Implementation of Mailbox Function using LPC 2148 35
9 Interrupt Performance Characteristics of Arm and FPGA 37
10 Flashing of LEDs 40
11 Stepper Motor Interface with ARM ? 7 LPC2148 43
12 LM35 Temperature Sensor Interface with ARM ? 7 LPC2148 47
13
Implementation of Wireless Communication Protocol using ZIGBEE Wireless
Module
50
ADDITIONAL EXPERIMENTS BEYOND THE SYYLABUS
14 Buzzer Interface with ARM ? 7 54
15 Relay interface with ARM? 7 57
FirstRanker.com - FirstRanker's Choice
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00






?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING

VII SEMESTER - R 2013

EC6711 ? EMBEDDED LABORATORY






Name : _______________________________________
Register No : _______________________________________
Section : _______________________________________
LABORATORY MANUAL



2 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00




is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and
training.

? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different
levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on
heart and soul
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

To impart professional education integrated with human values to the younger generation, so as to
shape them as proficient and dedicated engineers, capable of providing comprehensive solutions to the
challenges in deploying technology for the service of humanity

? To educate the students with the state-of-art technologies to meet the growing challenges of the
electronics industry
? To carry out research through continuous interaction with research institutes and industry, on
advances in communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning,
innovation and ethical practices
VISION
VISION
MISSION
MISSION



3 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

PROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To provide students with a solid foundation in Mathematics, Science and fundamentals of
engineering, enabling them to apply, to find solutions for engineering problems and use this knowledge
to acquire higher education
2. Core Competence
To train the students in Electronics and Communication technologies so that they apply their
knowledge and training to compare, and to analyze various engineering industrial problems to find
solutions
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice which
enables them to find solutions for the real time problems in industry, and to design products
4. Professionalism
To inculcate professional and effective communication skills, leadership qualities and team spirit in
the students to make them multi-faceted personalities and develop their ability to relate engineering
issues to broader social context
5. Lifelong Learning/Ethics
To demonstrate and practice ethical and professional responsibilities in the industry and society in
the large, through commitment and lifelong learning needed for successful professional career


4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
PROGRAMME OUTCOMES (POs)
a) To demonstrate and apply knowledge of Mathematics, Science and engineering fundamentals in
Electronics and Communication Engineering field
b) To design a component, a system or a process to meet the specific needs within the realistic
constraints such as economics, environment, ethics, health, safety and manufacturability
c) To demonstrate the competency to use software tools for computation, simulation and testing of electronics
and communication engineering circuits
d) To identify, formulate and solve electronic and communication engineering problems
e) To demonstrate an ability to visualize and work on laboratory and multidisciplinary tasks
f) To function as a member or a leader in multidisciplinary activities
g) To communicate in verbal and written form with fellow engineers and society at large
h) To understand the impact of Electronics and Communication Engineering in the society and demonstrate
awareness of contemporary issues and commitment to give solutions exhibiting social responsibility
i) To demonstrate professional & ethical responsibilities
j) To exhibit confidence in self-education and ability for lifelong learning
k) To participate and succeed in competitive exams


5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
SYLLABUS

? Learn the working of ARM processor
? Understand the Building Blocks of Embedded Systems
? Learn the concept of memory map and memory interface
? Know the characteristics of Real Time Systems
? Write programs to interface memory, I/Os with processor
? Study the interrupt performance
LIST OF EXPERIMENTS:
1. Study of ARM evaluation system
2. Interfacing ADC and DAC
3. Interfacing LED and PWM
4. Interfacing real time clock and serial port
5. Interfacing keyboard and LCD
6. Interfacing EPROM and interrupt
7. Mailbox
8. Interrupt performance characteristics of ARM and FPGA
9. Flashing of LEDS
10. Interfacing stepper motor and temperature sensor
11. Implementing zigbee protocol with ARM



? Write programs in ARM for a specific Application
? Interface memory and Write programs related to memory operations
? Interface A/D and D/A convertors with ARM system
? Analyze the performance of interrupt
? Write programmes for interfacing keyboard, display, motor and sensor.
? Formulate a mini project using embedded system
COURSE OBJECTIVES
COURSE OUTCOMES
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
CONTENTS
Sl. No. Name of the Experiment Page No.
CYCLE 1 ? EXPERIMENTS
1
Study of ARM evaluation system 7
2
Analog to Digital Convertor interfacing 16
3
Generation of ramp and square wave using on-Chip DAC 19
4
LED dimming using PWM 22
5
Interfacing real time clock and serial port 25
6
Interfacing keypad and LCD 28
7
Interfacing EPROM and interrupt 31
CYCLE 2 ? EXPERIMENTS
8 Implementation of Mailbox Function using LPC 2148 35
9 Interrupt Performance Characteristics of Arm and FPGA 37
10 Flashing of LEDs 40
11 Stepper Motor Interface with ARM ? 7 LPC2148 43
12 LM35 Temperature Sensor Interface with ARM ? 7 LPC2148 47
13
Implementation of Wireless Communication Protocol using ZIGBEE Wireless
Module
50
ADDITIONAL EXPERIMENTS BEYOND THE SYYLABUS
14 Buzzer Interface with ARM ? 7 54
15 Relay interface with ARM? 7 57
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Expt. No. 1 STUDY OF ARM EVALUATION SYSTEM
Aim:
To study the building blocks of ARM7 system, its features, pin configuration and the components
required for functioning of ARM controller.
Architecture Overview:
A RISC-based computer design approach means ARM processors require significantly fewer transistors
than typical processors in average computers. This approach reduces cost, heat and power usage. These
are desirable traits for light, portable, battery-powered devices (smart phones, laptops, tablet and notepad
computers), and other embedded systems. A simpler design facilitates more efficient multi-core CPUs and
higher core counts at lower cost, providing higher processing power and improved energy efficiency for
servers and supercomputers.
In 2005, about 98% of all mobile phones sold used at least one ARM processor. The low power
consumption of ARM processors has made them very popular: 37 billion ARM processors have been
produced as of 2013, up from 10 billion in 2008. The ARM architecture (32-bit) is the most widely used
architecture in mobile devices, and most popular 32-bit one in embedded systems.
According to ARM Holdings, in 2010 alone, producers of chips based on ARM architectures
reported shipments of 6.1 billion ARM based processors, representing 95% of smart phones, 35% of digital
televisions and set-top boxes and 10% of mobile computers. It is the most widely used 32-bit instruction set
architecture in terms of quantity produced.
LPC 2148:
LPC2148 is the widely used IC from ARM-7 family. It is manufactured by Philips and it is pre-loaded
with many inbuilt peripherals making it more efficient and a reliable option for the beginners as well as high
end application developer.

FirstRanker.com - FirstRanker's Choice
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00






?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING

VII SEMESTER - R 2013

EC6711 ? EMBEDDED LABORATORY






Name : _______________________________________
Register No : _______________________________________
Section : _______________________________________
LABORATORY MANUAL



2 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00




is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and
training.

? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different
levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on
heart and soul
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

To impart professional education integrated with human values to the younger generation, so as to
shape them as proficient and dedicated engineers, capable of providing comprehensive solutions to the
challenges in deploying technology for the service of humanity

? To educate the students with the state-of-art technologies to meet the growing challenges of the
electronics industry
? To carry out research through continuous interaction with research institutes and industry, on
advances in communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning,
innovation and ethical practices
VISION
VISION
MISSION
MISSION



3 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

PROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To provide students with a solid foundation in Mathematics, Science and fundamentals of
engineering, enabling them to apply, to find solutions for engineering problems and use this knowledge
to acquire higher education
2. Core Competence
To train the students in Electronics and Communication technologies so that they apply their
knowledge and training to compare, and to analyze various engineering industrial problems to find
solutions
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice which
enables them to find solutions for the real time problems in industry, and to design products
4. Professionalism
To inculcate professional and effective communication skills, leadership qualities and team spirit in
the students to make them multi-faceted personalities and develop their ability to relate engineering
issues to broader social context
5. Lifelong Learning/Ethics
To demonstrate and practice ethical and professional responsibilities in the industry and society in
the large, through commitment and lifelong learning needed for successful professional career


4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
PROGRAMME OUTCOMES (POs)
a) To demonstrate and apply knowledge of Mathematics, Science and engineering fundamentals in
Electronics and Communication Engineering field
b) To design a component, a system or a process to meet the specific needs within the realistic
constraints such as economics, environment, ethics, health, safety and manufacturability
c) To demonstrate the competency to use software tools for computation, simulation and testing of electronics
and communication engineering circuits
d) To identify, formulate and solve electronic and communication engineering problems
e) To demonstrate an ability to visualize and work on laboratory and multidisciplinary tasks
f) To function as a member or a leader in multidisciplinary activities
g) To communicate in verbal and written form with fellow engineers and society at large
h) To understand the impact of Electronics and Communication Engineering in the society and demonstrate
awareness of contemporary issues and commitment to give solutions exhibiting social responsibility
i) To demonstrate professional & ethical responsibilities
j) To exhibit confidence in self-education and ability for lifelong learning
k) To participate and succeed in competitive exams


5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
SYLLABUS

? Learn the working of ARM processor
? Understand the Building Blocks of Embedded Systems
? Learn the concept of memory map and memory interface
? Know the characteristics of Real Time Systems
? Write programs to interface memory, I/Os with processor
? Study the interrupt performance
LIST OF EXPERIMENTS:
1. Study of ARM evaluation system
2. Interfacing ADC and DAC
3. Interfacing LED and PWM
4. Interfacing real time clock and serial port
5. Interfacing keyboard and LCD
6. Interfacing EPROM and interrupt
7. Mailbox
8. Interrupt performance characteristics of ARM and FPGA
9. Flashing of LEDS
10. Interfacing stepper motor and temperature sensor
11. Implementing zigbee protocol with ARM



? Write programs in ARM for a specific Application
? Interface memory and Write programs related to memory operations
? Interface A/D and D/A convertors with ARM system
? Analyze the performance of interrupt
? Write programmes for interfacing keyboard, display, motor and sensor.
? Formulate a mini project using embedded system
COURSE OBJECTIVES
COURSE OUTCOMES
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
CONTENTS
Sl. No. Name of the Experiment Page No.
CYCLE 1 ? EXPERIMENTS
1
Study of ARM evaluation system 7
2
Analog to Digital Convertor interfacing 16
3
Generation of ramp and square wave using on-Chip DAC 19
4
LED dimming using PWM 22
5
Interfacing real time clock and serial port 25
6
Interfacing keypad and LCD 28
7
Interfacing EPROM and interrupt 31
CYCLE 2 ? EXPERIMENTS
8 Implementation of Mailbox Function using LPC 2148 35
9 Interrupt Performance Characteristics of Arm and FPGA 37
10 Flashing of LEDs 40
11 Stepper Motor Interface with ARM ? 7 LPC2148 43
12 LM35 Temperature Sensor Interface with ARM ? 7 LPC2148 47
13
Implementation of Wireless Communication Protocol using ZIGBEE Wireless
Module
50
ADDITIONAL EXPERIMENTS BEYOND THE SYYLABUS
14 Buzzer Interface with ARM ? 7 54
15 Relay interface with ARM? 7 57
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Expt. No. 1 STUDY OF ARM EVALUATION SYSTEM
Aim:
To study the building blocks of ARM7 system, its features, pin configuration and the components
required for functioning of ARM controller.
Architecture Overview:
A RISC-based computer design approach means ARM processors require significantly fewer transistors
than typical processors in average computers. This approach reduces cost, heat and power usage. These
are desirable traits for light, portable, battery-powered devices (smart phones, laptops, tablet and notepad
computers), and other embedded systems. A simpler design facilitates more efficient multi-core CPUs and
higher core counts at lower cost, providing higher processing power and improved energy efficiency for
servers and supercomputers.
In 2005, about 98% of all mobile phones sold used at least one ARM processor. The low power
consumption of ARM processors has made them very popular: 37 billion ARM processors have been
produced as of 2013, up from 10 billion in 2008. The ARM architecture (32-bit) is the most widely used
architecture in mobile devices, and most popular 32-bit one in embedded systems.
According to ARM Holdings, in 2010 alone, producers of chips based on ARM architectures
reported shipments of 6.1 billion ARM based processors, representing 95% of smart phones, 35% of digital
televisions and set-top boxes and 10% of mobile computers. It is the most widely used 32-bit instruction set
architecture in terms of quantity produced.
LPC 2148:
LPC2148 is the widely used IC from ARM-7 family. It is manufactured by Philips and it is pre-loaded
with many inbuilt peripherals making it more efficient and a reliable option for the beginners as well as high
end application developer.




8 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Features of LPC214x series controllers:
1. 8 to 40 kB of on-chip static RAM and 32 to 512 kB of on-chip flash program memory.128 bit wide
interface/accelerator enables high speed 60 MHz operation.
2. In-System/In-Application Programming (ISP/IAP) via on-chip boot-loader software. Single flash sector or
full chip erase in 400 ms and programming of 256 bytes in 1ms.
3. Embedded ICE RT and Embedded Trace interfaces offer real-time debugging with the on-chip Real
Monitor software and high speed tracing of instruction execution.
4. USB 2.0 Full Speed compliant Device Controller with 2 kB of endpoint RAM. In addition, the LPC2146/8
provides 8 kB of on-chip RAM accessible to USB by DMA.
5. One or two (LPC2141/2 vs. LPC2144/6/8) 10-bit A/D converters provide a total of 6/14analog inputs, with
conversion times as low as 2.44 us per channel.
6. Single 10-bit D/A converter provides variable analog output.
7. Two 32-bit timers/external event counters (with four capture and four compare channels each), PWM unit
(six outputs) and watchdog.
8. Low power real-time clock with independent power and dedicated 32 kHz clock input.
9. Multiple serial interfaces including two UARTs (16C550), two Fast I2C-bus (400 kbit/s), SPI and SSP with
buffering and variable data length capabilities.
10. Vectored interrupt controller with configurable priorities and vector addresses.
11. Up to 45 of 5 V tolerant fast general purpose I/O pins in a tiny LQFP64 package.
12. Up to nine edge or level sensitive external interrupt pins available.
13. On-chip integrated oscillator operates with an external crystal in range from 1 MHz to30 MHz and with
an external oscillator up to 50 MHz
14. Power saving modes include Idle and Power-down.
15. Individual enable/disable of peripheral functions as well as peripheral clock scaling for additional power
optimization.
16. Processor wake-up from Power-down mode via external interrupt, USB, Brown-Out Detect (BOD) or
Real-Time Clock (RTC).

FirstRanker.com - FirstRanker's Choice
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00






?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING

VII SEMESTER - R 2013

EC6711 ? EMBEDDED LABORATORY






Name : _______________________________________
Register No : _______________________________________
Section : _______________________________________
LABORATORY MANUAL



2 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00




is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and
training.

? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different
levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on
heart and soul
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

To impart professional education integrated with human values to the younger generation, so as to
shape them as proficient and dedicated engineers, capable of providing comprehensive solutions to the
challenges in deploying technology for the service of humanity

? To educate the students with the state-of-art technologies to meet the growing challenges of the
electronics industry
? To carry out research through continuous interaction with research institutes and industry, on
advances in communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning,
innovation and ethical practices
VISION
VISION
MISSION
MISSION



3 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

PROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To provide students with a solid foundation in Mathematics, Science and fundamentals of
engineering, enabling them to apply, to find solutions for engineering problems and use this knowledge
to acquire higher education
2. Core Competence
To train the students in Electronics and Communication technologies so that they apply their
knowledge and training to compare, and to analyze various engineering industrial problems to find
solutions
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice which
enables them to find solutions for the real time problems in industry, and to design products
4. Professionalism
To inculcate professional and effective communication skills, leadership qualities and team spirit in
the students to make them multi-faceted personalities and develop their ability to relate engineering
issues to broader social context
5. Lifelong Learning/Ethics
To demonstrate and practice ethical and professional responsibilities in the industry and society in
the large, through commitment and lifelong learning needed for successful professional career


4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
PROGRAMME OUTCOMES (POs)
a) To demonstrate and apply knowledge of Mathematics, Science and engineering fundamentals in
Electronics and Communication Engineering field
b) To design a component, a system or a process to meet the specific needs within the realistic
constraints such as economics, environment, ethics, health, safety and manufacturability
c) To demonstrate the competency to use software tools for computation, simulation and testing of electronics
and communication engineering circuits
d) To identify, formulate and solve electronic and communication engineering problems
e) To demonstrate an ability to visualize and work on laboratory and multidisciplinary tasks
f) To function as a member or a leader in multidisciplinary activities
g) To communicate in verbal and written form with fellow engineers and society at large
h) To understand the impact of Electronics and Communication Engineering in the society and demonstrate
awareness of contemporary issues and commitment to give solutions exhibiting social responsibility
i) To demonstrate professional & ethical responsibilities
j) To exhibit confidence in self-education and ability for lifelong learning
k) To participate and succeed in competitive exams


5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
SYLLABUS

? Learn the working of ARM processor
? Understand the Building Blocks of Embedded Systems
? Learn the concept of memory map and memory interface
? Know the characteristics of Real Time Systems
? Write programs to interface memory, I/Os with processor
? Study the interrupt performance
LIST OF EXPERIMENTS:
1. Study of ARM evaluation system
2. Interfacing ADC and DAC
3. Interfacing LED and PWM
4. Interfacing real time clock and serial port
5. Interfacing keyboard and LCD
6. Interfacing EPROM and interrupt
7. Mailbox
8. Interrupt performance characteristics of ARM and FPGA
9. Flashing of LEDS
10. Interfacing stepper motor and temperature sensor
11. Implementing zigbee protocol with ARM



? Write programs in ARM for a specific Application
? Interface memory and Write programs related to memory operations
? Interface A/D and D/A convertors with ARM system
? Analyze the performance of interrupt
? Write programmes for interfacing keyboard, display, motor and sensor.
? Formulate a mini project using embedded system
COURSE OBJECTIVES
COURSE OUTCOMES
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
CONTENTS
Sl. No. Name of the Experiment Page No.
CYCLE 1 ? EXPERIMENTS
1
Study of ARM evaluation system 7
2
Analog to Digital Convertor interfacing 16
3
Generation of ramp and square wave using on-Chip DAC 19
4
LED dimming using PWM 22
5
Interfacing real time clock and serial port 25
6
Interfacing keypad and LCD 28
7
Interfacing EPROM and interrupt 31
CYCLE 2 ? EXPERIMENTS
8 Implementation of Mailbox Function using LPC 2148 35
9 Interrupt Performance Characteristics of Arm and FPGA 37
10 Flashing of LEDs 40
11 Stepper Motor Interface with ARM ? 7 LPC2148 43
12 LM35 Temperature Sensor Interface with ARM ? 7 LPC2148 47
13
Implementation of Wireless Communication Protocol using ZIGBEE Wireless
Module
50
ADDITIONAL EXPERIMENTS BEYOND THE SYYLABUS
14 Buzzer Interface with ARM ? 7 54
15 Relay interface with ARM? 7 57
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Expt. No. 1 STUDY OF ARM EVALUATION SYSTEM
Aim:
To study the building blocks of ARM7 system, its features, pin configuration and the components
required for functioning of ARM controller.
Architecture Overview:
A RISC-based computer design approach means ARM processors require significantly fewer transistors
than typical processors in average computers. This approach reduces cost, heat and power usage. These
are desirable traits for light, portable, battery-powered devices (smart phones, laptops, tablet and notepad
computers), and other embedded systems. A simpler design facilitates more efficient multi-core CPUs and
higher core counts at lower cost, providing higher processing power and improved energy efficiency for
servers and supercomputers.
In 2005, about 98% of all mobile phones sold used at least one ARM processor. The low power
consumption of ARM processors has made them very popular: 37 billion ARM processors have been
produced as of 2013, up from 10 billion in 2008. The ARM architecture (32-bit) is the most widely used
architecture in mobile devices, and most popular 32-bit one in embedded systems.
According to ARM Holdings, in 2010 alone, producers of chips based on ARM architectures
reported shipments of 6.1 billion ARM based processors, representing 95% of smart phones, 35% of digital
televisions and set-top boxes and 10% of mobile computers. It is the most widely used 32-bit instruction set
architecture in terms of quantity produced.
LPC 2148:
LPC2148 is the widely used IC from ARM-7 family. It is manufactured by Philips and it is pre-loaded
with many inbuilt peripherals making it more efficient and a reliable option for the beginners as well as high
end application developer.




8 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Features of LPC214x series controllers:
1. 8 to 40 kB of on-chip static RAM and 32 to 512 kB of on-chip flash program memory.128 bit wide
interface/accelerator enables high speed 60 MHz operation.
2. In-System/In-Application Programming (ISP/IAP) via on-chip boot-loader software. Single flash sector or
full chip erase in 400 ms and programming of 256 bytes in 1ms.
3. Embedded ICE RT and Embedded Trace interfaces offer real-time debugging with the on-chip Real
Monitor software and high speed tracing of instruction execution.
4. USB 2.0 Full Speed compliant Device Controller with 2 kB of endpoint RAM. In addition, the LPC2146/8
provides 8 kB of on-chip RAM accessible to USB by DMA.
5. One or two (LPC2141/2 vs. LPC2144/6/8) 10-bit A/D converters provide a total of 6/14analog inputs, with
conversion times as low as 2.44 us per channel.
6. Single 10-bit D/A converter provides variable analog output.
7. Two 32-bit timers/external event counters (with four capture and four compare channels each), PWM unit
(six outputs) and watchdog.
8. Low power real-time clock with independent power and dedicated 32 kHz clock input.
9. Multiple serial interfaces including two UARTs (16C550), two Fast I2C-bus (400 kbit/s), SPI and SSP with
buffering and variable data length capabilities.
10. Vectored interrupt controller with configurable priorities and vector addresses.
11. Up to 45 of 5 V tolerant fast general purpose I/O pins in a tiny LQFP64 package.
12. Up to nine edge or level sensitive external interrupt pins available.
13. On-chip integrated oscillator operates with an external crystal in range from 1 MHz to30 MHz and with
an external oscillator up to 50 MHz
14. Power saving modes include Idle and Power-down.
15. Individual enable/disable of peripheral functions as well as peripheral clock scaling for additional power
optimization.
16. Processor wake-up from Power-down mode via external interrupt, USB, Brown-Out Detect (BOD) or
Real-Time Clock (RTC).




9 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


First Step- Hardware Requirement:
Pin configuration of LPC 2148.

Hardware requirement of LPC2148:
1. LPC2148 need minimum below listed hardware to work properly
2. Power Supply
3. Crystal Oscillator
4. Reset Circuit
5. RTC crystal oscillator
6. UART
FirstRanker.com - FirstRanker's Choice
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00






?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING

VII SEMESTER - R 2013

EC6711 ? EMBEDDED LABORATORY






Name : _______________________________________
Register No : _______________________________________
Section : _______________________________________
LABORATORY MANUAL



2 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00




is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and
training.

? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different
levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on
heart and soul
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

To impart professional education integrated with human values to the younger generation, so as to
shape them as proficient and dedicated engineers, capable of providing comprehensive solutions to the
challenges in deploying technology for the service of humanity

? To educate the students with the state-of-art technologies to meet the growing challenges of the
electronics industry
? To carry out research through continuous interaction with research institutes and industry, on
advances in communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning,
innovation and ethical practices
VISION
VISION
MISSION
MISSION



3 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

PROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To provide students with a solid foundation in Mathematics, Science and fundamentals of
engineering, enabling them to apply, to find solutions for engineering problems and use this knowledge
to acquire higher education
2. Core Competence
To train the students in Electronics and Communication technologies so that they apply their
knowledge and training to compare, and to analyze various engineering industrial problems to find
solutions
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice which
enables them to find solutions for the real time problems in industry, and to design products
4. Professionalism
To inculcate professional and effective communication skills, leadership qualities and team spirit in
the students to make them multi-faceted personalities and develop their ability to relate engineering
issues to broader social context
5. Lifelong Learning/Ethics
To demonstrate and practice ethical and professional responsibilities in the industry and society in
the large, through commitment and lifelong learning needed for successful professional career


4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
PROGRAMME OUTCOMES (POs)
a) To demonstrate and apply knowledge of Mathematics, Science and engineering fundamentals in
Electronics and Communication Engineering field
b) To design a component, a system or a process to meet the specific needs within the realistic
constraints such as economics, environment, ethics, health, safety and manufacturability
c) To demonstrate the competency to use software tools for computation, simulation and testing of electronics
and communication engineering circuits
d) To identify, formulate and solve electronic and communication engineering problems
e) To demonstrate an ability to visualize and work on laboratory and multidisciplinary tasks
f) To function as a member or a leader in multidisciplinary activities
g) To communicate in verbal and written form with fellow engineers and society at large
h) To understand the impact of Electronics and Communication Engineering in the society and demonstrate
awareness of contemporary issues and commitment to give solutions exhibiting social responsibility
i) To demonstrate professional & ethical responsibilities
j) To exhibit confidence in self-education and ability for lifelong learning
k) To participate and succeed in competitive exams


5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
SYLLABUS

? Learn the working of ARM processor
? Understand the Building Blocks of Embedded Systems
? Learn the concept of memory map and memory interface
? Know the characteristics of Real Time Systems
? Write programs to interface memory, I/Os with processor
? Study the interrupt performance
LIST OF EXPERIMENTS:
1. Study of ARM evaluation system
2. Interfacing ADC and DAC
3. Interfacing LED and PWM
4. Interfacing real time clock and serial port
5. Interfacing keyboard and LCD
6. Interfacing EPROM and interrupt
7. Mailbox
8. Interrupt performance characteristics of ARM and FPGA
9. Flashing of LEDS
10. Interfacing stepper motor and temperature sensor
11. Implementing zigbee protocol with ARM



? Write programs in ARM for a specific Application
? Interface memory and Write programs related to memory operations
? Interface A/D and D/A convertors with ARM system
? Analyze the performance of interrupt
? Write programmes for interfacing keyboard, display, motor and sensor.
? Formulate a mini project using embedded system
COURSE OBJECTIVES
COURSE OUTCOMES
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
CONTENTS
Sl. No. Name of the Experiment Page No.
CYCLE 1 ? EXPERIMENTS
1
Study of ARM evaluation system 7
2
Analog to Digital Convertor interfacing 16
3
Generation of ramp and square wave using on-Chip DAC 19
4
LED dimming using PWM 22
5
Interfacing real time clock and serial port 25
6
Interfacing keypad and LCD 28
7
Interfacing EPROM and interrupt 31
CYCLE 2 ? EXPERIMENTS
8 Implementation of Mailbox Function using LPC 2148 35
9 Interrupt Performance Characteristics of Arm and FPGA 37
10 Flashing of LEDs 40
11 Stepper Motor Interface with ARM ? 7 LPC2148 43
12 LM35 Temperature Sensor Interface with ARM ? 7 LPC2148 47
13
Implementation of Wireless Communication Protocol using ZIGBEE Wireless
Module
50
ADDITIONAL EXPERIMENTS BEYOND THE SYYLABUS
14 Buzzer Interface with ARM ? 7 54
15 Relay interface with ARM? 7 57
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Expt. No. 1 STUDY OF ARM EVALUATION SYSTEM
Aim:
To study the building blocks of ARM7 system, its features, pin configuration and the components
required for functioning of ARM controller.
Architecture Overview:
A RISC-based computer design approach means ARM processors require significantly fewer transistors
than typical processors in average computers. This approach reduces cost, heat and power usage. These
are desirable traits for light, portable, battery-powered devices (smart phones, laptops, tablet and notepad
computers), and other embedded systems. A simpler design facilitates more efficient multi-core CPUs and
higher core counts at lower cost, providing higher processing power and improved energy efficiency for
servers and supercomputers.
In 2005, about 98% of all mobile phones sold used at least one ARM processor. The low power
consumption of ARM processors has made them very popular: 37 billion ARM processors have been
produced as of 2013, up from 10 billion in 2008. The ARM architecture (32-bit) is the most widely used
architecture in mobile devices, and most popular 32-bit one in embedded systems.
According to ARM Holdings, in 2010 alone, producers of chips based on ARM architectures
reported shipments of 6.1 billion ARM based processors, representing 95% of smart phones, 35% of digital
televisions and set-top boxes and 10% of mobile computers. It is the most widely used 32-bit instruction set
architecture in terms of quantity produced.
LPC 2148:
LPC2148 is the widely used IC from ARM-7 family. It is manufactured by Philips and it is pre-loaded
with many inbuilt peripherals making it more efficient and a reliable option for the beginners as well as high
end application developer.




8 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Features of LPC214x series controllers:
1. 8 to 40 kB of on-chip static RAM and 32 to 512 kB of on-chip flash program memory.128 bit wide
interface/accelerator enables high speed 60 MHz operation.
2. In-System/In-Application Programming (ISP/IAP) via on-chip boot-loader software. Single flash sector or
full chip erase in 400 ms and programming of 256 bytes in 1ms.
3. Embedded ICE RT and Embedded Trace interfaces offer real-time debugging with the on-chip Real
Monitor software and high speed tracing of instruction execution.
4. USB 2.0 Full Speed compliant Device Controller with 2 kB of endpoint RAM. In addition, the LPC2146/8
provides 8 kB of on-chip RAM accessible to USB by DMA.
5. One or two (LPC2141/2 vs. LPC2144/6/8) 10-bit A/D converters provide a total of 6/14analog inputs, with
conversion times as low as 2.44 us per channel.
6. Single 10-bit D/A converter provides variable analog output.
7. Two 32-bit timers/external event counters (with four capture and four compare channels each), PWM unit
(six outputs) and watchdog.
8. Low power real-time clock with independent power and dedicated 32 kHz clock input.
9. Multiple serial interfaces including two UARTs (16C550), two Fast I2C-bus (400 kbit/s), SPI and SSP with
buffering and variable data length capabilities.
10. Vectored interrupt controller with configurable priorities and vector addresses.
11. Up to 45 of 5 V tolerant fast general purpose I/O pins in a tiny LQFP64 package.
12. Up to nine edge or level sensitive external interrupt pins available.
13. On-chip integrated oscillator operates with an external crystal in range from 1 MHz to30 MHz and with
an external oscillator up to 50 MHz
14. Power saving modes include Idle and Power-down.
15. Individual enable/disable of peripheral functions as well as peripheral clock scaling for additional power
optimization.
16. Processor wake-up from Power-down mode via external interrupt, USB, Brown-Out Detect (BOD) or
Real-Time Clock (RTC).




9 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


First Step- Hardware Requirement:
Pin configuration of LPC 2148.

Hardware requirement of LPC2148:
1. LPC2148 need minimum below listed hardware to work properly
2. Power Supply
3. Crystal Oscillator
4. Reset Circuit
5. RTC crystal oscillator
6. UART
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Power Supply:
LPC2148 works on 3.3 V power supply. LM 117 can be used for generating 3.3 V supply. However,
basic peripherals like LCD, ULN 2003 (Motor Driver IC) etc. works on 5V. So AC mains supply is converted
into 5V using below mentioned circuit and after that LM 117 is used to convert 5V into 3.3V.
Block diagram of power Supply

Transformer: It is used to step down 230V AC to 9V AC supply and provides isolation between power grids
and circuit.
Rectifier: It is used to convert AC supply into DC.
Filter: It is used to reduce ripple factor of DC output available from rectifier end.
Regulator: It is used to regulate DC supply output.

FirstRanker.com - FirstRanker's Choice
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00






?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING

VII SEMESTER - R 2013

EC6711 ? EMBEDDED LABORATORY






Name : _______________________________________
Register No : _______________________________________
Section : _______________________________________
LABORATORY MANUAL



2 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00




is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and
training.

? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different
levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on
heart and soul
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

To impart professional education integrated with human values to the younger generation, so as to
shape them as proficient and dedicated engineers, capable of providing comprehensive solutions to the
challenges in deploying technology for the service of humanity

? To educate the students with the state-of-art technologies to meet the growing challenges of the
electronics industry
? To carry out research through continuous interaction with research institutes and industry, on
advances in communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning,
innovation and ethical practices
VISION
VISION
MISSION
MISSION



3 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

PROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To provide students with a solid foundation in Mathematics, Science and fundamentals of
engineering, enabling them to apply, to find solutions for engineering problems and use this knowledge
to acquire higher education
2. Core Competence
To train the students in Electronics and Communication technologies so that they apply their
knowledge and training to compare, and to analyze various engineering industrial problems to find
solutions
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice which
enables them to find solutions for the real time problems in industry, and to design products
4. Professionalism
To inculcate professional and effective communication skills, leadership qualities and team spirit in
the students to make them multi-faceted personalities and develop their ability to relate engineering
issues to broader social context
5. Lifelong Learning/Ethics
To demonstrate and practice ethical and professional responsibilities in the industry and society in
the large, through commitment and lifelong learning needed for successful professional career


4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
PROGRAMME OUTCOMES (POs)
a) To demonstrate and apply knowledge of Mathematics, Science and engineering fundamentals in
Electronics and Communication Engineering field
b) To design a component, a system or a process to meet the specific needs within the realistic
constraints such as economics, environment, ethics, health, safety and manufacturability
c) To demonstrate the competency to use software tools for computation, simulation and testing of electronics
and communication engineering circuits
d) To identify, formulate and solve electronic and communication engineering problems
e) To demonstrate an ability to visualize and work on laboratory and multidisciplinary tasks
f) To function as a member or a leader in multidisciplinary activities
g) To communicate in verbal and written form with fellow engineers and society at large
h) To understand the impact of Electronics and Communication Engineering in the society and demonstrate
awareness of contemporary issues and commitment to give solutions exhibiting social responsibility
i) To demonstrate professional & ethical responsibilities
j) To exhibit confidence in self-education and ability for lifelong learning
k) To participate and succeed in competitive exams


5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
SYLLABUS

? Learn the working of ARM processor
? Understand the Building Blocks of Embedded Systems
? Learn the concept of memory map and memory interface
? Know the characteristics of Real Time Systems
? Write programs to interface memory, I/Os with processor
? Study the interrupt performance
LIST OF EXPERIMENTS:
1. Study of ARM evaluation system
2. Interfacing ADC and DAC
3. Interfacing LED and PWM
4. Interfacing real time clock and serial port
5. Interfacing keyboard and LCD
6. Interfacing EPROM and interrupt
7. Mailbox
8. Interrupt performance characteristics of ARM and FPGA
9. Flashing of LEDS
10. Interfacing stepper motor and temperature sensor
11. Implementing zigbee protocol with ARM



? Write programs in ARM for a specific Application
? Interface memory and Write programs related to memory operations
? Interface A/D and D/A convertors with ARM system
? Analyze the performance of interrupt
? Write programmes for interfacing keyboard, display, motor and sensor.
? Formulate a mini project using embedded system
COURSE OBJECTIVES
COURSE OUTCOMES
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
CONTENTS
Sl. No. Name of the Experiment Page No.
CYCLE 1 ? EXPERIMENTS
1
Study of ARM evaluation system 7
2
Analog to Digital Convertor interfacing 16
3
Generation of ramp and square wave using on-Chip DAC 19
4
LED dimming using PWM 22
5
Interfacing real time clock and serial port 25
6
Interfacing keypad and LCD 28
7
Interfacing EPROM and interrupt 31
CYCLE 2 ? EXPERIMENTS
8 Implementation of Mailbox Function using LPC 2148 35
9 Interrupt Performance Characteristics of Arm and FPGA 37
10 Flashing of LEDs 40
11 Stepper Motor Interface with ARM ? 7 LPC2148 43
12 LM35 Temperature Sensor Interface with ARM ? 7 LPC2148 47
13
Implementation of Wireless Communication Protocol using ZIGBEE Wireless
Module
50
ADDITIONAL EXPERIMENTS BEYOND THE SYYLABUS
14 Buzzer Interface with ARM ? 7 54
15 Relay interface with ARM? 7 57
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Expt. No. 1 STUDY OF ARM EVALUATION SYSTEM
Aim:
To study the building blocks of ARM7 system, its features, pin configuration and the components
required for functioning of ARM controller.
Architecture Overview:
A RISC-based computer design approach means ARM processors require significantly fewer transistors
than typical processors in average computers. This approach reduces cost, heat and power usage. These
are desirable traits for light, portable, battery-powered devices (smart phones, laptops, tablet and notepad
computers), and other embedded systems. A simpler design facilitates more efficient multi-core CPUs and
higher core counts at lower cost, providing higher processing power and improved energy efficiency for
servers and supercomputers.
In 2005, about 98% of all mobile phones sold used at least one ARM processor. The low power
consumption of ARM processors has made them very popular: 37 billion ARM processors have been
produced as of 2013, up from 10 billion in 2008. The ARM architecture (32-bit) is the most widely used
architecture in mobile devices, and most popular 32-bit one in embedded systems.
According to ARM Holdings, in 2010 alone, producers of chips based on ARM architectures
reported shipments of 6.1 billion ARM based processors, representing 95% of smart phones, 35% of digital
televisions and set-top boxes and 10% of mobile computers. It is the most widely used 32-bit instruction set
architecture in terms of quantity produced.
LPC 2148:
LPC2148 is the widely used IC from ARM-7 family. It is manufactured by Philips and it is pre-loaded
with many inbuilt peripherals making it more efficient and a reliable option for the beginners as well as high
end application developer.




8 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Features of LPC214x series controllers:
1. 8 to 40 kB of on-chip static RAM and 32 to 512 kB of on-chip flash program memory.128 bit wide
interface/accelerator enables high speed 60 MHz operation.
2. In-System/In-Application Programming (ISP/IAP) via on-chip boot-loader software. Single flash sector or
full chip erase in 400 ms and programming of 256 bytes in 1ms.
3. Embedded ICE RT and Embedded Trace interfaces offer real-time debugging with the on-chip Real
Monitor software and high speed tracing of instruction execution.
4. USB 2.0 Full Speed compliant Device Controller with 2 kB of endpoint RAM. In addition, the LPC2146/8
provides 8 kB of on-chip RAM accessible to USB by DMA.
5. One or two (LPC2141/2 vs. LPC2144/6/8) 10-bit A/D converters provide a total of 6/14analog inputs, with
conversion times as low as 2.44 us per channel.
6. Single 10-bit D/A converter provides variable analog output.
7. Two 32-bit timers/external event counters (with four capture and four compare channels each), PWM unit
(six outputs) and watchdog.
8. Low power real-time clock with independent power and dedicated 32 kHz clock input.
9. Multiple serial interfaces including two UARTs (16C550), two Fast I2C-bus (400 kbit/s), SPI and SSP with
buffering and variable data length capabilities.
10. Vectored interrupt controller with configurable priorities and vector addresses.
11. Up to 45 of 5 V tolerant fast general purpose I/O pins in a tiny LQFP64 package.
12. Up to nine edge or level sensitive external interrupt pins available.
13. On-chip integrated oscillator operates with an external crystal in range from 1 MHz to30 MHz and with
an external oscillator up to 50 MHz
14. Power saving modes include Idle and Power-down.
15. Individual enable/disable of peripheral functions as well as peripheral clock scaling for additional power
optimization.
16. Processor wake-up from Power-down mode via external interrupt, USB, Brown-Out Detect (BOD) or
Real-Time Clock (RTC).




9 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


First Step- Hardware Requirement:
Pin configuration of LPC 2148.

Hardware requirement of LPC2148:
1. LPC2148 need minimum below listed hardware to work properly
2. Power Supply
3. Crystal Oscillator
4. Reset Circuit
5. RTC crystal oscillator
6. UART
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Power Supply:
LPC2148 works on 3.3 V power supply. LM 117 can be used for generating 3.3 V supply. However,
basic peripherals like LCD, ULN 2003 (Motor Driver IC) etc. works on 5V. So AC mains supply is converted
into 5V using below mentioned circuit and after that LM 117 is used to convert 5V into 3.3V.
Block diagram of power Supply

Transformer: It is used to step down 230V AC to 9V AC supply and provides isolation between power grids
and circuit.
Rectifier: It is used to convert AC supply into DC.
Filter: It is used to reduce ripple factor of DC output available from rectifier end.
Regulator: It is used to regulate DC supply output.

11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Circuit Diagram:

Regulator IC 7805 is used to provide fix 5V dc supply.
LM 117 is used for generating 3.3V supply from 5V.

FirstRanker.com - FirstRanker's Choice
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00






?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING

VII SEMESTER - R 2013

EC6711 ? EMBEDDED LABORATORY






Name : _______________________________________
Register No : _______________________________________
Section : _______________________________________
LABORATORY MANUAL



2 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00




is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and
training.

? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different
levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on
heart and soul
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

To impart professional education integrated with human values to the younger generation, so as to
shape them as proficient and dedicated engineers, capable of providing comprehensive solutions to the
challenges in deploying technology for the service of humanity

? To educate the students with the state-of-art technologies to meet the growing challenges of the
electronics industry
? To carry out research through continuous interaction with research institutes and industry, on
advances in communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning,
innovation and ethical practices
VISION
VISION
MISSION
MISSION



3 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

PROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To provide students with a solid foundation in Mathematics, Science and fundamentals of
engineering, enabling them to apply, to find solutions for engineering problems and use this knowledge
to acquire higher education
2. Core Competence
To train the students in Electronics and Communication technologies so that they apply their
knowledge and training to compare, and to analyze various engineering industrial problems to find
solutions
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice which
enables them to find solutions for the real time problems in industry, and to design products
4. Professionalism
To inculcate professional and effective communication skills, leadership qualities and team spirit in
the students to make them multi-faceted personalities and develop their ability to relate engineering
issues to broader social context
5. Lifelong Learning/Ethics
To demonstrate and practice ethical and professional responsibilities in the industry and society in
the large, through commitment and lifelong learning needed for successful professional career


4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
PROGRAMME OUTCOMES (POs)
a) To demonstrate and apply knowledge of Mathematics, Science and engineering fundamentals in
Electronics and Communication Engineering field
b) To design a component, a system or a process to meet the specific needs within the realistic
constraints such as economics, environment, ethics, health, safety and manufacturability
c) To demonstrate the competency to use software tools for computation, simulation and testing of electronics
and communication engineering circuits
d) To identify, formulate and solve electronic and communication engineering problems
e) To demonstrate an ability to visualize and work on laboratory and multidisciplinary tasks
f) To function as a member or a leader in multidisciplinary activities
g) To communicate in verbal and written form with fellow engineers and society at large
h) To understand the impact of Electronics and Communication Engineering in the society and demonstrate
awareness of contemporary issues and commitment to give solutions exhibiting social responsibility
i) To demonstrate professional & ethical responsibilities
j) To exhibit confidence in self-education and ability for lifelong learning
k) To participate and succeed in competitive exams


5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
SYLLABUS

? Learn the working of ARM processor
? Understand the Building Blocks of Embedded Systems
? Learn the concept of memory map and memory interface
? Know the characteristics of Real Time Systems
? Write programs to interface memory, I/Os with processor
? Study the interrupt performance
LIST OF EXPERIMENTS:
1. Study of ARM evaluation system
2. Interfacing ADC and DAC
3. Interfacing LED and PWM
4. Interfacing real time clock and serial port
5. Interfacing keyboard and LCD
6. Interfacing EPROM and interrupt
7. Mailbox
8. Interrupt performance characteristics of ARM and FPGA
9. Flashing of LEDS
10. Interfacing stepper motor and temperature sensor
11. Implementing zigbee protocol with ARM



? Write programs in ARM for a specific Application
? Interface memory and Write programs related to memory operations
? Interface A/D and D/A convertors with ARM system
? Analyze the performance of interrupt
? Write programmes for interfacing keyboard, display, motor and sensor.
? Formulate a mini project using embedded system
COURSE OBJECTIVES
COURSE OUTCOMES
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
CONTENTS
Sl. No. Name of the Experiment Page No.
CYCLE 1 ? EXPERIMENTS
1
Study of ARM evaluation system 7
2
Analog to Digital Convertor interfacing 16
3
Generation of ramp and square wave using on-Chip DAC 19
4
LED dimming using PWM 22
5
Interfacing real time clock and serial port 25
6
Interfacing keypad and LCD 28
7
Interfacing EPROM and interrupt 31
CYCLE 2 ? EXPERIMENTS
8 Implementation of Mailbox Function using LPC 2148 35
9 Interrupt Performance Characteristics of Arm and FPGA 37
10 Flashing of LEDs 40
11 Stepper Motor Interface with ARM ? 7 LPC2148 43
12 LM35 Temperature Sensor Interface with ARM ? 7 LPC2148 47
13
Implementation of Wireless Communication Protocol using ZIGBEE Wireless
Module
50
ADDITIONAL EXPERIMENTS BEYOND THE SYYLABUS
14 Buzzer Interface with ARM ? 7 54
15 Relay interface with ARM? 7 57
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Expt. No. 1 STUDY OF ARM EVALUATION SYSTEM
Aim:
To study the building blocks of ARM7 system, its features, pin configuration and the components
required for functioning of ARM controller.
Architecture Overview:
A RISC-based computer design approach means ARM processors require significantly fewer transistors
than typical processors in average computers. This approach reduces cost, heat and power usage. These
are desirable traits for light, portable, battery-powered devices (smart phones, laptops, tablet and notepad
computers), and other embedded systems. A simpler design facilitates more efficient multi-core CPUs and
higher core counts at lower cost, providing higher processing power and improved energy efficiency for
servers and supercomputers.
In 2005, about 98% of all mobile phones sold used at least one ARM processor. The low power
consumption of ARM processors has made them very popular: 37 billion ARM processors have been
produced as of 2013, up from 10 billion in 2008. The ARM architecture (32-bit) is the most widely used
architecture in mobile devices, and most popular 32-bit one in embedded systems.
According to ARM Holdings, in 2010 alone, producers of chips based on ARM architectures
reported shipments of 6.1 billion ARM based processors, representing 95% of smart phones, 35% of digital
televisions and set-top boxes and 10% of mobile computers. It is the most widely used 32-bit instruction set
architecture in terms of quantity produced.
LPC 2148:
LPC2148 is the widely used IC from ARM-7 family. It is manufactured by Philips and it is pre-loaded
with many inbuilt peripherals making it more efficient and a reliable option for the beginners as well as high
end application developer.




8 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Features of LPC214x series controllers:
1. 8 to 40 kB of on-chip static RAM and 32 to 512 kB of on-chip flash program memory.128 bit wide
interface/accelerator enables high speed 60 MHz operation.
2. In-System/In-Application Programming (ISP/IAP) via on-chip boot-loader software. Single flash sector or
full chip erase in 400 ms and programming of 256 bytes in 1ms.
3. Embedded ICE RT and Embedded Trace interfaces offer real-time debugging with the on-chip Real
Monitor software and high speed tracing of instruction execution.
4. USB 2.0 Full Speed compliant Device Controller with 2 kB of endpoint RAM. In addition, the LPC2146/8
provides 8 kB of on-chip RAM accessible to USB by DMA.
5. One or two (LPC2141/2 vs. LPC2144/6/8) 10-bit A/D converters provide a total of 6/14analog inputs, with
conversion times as low as 2.44 us per channel.
6. Single 10-bit D/A converter provides variable analog output.
7. Two 32-bit timers/external event counters (with four capture and four compare channels each), PWM unit
(six outputs) and watchdog.
8. Low power real-time clock with independent power and dedicated 32 kHz clock input.
9. Multiple serial interfaces including two UARTs (16C550), two Fast I2C-bus (400 kbit/s), SPI and SSP with
buffering and variable data length capabilities.
10. Vectored interrupt controller with configurable priorities and vector addresses.
11. Up to 45 of 5 V tolerant fast general purpose I/O pins in a tiny LQFP64 package.
12. Up to nine edge or level sensitive external interrupt pins available.
13. On-chip integrated oscillator operates with an external crystal in range from 1 MHz to30 MHz and with
an external oscillator up to 50 MHz
14. Power saving modes include Idle and Power-down.
15. Individual enable/disable of peripheral functions as well as peripheral clock scaling for additional power
optimization.
16. Processor wake-up from Power-down mode via external interrupt, USB, Brown-Out Detect (BOD) or
Real-Time Clock (RTC).




9 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


First Step- Hardware Requirement:
Pin configuration of LPC 2148.

Hardware requirement of LPC2148:
1. LPC2148 need minimum below listed hardware to work properly
2. Power Supply
3. Crystal Oscillator
4. Reset Circuit
5. RTC crystal oscillator
6. UART
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Power Supply:
LPC2148 works on 3.3 V power supply. LM 117 can be used for generating 3.3 V supply. However,
basic peripherals like LCD, ULN 2003 (Motor Driver IC) etc. works on 5V. So AC mains supply is converted
into 5V using below mentioned circuit and after that LM 117 is used to convert 5V into 3.3V.
Block diagram of power Supply

Transformer: It is used to step down 230V AC to 9V AC supply and provides isolation between power grids
and circuit.
Rectifier: It is used to convert AC supply into DC.
Filter: It is used to reduce ripple factor of DC output available from rectifier end.
Regulator: It is used to regulate DC supply output.

11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Circuit Diagram:

Regulator IC 7805 is used to provide fix 5V dc supply.
LM 117 is used for generating 3.3V supply from 5V.

12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Calculations:

From the datasheet of LM117

Taking R 2= 240?, we get R 1=392?
Reset Circuit:
Reset button is essential in a system to avoid programming pitfalls and manually bring back the system
to the initialization mode. MCP 130T is a special IC used for providing stable RESET signal to LPC 2148.


FirstRanker.com - FirstRanker's Choice
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00






?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING

VII SEMESTER - R 2013

EC6711 ? EMBEDDED LABORATORY






Name : _______________________________________
Register No : _______________________________________
Section : _______________________________________
LABORATORY MANUAL



2 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00




is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and
training.

? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different
levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on
heart and soul
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

To impart professional education integrated with human values to the younger generation, so as to
shape them as proficient and dedicated engineers, capable of providing comprehensive solutions to the
challenges in deploying technology for the service of humanity

? To educate the students with the state-of-art technologies to meet the growing challenges of the
electronics industry
? To carry out research through continuous interaction with research institutes and industry, on
advances in communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning,
innovation and ethical practices
VISION
VISION
MISSION
MISSION



3 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

PROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To provide students with a solid foundation in Mathematics, Science and fundamentals of
engineering, enabling them to apply, to find solutions for engineering problems and use this knowledge
to acquire higher education
2. Core Competence
To train the students in Electronics and Communication technologies so that they apply their
knowledge and training to compare, and to analyze various engineering industrial problems to find
solutions
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice which
enables them to find solutions for the real time problems in industry, and to design products
4. Professionalism
To inculcate professional and effective communication skills, leadership qualities and team spirit in
the students to make them multi-faceted personalities and develop their ability to relate engineering
issues to broader social context
5. Lifelong Learning/Ethics
To demonstrate and practice ethical and professional responsibilities in the industry and society in
the large, through commitment and lifelong learning needed for successful professional career


4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
PROGRAMME OUTCOMES (POs)
a) To demonstrate and apply knowledge of Mathematics, Science and engineering fundamentals in
Electronics and Communication Engineering field
b) To design a component, a system or a process to meet the specific needs within the realistic
constraints such as economics, environment, ethics, health, safety and manufacturability
c) To demonstrate the competency to use software tools for computation, simulation and testing of electronics
and communication engineering circuits
d) To identify, formulate and solve electronic and communication engineering problems
e) To demonstrate an ability to visualize and work on laboratory and multidisciplinary tasks
f) To function as a member or a leader in multidisciplinary activities
g) To communicate in verbal and written form with fellow engineers and society at large
h) To understand the impact of Electronics and Communication Engineering in the society and demonstrate
awareness of contemporary issues and commitment to give solutions exhibiting social responsibility
i) To demonstrate professional & ethical responsibilities
j) To exhibit confidence in self-education and ability for lifelong learning
k) To participate and succeed in competitive exams


5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
SYLLABUS

? Learn the working of ARM processor
? Understand the Building Blocks of Embedded Systems
? Learn the concept of memory map and memory interface
? Know the characteristics of Real Time Systems
? Write programs to interface memory, I/Os with processor
? Study the interrupt performance
LIST OF EXPERIMENTS:
1. Study of ARM evaluation system
2. Interfacing ADC and DAC
3. Interfacing LED and PWM
4. Interfacing real time clock and serial port
5. Interfacing keyboard and LCD
6. Interfacing EPROM and interrupt
7. Mailbox
8. Interrupt performance characteristics of ARM and FPGA
9. Flashing of LEDS
10. Interfacing stepper motor and temperature sensor
11. Implementing zigbee protocol with ARM



? Write programs in ARM for a specific Application
? Interface memory and Write programs related to memory operations
? Interface A/D and D/A convertors with ARM system
? Analyze the performance of interrupt
? Write programmes for interfacing keyboard, display, motor and sensor.
? Formulate a mini project using embedded system
COURSE OBJECTIVES
COURSE OUTCOMES
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
CONTENTS
Sl. No. Name of the Experiment Page No.
CYCLE 1 ? EXPERIMENTS
1
Study of ARM evaluation system 7
2
Analog to Digital Convertor interfacing 16
3
Generation of ramp and square wave using on-Chip DAC 19
4
LED dimming using PWM 22
5
Interfacing real time clock and serial port 25
6
Interfacing keypad and LCD 28
7
Interfacing EPROM and interrupt 31
CYCLE 2 ? EXPERIMENTS
8 Implementation of Mailbox Function using LPC 2148 35
9 Interrupt Performance Characteristics of Arm and FPGA 37
10 Flashing of LEDs 40
11 Stepper Motor Interface with ARM ? 7 LPC2148 43
12 LM35 Temperature Sensor Interface with ARM ? 7 LPC2148 47
13
Implementation of Wireless Communication Protocol using ZIGBEE Wireless
Module
50
ADDITIONAL EXPERIMENTS BEYOND THE SYYLABUS
14 Buzzer Interface with ARM ? 7 54
15 Relay interface with ARM? 7 57
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Expt. No. 1 STUDY OF ARM EVALUATION SYSTEM
Aim:
To study the building blocks of ARM7 system, its features, pin configuration and the components
required for functioning of ARM controller.
Architecture Overview:
A RISC-based computer design approach means ARM processors require significantly fewer transistors
than typical processors in average computers. This approach reduces cost, heat and power usage. These
are desirable traits for light, portable, battery-powered devices (smart phones, laptops, tablet and notepad
computers), and other embedded systems. A simpler design facilitates more efficient multi-core CPUs and
higher core counts at lower cost, providing higher processing power and improved energy efficiency for
servers and supercomputers.
In 2005, about 98% of all mobile phones sold used at least one ARM processor. The low power
consumption of ARM processors has made them very popular: 37 billion ARM processors have been
produced as of 2013, up from 10 billion in 2008. The ARM architecture (32-bit) is the most widely used
architecture in mobile devices, and most popular 32-bit one in embedded systems.
According to ARM Holdings, in 2010 alone, producers of chips based on ARM architectures
reported shipments of 6.1 billion ARM based processors, representing 95% of smart phones, 35% of digital
televisions and set-top boxes and 10% of mobile computers. It is the most widely used 32-bit instruction set
architecture in terms of quantity produced.
LPC 2148:
LPC2148 is the widely used IC from ARM-7 family. It is manufactured by Philips and it is pre-loaded
with many inbuilt peripherals making it more efficient and a reliable option for the beginners as well as high
end application developer.




8 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Features of LPC214x series controllers:
1. 8 to 40 kB of on-chip static RAM and 32 to 512 kB of on-chip flash program memory.128 bit wide
interface/accelerator enables high speed 60 MHz operation.
2. In-System/In-Application Programming (ISP/IAP) via on-chip boot-loader software. Single flash sector or
full chip erase in 400 ms and programming of 256 bytes in 1ms.
3. Embedded ICE RT and Embedded Trace interfaces offer real-time debugging with the on-chip Real
Monitor software and high speed tracing of instruction execution.
4. USB 2.0 Full Speed compliant Device Controller with 2 kB of endpoint RAM. In addition, the LPC2146/8
provides 8 kB of on-chip RAM accessible to USB by DMA.
5. One or two (LPC2141/2 vs. LPC2144/6/8) 10-bit A/D converters provide a total of 6/14analog inputs, with
conversion times as low as 2.44 us per channel.
6. Single 10-bit D/A converter provides variable analog output.
7. Two 32-bit timers/external event counters (with four capture and four compare channels each), PWM unit
(six outputs) and watchdog.
8. Low power real-time clock with independent power and dedicated 32 kHz clock input.
9. Multiple serial interfaces including two UARTs (16C550), two Fast I2C-bus (400 kbit/s), SPI and SSP with
buffering and variable data length capabilities.
10. Vectored interrupt controller with configurable priorities and vector addresses.
11. Up to 45 of 5 V tolerant fast general purpose I/O pins in a tiny LQFP64 package.
12. Up to nine edge or level sensitive external interrupt pins available.
13. On-chip integrated oscillator operates with an external crystal in range from 1 MHz to30 MHz and with
an external oscillator up to 50 MHz
14. Power saving modes include Idle and Power-down.
15. Individual enable/disable of peripheral functions as well as peripheral clock scaling for additional power
optimization.
16. Processor wake-up from Power-down mode via external interrupt, USB, Brown-Out Detect (BOD) or
Real-Time Clock (RTC).




9 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


First Step- Hardware Requirement:
Pin configuration of LPC 2148.

Hardware requirement of LPC2148:
1. LPC2148 need minimum below listed hardware to work properly
2. Power Supply
3. Crystal Oscillator
4. Reset Circuit
5. RTC crystal oscillator
6. UART
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Power Supply:
LPC2148 works on 3.3 V power supply. LM 117 can be used for generating 3.3 V supply. However,
basic peripherals like LCD, ULN 2003 (Motor Driver IC) etc. works on 5V. So AC mains supply is converted
into 5V using below mentioned circuit and after that LM 117 is used to convert 5V into 3.3V.
Block diagram of power Supply

Transformer: It is used to step down 230V AC to 9V AC supply and provides isolation between power grids
and circuit.
Rectifier: It is used to convert AC supply into DC.
Filter: It is used to reduce ripple factor of DC output available from rectifier end.
Regulator: It is used to regulate DC supply output.

11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Circuit Diagram:

Regulator IC 7805 is used to provide fix 5V dc supply.
LM 117 is used for generating 3.3V supply from 5V.

12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Calculations:

From the datasheet of LM117

Taking R 2= 240?, we get R 1=392?
Reset Circuit:
Reset button is essential in a system to avoid programming pitfalls and manually bring back the system
to the initialization mode. MCP 130T is a special IC used for providing stable RESET signal to LPC 2148.


13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Oscillator Circuit:

The value of capacitors C20 & C21 depends upon the frequency of crystal Y3. General circuit and
its equivalent circuit is as shown below.

FirstRanker.com - FirstRanker's Choice
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00






?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING

VII SEMESTER - R 2013

EC6711 ? EMBEDDED LABORATORY






Name : _______________________________________
Register No : _______________________________________
Section : _______________________________________
LABORATORY MANUAL



2 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00




is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and
training.

? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different
levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on
heart and soul
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

To impart professional education integrated with human values to the younger generation, so as to
shape them as proficient and dedicated engineers, capable of providing comprehensive solutions to the
challenges in deploying technology for the service of humanity

? To educate the students with the state-of-art technologies to meet the growing challenges of the
electronics industry
? To carry out research through continuous interaction with research institutes and industry, on
advances in communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning,
innovation and ethical practices
VISION
VISION
MISSION
MISSION



3 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

PROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To provide students with a solid foundation in Mathematics, Science and fundamentals of
engineering, enabling them to apply, to find solutions for engineering problems and use this knowledge
to acquire higher education
2. Core Competence
To train the students in Electronics and Communication technologies so that they apply their
knowledge and training to compare, and to analyze various engineering industrial problems to find
solutions
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice which
enables them to find solutions for the real time problems in industry, and to design products
4. Professionalism
To inculcate professional and effective communication skills, leadership qualities and team spirit in
the students to make them multi-faceted personalities and develop their ability to relate engineering
issues to broader social context
5. Lifelong Learning/Ethics
To demonstrate and practice ethical and professional responsibilities in the industry and society in
the large, through commitment and lifelong learning needed for successful professional career


4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
PROGRAMME OUTCOMES (POs)
a) To demonstrate and apply knowledge of Mathematics, Science and engineering fundamentals in
Electronics and Communication Engineering field
b) To design a component, a system or a process to meet the specific needs within the realistic
constraints such as economics, environment, ethics, health, safety and manufacturability
c) To demonstrate the competency to use software tools for computation, simulation and testing of electronics
and communication engineering circuits
d) To identify, formulate and solve electronic and communication engineering problems
e) To demonstrate an ability to visualize and work on laboratory and multidisciplinary tasks
f) To function as a member or a leader in multidisciplinary activities
g) To communicate in verbal and written form with fellow engineers and society at large
h) To understand the impact of Electronics and Communication Engineering in the society and demonstrate
awareness of contemporary issues and commitment to give solutions exhibiting social responsibility
i) To demonstrate professional & ethical responsibilities
j) To exhibit confidence in self-education and ability for lifelong learning
k) To participate and succeed in competitive exams


5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
SYLLABUS

? Learn the working of ARM processor
? Understand the Building Blocks of Embedded Systems
? Learn the concept of memory map and memory interface
? Know the characteristics of Real Time Systems
? Write programs to interface memory, I/Os with processor
? Study the interrupt performance
LIST OF EXPERIMENTS:
1. Study of ARM evaluation system
2. Interfacing ADC and DAC
3. Interfacing LED and PWM
4. Interfacing real time clock and serial port
5. Interfacing keyboard and LCD
6. Interfacing EPROM and interrupt
7. Mailbox
8. Interrupt performance characteristics of ARM and FPGA
9. Flashing of LEDS
10. Interfacing stepper motor and temperature sensor
11. Implementing zigbee protocol with ARM



? Write programs in ARM for a specific Application
? Interface memory and Write programs related to memory operations
? Interface A/D and D/A convertors with ARM system
? Analyze the performance of interrupt
? Write programmes for interfacing keyboard, display, motor and sensor.
? Formulate a mini project using embedded system
COURSE OBJECTIVES
COURSE OUTCOMES
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
CONTENTS
Sl. No. Name of the Experiment Page No.
CYCLE 1 ? EXPERIMENTS
1
Study of ARM evaluation system 7
2
Analog to Digital Convertor interfacing 16
3
Generation of ramp and square wave using on-Chip DAC 19
4
LED dimming using PWM 22
5
Interfacing real time clock and serial port 25
6
Interfacing keypad and LCD 28
7
Interfacing EPROM and interrupt 31
CYCLE 2 ? EXPERIMENTS
8 Implementation of Mailbox Function using LPC 2148 35
9 Interrupt Performance Characteristics of Arm and FPGA 37
10 Flashing of LEDs 40
11 Stepper Motor Interface with ARM ? 7 LPC2148 43
12 LM35 Temperature Sensor Interface with ARM ? 7 LPC2148 47
13
Implementation of Wireless Communication Protocol using ZIGBEE Wireless
Module
50
ADDITIONAL EXPERIMENTS BEYOND THE SYYLABUS
14 Buzzer Interface with ARM ? 7 54
15 Relay interface with ARM? 7 57
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Expt. No. 1 STUDY OF ARM EVALUATION SYSTEM
Aim:
To study the building blocks of ARM7 system, its features, pin configuration and the components
required for functioning of ARM controller.
Architecture Overview:
A RISC-based computer design approach means ARM processors require significantly fewer transistors
than typical processors in average computers. This approach reduces cost, heat and power usage. These
are desirable traits for light, portable, battery-powered devices (smart phones, laptops, tablet and notepad
computers), and other embedded systems. A simpler design facilitates more efficient multi-core CPUs and
higher core counts at lower cost, providing higher processing power and improved energy efficiency for
servers and supercomputers.
In 2005, about 98% of all mobile phones sold used at least one ARM processor. The low power
consumption of ARM processors has made them very popular: 37 billion ARM processors have been
produced as of 2013, up from 10 billion in 2008. The ARM architecture (32-bit) is the most widely used
architecture in mobile devices, and most popular 32-bit one in embedded systems.
According to ARM Holdings, in 2010 alone, producers of chips based on ARM architectures
reported shipments of 6.1 billion ARM based processors, representing 95% of smart phones, 35% of digital
televisions and set-top boxes and 10% of mobile computers. It is the most widely used 32-bit instruction set
architecture in terms of quantity produced.
LPC 2148:
LPC2148 is the widely used IC from ARM-7 family. It is manufactured by Philips and it is pre-loaded
with many inbuilt peripherals making it more efficient and a reliable option for the beginners as well as high
end application developer.




8 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Features of LPC214x series controllers:
1. 8 to 40 kB of on-chip static RAM and 32 to 512 kB of on-chip flash program memory.128 bit wide
interface/accelerator enables high speed 60 MHz operation.
2. In-System/In-Application Programming (ISP/IAP) via on-chip boot-loader software. Single flash sector or
full chip erase in 400 ms and programming of 256 bytes in 1ms.
3. Embedded ICE RT and Embedded Trace interfaces offer real-time debugging with the on-chip Real
Monitor software and high speed tracing of instruction execution.
4. USB 2.0 Full Speed compliant Device Controller with 2 kB of endpoint RAM. In addition, the LPC2146/8
provides 8 kB of on-chip RAM accessible to USB by DMA.
5. One or two (LPC2141/2 vs. LPC2144/6/8) 10-bit A/D converters provide a total of 6/14analog inputs, with
conversion times as low as 2.44 us per channel.
6. Single 10-bit D/A converter provides variable analog output.
7. Two 32-bit timers/external event counters (with four capture and four compare channels each), PWM unit
(six outputs) and watchdog.
8. Low power real-time clock with independent power and dedicated 32 kHz clock input.
9. Multiple serial interfaces including two UARTs (16C550), two Fast I2C-bus (400 kbit/s), SPI and SSP with
buffering and variable data length capabilities.
10. Vectored interrupt controller with configurable priorities and vector addresses.
11. Up to 45 of 5 V tolerant fast general purpose I/O pins in a tiny LQFP64 package.
12. Up to nine edge or level sensitive external interrupt pins available.
13. On-chip integrated oscillator operates with an external crystal in range from 1 MHz to30 MHz and with
an external oscillator up to 50 MHz
14. Power saving modes include Idle and Power-down.
15. Individual enable/disable of peripheral functions as well as peripheral clock scaling for additional power
optimization.
16. Processor wake-up from Power-down mode via external interrupt, USB, Brown-Out Detect (BOD) or
Real-Time Clock (RTC).




9 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


First Step- Hardware Requirement:
Pin configuration of LPC 2148.

Hardware requirement of LPC2148:
1. LPC2148 need minimum below listed hardware to work properly
2. Power Supply
3. Crystal Oscillator
4. Reset Circuit
5. RTC crystal oscillator
6. UART
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Power Supply:
LPC2148 works on 3.3 V power supply. LM 117 can be used for generating 3.3 V supply. However,
basic peripherals like LCD, ULN 2003 (Motor Driver IC) etc. works on 5V. So AC mains supply is converted
into 5V using below mentioned circuit and after that LM 117 is used to convert 5V into 3.3V.
Block diagram of power Supply

Transformer: It is used to step down 230V AC to 9V AC supply and provides isolation between power grids
and circuit.
Rectifier: It is used to convert AC supply into DC.
Filter: It is used to reduce ripple factor of DC output available from rectifier end.
Regulator: It is used to regulate DC supply output.

11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Circuit Diagram:

Regulator IC 7805 is used to provide fix 5V dc supply.
LM 117 is used for generating 3.3V supply from 5V.

12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Calculations:

From the datasheet of LM117

Taking R 2= 240?, we get R 1=392?
Reset Circuit:
Reset button is essential in a system to avoid programming pitfalls and manually bring back the system
to the initialization mode. MCP 130T is a special IC used for providing stable RESET signal to LPC 2148.


13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Oscillator Circuit:

The value of capacitors C20 & C21 depends upon the frequency of crystal Y3. General circuit and
its equivalent circuit is as shown below.

14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Recommended values are as shown in table:

UART:
LPC 2148 has inbuilt ISP which means we can program it within the system using serial
communication on COM0. It has also COM1 for serial communication. MAX 232/233 IC must be used for
voltage logic conversion. Related connections are as given below.

Once the above listed circuit design is ready, we are ready to go further.
FirstRanker.com - FirstRanker's Choice
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00






?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING

VII SEMESTER - R 2013

EC6711 ? EMBEDDED LABORATORY






Name : _______________________________________
Register No : _______________________________________
Section : _______________________________________
LABORATORY MANUAL



2 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00




is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and
training.

? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different
levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on
heart and soul
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

To impart professional education integrated with human values to the younger generation, so as to
shape them as proficient and dedicated engineers, capable of providing comprehensive solutions to the
challenges in deploying technology for the service of humanity

? To educate the students with the state-of-art technologies to meet the growing challenges of the
electronics industry
? To carry out research through continuous interaction with research institutes and industry, on
advances in communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning,
innovation and ethical practices
VISION
VISION
MISSION
MISSION



3 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

PROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To provide students with a solid foundation in Mathematics, Science and fundamentals of
engineering, enabling them to apply, to find solutions for engineering problems and use this knowledge
to acquire higher education
2. Core Competence
To train the students in Electronics and Communication technologies so that they apply their
knowledge and training to compare, and to analyze various engineering industrial problems to find
solutions
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice which
enables them to find solutions for the real time problems in industry, and to design products
4. Professionalism
To inculcate professional and effective communication skills, leadership qualities and team spirit in
the students to make them multi-faceted personalities and develop their ability to relate engineering
issues to broader social context
5. Lifelong Learning/Ethics
To demonstrate and practice ethical and professional responsibilities in the industry and society in
the large, through commitment and lifelong learning needed for successful professional career


4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
PROGRAMME OUTCOMES (POs)
a) To demonstrate and apply knowledge of Mathematics, Science and engineering fundamentals in
Electronics and Communication Engineering field
b) To design a component, a system or a process to meet the specific needs within the realistic
constraints such as economics, environment, ethics, health, safety and manufacturability
c) To demonstrate the competency to use software tools for computation, simulation and testing of electronics
and communication engineering circuits
d) To identify, formulate and solve electronic and communication engineering problems
e) To demonstrate an ability to visualize and work on laboratory and multidisciplinary tasks
f) To function as a member or a leader in multidisciplinary activities
g) To communicate in verbal and written form with fellow engineers and society at large
h) To understand the impact of Electronics and Communication Engineering in the society and demonstrate
awareness of contemporary issues and commitment to give solutions exhibiting social responsibility
i) To demonstrate professional & ethical responsibilities
j) To exhibit confidence in self-education and ability for lifelong learning
k) To participate and succeed in competitive exams


5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
SYLLABUS

? Learn the working of ARM processor
? Understand the Building Blocks of Embedded Systems
? Learn the concept of memory map and memory interface
? Know the characteristics of Real Time Systems
? Write programs to interface memory, I/Os with processor
? Study the interrupt performance
LIST OF EXPERIMENTS:
1. Study of ARM evaluation system
2. Interfacing ADC and DAC
3. Interfacing LED and PWM
4. Interfacing real time clock and serial port
5. Interfacing keyboard and LCD
6. Interfacing EPROM and interrupt
7. Mailbox
8. Interrupt performance characteristics of ARM and FPGA
9. Flashing of LEDS
10. Interfacing stepper motor and temperature sensor
11. Implementing zigbee protocol with ARM



? Write programs in ARM for a specific Application
? Interface memory and Write programs related to memory operations
? Interface A/D and D/A convertors with ARM system
? Analyze the performance of interrupt
? Write programmes for interfacing keyboard, display, motor and sensor.
? Formulate a mini project using embedded system
COURSE OBJECTIVES
COURSE OUTCOMES
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
CONTENTS
Sl. No. Name of the Experiment Page No.
CYCLE 1 ? EXPERIMENTS
1
Study of ARM evaluation system 7
2
Analog to Digital Convertor interfacing 16
3
Generation of ramp and square wave using on-Chip DAC 19
4
LED dimming using PWM 22
5
Interfacing real time clock and serial port 25
6
Interfacing keypad and LCD 28
7
Interfacing EPROM and interrupt 31
CYCLE 2 ? EXPERIMENTS
8 Implementation of Mailbox Function using LPC 2148 35
9 Interrupt Performance Characteristics of Arm and FPGA 37
10 Flashing of LEDs 40
11 Stepper Motor Interface with ARM ? 7 LPC2148 43
12 LM35 Temperature Sensor Interface with ARM ? 7 LPC2148 47
13
Implementation of Wireless Communication Protocol using ZIGBEE Wireless
Module
50
ADDITIONAL EXPERIMENTS BEYOND THE SYYLABUS
14 Buzzer Interface with ARM ? 7 54
15 Relay interface with ARM? 7 57
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Expt. No. 1 STUDY OF ARM EVALUATION SYSTEM
Aim:
To study the building blocks of ARM7 system, its features, pin configuration and the components
required for functioning of ARM controller.
Architecture Overview:
A RISC-based computer design approach means ARM processors require significantly fewer transistors
than typical processors in average computers. This approach reduces cost, heat and power usage. These
are desirable traits for light, portable, battery-powered devices (smart phones, laptops, tablet and notepad
computers), and other embedded systems. A simpler design facilitates more efficient multi-core CPUs and
higher core counts at lower cost, providing higher processing power and improved energy efficiency for
servers and supercomputers.
In 2005, about 98% of all mobile phones sold used at least one ARM processor. The low power
consumption of ARM processors has made them very popular: 37 billion ARM processors have been
produced as of 2013, up from 10 billion in 2008. The ARM architecture (32-bit) is the most widely used
architecture in mobile devices, and most popular 32-bit one in embedded systems.
According to ARM Holdings, in 2010 alone, producers of chips based on ARM architectures
reported shipments of 6.1 billion ARM based processors, representing 95% of smart phones, 35% of digital
televisions and set-top boxes and 10% of mobile computers. It is the most widely used 32-bit instruction set
architecture in terms of quantity produced.
LPC 2148:
LPC2148 is the widely used IC from ARM-7 family. It is manufactured by Philips and it is pre-loaded
with many inbuilt peripherals making it more efficient and a reliable option for the beginners as well as high
end application developer.




8 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Features of LPC214x series controllers:
1. 8 to 40 kB of on-chip static RAM and 32 to 512 kB of on-chip flash program memory.128 bit wide
interface/accelerator enables high speed 60 MHz operation.
2. In-System/In-Application Programming (ISP/IAP) via on-chip boot-loader software. Single flash sector or
full chip erase in 400 ms and programming of 256 bytes in 1ms.
3. Embedded ICE RT and Embedded Trace interfaces offer real-time debugging with the on-chip Real
Monitor software and high speed tracing of instruction execution.
4. USB 2.0 Full Speed compliant Device Controller with 2 kB of endpoint RAM. In addition, the LPC2146/8
provides 8 kB of on-chip RAM accessible to USB by DMA.
5. One or two (LPC2141/2 vs. LPC2144/6/8) 10-bit A/D converters provide a total of 6/14analog inputs, with
conversion times as low as 2.44 us per channel.
6. Single 10-bit D/A converter provides variable analog output.
7. Two 32-bit timers/external event counters (with four capture and four compare channels each), PWM unit
(six outputs) and watchdog.
8. Low power real-time clock with independent power and dedicated 32 kHz clock input.
9. Multiple serial interfaces including two UARTs (16C550), two Fast I2C-bus (400 kbit/s), SPI and SSP with
buffering and variable data length capabilities.
10. Vectored interrupt controller with configurable priorities and vector addresses.
11. Up to 45 of 5 V tolerant fast general purpose I/O pins in a tiny LQFP64 package.
12. Up to nine edge or level sensitive external interrupt pins available.
13. On-chip integrated oscillator operates with an external crystal in range from 1 MHz to30 MHz and with
an external oscillator up to 50 MHz
14. Power saving modes include Idle and Power-down.
15. Individual enable/disable of peripheral functions as well as peripheral clock scaling for additional power
optimization.
16. Processor wake-up from Power-down mode via external interrupt, USB, Brown-Out Detect (BOD) or
Real-Time Clock (RTC).




9 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


First Step- Hardware Requirement:
Pin configuration of LPC 2148.

Hardware requirement of LPC2148:
1. LPC2148 need minimum below listed hardware to work properly
2. Power Supply
3. Crystal Oscillator
4. Reset Circuit
5. RTC crystal oscillator
6. UART
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Power Supply:
LPC2148 works on 3.3 V power supply. LM 117 can be used for generating 3.3 V supply. However,
basic peripherals like LCD, ULN 2003 (Motor Driver IC) etc. works on 5V. So AC mains supply is converted
into 5V using below mentioned circuit and after that LM 117 is used to convert 5V into 3.3V.
Block diagram of power Supply

Transformer: It is used to step down 230V AC to 9V AC supply and provides isolation between power grids
and circuit.
Rectifier: It is used to convert AC supply into DC.
Filter: It is used to reduce ripple factor of DC output available from rectifier end.
Regulator: It is used to regulate DC supply output.

11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Circuit Diagram:

Regulator IC 7805 is used to provide fix 5V dc supply.
LM 117 is used for generating 3.3V supply from 5V.

12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Calculations:

From the datasheet of LM117

Taking R 2= 240?, we get R 1=392?
Reset Circuit:
Reset button is essential in a system to avoid programming pitfalls and manually bring back the system
to the initialization mode. MCP 130T is a special IC used for providing stable RESET signal to LPC 2148.


13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Oscillator Circuit:

The value of capacitors C20 & C21 depends upon the frequency of crystal Y3. General circuit and
its equivalent circuit is as shown below.

14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Recommended values are as shown in table:

UART:
LPC 2148 has inbuilt ISP which means we can program it within the system using serial
communication on COM0. It has also COM1 for serial communication. MAX 232/233 IC must be used for
voltage logic conversion. Related connections are as given below.

Once the above listed circuit design is ready, we are ready to go further.



15 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Result:
ARM Evaluation system and the configuration of LPC2148 has been studied fully. The minimal setup
required for the functioning of the ARM processor is studied.
Outcomes:
1. Able to understand the ARM controller, its basic components inside and its features.
2. Able to know the components required for the working of ARM LPC2148

Applications:
ARM controller LPC2148 is used in no. of devices such as
1. Smart phones
2. Net books
3. E Readers
4. Digital TV
5. Home Gateways


1. What are the basic units of ARM 7?
2. What is the address system supported by ARM?
3. Define - RISC
4. What are the instructions used to access the memory in ARM?
5. What are the basic units of Microprocessor?
6. What is an Instruction?
7. What is clock cycle?
8. Define - Pipelining
9. What is cache miss?
10. What is meant by memory mapped I/O?
11. Define ? interrupt
12. What is meant by Exception?
13. What is meant by little ? endian mode?
14. What is meant by big ? endian mode?
15. What is the function of CPSR?
16. What is register - indirect addressing?
Viva-voce

FirstRanker.com - FirstRanker's Choice
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00






?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING

VII SEMESTER - R 2013

EC6711 ? EMBEDDED LABORATORY






Name : _______________________________________
Register No : _______________________________________
Section : _______________________________________
LABORATORY MANUAL



2 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00




is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and
training.

? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different
levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on
heart and soul
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

To impart professional education integrated with human values to the younger generation, so as to
shape them as proficient and dedicated engineers, capable of providing comprehensive solutions to the
challenges in deploying technology for the service of humanity

? To educate the students with the state-of-art technologies to meet the growing challenges of the
electronics industry
? To carry out research through continuous interaction with research institutes and industry, on
advances in communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning,
innovation and ethical practices
VISION
VISION
MISSION
MISSION



3 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

PROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To provide students with a solid foundation in Mathematics, Science and fundamentals of
engineering, enabling them to apply, to find solutions for engineering problems and use this knowledge
to acquire higher education
2. Core Competence
To train the students in Electronics and Communication technologies so that they apply their
knowledge and training to compare, and to analyze various engineering industrial problems to find
solutions
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice which
enables them to find solutions for the real time problems in industry, and to design products
4. Professionalism
To inculcate professional and effective communication skills, leadership qualities and team spirit in
the students to make them multi-faceted personalities and develop their ability to relate engineering
issues to broader social context
5. Lifelong Learning/Ethics
To demonstrate and practice ethical and professional responsibilities in the industry and society in
the large, through commitment and lifelong learning needed for successful professional career


4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
PROGRAMME OUTCOMES (POs)
a) To demonstrate and apply knowledge of Mathematics, Science and engineering fundamentals in
Electronics and Communication Engineering field
b) To design a component, a system or a process to meet the specific needs within the realistic
constraints such as economics, environment, ethics, health, safety and manufacturability
c) To demonstrate the competency to use software tools for computation, simulation and testing of electronics
and communication engineering circuits
d) To identify, formulate and solve electronic and communication engineering problems
e) To demonstrate an ability to visualize and work on laboratory and multidisciplinary tasks
f) To function as a member or a leader in multidisciplinary activities
g) To communicate in verbal and written form with fellow engineers and society at large
h) To understand the impact of Electronics and Communication Engineering in the society and demonstrate
awareness of contemporary issues and commitment to give solutions exhibiting social responsibility
i) To demonstrate professional & ethical responsibilities
j) To exhibit confidence in self-education and ability for lifelong learning
k) To participate and succeed in competitive exams


5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
SYLLABUS

? Learn the working of ARM processor
? Understand the Building Blocks of Embedded Systems
? Learn the concept of memory map and memory interface
? Know the characteristics of Real Time Systems
? Write programs to interface memory, I/Os with processor
? Study the interrupt performance
LIST OF EXPERIMENTS:
1. Study of ARM evaluation system
2. Interfacing ADC and DAC
3. Interfacing LED and PWM
4. Interfacing real time clock and serial port
5. Interfacing keyboard and LCD
6. Interfacing EPROM and interrupt
7. Mailbox
8. Interrupt performance characteristics of ARM and FPGA
9. Flashing of LEDS
10. Interfacing stepper motor and temperature sensor
11. Implementing zigbee protocol with ARM



? Write programs in ARM for a specific Application
? Interface memory and Write programs related to memory operations
? Interface A/D and D/A convertors with ARM system
? Analyze the performance of interrupt
? Write programmes for interfacing keyboard, display, motor and sensor.
? Formulate a mini project using embedded system
COURSE OBJECTIVES
COURSE OUTCOMES
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
CONTENTS
Sl. No. Name of the Experiment Page No.
CYCLE 1 ? EXPERIMENTS
1
Study of ARM evaluation system 7
2
Analog to Digital Convertor interfacing 16
3
Generation of ramp and square wave using on-Chip DAC 19
4
LED dimming using PWM 22
5
Interfacing real time clock and serial port 25
6
Interfacing keypad and LCD 28
7
Interfacing EPROM and interrupt 31
CYCLE 2 ? EXPERIMENTS
8 Implementation of Mailbox Function using LPC 2148 35
9 Interrupt Performance Characteristics of Arm and FPGA 37
10 Flashing of LEDs 40
11 Stepper Motor Interface with ARM ? 7 LPC2148 43
12 LM35 Temperature Sensor Interface with ARM ? 7 LPC2148 47
13
Implementation of Wireless Communication Protocol using ZIGBEE Wireless
Module
50
ADDITIONAL EXPERIMENTS BEYOND THE SYYLABUS
14 Buzzer Interface with ARM ? 7 54
15 Relay interface with ARM? 7 57
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Expt. No. 1 STUDY OF ARM EVALUATION SYSTEM
Aim:
To study the building blocks of ARM7 system, its features, pin configuration and the components
required for functioning of ARM controller.
Architecture Overview:
A RISC-based computer design approach means ARM processors require significantly fewer transistors
than typical processors in average computers. This approach reduces cost, heat and power usage. These
are desirable traits for light, portable, battery-powered devices (smart phones, laptops, tablet and notepad
computers), and other embedded systems. A simpler design facilitates more efficient multi-core CPUs and
higher core counts at lower cost, providing higher processing power and improved energy efficiency for
servers and supercomputers.
In 2005, about 98% of all mobile phones sold used at least one ARM processor. The low power
consumption of ARM processors has made them very popular: 37 billion ARM processors have been
produced as of 2013, up from 10 billion in 2008. The ARM architecture (32-bit) is the most widely used
architecture in mobile devices, and most popular 32-bit one in embedded systems.
According to ARM Holdings, in 2010 alone, producers of chips based on ARM architectures
reported shipments of 6.1 billion ARM based processors, representing 95% of smart phones, 35% of digital
televisions and set-top boxes and 10% of mobile computers. It is the most widely used 32-bit instruction set
architecture in terms of quantity produced.
LPC 2148:
LPC2148 is the widely used IC from ARM-7 family. It is manufactured by Philips and it is pre-loaded
with many inbuilt peripherals making it more efficient and a reliable option for the beginners as well as high
end application developer.




8 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Features of LPC214x series controllers:
1. 8 to 40 kB of on-chip static RAM and 32 to 512 kB of on-chip flash program memory.128 bit wide
interface/accelerator enables high speed 60 MHz operation.
2. In-System/In-Application Programming (ISP/IAP) via on-chip boot-loader software. Single flash sector or
full chip erase in 400 ms and programming of 256 bytes in 1ms.
3. Embedded ICE RT and Embedded Trace interfaces offer real-time debugging with the on-chip Real
Monitor software and high speed tracing of instruction execution.
4. USB 2.0 Full Speed compliant Device Controller with 2 kB of endpoint RAM. In addition, the LPC2146/8
provides 8 kB of on-chip RAM accessible to USB by DMA.
5. One or two (LPC2141/2 vs. LPC2144/6/8) 10-bit A/D converters provide a total of 6/14analog inputs, with
conversion times as low as 2.44 us per channel.
6. Single 10-bit D/A converter provides variable analog output.
7. Two 32-bit timers/external event counters (with four capture and four compare channels each), PWM unit
(six outputs) and watchdog.
8. Low power real-time clock with independent power and dedicated 32 kHz clock input.
9. Multiple serial interfaces including two UARTs (16C550), two Fast I2C-bus (400 kbit/s), SPI and SSP with
buffering and variable data length capabilities.
10. Vectored interrupt controller with configurable priorities and vector addresses.
11. Up to 45 of 5 V tolerant fast general purpose I/O pins in a tiny LQFP64 package.
12. Up to nine edge or level sensitive external interrupt pins available.
13. On-chip integrated oscillator operates with an external crystal in range from 1 MHz to30 MHz and with
an external oscillator up to 50 MHz
14. Power saving modes include Idle and Power-down.
15. Individual enable/disable of peripheral functions as well as peripheral clock scaling for additional power
optimization.
16. Processor wake-up from Power-down mode via external interrupt, USB, Brown-Out Detect (BOD) or
Real-Time Clock (RTC).




9 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


First Step- Hardware Requirement:
Pin configuration of LPC 2148.

Hardware requirement of LPC2148:
1. LPC2148 need minimum below listed hardware to work properly
2. Power Supply
3. Crystal Oscillator
4. Reset Circuit
5. RTC crystal oscillator
6. UART
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Power Supply:
LPC2148 works on 3.3 V power supply. LM 117 can be used for generating 3.3 V supply. However,
basic peripherals like LCD, ULN 2003 (Motor Driver IC) etc. works on 5V. So AC mains supply is converted
into 5V using below mentioned circuit and after that LM 117 is used to convert 5V into 3.3V.
Block diagram of power Supply

Transformer: It is used to step down 230V AC to 9V AC supply and provides isolation between power grids
and circuit.
Rectifier: It is used to convert AC supply into DC.
Filter: It is used to reduce ripple factor of DC output available from rectifier end.
Regulator: It is used to regulate DC supply output.

11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Circuit Diagram:

Regulator IC 7805 is used to provide fix 5V dc supply.
LM 117 is used for generating 3.3V supply from 5V.

12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Calculations:

From the datasheet of LM117

Taking R 2= 240?, we get R 1=392?
Reset Circuit:
Reset button is essential in a system to avoid programming pitfalls and manually bring back the system
to the initialization mode. MCP 130T is a special IC used for providing stable RESET signal to LPC 2148.


13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Oscillator Circuit:

The value of capacitors C20 & C21 depends upon the frequency of crystal Y3. General circuit and
its equivalent circuit is as shown below.

14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Recommended values are as shown in table:

UART:
LPC 2148 has inbuilt ISP which means we can program it within the system using serial
communication on COM0. It has also COM1 for serial communication. MAX 232/233 IC must be used for
voltage logic conversion. Related connections are as given below.

Once the above listed circuit design is ready, we are ready to go further.



15 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Result:
ARM Evaluation system and the configuration of LPC2148 has been studied fully. The minimal setup
required for the functioning of the ARM processor is studied.
Outcomes:
1. Able to understand the ARM controller, its basic components inside and its features.
2. Able to know the components required for the working of ARM LPC2148

Applications:
ARM controller LPC2148 is used in no. of devices such as
1. Smart phones
2. Net books
3. E Readers
4. Digital TV
5. Home Gateways


1. What are the basic units of ARM 7?
2. What is the address system supported by ARM?
3. Define - RISC
4. What are the instructions used to access the memory in ARM?
5. What are the basic units of Microprocessor?
6. What is an Instruction?
7. What is clock cycle?
8. Define - Pipelining
9. What is cache miss?
10. What is meant by memory mapped I/O?
11. Define ? interrupt
12. What is meant by Exception?
13. What is meant by little ? endian mode?
14. What is meant by big ? endian mode?
15. What is the function of CPSR?
16. What is register - indirect addressing?
Viva-voce




16 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 2 ANALOG TO DIGITAL CONVERTOR
INTERFACING
Aim:
To write an embedded c program for interfacing an on chip ADC with LPC2148 ARM processor and
convert the given input voltage into corresponding decimal values.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. PC
Theory:
Analog to Digital converter (ADC) is a device that converts continuously varying analog signals from
instruments that monitor such conditions as movement, temperature, sound, etc., into binary code for the
computer. It may be either a single chip or can be one circuit within a chip. Analog to Digital conversion is
the process of changing continuously varying data, such as voltage, current, or shaft rotation, into discrete
digital quantities that represent the magnitude of the data compared to a standard or reference at the
moment the conversion is made. According to the method of conversion, ADCs can be classified into
Direct-Conversion ADCs, Successive Approximation ADCs, Integrating ADC and Sigma-Delta ADCs.
The LPC 2148 has 10-bit successive approximation analog to digital converter. Basic clocking for the
A/D converters is provided by the VPB clock. A programmable divider is included in each converter, to
scale this clock to the 4.5 MHz (max) clock needed by the successive approximation process. A fully
accurate conversion requires 11 of these clocks. The ADC cell can measure the voltage on any of the ADC
input signals. It is noted that these analog inputs are always connected to their pins, even if the Pin function
Select register assigns them to port pins. A simple self-test of the ADC can be done by driving these pins
as port outputs.
FirstRanker.com - FirstRanker's Choice
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00






?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING

VII SEMESTER - R 2013

EC6711 ? EMBEDDED LABORATORY






Name : _______________________________________
Register No : _______________________________________
Section : _______________________________________
LABORATORY MANUAL



2 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00




is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and
training.

? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different
levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on
heart and soul
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

To impart professional education integrated with human values to the younger generation, so as to
shape them as proficient and dedicated engineers, capable of providing comprehensive solutions to the
challenges in deploying technology for the service of humanity

? To educate the students with the state-of-art technologies to meet the growing challenges of the
electronics industry
? To carry out research through continuous interaction with research institutes and industry, on
advances in communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning,
innovation and ethical practices
VISION
VISION
MISSION
MISSION



3 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

PROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To provide students with a solid foundation in Mathematics, Science and fundamentals of
engineering, enabling them to apply, to find solutions for engineering problems and use this knowledge
to acquire higher education
2. Core Competence
To train the students in Electronics and Communication technologies so that they apply their
knowledge and training to compare, and to analyze various engineering industrial problems to find
solutions
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice which
enables them to find solutions for the real time problems in industry, and to design products
4. Professionalism
To inculcate professional and effective communication skills, leadership qualities and team spirit in
the students to make them multi-faceted personalities and develop their ability to relate engineering
issues to broader social context
5. Lifelong Learning/Ethics
To demonstrate and practice ethical and professional responsibilities in the industry and society in
the large, through commitment and lifelong learning needed for successful professional career


4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
PROGRAMME OUTCOMES (POs)
a) To demonstrate and apply knowledge of Mathematics, Science and engineering fundamentals in
Electronics and Communication Engineering field
b) To design a component, a system or a process to meet the specific needs within the realistic
constraints such as economics, environment, ethics, health, safety and manufacturability
c) To demonstrate the competency to use software tools for computation, simulation and testing of electronics
and communication engineering circuits
d) To identify, formulate and solve electronic and communication engineering problems
e) To demonstrate an ability to visualize and work on laboratory and multidisciplinary tasks
f) To function as a member or a leader in multidisciplinary activities
g) To communicate in verbal and written form with fellow engineers and society at large
h) To understand the impact of Electronics and Communication Engineering in the society and demonstrate
awareness of contemporary issues and commitment to give solutions exhibiting social responsibility
i) To demonstrate professional & ethical responsibilities
j) To exhibit confidence in self-education and ability for lifelong learning
k) To participate and succeed in competitive exams


5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
SYLLABUS

? Learn the working of ARM processor
? Understand the Building Blocks of Embedded Systems
? Learn the concept of memory map and memory interface
? Know the characteristics of Real Time Systems
? Write programs to interface memory, I/Os with processor
? Study the interrupt performance
LIST OF EXPERIMENTS:
1. Study of ARM evaluation system
2. Interfacing ADC and DAC
3. Interfacing LED and PWM
4. Interfacing real time clock and serial port
5. Interfacing keyboard and LCD
6. Interfacing EPROM and interrupt
7. Mailbox
8. Interrupt performance characteristics of ARM and FPGA
9. Flashing of LEDS
10. Interfacing stepper motor and temperature sensor
11. Implementing zigbee protocol with ARM



? Write programs in ARM for a specific Application
? Interface memory and Write programs related to memory operations
? Interface A/D and D/A convertors with ARM system
? Analyze the performance of interrupt
? Write programmes for interfacing keyboard, display, motor and sensor.
? Formulate a mini project using embedded system
COURSE OBJECTIVES
COURSE OUTCOMES
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
CONTENTS
Sl. No. Name of the Experiment Page No.
CYCLE 1 ? EXPERIMENTS
1
Study of ARM evaluation system 7
2
Analog to Digital Convertor interfacing 16
3
Generation of ramp and square wave using on-Chip DAC 19
4
LED dimming using PWM 22
5
Interfacing real time clock and serial port 25
6
Interfacing keypad and LCD 28
7
Interfacing EPROM and interrupt 31
CYCLE 2 ? EXPERIMENTS
8 Implementation of Mailbox Function using LPC 2148 35
9 Interrupt Performance Characteristics of Arm and FPGA 37
10 Flashing of LEDs 40
11 Stepper Motor Interface with ARM ? 7 LPC2148 43
12 LM35 Temperature Sensor Interface with ARM ? 7 LPC2148 47
13
Implementation of Wireless Communication Protocol using ZIGBEE Wireless
Module
50
ADDITIONAL EXPERIMENTS BEYOND THE SYYLABUS
14 Buzzer Interface with ARM ? 7 54
15 Relay interface with ARM? 7 57
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Expt. No. 1 STUDY OF ARM EVALUATION SYSTEM
Aim:
To study the building blocks of ARM7 system, its features, pin configuration and the components
required for functioning of ARM controller.
Architecture Overview:
A RISC-based computer design approach means ARM processors require significantly fewer transistors
than typical processors in average computers. This approach reduces cost, heat and power usage. These
are desirable traits for light, portable, battery-powered devices (smart phones, laptops, tablet and notepad
computers), and other embedded systems. A simpler design facilitates more efficient multi-core CPUs and
higher core counts at lower cost, providing higher processing power and improved energy efficiency for
servers and supercomputers.
In 2005, about 98% of all mobile phones sold used at least one ARM processor. The low power
consumption of ARM processors has made them very popular: 37 billion ARM processors have been
produced as of 2013, up from 10 billion in 2008. The ARM architecture (32-bit) is the most widely used
architecture in mobile devices, and most popular 32-bit one in embedded systems.
According to ARM Holdings, in 2010 alone, producers of chips based on ARM architectures
reported shipments of 6.1 billion ARM based processors, representing 95% of smart phones, 35% of digital
televisions and set-top boxes and 10% of mobile computers. It is the most widely used 32-bit instruction set
architecture in terms of quantity produced.
LPC 2148:
LPC2148 is the widely used IC from ARM-7 family. It is manufactured by Philips and it is pre-loaded
with many inbuilt peripherals making it more efficient and a reliable option for the beginners as well as high
end application developer.




8 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Features of LPC214x series controllers:
1. 8 to 40 kB of on-chip static RAM and 32 to 512 kB of on-chip flash program memory.128 bit wide
interface/accelerator enables high speed 60 MHz operation.
2. In-System/In-Application Programming (ISP/IAP) via on-chip boot-loader software. Single flash sector or
full chip erase in 400 ms and programming of 256 bytes in 1ms.
3. Embedded ICE RT and Embedded Trace interfaces offer real-time debugging with the on-chip Real
Monitor software and high speed tracing of instruction execution.
4. USB 2.0 Full Speed compliant Device Controller with 2 kB of endpoint RAM. In addition, the LPC2146/8
provides 8 kB of on-chip RAM accessible to USB by DMA.
5. One or two (LPC2141/2 vs. LPC2144/6/8) 10-bit A/D converters provide a total of 6/14analog inputs, with
conversion times as low as 2.44 us per channel.
6. Single 10-bit D/A converter provides variable analog output.
7. Two 32-bit timers/external event counters (with four capture and four compare channels each), PWM unit
(six outputs) and watchdog.
8. Low power real-time clock with independent power and dedicated 32 kHz clock input.
9. Multiple serial interfaces including two UARTs (16C550), two Fast I2C-bus (400 kbit/s), SPI and SSP with
buffering and variable data length capabilities.
10. Vectored interrupt controller with configurable priorities and vector addresses.
11. Up to 45 of 5 V tolerant fast general purpose I/O pins in a tiny LQFP64 package.
12. Up to nine edge or level sensitive external interrupt pins available.
13. On-chip integrated oscillator operates with an external crystal in range from 1 MHz to30 MHz and with
an external oscillator up to 50 MHz
14. Power saving modes include Idle and Power-down.
15. Individual enable/disable of peripheral functions as well as peripheral clock scaling for additional power
optimization.
16. Processor wake-up from Power-down mode via external interrupt, USB, Brown-Out Detect (BOD) or
Real-Time Clock (RTC).




9 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


First Step- Hardware Requirement:
Pin configuration of LPC 2148.

Hardware requirement of LPC2148:
1. LPC2148 need minimum below listed hardware to work properly
2. Power Supply
3. Crystal Oscillator
4. Reset Circuit
5. RTC crystal oscillator
6. UART
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Power Supply:
LPC2148 works on 3.3 V power supply. LM 117 can be used for generating 3.3 V supply. However,
basic peripherals like LCD, ULN 2003 (Motor Driver IC) etc. works on 5V. So AC mains supply is converted
into 5V using below mentioned circuit and after that LM 117 is used to convert 5V into 3.3V.
Block diagram of power Supply

Transformer: It is used to step down 230V AC to 9V AC supply and provides isolation between power grids
and circuit.
Rectifier: It is used to convert AC supply into DC.
Filter: It is used to reduce ripple factor of DC output available from rectifier end.
Regulator: It is used to regulate DC supply output.

11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Circuit Diagram:

Regulator IC 7805 is used to provide fix 5V dc supply.
LM 117 is used for generating 3.3V supply from 5V.

12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Calculations:

From the datasheet of LM117

Taking R 2= 240?, we get R 1=392?
Reset Circuit:
Reset button is essential in a system to avoid programming pitfalls and manually bring back the system
to the initialization mode. MCP 130T is a special IC used for providing stable RESET signal to LPC 2148.


13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Oscillator Circuit:

The value of capacitors C20 & C21 depends upon the frequency of crystal Y3. General circuit and
its equivalent circuit is as shown below.

14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Recommended values are as shown in table:

UART:
LPC 2148 has inbuilt ISP which means we can program it within the system using serial
communication on COM0. It has also COM1 for serial communication. MAX 232/233 IC must be used for
voltage logic conversion. Related connections are as given below.

Once the above listed circuit design is ready, we are ready to go further.



15 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Result:
ARM Evaluation system and the configuration of LPC2148 has been studied fully. The minimal setup
required for the functioning of the ARM processor is studied.
Outcomes:
1. Able to understand the ARM controller, its basic components inside and its features.
2. Able to know the components required for the working of ARM LPC2148

Applications:
ARM controller LPC2148 is used in no. of devices such as
1. Smart phones
2. Net books
3. E Readers
4. Digital TV
5. Home Gateways


1. What are the basic units of ARM 7?
2. What is the address system supported by ARM?
3. Define - RISC
4. What are the instructions used to access the memory in ARM?
5. What are the basic units of Microprocessor?
6. What is an Instruction?
7. What is clock cycle?
8. Define - Pipelining
9. What is cache miss?
10. What is meant by memory mapped I/O?
11. Define ? interrupt
12. What is meant by Exception?
13. What is meant by little ? endian mode?
14. What is meant by big ? endian mode?
15. What is the function of CPSR?
16. What is register - indirect addressing?
Viva-voce




16 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 2 ANALOG TO DIGITAL CONVERTOR
INTERFACING
Aim:
To write an embedded c program for interfacing an on chip ADC with LPC2148 ARM processor and
convert the given input voltage into corresponding decimal values.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. PC
Theory:
Analog to Digital converter (ADC) is a device that converts continuously varying analog signals from
instruments that monitor such conditions as movement, temperature, sound, etc., into binary code for the
computer. It may be either a single chip or can be one circuit within a chip. Analog to Digital conversion is
the process of changing continuously varying data, such as voltage, current, or shaft rotation, into discrete
digital quantities that represent the magnitude of the data compared to a standard or reference at the
moment the conversion is made. According to the method of conversion, ADCs can be classified into
Direct-Conversion ADCs, Successive Approximation ADCs, Integrating ADC and Sigma-Delta ADCs.
The LPC 2148 has 10-bit successive approximation analog to digital converter. Basic clocking for the
A/D converters is provided by the VPB clock. A programmable divider is included in each converter, to
scale this clock to the 4.5 MHz (max) clock needed by the successive approximation process. A fully
accurate conversion requires 11 of these clocks. The ADC cell can measure the voltage on any of the ADC
input signals. It is noted that these analog inputs are always connected to their pins, even if the Pin function
Select register assigns them to port pins. A simple self-test of the ADC can be done by driving these pins
as port outputs.



17 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Circuit diagram:

FirstRanker.com - FirstRanker's Choice
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00






?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING

VII SEMESTER - R 2013

EC6711 ? EMBEDDED LABORATORY






Name : _______________________________________
Register No : _______________________________________
Section : _______________________________________
LABORATORY MANUAL



2 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00




is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and
training.

? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different
levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on
heart and soul
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

To impart professional education integrated with human values to the younger generation, so as to
shape them as proficient and dedicated engineers, capable of providing comprehensive solutions to the
challenges in deploying technology for the service of humanity

? To educate the students with the state-of-art technologies to meet the growing challenges of the
electronics industry
? To carry out research through continuous interaction with research institutes and industry, on
advances in communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning,
innovation and ethical practices
VISION
VISION
MISSION
MISSION



3 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

PROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To provide students with a solid foundation in Mathematics, Science and fundamentals of
engineering, enabling them to apply, to find solutions for engineering problems and use this knowledge
to acquire higher education
2. Core Competence
To train the students in Electronics and Communication technologies so that they apply their
knowledge and training to compare, and to analyze various engineering industrial problems to find
solutions
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice which
enables them to find solutions for the real time problems in industry, and to design products
4. Professionalism
To inculcate professional and effective communication skills, leadership qualities and team spirit in
the students to make them multi-faceted personalities and develop their ability to relate engineering
issues to broader social context
5. Lifelong Learning/Ethics
To demonstrate and practice ethical and professional responsibilities in the industry and society in
the large, through commitment and lifelong learning needed for successful professional career


4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
PROGRAMME OUTCOMES (POs)
a) To demonstrate and apply knowledge of Mathematics, Science and engineering fundamentals in
Electronics and Communication Engineering field
b) To design a component, a system or a process to meet the specific needs within the realistic
constraints such as economics, environment, ethics, health, safety and manufacturability
c) To demonstrate the competency to use software tools for computation, simulation and testing of electronics
and communication engineering circuits
d) To identify, formulate and solve electronic and communication engineering problems
e) To demonstrate an ability to visualize and work on laboratory and multidisciplinary tasks
f) To function as a member or a leader in multidisciplinary activities
g) To communicate in verbal and written form with fellow engineers and society at large
h) To understand the impact of Electronics and Communication Engineering in the society and demonstrate
awareness of contemporary issues and commitment to give solutions exhibiting social responsibility
i) To demonstrate professional & ethical responsibilities
j) To exhibit confidence in self-education and ability for lifelong learning
k) To participate and succeed in competitive exams


5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
SYLLABUS

? Learn the working of ARM processor
? Understand the Building Blocks of Embedded Systems
? Learn the concept of memory map and memory interface
? Know the characteristics of Real Time Systems
? Write programs to interface memory, I/Os with processor
? Study the interrupt performance
LIST OF EXPERIMENTS:
1. Study of ARM evaluation system
2. Interfacing ADC and DAC
3. Interfacing LED and PWM
4. Interfacing real time clock and serial port
5. Interfacing keyboard and LCD
6. Interfacing EPROM and interrupt
7. Mailbox
8. Interrupt performance characteristics of ARM and FPGA
9. Flashing of LEDS
10. Interfacing stepper motor and temperature sensor
11. Implementing zigbee protocol with ARM



? Write programs in ARM for a specific Application
? Interface memory and Write programs related to memory operations
? Interface A/D and D/A convertors with ARM system
? Analyze the performance of interrupt
? Write programmes for interfacing keyboard, display, motor and sensor.
? Formulate a mini project using embedded system
COURSE OBJECTIVES
COURSE OUTCOMES
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
CONTENTS
Sl. No. Name of the Experiment Page No.
CYCLE 1 ? EXPERIMENTS
1
Study of ARM evaluation system 7
2
Analog to Digital Convertor interfacing 16
3
Generation of ramp and square wave using on-Chip DAC 19
4
LED dimming using PWM 22
5
Interfacing real time clock and serial port 25
6
Interfacing keypad and LCD 28
7
Interfacing EPROM and interrupt 31
CYCLE 2 ? EXPERIMENTS
8 Implementation of Mailbox Function using LPC 2148 35
9 Interrupt Performance Characteristics of Arm and FPGA 37
10 Flashing of LEDs 40
11 Stepper Motor Interface with ARM ? 7 LPC2148 43
12 LM35 Temperature Sensor Interface with ARM ? 7 LPC2148 47
13
Implementation of Wireless Communication Protocol using ZIGBEE Wireless
Module
50
ADDITIONAL EXPERIMENTS BEYOND THE SYYLABUS
14 Buzzer Interface with ARM ? 7 54
15 Relay interface with ARM? 7 57
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Expt. No. 1 STUDY OF ARM EVALUATION SYSTEM
Aim:
To study the building blocks of ARM7 system, its features, pin configuration and the components
required for functioning of ARM controller.
Architecture Overview:
A RISC-based computer design approach means ARM processors require significantly fewer transistors
than typical processors in average computers. This approach reduces cost, heat and power usage. These
are desirable traits for light, portable, battery-powered devices (smart phones, laptops, tablet and notepad
computers), and other embedded systems. A simpler design facilitates more efficient multi-core CPUs and
higher core counts at lower cost, providing higher processing power and improved energy efficiency for
servers and supercomputers.
In 2005, about 98% of all mobile phones sold used at least one ARM processor. The low power
consumption of ARM processors has made them very popular: 37 billion ARM processors have been
produced as of 2013, up from 10 billion in 2008. The ARM architecture (32-bit) is the most widely used
architecture in mobile devices, and most popular 32-bit one in embedded systems.
According to ARM Holdings, in 2010 alone, producers of chips based on ARM architectures
reported shipments of 6.1 billion ARM based processors, representing 95% of smart phones, 35% of digital
televisions and set-top boxes and 10% of mobile computers. It is the most widely used 32-bit instruction set
architecture in terms of quantity produced.
LPC 2148:
LPC2148 is the widely used IC from ARM-7 family. It is manufactured by Philips and it is pre-loaded
with many inbuilt peripherals making it more efficient and a reliable option for the beginners as well as high
end application developer.




8 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Features of LPC214x series controllers:
1. 8 to 40 kB of on-chip static RAM and 32 to 512 kB of on-chip flash program memory.128 bit wide
interface/accelerator enables high speed 60 MHz operation.
2. In-System/In-Application Programming (ISP/IAP) via on-chip boot-loader software. Single flash sector or
full chip erase in 400 ms and programming of 256 bytes in 1ms.
3. Embedded ICE RT and Embedded Trace interfaces offer real-time debugging with the on-chip Real
Monitor software and high speed tracing of instruction execution.
4. USB 2.0 Full Speed compliant Device Controller with 2 kB of endpoint RAM. In addition, the LPC2146/8
provides 8 kB of on-chip RAM accessible to USB by DMA.
5. One or two (LPC2141/2 vs. LPC2144/6/8) 10-bit A/D converters provide a total of 6/14analog inputs, with
conversion times as low as 2.44 us per channel.
6. Single 10-bit D/A converter provides variable analog output.
7. Two 32-bit timers/external event counters (with four capture and four compare channels each), PWM unit
(six outputs) and watchdog.
8. Low power real-time clock with independent power and dedicated 32 kHz clock input.
9. Multiple serial interfaces including two UARTs (16C550), two Fast I2C-bus (400 kbit/s), SPI and SSP with
buffering and variable data length capabilities.
10. Vectored interrupt controller with configurable priorities and vector addresses.
11. Up to 45 of 5 V tolerant fast general purpose I/O pins in a tiny LQFP64 package.
12. Up to nine edge or level sensitive external interrupt pins available.
13. On-chip integrated oscillator operates with an external crystal in range from 1 MHz to30 MHz and with
an external oscillator up to 50 MHz
14. Power saving modes include Idle and Power-down.
15. Individual enable/disable of peripheral functions as well as peripheral clock scaling for additional power
optimization.
16. Processor wake-up from Power-down mode via external interrupt, USB, Brown-Out Detect (BOD) or
Real-Time Clock (RTC).




9 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


First Step- Hardware Requirement:
Pin configuration of LPC 2148.

Hardware requirement of LPC2148:
1. LPC2148 need minimum below listed hardware to work properly
2. Power Supply
3. Crystal Oscillator
4. Reset Circuit
5. RTC crystal oscillator
6. UART
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Power Supply:
LPC2148 works on 3.3 V power supply. LM 117 can be used for generating 3.3 V supply. However,
basic peripherals like LCD, ULN 2003 (Motor Driver IC) etc. works on 5V. So AC mains supply is converted
into 5V using below mentioned circuit and after that LM 117 is used to convert 5V into 3.3V.
Block diagram of power Supply

Transformer: It is used to step down 230V AC to 9V AC supply and provides isolation between power grids
and circuit.
Rectifier: It is used to convert AC supply into DC.
Filter: It is used to reduce ripple factor of DC output available from rectifier end.
Regulator: It is used to regulate DC supply output.

11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Circuit Diagram:

Regulator IC 7805 is used to provide fix 5V dc supply.
LM 117 is used for generating 3.3V supply from 5V.

12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Calculations:

From the datasheet of LM117

Taking R 2= 240?, we get R 1=392?
Reset Circuit:
Reset button is essential in a system to avoid programming pitfalls and manually bring back the system
to the initialization mode. MCP 130T is a special IC used for providing stable RESET signal to LPC 2148.


13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Oscillator Circuit:

The value of capacitors C20 & C21 depends upon the frequency of crystal Y3. General circuit and
its equivalent circuit is as shown below.

14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Recommended values are as shown in table:

UART:
LPC 2148 has inbuilt ISP which means we can program it within the system using serial
communication on COM0. It has also COM1 for serial communication. MAX 232/233 IC must be used for
voltage logic conversion. Related connections are as given below.

Once the above listed circuit design is ready, we are ready to go further.



15 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Result:
ARM Evaluation system and the configuration of LPC2148 has been studied fully. The minimal setup
required for the functioning of the ARM processor is studied.
Outcomes:
1. Able to understand the ARM controller, its basic components inside and its features.
2. Able to know the components required for the working of ARM LPC2148

Applications:
ARM controller LPC2148 is used in no. of devices such as
1. Smart phones
2. Net books
3. E Readers
4. Digital TV
5. Home Gateways


1. What are the basic units of ARM 7?
2. What is the address system supported by ARM?
3. Define - RISC
4. What are the instructions used to access the memory in ARM?
5. What are the basic units of Microprocessor?
6. What is an Instruction?
7. What is clock cycle?
8. Define - Pipelining
9. What is cache miss?
10. What is meant by memory mapped I/O?
11. Define ? interrupt
12. What is meant by Exception?
13. What is meant by little ? endian mode?
14. What is meant by big ? endian mode?
15. What is the function of CPSR?
16. What is register - indirect addressing?
Viva-voce




16 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 2 ANALOG TO DIGITAL CONVERTOR
INTERFACING
Aim:
To write an embedded c program for interfacing an on chip ADC with LPC2148 ARM processor and
convert the given input voltage into corresponding decimal values.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. PC
Theory:
Analog to Digital converter (ADC) is a device that converts continuously varying analog signals from
instruments that monitor such conditions as movement, temperature, sound, etc., into binary code for the
computer. It may be either a single chip or can be one circuit within a chip. Analog to Digital conversion is
the process of changing continuously varying data, such as voltage, current, or shaft rotation, into discrete
digital quantities that represent the magnitude of the data compared to a standard or reference at the
moment the conversion is made. According to the method of conversion, ADCs can be classified into
Direct-Conversion ADCs, Successive Approximation ADCs, Integrating ADC and Sigma-Delta ADCs.
The LPC 2148 has 10-bit successive approximation analog to digital converter. Basic clocking for the
A/D converters is provided by the VPB clock. A programmable divider is included in each converter, to
scale this clock to the 4.5 MHz (max) clock needed by the successive approximation process. A fully
accurate conversion requires 11 of these clocks. The ADC cell can measure the voltage on any of the ADC
input signals. It is noted that these analog inputs are always connected to their pins, even if the Pin function
Select register assigns them to port pins. A simple self-test of the ADC can be done by driving these pins
as port outputs.



17 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Circuit diagram:




18 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus, an embedded c program for interfacing on-chip ADC with ARM processor is written and
executed. The decimal values of the converted voltage are seen in the WinXTalk screen.
Outcome:
Able to interface A/D convertors with ARM system and check its working by connecting an analog
quantity as input.
Applications:
1. ADC used in MODEM for converting analog signals to digital.
2. A fast video ADC in TV tuner cards
3. ADC used in digital storage oscilloscopes
4. Used in music reproduction technology.
5. Used in DSP if input is analog


1. What are the ADC operating modes in LPC2148?
2. What is meant by conversion time?
3. Why are internal ADCs preferred over external ADCs?
4. Why has 16-bit ADC more resolution than from 10-bit and 8-bit ADC?
5. What are ADC & its Resolution?
6. What is Burst conversion mode?
7. What is the function of A/D Control Register?
8. What is the function of A/D Global Data Register?
9. What is the function of A/D Status Register?
10. What is analog-to-digital (ADC) conversion error?
11. What is the function of Sample-and-hold circuits in analog-to digital converters?
12. What is the disadvantage of the flash analog-to digital converter?
Viva-voce

FirstRanker.com - FirstRanker's Choice
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00






?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING

VII SEMESTER - R 2013

EC6711 ? EMBEDDED LABORATORY






Name : _______________________________________
Register No : _______________________________________
Section : _______________________________________
LABORATORY MANUAL



2 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00




is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and
training.

? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different
levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on
heart and soul
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

To impart professional education integrated with human values to the younger generation, so as to
shape them as proficient and dedicated engineers, capable of providing comprehensive solutions to the
challenges in deploying technology for the service of humanity

? To educate the students with the state-of-art technologies to meet the growing challenges of the
electronics industry
? To carry out research through continuous interaction with research institutes and industry, on
advances in communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning,
innovation and ethical practices
VISION
VISION
MISSION
MISSION



3 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

PROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To provide students with a solid foundation in Mathematics, Science and fundamentals of
engineering, enabling them to apply, to find solutions for engineering problems and use this knowledge
to acquire higher education
2. Core Competence
To train the students in Electronics and Communication technologies so that they apply their
knowledge and training to compare, and to analyze various engineering industrial problems to find
solutions
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice which
enables them to find solutions for the real time problems in industry, and to design products
4. Professionalism
To inculcate professional and effective communication skills, leadership qualities and team spirit in
the students to make them multi-faceted personalities and develop their ability to relate engineering
issues to broader social context
5. Lifelong Learning/Ethics
To demonstrate and practice ethical and professional responsibilities in the industry and society in
the large, through commitment and lifelong learning needed for successful professional career


4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
PROGRAMME OUTCOMES (POs)
a) To demonstrate and apply knowledge of Mathematics, Science and engineering fundamentals in
Electronics and Communication Engineering field
b) To design a component, a system or a process to meet the specific needs within the realistic
constraints such as economics, environment, ethics, health, safety and manufacturability
c) To demonstrate the competency to use software tools for computation, simulation and testing of electronics
and communication engineering circuits
d) To identify, formulate and solve electronic and communication engineering problems
e) To demonstrate an ability to visualize and work on laboratory and multidisciplinary tasks
f) To function as a member or a leader in multidisciplinary activities
g) To communicate in verbal and written form with fellow engineers and society at large
h) To understand the impact of Electronics and Communication Engineering in the society and demonstrate
awareness of contemporary issues and commitment to give solutions exhibiting social responsibility
i) To demonstrate professional & ethical responsibilities
j) To exhibit confidence in self-education and ability for lifelong learning
k) To participate and succeed in competitive exams


5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
SYLLABUS

? Learn the working of ARM processor
? Understand the Building Blocks of Embedded Systems
? Learn the concept of memory map and memory interface
? Know the characteristics of Real Time Systems
? Write programs to interface memory, I/Os with processor
? Study the interrupt performance
LIST OF EXPERIMENTS:
1. Study of ARM evaluation system
2. Interfacing ADC and DAC
3. Interfacing LED and PWM
4. Interfacing real time clock and serial port
5. Interfacing keyboard and LCD
6. Interfacing EPROM and interrupt
7. Mailbox
8. Interrupt performance characteristics of ARM and FPGA
9. Flashing of LEDS
10. Interfacing stepper motor and temperature sensor
11. Implementing zigbee protocol with ARM



? Write programs in ARM for a specific Application
? Interface memory and Write programs related to memory operations
? Interface A/D and D/A convertors with ARM system
? Analyze the performance of interrupt
? Write programmes for interfacing keyboard, display, motor and sensor.
? Formulate a mini project using embedded system
COURSE OBJECTIVES
COURSE OUTCOMES
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
CONTENTS
Sl. No. Name of the Experiment Page No.
CYCLE 1 ? EXPERIMENTS
1
Study of ARM evaluation system 7
2
Analog to Digital Convertor interfacing 16
3
Generation of ramp and square wave using on-Chip DAC 19
4
LED dimming using PWM 22
5
Interfacing real time clock and serial port 25
6
Interfacing keypad and LCD 28
7
Interfacing EPROM and interrupt 31
CYCLE 2 ? EXPERIMENTS
8 Implementation of Mailbox Function using LPC 2148 35
9 Interrupt Performance Characteristics of Arm and FPGA 37
10 Flashing of LEDs 40
11 Stepper Motor Interface with ARM ? 7 LPC2148 43
12 LM35 Temperature Sensor Interface with ARM ? 7 LPC2148 47
13
Implementation of Wireless Communication Protocol using ZIGBEE Wireless
Module
50
ADDITIONAL EXPERIMENTS BEYOND THE SYYLABUS
14 Buzzer Interface with ARM ? 7 54
15 Relay interface with ARM? 7 57
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Expt. No. 1 STUDY OF ARM EVALUATION SYSTEM
Aim:
To study the building blocks of ARM7 system, its features, pin configuration and the components
required for functioning of ARM controller.
Architecture Overview:
A RISC-based computer design approach means ARM processors require significantly fewer transistors
than typical processors in average computers. This approach reduces cost, heat and power usage. These
are desirable traits for light, portable, battery-powered devices (smart phones, laptops, tablet and notepad
computers), and other embedded systems. A simpler design facilitates more efficient multi-core CPUs and
higher core counts at lower cost, providing higher processing power and improved energy efficiency for
servers and supercomputers.
In 2005, about 98% of all mobile phones sold used at least one ARM processor. The low power
consumption of ARM processors has made them very popular: 37 billion ARM processors have been
produced as of 2013, up from 10 billion in 2008. The ARM architecture (32-bit) is the most widely used
architecture in mobile devices, and most popular 32-bit one in embedded systems.
According to ARM Holdings, in 2010 alone, producers of chips based on ARM architectures
reported shipments of 6.1 billion ARM based processors, representing 95% of smart phones, 35% of digital
televisions and set-top boxes and 10% of mobile computers. It is the most widely used 32-bit instruction set
architecture in terms of quantity produced.
LPC 2148:
LPC2148 is the widely used IC from ARM-7 family. It is manufactured by Philips and it is pre-loaded
with many inbuilt peripherals making it more efficient and a reliable option for the beginners as well as high
end application developer.




8 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Features of LPC214x series controllers:
1. 8 to 40 kB of on-chip static RAM and 32 to 512 kB of on-chip flash program memory.128 bit wide
interface/accelerator enables high speed 60 MHz operation.
2. In-System/In-Application Programming (ISP/IAP) via on-chip boot-loader software. Single flash sector or
full chip erase in 400 ms and programming of 256 bytes in 1ms.
3. Embedded ICE RT and Embedded Trace interfaces offer real-time debugging with the on-chip Real
Monitor software and high speed tracing of instruction execution.
4. USB 2.0 Full Speed compliant Device Controller with 2 kB of endpoint RAM. In addition, the LPC2146/8
provides 8 kB of on-chip RAM accessible to USB by DMA.
5. One or two (LPC2141/2 vs. LPC2144/6/8) 10-bit A/D converters provide a total of 6/14analog inputs, with
conversion times as low as 2.44 us per channel.
6. Single 10-bit D/A converter provides variable analog output.
7. Two 32-bit timers/external event counters (with four capture and four compare channels each), PWM unit
(six outputs) and watchdog.
8. Low power real-time clock with independent power and dedicated 32 kHz clock input.
9. Multiple serial interfaces including two UARTs (16C550), two Fast I2C-bus (400 kbit/s), SPI and SSP with
buffering and variable data length capabilities.
10. Vectored interrupt controller with configurable priorities and vector addresses.
11. Up to 45 of 5 V tolerant fast general purpose I/O pins in a tiny LQFP64 package.
12. Up to nine edge or level sensitive external interrupt pins available.
13. On-chip integrated oscillator operates with an external crystal in range from 1 MHz to30 MHz and with
an external oscillator up to 50 MHz
14. Power saving modes include Idle and Power-down.
15. Individual enable/disable of peripheral functions as well as peripheral clock scaling for additional power
optimization.
16. Processor wake-up from Power-down mode via external interrupt, USB, Brown-Out Detect (BOD) or
Real-Time Clock (RTC).




9 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


First Step- Hardware Requirement:
Pin configuration of LPC 2148.

Hardware requirement of LPC2148:
1. LPC2148 need minimum below listed hardware to work properly
2. Power Supply
3. Crystal Oscillator
4. Reset Circuit
5. RTC crystal oscillator
6. UART
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Power Supply:
LPC2148 works on 3.3 V power supply. LM 117 can be used for generating 3.3 V supply. However,
basic peripherals like LCD, ULN 2003 (Motor Driver IC) etc. works on 5V. So AC mains supply is converted
into 5V using below mentioned circuit and after that LM 117 is used to convert 5V into 3.3V.
Block diagram of power Supply

Transformer: It is used to step down 230V AC to 9V AC supply and provides isolation between power grids
and circuit.
Rectifier: It is used to convert AC supply into DC.
Filter: It is used to reduce ripple factor of DC output available from rectifier end.
Regulator: It is used to regulate DC supply output.

11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Circuit Diagram:

Regulator IC 7805 is used to provide fix 5V dc supply.
LM 117 is used for generating 3.3V supply from 5V.

12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Calculations:

From the datasheet of LM117

Taking R 2= 240?, we get R 1=392?
Reset Circuit:
Reset button is essential in a system to avoid programming pitfalls and manually bring back the system
to the initialization mode. MCP 130T is a special IC used for providing stable RESET signal to LPC 2148.


13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Oscillator Circuit:

The value of capacitors C20 & C21 depends upon the frequency of crystal Y3. General circuit and
its equivalent circuit is as shown below.

14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Recommended values are as shown in table:

UART:
LPC 2148 has inbuilt ISP which means we can program it within the system using serial
communication on COM0. It has also COM1 for serial communication. MAX 232/233 IC must be used for
voltage logic conversion. Related connections are as given below.

Once the above listed circuit design is ready, we are ready to go further.



15 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Result:
ARM Evaluation system and the configuration of LPC2148 has been studied fully. The minimal setup
required for the functioning of the ARM processor is studied.
Outcomes:
1. Able to understand the ARM controller, its basic components inside and its features.
2. Able to know the components required for the working of ARM LPC2148

Applications:
ARM controller LPC2148 is used in no. of devices such as
1. Smart phones
2. Net books
3. E Readers
4. Digital TV
5. Home Gateways


1. What are the basic units of ARM 7?
2. What is the address system supported by ARM?
3. Define - RISC
4. What are the instructions used to access the memory in ARM?
5. What are the basic units of Microprocessor?
6. What is an Instruction?
7. What is clock cycle?
8. Define - Pipelining
9. What is cache miss?
10. What is meant by memory mapped I/O?
11. Define ? interrupt
12. What is meant by Exception?
13. What is meant by little ? endian mode?
14. What is meant by big ? endian mode?
15. What is the function of CPSR?
16. What is register - indirect addressing?
Viva-voce




16 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 2 ANALOG TO DIGITAL CONVERTOR
INTERFACING
Aim:
To write an embedded c program for interfacing an on chip ADC with LPC2148 ARM processor and
convert the given input voltage into corresponding decimal values.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. PC
Theory:
Analog to Digital converter (ADC) is a device that converts continuously varying analog signals from
instruments that monitor such conditions as movement, temperature, sound, etc., into binary code for the
computer. It may be either a single chip or can be one circuit within a chip. Analog to Digital conversion is
the process of changing continuously varying data, such as voltage, current, or shaft rotation, into discrete
digital quantities that represent the magnitude of the data compared to a standard or reference at the
moment the conversion is made. According to the method of conversion, ADCs can be classified into
Direct-Conversion ADCs, Successive Approximation ADCs, Integrating ADC and Sigma-Delta ADCs.
The LPC 2148 has 10-bit successive approximation analog to digital converter. Basic clocking for the
A/D converters is provided by the VPB clock. A programmable divider is included in each converter, to
scale this clock to the 4.5 MHz (max) clock needed by the successive approximation process. A fully
accurate conversion requires 11 of these clocks. The ADC cell can measure the voltage on any of the ADC
input signals. It is noted that these analog inputs are always connected to their pins, even if the Pin function
Select register assigns them to port pins. A simple self-test of the ADC can be done by driving these pins
as port outputs.



17 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Circuit diagram:




18 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus, an embedded c program for interfacing on-chip ADC with ARM processor is written and
executed. The decimal values of the converted voltage are seen in the WinXTalk screen.
Outcome:
Able to interface A/D convertors with ARM system and check its working by connecting an analog
quantity as input.
Applications:
1. ADC used in MODEM for converting analog signals to digital.
2. A fast video ADC in TV tuner cards
3. ADC used in digital storage oscilloscopes
4. Used in music reproduction technology.
5. Used in DSP if input is analog


1. What are the ADC operating modes in LPC2148?
2. What is meant by conversion time?
3. Why are internal ADCs preferred over external ADCs?
4. Why has 16-bit ADC more resolution than from 10-bit and 8-bit ADC?
5. What are ADC & its Resolution?
6. What is Burst conversion mode?
7. What is the function of A/D Control Register?
8. What is the function of A/D Global Data Register?
9. What is the function of A/D Status Register?
10. What is analog-to-digital (ADC) conversion error?
11. What is the function of Sample-and-hold circuits in analog-to digital converters?
12. What is the disadvantage of the flash analog-to digital converter?
Viva-voce




19 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 3 GENERATION OF RAMP AND SQUARE
WAVE USING ON-CHIP DAC
Aim:
To write and execute an embedded c program to generate ramp wave and square wave using on-chip
DAC of LPC2148 ARM controller.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
A digital-to-analog converter is a device for converting a digital signal into an analog signal (current or
voltage). Digital-to-Analog Converters are the interface between the abstract digital world and the analog
real world. Simple switches, a network of resistors, current sources or capacitors may be used to
implement this conversion. A DAC inputs a binary number and outputs an analog voltage or current signal.
The Microchip Technology Inc. MCP4921 is 2.7 ? 5.5V, low-power, 12-Bit Digital-to-Analog Converter
(DAC) with SPI interface. The MCP4921 DAC provides high accuracy and low noise performance for
industrial applications where calibration or compensation of signals is required. With an SPI connection
there is always one master device (usually a microcontroller) which controls the peripheral devices.
Typically there are three lines common to all the devices,
Master In Slave Out (MISO) ? The Slave line for sending data to the master,
Master Out Slave In (MOSI) ? The Master line for sending data to the peripherals,
Serial Clock (SCK) ? The clock pulses which synchronize data transmission generated by the
master and slave
Slave Select pin ? the pin on each device that the master can use to enable and disable specific
devices. When a device Slave Select pin is low, it communicates with the master. When it is high, it ignores
the master. In SPI, the clock signal is controlled by the master device LPC2148. All data is clocked in and
out using this pin. These lines need to be connected to the relevant pins on the LPC21xx processor. Any
unused GIO pin can be used for CS, instead pull this pin high. Conversion speed is the time it takes for the
FirstRanker.com - FirstRanker's Choice
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00






?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING

VII SEMESTER - R 2013

EC6711 ? EMBEDDED LABORATORY






Name : _______________________________________
Register No : _______________________________________
Section : _______________________________________
LABORATORY MANUAL



2 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00




is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and
training.

? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different
levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on
heart and soul
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

To impart professional education integrated with human values to the younger generation, so as to
shape them as proficient and dedicated engineers, capable of providing comprehensive solutions to the
challenges in deploying technology for the service of humanity

? To educate the students with the state-of-art technologies to meet the growing challenges of the
electronics industry
? To carry out research through continuous interaction with research institutes and industry, on
advances in communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning,
innovation and ethical practices
VISION
VISION
MISSION
MISSION



3 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

PROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To provide students with a solid foundation in Mathematics, Science and fundamentals of
engineering, enabling them to apply, to find solutions for engineering problems and use this knowledge
to acquire higher education
2. Core Competence
To train the students in Electronics and Communication technologies so that they apply their
knowledge and training to compare, and to analyze various engineering industrial problems to find
solutions
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice which
enables them to find solutions for the real time problems in industry, and to design products
4. Professionalism
To inculcate professional and effective communication skills, leadership qualities and team spirit in
the students to make them multi-faceted personalities and develop their ability to relate engineering
issues to broader social context
5. Lifelong Learning/Ethics
To demonstrate and practice ethical and professional responsibilities in the industry and society in
the large, through commitment and lifelong learning needed for successful professional career


4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
PROGRAMME OUTCOMES (POs)
a) To demonstrate and apply knowledge of Mathematics, Science and engineering fundamentals in
Electronics and Communication Engineering field
b) To design a component, a system or a process to meet the specific needs within the realistic
constraints such as economics, environment, ethics, health, safety and manufacturability
c) To demonstrate the competency to use software tools for computation, simulation and testing of electronics
and communication engineering circuits
d) To identify, formulate and solve electronic and communication engineering problems
e) To demonstrate an ability to visualize and work on laboratory and multidisciplinary tasks
f) To function as a member or a leader in multidisciplinary activities
g) To communicate in verbal and written form with fellow engineers and society at large
h) To understand the impact of Electronics and Communication Engineering in the society and demonstrate
awareness of contemporary issues and commitment to give solutions exhibiting social responsibility
i) To demonstrate professional & ethical responsibilities
j) To exhibit confidence in self-education and ability for lifelong learning
k) To participate and succeed in competitive exams


5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
SYLLABUS

? Learn the working of ARM processor
? Understand the Building Blocks of Embedded Systems
? Learn the concept of memory map and memory interface
? Know the characteristics of Real Time Systems
? Write programs to interface memory, I/Os with processor
? Study the interrupt performance
LIST OF EXPERIMENTS:
1. Study of ARM evaluation system
2. Interfacing ADC and DAC
3. Interfacing LED and PWM
4. Interfacing real time clock and serial port
5. Interfacing keyboard and LCD
6. Interfacing EPROM and interrupt
7. Mailbox
8. Interrupt performance characteristics of ARM and FPGA
9. Flashing of LEDS
10. Interfacing stepper motor and temperature sensor
11. Implementing zigbee protocol with ARM



? Write programs in ARM for a specific Application
? Interface memory and Write programs related to memory operations
? Interface A/D and D/A convertors with ARM system
? Analyze the performance of interrupt
? Write programmes for interfacing keyboard, display, motor and sensor.
? Formulate a mini project using embedded system
COURSE OBJECTIVES
COURSE OUTCOMES
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
CONTENTS
Sl. No. Name of the Experiment Page No.
CYCLE 1 ? EXPERIMENTS
1
Study of ARM evaluation system 7
2
Analog to Digital Convertor interfacing 16
3
Generation of ramp and square wave using on-Chip DAC 19
4
LED dimming using PWM 22
5
Interfacing real time clock and serial port 25
6
Interfacing keypad and LCD 28
7
Interfacing EPROM and interrupt 31
CYCLE 2 ? EXPERIMENTS
8 Implementation of Mailbox Function using LPC 2148 35
9 Interrupt Performance Characteristics of Arm and FPGA 37
10 Flashing of LEDs 40
11 Stepper Motor Interface with ARM ? 7 LPC2148 43
12 LM35 Temperature Sensor Interface with ARM ? 7 LPC2148 47
13
Implementation of Wireless Communication Protocol using ZIGBEE Wireless
Module
50
ADDITIONAL EXPERIMENTS BEYOND THE SYYLABUS
14 Buzzer Interface with ARM ? 7 54
15 Relay interface with ARM? 7 57
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Expt. No. 1 STUDY OF ARM EVALUATION SYSTEM
Aim:
To study the building blocks of ARM7 system, its features, pin configuration and the components
required for functioning of ARM controller.
Architecture Overview:
A RISC-based computer design approach means ARM processors require significantly fewer transistors
than typical processors in average computers. This approach reduces cost, heat and power usage. These
are desirable traits for light, portable, battery-powered devices (smart phones, laptops, tablet and notepad
computers), and other embedded systems. A simpler design facilitates more efficient multi-core CPUs and
higher core counts at lower cost, providing higher processing power and improved energy efficiency for
servers and supercomputers.
In 2005, about 98% of all mobile phones sold used at least one ARM processor. The low power
consumption of ARM processors has made them very popular: 37 billion ARM processors have been
produced as of 2013, up from 10 billion in 2008. The ARM architecture (32-bit) is the most widely used
architecture in mobile devices, and most popular 32-bit one in embedded systems.
According to ARM Holdings, in 2010 alone, producers of chips based on ARM architectures
reported shipments of 6.1 billion ARM based processors, representing 95% of smart phones, 35% of digital
televisions and set-top boxes and 10% of mobile computers. It is the most widely used 32-bit instruction set
architecture in terms of quantity produced.
LPC 2148:
LPC2148 is the widely used IC from ARM-7 family. It is manufactured by Philips and it is pre-loaded
with many inbuilt peripherals making it more efficient and a reliable option for the beginners as well as high
end application developer.




8 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Features of LPC214x series controllers:
1. 8 to 40 kB of on-chip static RAM and 32 to 512 kB of on-chip flash program memory.128 bit wide
interface/accelerator enables high speed 60 MHz operation.
2. In-System/In-Application Programming (ISP/IAP) via on-chip boot-loader software. Single flash sector or
full chip erase in 400 ms and programming of 256 bytes in 1ms.
3. Embedded ICE RT and Embedded Trace interfaces offer real-time debugging with the on-chip Real
Monitor software and high speed tracing of instruction execution.
4. USB 2.0 Full Speed compliant Device Controller with 2 kB of endpoint RAM. In addition, the LPC2146/8
provides 8 kB of on-chip RAM accessible to USB by DMA.
5. One or two (LPC2141/2 vs. LPC2144/6/8) 10-bit A/D converters provide a total of 6/14analog inputs, with
conversion times as low as 2.44 us per channel.
6. Single 10-bit D/A converter provides variable analog output.
7. Two 32-bit timers/external event counters (with four capture and four compare channels each), PWM unit
(six outputs) and watchdog.
8. Low power real-time clock with independent power and dedicated 32 kHz clock input.
9. Multiple serial interfaces including two UARTs (16C550), two Fast I2C-bus (400 kbit/s), SPI and SSP with
buffering and variable data length capabilities.
10. Vectored interrupt controller with configurable priorities and vector addresses.
11. Up to 45 of 5 V tolerant fast general purpose I/O pins in a tiny LQFP64 package.
12. Up to nine edge or level sensitive external interrupt pins available.
13. On-chip integrated oscillator operates with an external crystal in range from 1 MHz to30 MHz and with
an external oscillator up to 50 MHz
14. Power saving modes include Idle and Power-down.
15. Individual enable/disable of peripheral functions as well as peripheral clock scaling for additional power
optimization.
16. Processor wake-up from Power-down mode via external interrupt, USB, Brown-Out Detect (BOD) or
Real-Time Clock (RTC).




9 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


First Step- Hardware Requirement:
Pin configuration of LPC 2148.

Hardware requirement of LPC2148:
1. LPC2148 need minimum below listed hardware to work properly
2. Power Supply
3. Crystal Oscillator
4. Reset Circuit
5. RTC crystal oscillator
6. UART
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Power Supply:
LPC2148 works on 3.3 V power supply. LM 117 can be used for generating 3.3 V supply. However,
basic peripherals like LCD, ULN 2003 (Motor Driver IC) etc. works on 5V. So AC mains supply is converted
into 5V using below mentioned circuit and after that LM 117 is used to convert 5V into 3.3V.
Block diagram of power Supply

Transformer: It is used to step down 230V AC to 9V AC supply and provides isolation between power grids
and circuit.
Rectifier: It is used to convert AC supply into DC.
Filter: It is used to reduce ripple factor of DC output available from rectifier end.
Regulator: It is used to regulate DC supply output.

11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Circuit Diagram:

Regulator IC 7805 is used to provide fix 5V dc supply.
LM 117 is used for generating 3.3V supply from 5V.

12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Calculations:

From the datasheet of LM117

Taking R 2= 240?, we get R 1=392?
Reset Circuit:
Reset button is essential in a system to avoid programming pitfalls and manually bring back the system
to the initialization mode. MCP 130T is a special IC used for providing stable RESET signal to LPC 2148.


13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Oscillator Circuit:

The value of capacitors C20 & C21 depends upon the frequency of crystal Y3. General circuit and
its equivalent circuit is as shown below.

14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Recommended values are as shown in table:

UART:
LPC 2148 has inbuilt ISP which means we can program it within the system using serial
communication on COM0. It has also COM1 for serial communication. MAX 232/233 IC must be used for
voltage logic conversion. Related connections are as given below.

Once the above listed circuit design is ready, we are ready to go further.



15 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Result:
ARM Evaluation system and the configuration of LPC2148 has been studied fully. The minimal setup
required for the functioning of the ARM processor is studied.
Outcomes:
1. Able to understand the ARM controller, its basic components inside and its features.
2. Able to know the components required for the working of ARM LPC2148

Applications:
ARM controller LPC2148 is used in no. of devices such as
1. Smart phones
2. Net books
3. E Readers
4. Digital TV
5. Home Gateways


1. What are the basic units of ARM 7?
2. What is the address system supported by ARM?
3. Define - RISC
4. What are the instructions used to access the memory in ARM?
5. What are the basic units of Microprocessor?
6. What is an Instruction?
7. What is clock cycle?
8. Define - Pipelining
9. What is cache miss?
10. What is meant by memory mapped I/O?
11. Define ? interrupt
12. What is meant by Exception?
13. What is meant by little ? endian mode?
14. What is meant by big ? endian mode?
15. What is the function of CPSR?
16. What is register - indirect addressing?
Viva-voce




16 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 2 ANALOG TO DIGITAL CONVERTOR
INTERFACING
Aim:
To write an embedded c program for interfacing an on chip ADC with LPC2148 ARM processor and
convert the given input voltage into corresponding decimal values.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. PC
Theory:
Analog to Digital converter (ADC) is a device that converts continuously varying analog signals from
instruments that monitor such conditions as movement, temperature, sound, etc., into binary code for the
computer. It may be either a single chip or can be one circuit within a chip. Analog to Digital conversion is
the process of changing continuously varying data, such as voltage, current, or shaft rotation, into discrete
digital quantities that represent the magnitude of the data compared to a standard or reference at the
moment the conversion is made. According to the method of conversion, ADCs can be classified into
Direct-Conversion ADCs, Successive Approximation ADCs, Integrating ADC and Sigma-Delta ADCs.
The LPC 2148 has 10-bit successive approximation analog to digital converter. Basic clocking for the
A/D converters is provided by the VPB clock. A programmable divider is included in each converter, to
scale this clock to the 4.5 MHz (max) clock needed by the successive approximation process. A fully
accurate conversion requires 11 of these clocks. The ADC cell can measure the voltage on any of the ADC
input signals. It is noted that these analog inputs are always connected to their pins, even if the Pin function
Select register assigns them to port pins. A simple self-test of the ADC can be done by driving these pins
as port outputs.



17 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Circuit diagram:




18 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus, an embedded c program for interfacing on-chip ADC with ARM processor is written and
executed. The decimal values of the converted voltage are seen in the WinXTalk screen.
Outcome:
Able to interface A/D convertors with ARM system and check its working by connecting an analog
quantity as input.
Applications:
1. ADC used in MODEM for converting analog signals to digital.
2. A fast video ADC in TV tuner cards
3. ADC used in digital storage oscilloscopes
4. Used in music reproduction technology.
5. Used in DSP if input is analog


1. What are the ADC operating modes in LPC2148?
2. What is meant by conversion time?
3. Why are internal ADCs preferred over external ADCs?
4. Why has 16-bit ADC more resolution than from 10-bit and 8-bit ADC?
5. What are ADC & its Resolution?
6. What is Burst conversion mode?
7. What is the function of A/D Control Register?
8. What is the function of A/D Global Data Register?
9. What is the function of A/D Status Register?
10. What is analog-to-digital (ADC) conversion error?
11. What is the function of Sample-and-hold circuits in analog-to digital converters?
12. What is the disadvantage of the flash analog-to digital converter?
Viva-voce




19 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 3 GENERATION OF RAMP AND SQUARE
WAVE USING ON-CHIP DAC
Aim:
To write and execute an embedded c program to generate ramp wave and square wave using on-chip
DAC of LPC2148 ARM controller.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
A digital-to-analog converter is a device for converting a digital signal into an analog signal (current or
voltage). Digital-to-Analog Converters are the interface between the abstract digital world and the analog
real world. Simple switches, a network of resistors, current sources or capacitors may be used to
implement this conversion. A DAC inputs a binary number and outputs an analog voltage or current signal.
The Microchip Technology Inc. MCP4921 is 2.7 ? 5.5V, low-power, 12-Bit Digital-to-Analog Converter
(DAC) with SPI interface. The MCP4921 DAC provides high accuracy and low noise performance for
industrial applications where calibration or compensation of signals is required. With an SPI connection
there is always one master device (usually a microcontroller) which controls the peripheral devices.
Typically there are three lines common to all the devices,
Master In Slave Out (MISO) ? The Slave line for sending data to the master,
Master Out Slave In (MOSI) ? The Master line for sending data to the peripherals,
Serial Clock (SCK) ? The clock pulses which synchronize data transmission generated by the
master and slave
Slave Select pin ? the pin on each device that the master can use to enable and disable specific
devices. When a device Slave Select pin is low, it communicates with the master. When it is high, it ignores
the master. In SPI, the clock signal is controlled by the master device LPC2148. All data is clocked in and
out using this pin. These lines need to be connected to the relevant pins on the LPC21xx processor. Any
unused GIO pin can be used for CS, instead pull this pin high. Conversion speed is the time it takes for the



20 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

DAC to provide an analog output when the digital input word is changed. The MCP4291 DAC ? SPI
connections with LPC21xx have four I/O lines (P0.4 ? P0.7) required. The analog output is generated by
using these four lines.
Circuit diagram:


Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the embedded c programs for generating ramp wave and square wave using ARM LPC2148 are
written and executed successfully and the waveforms are viewed in oscilloscope.
Outcome:
Able to program the DAC in-built inside the ARM controller and get the waveforms using it.

FirstRanker.com - FirstRanker's Choice
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00






?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING

VII SEMESTER - R 2013

EC6711 ? EMBEDDED LABORATORY






Name : _______________________________________
Register No : _______________________________________
Section : _______________________________________
LABORATORY MANUAL



2 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00




is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and
training.

? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different
levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on
heart and soul
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

To impart professional education integrated with human values to the younger generation, so as to
shape them as proficient and dedicated engineers, capable of providing comprehensive solutions to the
challenges in deploying technology for the service of humanity

? To educate the students with the state-of-art technologies to meet the growing challenges of the
electronics industry
? To carry out research through continuous interaction with research institutes and industry, on
advances in communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning,
innovation and ethical practices
VISION
VISION
MISSION
MISSION



3 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

PROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To provide students with a solid foundation in Mathematics, Science and fundamentals of
engineering, enabling them to apply, to find solutions for engineering problems and use this knowledge
to acquire higher education
2. Core Competence
To train the students in Electronics and Communication technologies so that they apply their
knowledge and training to compare, and to analyze various engineering industrial problems to find
solutions
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice which
enables them to find solutions for the real time problems in industry, and to design products
4. Professionalism
To inculcate professional and effective communication skills, leadership qualities and team spirit in
the students to make them multi-faceted personalities and develop their ability to relate engineering
issues to broader social context
5. Lifelong Learning/Ethics
To demonstrate and practice ethical and professional responsibilities in the industry and society in
the large, through commitment and lifelong learning needed for successful professional career


4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
PROGRAMME OUTCOMES (POs)
a) To demonstrate and apply knowledge of Mathematics, Science and engineering fundamentals in
Electronics and Communication Engineering field
b) To design a component, a system or a process to meet the specific needs within the realistic
constraints such as economics, environment, ethics, health, safety and manufacturability
c) To demonstrate the competency to use software tools for computation, simulation and testing of electronics
and communication engineering circuits
d) To identify, formulate and solve electronic and communication engineering problems
e) To demonstrate an ability to visualize and work on laboratory and multidisciplinary tasks
f) To function as a member or a leader in multidisciplinary activities
g) To communicate in verbal and written form with fellow engineers and society at large
h) To understand the impact of Electronics and Communication Engineering in the society and demonstrate
awareness of contemporary issues and commitment to give solutions exhibiting social responsibility
i) To demonstrate professional & ethical responsibilities
j) To exhibit confidence in self-education and ability for lifelong learning
k) To participate and succeed in competitive exams


5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
SYLLABUS

? Learn the working of ARM processor
? Understand the Building Blocks of Embedded Systems
? Learn the concept of memory map and memory interface
? Know the characteristics of Real Time Systems
? Write programs to interface memory, I/Os with processor
? Study the interrupt performance
LIST OF EXPERIMENTS:
1. Study of ARM evaluation system
2. Interfacing ADC and DAC
3. Interfacing LED and PWM
4. Interfacing real time clock and serial port
5. Interfacing keyboard and LCD
6. Interfacing EPROM and interrupt
7. Mailbox
8. Interrupt performance characteristics of ARM and FPGA
9. Flashing of LEDS
10. Interfacing stepper motor and temperature sensor
11. Implementing zigbee protocol with ARM



? Write programs in ARM for a specific Application
? Interface memory and Write programs related to memory operations
? Interface A/D and D/A convertors with ARM system
? Analyze the performance of interrupt
? Write programmes for interfacing keyboard, display, motor and sensor.
? Formulate a mini project using embedded system
COURSE OBJECTIVES
COURSE OUTCOMES
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
CONTENTS
Sl. No. Name of the Experiment Page No.
CYCLE 1 ? EXPERIMENTS
1
Study of ARM evaluation system 7
2
Analog to Digital Convertor interfacing 16
3
Generation of ramp and square wave using on-Chip DAC 19
4
LED dimming using PWM 22
5
Interfacing real time clock and serial port 25
6
Interfacing keypad and LCD 28
7
Interfacing EPROM and interrupt 31
CYCLE 2 ? EXPERIMENTS
8 Implementation of Mailbox Function using LPC 2148 35
9 Interrupt Performance Characteristics of Arm and FPGA 37
10 Flashing of LEDs 40
11 Stepper Motor Interface with ARM ? 7 LPC2148 43
12 LM35 Temperature Sensor Interface with ARM ? 7 LPC2148 47
13
Implementation of Wireless Communication Protocol using ZIGBEE Wireless
Module
50
ADDITIONAL EXPERIMENTS BEYOND THE SYYLABUS
14 Buzzer Interface with ARM ? 7 54
15 Relay interface with ARM? 7 57
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Expt. No. 1 STUDY OF ARM EVALUATION SYSTEM
Aim:
To study the building blocks of ARM7 system, its features, pin configuration and the components
required for functioning of ARM controller.
Architecture Overview:
A RISC-based computer design approach means ARM processors require significantly fewer transistors
than typical processors in average computers. This approach reduces cost, heat and power usage. These
are desirable traits for light, portable, battery-powered devices (smart phones, laptops, tablet and notepad
computers), and other embedded systems. A simpler design facilitates more efficient multi-core CPUs and
higher core counts at lower cost, providing higher processing power and improved energy efficiency for
servers and supercomputers.
In 2005, about 98% of all mobile phones sold used at least one ARM processor. The low power
consumption of ARM processors has made them very popular: 37 billion ARM processors have been
produced as of 2013, up from 10 billion in 2008. The ARM architecture (32-bit) is the most widely used
architecture in mobile devices, and most popular 32-bit one in embedded systems.
According to ARM Holdings, in 2010 alone, producers of chips based on ARM architectures
reported shipments of 6.1 billion ARM based processors, representing 95% of smart phones, 35% of digital
televisions and set-top boxes and 10% of mobile computers. It is the most widely used 32-bit instruction set
architecture in terms of quantity produced.
LPC 2148:
LPC2148 is the widely used IC from ARM-7 family. It is manufactured by Philips and it is pre-loaded
with many inbuilt peripherals making it more efficient and a reliable option for the beginners as well as high
end application developer.




8 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Features of LPC214x series controllers:
1. 8 to 40 kB of on-chip static RAM and 32 to 512 kB of on-chip flash program memory.128 bit wide
interface/accelerator enables high speed 60 MHz operation.
2. In-System/In-Application Programming (ISP/IAP) via on-chip boot-loader software. Single flash sector or
full chip erase in 400 ms and programming of 256 bytes in 1ms.
3. Embedded ICE RT and Embedded Trace interfaces offer real-time debugging with the on-chip Real
Monitor software and high speed tracing of instruction execution.
4. USB 2.0 Full Speed compliant Device Controller with 2 kB of endpoint RAM. In addition, the LPC2146/8
provides 8 kB of on-chip RAM accessible to USB by DMA.
5. One or two (LPC2141/2 vs. LPC2144/6/8) 10-bit A/D converters provide a total of 6/14analog inputs, with
conversion times as low as 2.44 us per channel.
6. Single 10-bit D/A converter provides variable analog output.
7. Two 32-bit timers/external event counters (with four capture and four compare channels each), PWM unit
(six outputs) and watchdog.
8. Low power real-time clock with independent power and dedicated 32 kHz clock input.
9. Multiple serial interfaces including two UARTs (16C550), two Fast I2C-bus (400 kbit/s), SPI and SSP with
buffering and variable data length capabilities.
10. Vectored interrupt controller with configurable priorities and vector addresses.
11. Up to 45 of 5 V tolerant fast general purpose I/O pins in a tiny LQFP64 package.
12. Up to nine edge or level sensitive external interrupt pins available.
13. On-chip integrated oscillator operates with an external crystal in range from 1 MHz to30 MHz and with
an external oscillator up to 50 MHz
14. Power saving modes include Idle and Power-down.
15. Individual enable/disable of peripheral functions as well as peripheral clock scaling for additional power
optimization.
16. Processor wake-up from Power-down mode via external interrupt, USB, Brown-Out Detect (BOD) or
Real-Time Clock (RTC).




9 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


First Step- Hardware Requirement:
Pin configuration of LPC 2148.

Hardware requirement of LPC2148:
1. LPC2148 need minimum below listed hardware to work properly
2. Power Supply
3. Crystal Oscillator
4. Reset Circuit
5. RTC crystal oscillator
6. UART
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Power Supply:
LPC2148 works on 3.3 V power supply. LM 117 can be used for generating 3.3 V supply. However,
basic peripherals like LCD, ULN 2003 (Motor Driver IC) etc. works on 5V. So AC mains supply is converted
into 5V using below mentioned circuit and after that LM 117 is used to convert 5V into 3.3V.
Block diagram of power Supply

Transformer: It is used to step down 230V AC to 9V AC supply and provides isolation between power grids
and circuit.
Rectifier: It is used to convert AC supply into DC.
Filter: It is used to reduce ripple factor of DC output available from rectifier end.
Regulator: It is used to regulate DC supply output.

11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Circuit Diagram:

Regulator IC 7805 is used to provide fix 5V dc supply.
LM 117 is used for generating 3.3V supply from 5V.

12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Calculations:

From the datasheet of LM117

Taking R 2= 240?, we get R 1=392?
Reset Circuit:
Reset button is essential in a system to avoid programming pitfalls and manually bring back the system
to the initialization mode. MCP 130T is a special IC used for providing stable RESET signal to LPC 2148.


13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Oscillator Circuit:

The value of capacitors C20 & C21 depends upon the frequency of crystal Y3. General circuit and
its equivalent circuit is as shown below.

14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Recommended values are as shown in table:

UART:
LPC 2148 has inbuilt ISP which means we can program it within the system using serial
communication on COM0. It has also COM1 for serial communication. MAX 232/233 IC must be used for
voltage logic conversion. Related connections are as given below.

Once the above listed circuit design is ready, we are ready to go further.



15 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Result:
ARM Evaluation system and the configuration of LPC2148 has been studied fully. The minimal setup
required for the functioning of the ARM processor is studied.
Outcomes:
1. Able to understand the ARM controller, its basic components inside and its features.
2. Able to know the components required for the working of ARM LPC2148

Applications:
ARM controller LPC2148 is used in no. of devices such as
1. Smart phones
2. Net books
3. E Readers
4. Digital TV
5. Home Gateways


1. What are the basic units of ARM 7?
2. What is the address system supported by ARM?
3. Define - RISC
4. What are the instructions used to access the memory in ARM?
5. What are the basic units of Microprocessor?
6. What is an Instruction?
7. What is clock cycle?
8. Define - Pipelining
9. What is cache miss?
10. What is meant by memory mapped I/O?
11. Define ? interrupt
12. What is meant by Exception?
13. What is meant by little ? endian mode?
14. What is meant by big ? endian mode?
15. What is the function of CPSR?
16. What is register - indirect addressing?
Viva-voce




16 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 2 ANALOG TO DIGITAL CONVERTOR
INTERFACING
Aim:
To write an embedded c program for interfacing an on chip ADC with LPC2148 ARM processor and
convert the given input voltage into corresponding decimal values.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. PC
Theory:
Analog to Digital converter (ADC) is a device that converts continuously varying analog signals from
instruments that monitor such conditions as movement, temperature, sound, etc., into binary code for the
computer. It may be either a single chip or can be one circuit within a chip. Analog to Digital conversion is
the process of changing continuously varying data, such as voltage, current, or shaft rotation, into discrete
digital quantities that represent the magnitude of the data compared to a standard or reference at the
moment the conversion is made. According to the method of conversion, ADCs can be classified into
Direct-Conversion ADCs, Successive Approximation ADCs, Integrating ADC and Sigma-Delta ADCs.
The LPC 2148 has 10-bit successive approximation analog to digital converter. Basic clocking for the
A/D converters is provided by the VPB clock. A programmable divider is included in each converter, to
scale this clock to the 4.5 MHz (max) clock needed by the successive approximation process. A fully
accurate conversion requires 11 of these clocks. The ADC cell can measure the voltage on any of the ADC
input signals. It is noted that these analog inputs are always connected to their pins, even if the Pin function
Select register assigns them to port pins. A simple self-test of the ADC can be done by driving these pins
as port outputs.



17 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Circuit diagram:




18 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus, an embedded c program for interfacing on-chip ADC with ARM processor is written and
executed. The decimal values of the converted voltage are seen in the WinXTalk screen.
Outcome:
Able to interface A/D convertors with ARM system and check its working by connecting an analog
quantity as input.
Applications:
1. ADC used in MODEM for converting analog signals to digital.
2. A fast video ADC in TV tuner cards
3. ADC used in digital storage oscilloscopes
4. Used in music reproduction technology.
5. Used in DSP if input is analog


1. What are the ADC operating modes in LPC2148?
2. What is meant by conversion time?
3. Why are internal ADCs preferred over external ADCs?
4. Why has 16-bit ADC more resolution than from 10-bit and 8-bit ADC?
5. What are ADC & its Resolution?
6. What is Burst conversion mode?
7. What is the function of A/D Control Register?
8. What is the function of A/D Global Data Register?
9. What is the function of A/D Status Register?
10. What is analog-to-digital (ADC) conversion error?
11. What is the function of Sample-and-hold circuits in analog-to digital converters?
12. What is the disadvantage of the flash analog-to digital converter?
Viva-voce




19 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 3 GENERATION OF RAMP AND SQUARE
WAVE USING ON-CHIP DAC
Aim:
To write and execute an embedded c program to generate ramp wave and square wave using on-chip
DAC of LPC2148 ARM controller.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
A digital-to-analog converter is a device for converting a digital signal into an analog signal (current or
voltage). Digital-to-Analog Converters are the interface between the abstract digital world and the analog
real world. Simple switches, a network of resistors, current sources or capacitors may be used to
implement this conversion. A DAC inputs a binary number and outputs an analog voltage or current signal.
The Microchip Technology Inc. MCP4921 is 2.7 ? 5.5V, low-power, 12-Bit Digital-to-Analog Converter
(DAC) with SPI interface. The MCP4921 DAC provides high accuracy and low noise performance for
industrial applications where calibration or compensation of signals is required. With an SPI connection
there is always one master device (usually a microcontroller) which controls the peripheral devices.
Typically there are three lines common to all the devices,
Master In Slave Out (MISO) ? The Slave line for sending data to the master,
Master Out Slave In (MOSI) ? The Master line for sending data to the peripherals,
Serial Clock (SCK) ? The clock pulses which synchronize data transmission generated by the
master and slave
Slave Select pin ? the pin on each device that the master can use to enable and disable specific
devices. When a device Slave Select pin is low, it communicates with the master. When it is high, it ignores
the master. In SPI, the clock signal is controlled by the master device LPC2148. All data is clocked in and
out using this pin. These lines need to be connected to the relevant pins on the LPC21xx processor. Any
unused GIO pin can be used for CS, instead pull this pin high. Conversion speed is the time it takes for the



20 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

DAC to provide an analog output when the digital input word is changed. The MCP4291 DAC ? SPI
connections with LPC21xx have four I/O lines (P0.4 ? P0.7) required. The analog output is generated by
using these four lines.
Circuit diagram:


Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the embedded c programs for generating ramp wave and square wave using ARM LPC2148 are
written and executed successfully and the waveforms are viewed in oscilloscope.
Outcome:
Able to program the DAC in-built inside the ARM controller and get the waveforms using it.




21 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications :
1. DAC used in Audio amplifier.
2. Video encoder
3. Display electronics
4. Data Acquistion systems
5. Motor control



1. What are the features of LPC2148 DAC?
2. What is the function of DAC register?
3. Which pin provides a voltage reference level for the D/A converter?
4. What are the applications of DAC in signal processing applications?
5. What is GIO?
6. What is the resolution of a digital-to-analog converter (DAC)?
7. What is the major advantage of the R/2R ladder digital-to-analog (DAC), as compared to a binary-
weighted digital-to-analog DAC converter?
8. What is the resolution of a 0?5 V 6-bit digital-to-analog converter (DAC) ?
9. What are DAC configurations?
10. What are the different types of DAC Circuits?
11. What are the Limitations of the Binary Weighted DAC?
12. What are the General DAC Characteristics?
13. Define reference voltage in DAC.
14. What is full scale voltage?
15. What is settling time?
VIVA-VOCE

FirstRanker.com - FirstRanker's Choice
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00






?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING

VII SEMESTER - R 2013

EC6711 ? EMBEDDED LABORATORY






Name : _______________________________________
Register No : _______________________________________
Section : _______________________________________
LABORATORY MANUAL



2 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00




is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and
training.

? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different
levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on
heart and soul
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

To impart professional education integrated with human values to the younger generation, so as to
shape them as proficient and dedicated engineers, capable of providing comprehensive solutions to the
challenges in deploying technology for the service of humanity

? To educate the students with the state-of-art technologies to meet the growing challenges of the
electronics industry
? To carry out research through continuous interaction with research institutes and industry, on
advances in communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning,
innovation and ethical practices
VISION
VISION
MISSION
MISSION



3 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

PROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To provide students with a solid foundation in Mathematics, Science and fundamentals of
engineering, enabling them to apply, to find solutions for engineering problems and use this knowledge
to acquire higher education
2. Core Competence
To train the students in Electronics and Communication technologies so that they apply their
knowledge and training to compare, and to analyze various engineering industrial problems to find
solutions
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice which
enables them to find solutions for the real time problems in industry, and to design products
4. Professionalism
To inculcate professional and effective communication skills, leadership qualities and team spirit in
the students to make them multi-faceted personalities and develop their ability to relate engineering
issues to broader social context
5. Lifelong Learning/Ethics
To demonstrate and practice ethical and professional responsibilities in the industry and society in
the large, through commitment and lifelong learning needed for successful professional career


4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
PROGRAMME OUTCOMES (POs)
a) To demonstrate and apply knowledge of Mathematics, Science and engineering fundamentals in
Electronics and Communication Engineering field
b) To design a component, a system or a process to meet the specific needs within the realistic
constraints such as economics, environment, ethics, health, safety and manufacturability
c) To demonstrate the competency to use software tools for computation, simulation and testing of electronics
and communication engineering circuits
d) To identify, formulate and solve electronic and communication engineering problems
e) To demonstrate an ability to visualize and work on laboratory and multidisciplinary tasks
f) To function as a member or a leader in multidisciplinary activities
g) To communicate in verbal and written form with fellow engineers and society at large
h) To understand the impact of Electronics and Communication Engineering in the society and demonstrate
awareness of contemporary issues and commitment to give solutions exhibiting social responsibility
i) To demonstrate professional & ethical responsibilities
j) To exhibit confidence in self-education and ability for lifelong learning
k) To participate and succeed in competitive exams


5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
SYLLABUS

? Learn the working of ARM processor
? Understand the Building Blocks of Embedded Systems
? Learn the concept of memory map and memory interface
? Know the characteristics of Real Time Systems
? Write programs to interface memory, I/Os with processor
? Study the interrupt performance
LIST OF EXPERIMENTS:
1. Study of ARM evaluation system
2. Interfacing ADC and DAC
3. Interfacing LED and PWM
4. Interfacing real time clock and serial port
5. Interfacing keyboard and LCD
6. Interfacing EPROM and interrupt
7. Mailbox
8. Interrupt performance characteristics of ARM and FPGA
9. Flashing of LEDS
10. Interfacing stepper motor and temperature sensor
11. Implementing zigbee protocol with ARM



? Write programs in ARM for a specific Application
? Interface memory and Write programs related to memory operations
? Interface A/D and D/A convertors with ARM system
? Analyze the performance of interrupt
? Write programmes for interfacing keyboard, display, motor and sensor.
? Formulate a mini project using embedded system
COURSE OBJECTIVES
COURSE OUTCOMES
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
CONTENTS
Sl. No. Name of the Experiment Page No.
CYCLE 1 ? EXPERIMENTS
1
Study of ARM evaluation system 7
2
Analog to Digital Convertor interfacing 16
3
Generation of ramp and square wave using on-Chip DAC 19
4
LED dimming using PWM 22
5
Interfacing real time clock and serial port 25
6
Interfacing keypad and LCD 28
7
Interfacing EPROM and interrupt 31
CYCLE 2 ? EXPERIMENTS
8 Implementation of Mailbox Function using LPC 2148 35
9 Interrupt Performance Characteristics of Arm and FPGA 37
10 Flashing of LEDs 40
11 Stepper Motor Interface with ARM ? 7 LPC2148 43
12 LM35 Temperature Sensor Interface with ARM ? 7 LPC2148 47
13
Implementation of Wireless Communication Protocol using ZIGBEE Wireless
Module
50
ADDITIONAL EXPERIMENTS BEYOND THE SYYLABUS
14 Buzzer Interface with ARM ? 7 54
15 Relay interface with ARM? 7 57
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Expt. No. 1 STUDY OF ARM EVALUATION SYSTEM
Aim:
To study the building blocks of ARM7 system, its features, pin configuration and the components
required for functioning of ARM controller.
Architecture Overview:
A RISC-based computer design approach means ARM processors require significantly fewer transistors
than typical processors in average computers. This approach reduces cost, heat and power usage. These
are desirable traits for light, portable, battery-powered devices (smart phones, laptops, tablet and notepad
computers), and other embedded systems. A simpler design facilitates more efficient multi-core CPUs and
higher core counts at lower cost, providing higher processing power and improved energy efficiency for
servers and supercomputers.
In 2005, about 98% of all mobile phones sold used at least one ARM processor. The low power
consumption of ARM processors has made them very popular: 37 billion ARM processors have been
produced as of 2013, up from 10 billion in 2008. The ARM architecture (32-bit) is the most widely used
architecture in mobile devices, and most popular 32-bit one in embedded systems.
According to ARM Holdings, in 2010 alone, producers of chips based on ARM architectures
reported shipments of 6.1 billion ARM based processors, representing 95% of smart phones, 35% of digital
televisions and set-top boxes and 10% of mobile computers. It is the most widely used 32-bit instruction set
architecture in terms of quantity produced.
LPC 2148:
LPC2148 is the widely used IC from ARM-7 family. It is manufactured by Philips and it is pre-loaded
with many inbuilt peripherals making it more efficient and a reliable option for the beginners as well as high
end application developer.




8 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Features of LPC214x series controllers:
1. 8 to 40 kB of on-chip static RAM and 32 to 512 kB of on-chip flash program memory.128 bit wide
interface/accelerator enables high speed 60 MHz operation.
2. In-System/In-Application Programming (ISP/IAP) via on-chip boot-loader software. Single flash sector or
full chip erase in 400 ms and programming of 256 bytes in 1ms.
3. Embedded ICE RT and Embedded Trace interfaces offer real-time debugging with the on-chip Real
Monitor software and high speed tracing of instruction execution.
4. USB 2.0 Full Speed compliant Device Controller with 2 kB of endpoint RAM. In addition, the LPC2146/8
provides 8 kB of on-chip RAM accessible to USB by DMA.
5. One or two (LPC2141/2 vs. LPC2144/6/8) 10-bit A/D converters provide a total of 6/14analog inputs, with
conversion times as low as 2.44 us per channel.
6. Single 10-bit D/A converter provides variable analog output.
7. Two 32-bit timers/external event counters (with four capture and four compare channels each), PWM unit
(six outputs) and watchdog.
8. Low power real-time clock with independent power and dedicated 32 kHz clock input.
9. Multiple serial interfaces including two UARTs (16C550), two Fast I2C-bus (400 kbit/s), SPI and SSP with
buffering and variable data length capabilities.
10. Vectored interrupt controller with configurable priorities and vector addresses.
11. Up to 45 of 5 V tolerant fast general purpose I/O pins in a tiny LQFP64 package.
12. Up to nine edge or level sensitive external interrupt pins available.
13. On-chip integrated oscillator operates with an external crystal in range from 1 MHz to30 MHz and with
an external oscillator up to 50 MHz
14. Power saving modes include Idle and Power-down.
15. Individual enable/disable of peripheral functions as well as peripheral clock scaling for additional power
optimization.
16. Processor wake-up from Power-down mode via external interrupt, USB, Brown-Out Detect (BOD) or
Real-Time Clock (RTC).




9 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


First Step- Hardware Requirement:
Pin configuration of LPC 2148.

Hardware requirement of LPC2148:
1. LPC2148 need minimum below listed hardware to work properly
2. Power Supply
3. Crystal Oscillator
4. Reset Circuit
5. RTC crystal oscillator
6. UART
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Power Supply:
LPC2148 works on 3.3 V power supply. LM 117 can be used for generating 3.3 V supply. However,
basic peripherals like LCD, ULN 2003 (Motor Driver IC) etc. works on 5V. So AC mains supply is converted
into 5V using below mentioned circuit and after that LM 117 is used to convert 5V into 3.3V.
Block diagram of power Supply

Transformer: It is used to step down 230V AC to 9V AC supply and provides isolation between power grids
and circuit.
Rectifier: It is used to convert AC supply into DC.
Filter: It is used to reduce ripple factor of DC output available from rectifier end.
Regulator: It is used to regulate DC supply output.

11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Circuit Diagram:

Regulator IC 7805 is used to provide fix 5V dc supply.
LM 117 is used for generating 3.3V supply from 5V.

12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Calculations:

From the datasheet of LM117

Taking R 2= 240?, we get R 1=392?
Reset Circuit:
Reset button is essential in a system to avoid programming pitfalls and manually bring back the system
to the initialization mode. MCP 130T is a special IC used for providing stable RESET signal to LPC 2148.


13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Oscillator Circuit:

The value of capacitors C20 & C21 depends upon the frequency of crystal Y3. General circuit and
its equivalent circuit is as shown below.

14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Recommended values are as shown in table:

UART:
LPC 2148 has inbuilt ISP which means we can program it within the system using serial
communication on COM0. It has also COM1 for serial communication. MAX 232/233 IC must be used for
voltage logic conversion. Related connections are as given below.

Once the above listed circuit design is ready, we are ready to go further.



15 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Result:
ARM Evaluation system and the configuration of LPC2148 has been studied fully. The minimal setup
required for the functioning of the ARM processor is studied.
Outcomes:
1. Able to understand the ARM controller, its basic components inside and its features.
2. Able to know the components required for the working of ARM LPC2148

Applications:
ARM controller LPC2148 is used in no. of devices such as
1. Smart phones
2. Net books
3. E Readers
4. Digital TV
5. Home Gateways


1. What are the basic units of ARM 7?
2. What is the address system supported by ARM?
3. Define - RISC
4. What are the instructions used to access the memory in ARM?
5. What are the basic units of Microprocessor?
6. What is an Instruction?
7. What is clock cycle?
8. Define - Pipelining
9. What is cache miss?
10. What is meant by memory mapped I/O?
11. Define ? interrupt
12. What is meant by Exception?
13. What is meant by little ? endian mode?
14. What is meant by big ? endian mode?
15. What is the function of CPSR?
16. What is register - indirect addressing?
Viva-voce




16 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 2 ANALOG TO DIGITAL CONVERTOR
INTERFACING
Aim:
To write an embedded c program for interfacing an on chip ADC with LPC2148 ARM processor and
convert the given input voltage into corresponding decimal values.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. PC
Theory:
Analog to Digital converter (ADC) is a device that converts continuously varying analog signals from
instruments that monitor such conditions as movement, temperature, sound, etc., into binary code for the
computer. It may be either a single chip or can be one circuit within a chip. Analog to Digital conversion is
the process of changing continuously varying data, such as voltage, current, or shaft rotation, into discrete
digital quantities that represent the magnitude of the data compared to a standard or reference at the
moment the conversion is made. According to the method of conversion, ADCs can be classified into
Direct-Conversion ADCs, Successive Approximation ADCs, Integrating ADC and Sigma-Delta ADCs.
The LPC 2148 has 10-bit successive approximation analog to digital converter. Basic clocking for the
A/D converters is provided by the VPB clock. A programmable divider is included in each converter, to
scale this clock to the 4.5 MHz (max) clock needed by the successive approximation process. A fully
accurate conversion requires 11 of these clocks. The ADC cell can measure the voltage on any of the ADC
input signals. It is noted that these analog inputs are always connected to their pins, even if the Pin function
Select register assigns them to port pins. A simple self-test of the ADC can be done by driving these pins
as port outputs.



17 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Circuit diagram:




18 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus, an embedded c program for interfacing on-chip ADC with ARM processor is written and
executed. The decimal values of the converted voltage are seen in the WinXTalk screen.
Outcome:
Able to interface A/D convertors with ARM system and check its working by connecting an analog
quantity as input.
Applications:
1. ADC used in MODEM for converting analog signals to digital.
2. A fast video ADC in TV tuner cards
3. ADC used in digital storage oscilloscopes
4. Used in music reproduction technology.
5. Used in DSP if input is analog


1. What are the ADC operating modes in LPC2148?
2. What is meant by conversion time?
3. Why are internal ADCs preferred over external ADCs?
4. Why has 16-bit ADC more resolution than from 10-bit and 8-bit ADC?
5. What are ADC & its Resolution?
6. What is Burst conversion mode?
7. What is the function of A/D Control Register?
8. What is the function of A/D Global Data Register?
9. What is the function of A/D Status Register?
10. What is analog-to-digital (ADC) conversion error?
11. What is the function of Sample-and-hold circuits in analog-to digital converters?
12. What is the disadvantage of the flash analog-to digital converter?
Viva-voce




19 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 3 GENERATION OF RAMP AND SQUARE
WAVE USING ON-CHIP DAC
Aim:
To write and execute an embedded c program to generate ramp wave and square wave using on-chip
DAC of LPC2148 ARM controller.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
A digital-to-analog converter is a device for converting a digital signal into an analog signal (current or
voltage). Digital-to-Analog Converters are the interface between the abstract digital world and the analog
real world. Simple switches, a network of resistors, current sources or capacitors may be used to
implement this conversion. A DAC inputs a binary number and outputs an analog voltage or current signal.
The Microchip Technology Inc. MCP4921 is 2.7 ? 5.5V, low-power, 12-Bit Digital-to-Analog Converter
(DAC) with SPI interface. The MCP4921 DAC provides high accuracy and low noise performance for
industrial applications where calibration or compensation of signals is required. With an SPI connection
there is always one master device (usually a microcontroller) which controls the peripheral devices.
Typically there are three lines common to all the devices,
Master In Slave Out (MISO) ? The Slave line for sending data to the master,
Master Out Slave In (MOSI) ? The Master line for sending data to the peripherals,
Serial Clock (SCK) ? The clock pulses which synchronize data transmission generated by the
master and slave
Slave Select pin ? the pin on each device that the master can use to enable and disable specific
devices. When a device Slave Select pin is low, it communicates with the master. When it is high, it ignores
the master. In SPI, the clock signal is controlled by the master device LPC2148. All data is clocked in and
out using this pin. These lines need to be connected to the relevant pins on the LPC21xx processor. Any
unused GIO pin can be used for CS, instead pull this pin high. Conversion speed is the time it takes for the



20 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

DAC to provide an analog output when the digital input word is changed. The MCP4291 DAC ? SPI
connections with LPC21xx have four I/O lines (P0.4 ? P0.7) required. The analog output is generated by
using these four lines.
Circuit diagram:


Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the embedded c programs for generating ramp wave and square wave using ARM LPC2148 are
written and executed successfully and the waveforms are viewed in oscilloscope.
Outcome:
Able to program the DAC in-built inside the ARM controller and get the waveforms using it.




21 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications :
1. DAC used in Audio amplifier.
2. Video encoder
3. Display electronics
4. Data Acquistion systems
5. Motor control



1. What are the features of LPC2148 DAC?
2. What is the function of DAC register?
3. Which pin provides a voltage reference level for the D/A converter?
4. What are the applications of DAC in signal processing applications?
5. What is GIO?
6. What is the resolution of a digital-to-analog converter (DAC)?
7. What is the major advantage of the R/2R ladder digital-to-analog (DAC), as compared to a binary-
weighted digital-to-analog DAC converter?
8. What is the resolution of a 0?5 V 6-bit digital-to-analog converter (DAC) ?
9. What are DAC configurations?
10. What are the different types of DAC Circuits?
11. What are the Limitations of the Binary Weighted DAC?
12. What are the General DAC Characteristics?
13. Define reference voltage in DAC.
14. What is full scale voltage?
15. What is settling time?
VIVA-VOCE




22 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 4 LED DIMMING USING PWM

Aim:
To write an embedded c program for implementing PWM using ARM controller and verify the same by
dimming of LEDs.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
LPC2148 supports 2 types of PWM:
1) Single Edge PWM ? Pulse starts with new Period i.e pulse is always at the beginning
2) Double Edge PWM ? Pulse can be anywhere within the Period
A PWM block, like a Timer block , has a Timer Counter and an associated Pre-scale Register along
with Match Registers. These work exactly the same way as in the case of Timers. Match Registers 1 to 6
(except 0) are pinned on LPC214x i.e. the corresponding outputs are diverted to actual Pins on LPC214x
MCU. The PWM function must be selected for these Pins to get the PWM output.
The basic setup is to simply replace Servo by a LED and no external 5V source is needed. The
anode of LED is connected to P0.0 and cathode to ground. Pulse Widths corresponding to the switches
connected to P0.1/2/3/4 will be 2.5ms/5ms/7.5ms/10ms respectively. As the Pulse Width Increases LED
will keep on getting brighter and the reverse will happen if Pulse Width is decreased.
FirstRanker.com - FirstRanker's Choice
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00






?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING

VII SEMESTER - R 2013

EC6711 ? EMBEDDED LABORATORY






Name : _______________________________________
Register No : _______________________________________
Section : _______________________________________
LABORATORY MANUAL



2 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00




is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and
training.

? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different
levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on
heart and soul
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

To impart professional education integrated with human values to the younger generation, so as to
shape them as proficient and dedicated engineers, capable of providing comprehensive solutions to the
challenges in deploying technology for the service of humanity

? To educate the students with the state-of-art technologies to meet the growing challenges of the
electronics industry
? To carry out research through continuous interaction with research institutes and industry, on
advances in communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning,
innovation and ethical practices
VISION
VISION
MISSION
MISSION



3 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

PROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To provide students with a solid foundation in Mathematics, Science and fundamentals of
engineering, enabling them to apply, to find solutions for engineering problems and use this knowledge
to acquire higher education
2. Core Competence
To train the students in Electronics and Communication technologies so that they apply their
knowledge and training to compare, and to analyze various engineering industrial problems to find
solutions
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice which
enables them to find solutions for the real time problems in industry, and to design products
4. Professionalism
To inculcate professional and effective communication skills, leadership qualities and team spirit in
the students to make them multi-faceted personalities and develop their ability to relate engineering
issues to broader social context
5. Lifelong Learning/Ethics
To demonstrate and practice ethical and professional responsibilities in the industry and society in
the large, through commitment and lifelong learning needed for successful professional career


4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
PROGRAMME OUTCOMES (POs)
a) To demonstrate and apply knowledge of Mathematics, Science and engineering fundamentals in
Electronics and Communication Engineering field
b) To design a component, a system or a process to meet the specific needs within the realistic
constraints such as economics, environment, ethics, health, safety and manufacturability
c) To demonstrate the competency to use software tools for computation, simulation and testing of electronics
and communication engineering circuits
d) To identify, formulate and solve electronic and communication engineering problems
e) To demonstrate an ability to visualize and work on laboratory and multidisciplinary tasks
f) To function as a member or a leader in multidisciplinary activities
g) To communicate in verbal and written form with fellow engineers and society at large
h) To understand the impact of Electronics and Communication Engineering in the society and demonstrate
awareness of contemporary issues and commitment to give solutions exhibiting social responsibility
i) To demonstrate professional & ethical responsibilities
j) To exhibit confidence in self-education and ability for lifelong learning
k) To participate and succeed in competitive exams


5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
SYLLABUS

? Learn the working of ARM processor
? Understand the Building Blocks of Embedded Systems
? Learn the concept of memory map and memory interface
? Know the characteristics of Real Time Systems
? Write programs to interface memory, I/Os with processor
? Study the interrupt performance
LIST OF EXPERIMENTS:
1. Study of ARM evaluation system
2. Interfacing ADC and DAC
3. Interfacing LED and PWM
4. Interfacing real time clock and serial port
5. Interfacing keyboard and LCD
6. Interfacing EPROM and interrupt
7. Mailbox
8. Interrupt performance characteristics of ARM and FPGA
9. Flashing of LEDS
10. Interfacing stepper motor and temperature sensor
11. Implementing zigbee protocol with ARM



? Write programs in ARM for a specific Application
? Interface memory and Write programs related to memory operations
? Interface A/D and D/A convertors with ARM system
? Analyze the performance of interrupt
? Write programmes for interfacing keyboard, display, motor and sensor.
? Formulate a mini project using embedded system
COURSE OBJECTIVES
COURSE OUTCOMES
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
CONTENTS
Sl. No. Name of the Experiment Page No.
CYCLE 1 ? EXPERIMENTS
1
Study of ARM evaluation system 7
2
Analog to Digital Convertor interfacing 16
3
Generation of ramp and square wave using on-Chip DAC 19
4
LED dimming using PWM 22
5
Interfacing real time clock and serial port 25
6
Interfacing keypad and LCD 28
7
Interfacing EPROM and interrupt 31
CYCLE 2 ? EXPERIMENTS
8 Implementation of Mailbox Function using LPC 2148 35
9 Interrupt Performance Characteristics of Arm and FPGA 37
10 Flashing of LEDs 40
11 Stepper Motor Interface with ARM ? 7 LPC2148 43
12 LM35 Temperature Sensor Interface with ARM ? 7 LPC2148 47
13
Implementation of Wireless Communication Protocol using ZIGBEE Wireless
Module
50
ADDITIONAL EXPERIMENTS BEYOND THE SYYLABUS
14 Buzzer Interface with ARM ? 7 54
15 Relay interface with ARM? 7 57
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Expt. No. 1 STUDY OF ARM EVALUATION SYSTEM
Aim:
To study the building blocks of ARM7 system, its features, pin configuration and the components
required for functioning of ARM controller.
Architecture Overview:
A RISC-based computer design approach means ARM processors require significantly fewer transistors
than typical processors in average computers. This approach reduces cost, heat and power usage. These
are desirable traits for light, portable, battery-powered devices (smart phones, laptops, tablet and notepad
computers), and other embedded systems. A simpler design facilitates more efficient multi-core CPUs and
higher core counts at lower cost, providing higher processing power and improved energy efficiency for
servers and supercomputers.
In 2005, about 98% of all mobile phones sold used at least one ARM processor. The low power
consumption of ARM processors has made them very popular: 37 billion ARM processors have been
produced as of 2013, up from 10 billion in 2008. The ARM architecture (32-bit) is the most widely used
architecture in mobile devices, and most popular 32-bit one in embedded systems.
According to ARM Holdings, in 2010 alone, producers of chips based on ARM architectures
reported shipments of 6.1 billion ARM based processors, representing 95% of smart phones, 35% of digital
televisions and set-top boxes and 10% of mobile computers. It is the most widely used 32-bit instruction set
architecture in terms of quantity produced.
LPC 2148:
LPC2148 is the widely used IC from ARM-7 family. It is manufactured by Philips and it is pre-loaded
with many inbuilt peripherals making it more efficient and a reliable option for the beginners as well as high
end application developer.




8 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Features of LPC214x series controllers:
1. 8 to 40 kB of on-chip static RAM and 32 to 512 kB of on-chip flash program memory.128 bit wide
interface/accelerator enables high speed 60 MHz operation.
2. In-System/In-Application Programming (ISP/IAP) via on-chip boot-loader software. Single flash sector or
full chip erase in 400 ms and programming of 256 bytes in 1ms.
3. Embedded ICE RT and Embedded Trace interfaces offer real-time debugging with the on-chip Real
Monitor software and high speed tracing of instruction execution.
4. USB 2.0 Full Speed compliant Device Controller with 2 kB of endpoint RAM. In addition, the LPC2146/8
provides 8 kB of on-chip RAM accessible to USB by DMA.
5. One or two (LPC2141/2 vs. LPC2144/6/8) 10-bit A/D converters provide a total of 6/14analog inputs, with
conversion times as low as 2.44 us per channel.
6. Single 10-bit D/A converter provides variable analog output.
7. Two 32-bit timers/external event counters (with four capture and four compare channels each), PWM unit
(six outputs) and watchdog.
8. Low power real-time clock with independent power and dedicated 32 kHz clock input.
9. Multiple serial interfaces including two UARTs (16C550), two Fast I2C-bus (400 kbit/s), SPI and SSP with
buffering and variable data length capabilities.
10. Vectored interrupt controller with configurable priorities and vector addresses.
11. Up to 45 of 5 V tolerant fast general purpose I/O pins in a tiny LQFP64 package.
12. Up to nine edge or level sensitive external interrupt pins available.
13. On-chip integrated oscillator operates with an external crystal in range from 1 MHz to30 MHz and with
an external oscillator up to 50 MHz
14. Power saving modes include Idle and Power-down.
15. Individual enable/disable of peripheral functions as well as peripheral clock scaling for additional power
optimization.
16. Processor wake-up from Power-down mode via external interrupt, USB, Brown-Out Detect (BOD) or
Real-Time Clock (RTC).




9 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


First Step- Hardware Requirement:
Pin configuration of LPC 2148.

Hardware requirement of LPC2148:
1. LPC2148 need minimum below listed hardware to work properly
2. Power Supply
3. Crystal Oscillator
4. Reset Circuit
5. RTC crystal oscillator
6. UART
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Power Supply:
LPC2148 works on 3.3 V power supply. LM 117 can be used for generating 3.3 V supply. However,
basic peripherals like LCD, ULN 2003 (Motor Driver IC) etc. works on 5V. So AC mains supply is converted
into 5V using below mentioned circuit and after that LM 117 is used to convert 5V into 3.3V.
Block diagram of power Supply

Transformer: It is used to step down 230V AC to 9V AC supply and provides isolation between power grids
and circuit.
Rectifier: It is used to convert AC supply into DC.
Filter: It is used to reduce ripple factor of DC output available from rectifier end.
Regulator: It is used to regulate DC supply output.

11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Circuit Diagram:

Regulator IC 7805 is used to provide fix 5V dc supply.
LM 117 is used for generating 3.3V supply from 5V.

12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Calculations:

From the datasheet of LM117

Taking R 2= 240?, we get R 1=392?
Reset Circuit:
Reset button is essential in a system to avoid programming pitfalls and manually bring back the system
to the initialization mode. MCP 130T is a special IC used for providing stable RESET signal to LPC 2148.


13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Oscillator Circuit:

The value of capacitors C20 & C21 depends upon the frequency of crystal Y3. General circuit and
its equivalent circuit is as shown below.

14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Recommended values are as shown in table:

UART:
LPC 2148 has inbuilt ISP which means we can program it within the system using serial
communication on COM0. It has also COM1 for serial communication. MAX 232/233 IC must be used for
voltage logic conversion. Related connections are as given below.

Once the above listed circuit design is ready, we are ready to go further.



15 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Result:
ARM Evaluation system and the configuration of LPC2148 has been studied fully. The minimal setup
required for the functioning of the ARM processor is studied.
Outcomes:
1. Able to understand the ARM controller, its basic components inside and its features.
2. Able to know the components required for the working of ARM LPC2148

Applications:
ARM controller LPC2148 is used in no. of devices such as
1. Smart phones
2. Net books
3. E Readers
4. Digital TV
5. Home Gateways


1. What are the basic units of ARM 7?
2. What is the address system supported by ARM?
3. Define - RISC
4. What are the instructions used to access the memory in ARM?
5. What are the basic units of Microprocessor?
6. What is an Instruction?
7. What is clock cycle?
8. Define - Pipelining
9. What is cache miss?
10. What is meant by memory mapped I/O?
11. Define ? interrupt
12. What is meant by Exception?
13. What is meant by little ? endian mode?
14. What is meant by big ? endian mode?
15. What is the function of CPSR?
16. What is register - indirect addressing?
Viva-voce




16 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 2 ANALOG TO DIGITAL CONVERTOR
INTERFACING
Aim:
To write an embedded c program for interfacing an on chip ADC with LPC2148 ARM processor and
convert the given input voltage into corresponding decimal values.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. PC
Theory:
Analog to Digital converter (ADC) is a device that converts continuously varying analog signals from
instruments that monitor such conditions as movement, temperature, sound, etc., into binary code for the
computer. It may be either a single chip or can be one circuit within a chip. Analog to Digital conversion is
the process of changing continuously varying data, such as voltage, current, or shaft rotation, into discrete
digital quantities that represent the magnitude of the data compared to a standard or reference at the
moment the conversion is made. According to the method of conversion, ADCs can be classified into
Direct-Conversion ADCs, Successive Approximation ADCs, Integrating ADC and Sigma-Delta ADCs.
The LPC 2148 has 10-bit successive approximation analog to digital converter. Basic clocking for the
A/D converters is provided by the VPB clock. A programmable divider is included in each converter, to
scale this clock to the 4.5 MHz (max) clock needed by the successive approximation process. A fully
accurate conversion requires 11 of these clocks. The ADC cell can measure the voltage on any of the ADC
input signals. It is noted that these analog inputs are always connected to their pins, even if the Pin function
Select register assigns them to port pins. A simple self-test of the ADC can be done by driving these pins
as port outputs.



17 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Circuit diagram:




18 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus, an embedded c program for interfacing on-chip ADC with ARM processor is written and
executed. The decimal values of the converted voltage are seen in the WinXTalk screen.
Outcome:
Able to interface A/D convertors with ARM system and check its working by connecting an analog
quantity as input.
Applications:
1. ADC used in MODEM for converting analog signals to digital.
2. A fast video ADC in TV tuner cards
3. ADC used in digital storage oscilloscopes
4. Used in music reproduction technology.
5. Used in DSP if input is analog


1. What are the ADC operating modes in LPC2148?
2. What is meant by conversion time?
3. Why are internal ADCs preferred over external ADCs?
4. Why has 16-bit ADC more resolution than from 10-bit and 8-bit ADC?
5. What are ADC & its Resolution?
6. What is Burst conversion mode?
7. What is the function of A/D Control Register?
8. What is the function of A/D Global Data Register?
9. What is the function of A/D Status Register?
10. What is analog-to-digital (ADC) conversion error?
11. What is the function of Sample-and-hold circuits in analog-to digital converters?
12. What is the disadvantage of the flash analog-to digital converter?
Viva-voce




19 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 3 GENERATION OF RAMP AND SQUARE
WAVE USING ON-CHIP DAC
Aim:
To write and execute an embedded c program to generate ramp wave and square wave using on-chip
DAC of LPC2148 ARM controller.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
A digital-to-analog converter is a device for converting a digital signal into an analog signal (current or
voltage). Digital-to-Analog Converters are the interface between the abstract digital world and the analog
real world. Simple switches, a network of resistors, current sources or capacitors may be used to
implement this conversion. A DAC inputs a binary number and outputs an analog voltage or current signal.
The Microchip Technology Inc. MCP4921 is 2.7 ? 5.5V, low-power, 12-Bit Digital-to-Analog Converter
(DAC) with SPI interface. The MCP4921 DAC provides high accuracy and low noise performance for
industrial applications where calibration or compensation of signals is required. With an SPI connection
there is always one master device (usually a microcontroller) which controls the peripheral devices.
Typically there are three lines common to all the devices,
Master In Slave Out (MISO) ? The Slave line for sending data to the master,
Master Out Slave In (MOSI) ? The Master line for sending data to the peripherals,
Serial Clock (SCK) ? The clock pulses which synchronize data transmission generated by the
master and slave
Slave Select pin ? the pin on each device that the master can use to enable and disable specific
devices. When a device Slave Select pin is low, it communicates with the master. When it is high, it ignores
the master. In SPI, the clock signal is controlled by the master device LPC2148. All data is clocked in and
out using this pin. These lines need to be connected to the relevant pins on the LPC21xx processor. Any
unused GIO pin can be used for CS, instead pull this pin high. Conversion speed is the time it takes for the



20 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

DAC to provide an analog output when the digital input word is changed. The MCP4291 DAC ? SPI
connections with LPC21xx have four I/O lines (P0.4 ? P0.7) required. The analog output is generated by
using these four lines.
Circuit diagram:


Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the embedded c programs for generating ramp wave and square wave using ARM LPC2148 are
written and executed successfully and the waveforms are viewed in oscilloscope.
Outcome:
Able to program the DAC in-built inside the ARM controller and get the waveforms using it.




21 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications :
1. DAC used in Audio amplifier.
2. Video encoder
3. Display electronics
4. Data Acquistion systems
5. Motor control



1. What are the features of LPC2148 DAC?
2. What is the function of DAC register?
3. Which pin provides a voltage reference level for the D/A converter?
4. What are the applications of DAC in signal processing applications?
5. What is GIO?
6. What is the resolution of a digital-to-analog converter (DAC)?
7. What is the major advantage of the R/2R ladder digital-to-analog (DAC), as compared to a binary-
weighted digital-to-analog DAC converter?
8. What is the resolution of a 0?5 V 6-bit digital-to-analog converter (DAC) ?
9. What are DAC configurations?
10. What are the different types of DAC Circuits?
11. What are the Limitations of the Binary Weighted DAC?
12. What are the General DAC Characteristics?
13. Define reference voltage in DAC.
14. What is full scale voltage?
15. What is settling time?
VIVA-VOCE




22 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 4 LED DIMMING USING PWM

Aim:
To write an embedded c program for implementing PWM using ARM controller and verify the same by
dimming of LEDs.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
LPC2148 supports 2 types of PWM:
1) Single Edge PWM ? Pulse starts with new Period i.e pulse is always at the beginning
2) Double Edge PWM ? Pulse can be anywhere within the Period
A PWM block, like a Timer block , has a Timer Counter and an associated Pre-scale Register along
with Match Registers. These work exactly the same way as in the case of Timers. Match Registers 1 to 6
(except 0) are pinned on LPC214x i.e. the corresponding outputs are diverted to actual Pins on LPC214x
MCU. The PWM function must be selected for these Pins to get the PWM output.
The basic setup is to simply replace Servo by a LED and no external 5V source is needed. The
anode of LED is connected to P0.0 and cathode to ground. Pulse Widths corresponding to the switches
connected to P0.1/2/3/4 will be 2.5ms/5ms/7.5ms/10ms respectively. As the Pulse Width Increases LED
will keep on getting brighter and the reverse will happen if Pulse Width is decreased.



23 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus embedded c program for implementing Pulse Width Modulation is written and executed and
output has been verified in LED display.
Outcome:
Able to implement PWM using the ARM controller and verify the same in the form of dimming of
LEDS.
FirstRanker.com - FirstRanker's Choice
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00






?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING

VII SEMESTER - R 2013

EC6711 ? EMBEDDED LABORATORY






Name : _______________________________________
Register No : _______________________________________
Section : _______________________________________
LABORATORY MANUAL



2 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00




is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and
training.

? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different
levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on
heart and soul
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

To impart professional education integrated with human values to the younger generation, so as to
shape them as proficient and dedicated engineers, capable of providing comprehensive solutions to the
challenges in deploying technology for the service of humanity

? To educate the students with the state-of-art technologies to meet the growing challenges of the
electronics industry
? To carry out research through continuous interaction with research institutes and industry, on
advances in communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning,
innovation and ethical practices
VISION
VISION
MISSION
MISSION



3 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

PROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To provide students with a solid foundation in Mathematics, Science and fundamentals of
engineering, enabling them to apply, to find solutions for engineering problems and use this knowledge
to acquire higher education
2. Core Competence
To train the students in Electronics and Communication technologies so that they apply their
knowledge and training to compare, and to analyze various engineering industrial problems to find
solutions
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice which
enables them to find solutions for the real time problems in industry, and to design products
4. Professionalism
To inculcate professional and effective communication skills, leadership qualities and team spirit in
the students to make them multi-faceted personalities and develop their ability to relate engineering
issues to broader social context
5. Lifelong Learning/Ethics
To demonstrate and practice ethical and professional responsibilities in the industry and society in
the large, through commitment and lifelong learning needed for successful professional career


4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
PROGRAMME OUTCOMES (POs)
a) To demonstrate and apply knowledge of Mathematics, Science and engineering fundamentals in
Electronics and Communication Engineering field
b) To design a component, a system or a process to meet the specific needs within the realistic
constraints such as economics, environment, ethics, health, safety and manufacturability
c) To demonstrate the competency to use software tools for computation, simulation and testing of electronics
and communication engineering circuits
d) To identify, formulate and solve electronic and communication engineering problems
e) To demonstrate an ability to visualize and work on laboratory and multidisciplinary tasks
f) To function as a member or a leader in multidisciplinary activities
g) To communicate in verbal and written form with fellow engineers and society at large
h) To understand the impact of Electronics and Communication Engineering in the society and demonstrate
awareness of contemporary issues and commitment to give solutions exhibiting social responsibility
i) To demonstrate professional & ethical responsibilities
j) To exhibit confidence in self-education and ability for lifelong learning
k) To participate and succeed in competitive exams


5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
SYLLABUS

? Learn the working of ARM processor
? Understand the Building Blocks of Embedded Systems
? Learn the concept of memory map and memory interface
? Know the characteristics of Real Time Systems
? Write programs to interface memory, I/Os with processor
? Study the interrupt performance
LIST OF EXPERIMENTS:
1. Study of ARM evaluation system
2. Interfacing ADC and DAC
3. Interfacing LED and PWM
4. Interfacing real time clock and serial port
5. Interfacing keyboard and LCD
6. Interfacing EPROM and interrupt
7. Mailbox
8. Interrupt performance characteristics of ARM and FPGA
9. Flashing of LEDS
10. Interfacing stepper motor and temperature sensor
11. Implementing zigbee protocol with ARM



? Write programs in ARM for a specific Application
? Interface memory and Write programs related to memory operations
? Interface A/D and D/A convertors with ARM system
? Analyze the performance of interrupt
? Write programmes for interfacing keyboard, display, motor and sensor.
? Formulate a mini project using embedded system
COURSE OBJECTIVES
COURSE OUTCOMES
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
CONTENTS
Sl. No. Name of the Experiment Page No.
CYCLE 1 ? EXPERIMENTS
1
Study of ARM evaluation system 7
2
Analog to Digital Convertor interfacing 16
3
Generation of ramp and square wave using on-Chip DAC 19
4
LED dimming using PWM 22
5
Interfacing real time clock and serial port 25
6
Interfacing keypad and LCD 28
7
Interfacing EPROM and interrupt 31
CYCLE 2 ? EXPERIMENTS
8 Implementation of Mailbox Function using LPC 2148 35
9 Interrupt Performance Characteristics of Arm and FPGA 37
10 Flashing of LEDs 40
11 Stepper Motor Interface with ARM ? 7 LPC2148 43
12 LM35 Temperature Sensor Interface with ARM ? 7 LPC2148 47
13
Implementation of Wireless Communication Protocol using ZIGBEE Wireless
Module
50
ADDITIONAL EXPERIMENTS BEYOND THE SYYLABUS
14 Buzzer Interface with ARM ? 7 54
15 Relay interface with ARM? 7 57
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Expt. No. 1 STUDY OF ARM EVALUATION SYSTEM
Aim:
To study the building blocks of ARM7 system, its features, pin configuration and the components
required for functioning of ARM controller.
Architecture Overview:
A RISC-based computer design approach means ARM processors require significantly fewer transistors
than typical processors in average computers. This approach reduces cost, heat and power usage. These
are desirable traits for light, portable, battery-powered devices (smart phones, laptops, tablet and notepad
computers), and other embedded systems. A simpler design facilitates more efficient multi-core CPUs and
higher core counts at lower cost, providing higher processing power and improved energy efficiency for
servers and supercomputers.
In 2005, about 98% of all mobile phones sold used at least one ARM processor. The low power
consumption of ARM processors has made them very popular: 37 billion ARM processors have been
produced as of 2013, up from 10 billion in 2008. The ARM architecture (32-bit) is the most widely used
architecture in mobile devices, and most popular 32-bit one in embedded systems.
According to ARM Holdings, in 2010 alone, producers of chips based on ARM architectures
reported shipments of 6.1 billion ARM based processors, representing 95% of smart phones, 35% of digital
televisions and set-top boxes and 10% of mobile computers. It is the most widely used 32-bit instruction set
architecture in terms of quantity produced.
LPC 2148:
LPC2148 is the widely used IC from ARM-7 family. It is manufactured by Philips and it is pre-loaded
with many inbuilt peripherals making it more efficient and a reliable option for the beginners as well as high
end application developer.




8 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Features of LPC214x series controllers:
1. 8 to 40 kB of on-chip static RAM and 32 to 512 kB of on-chip flash program memory.128 bit wide
interface/accelerator enables high speed 60 MHz operation.
2. In-System/In-Application Programming (ISP/IAP) via on-chip boot-loader software. Single flash sector or
full chip erase in 400 ms and programming of 256 bytes in 1ms.
3. Embedded ICE RT and Embedded Trace interfaces offer real-time debugging with the on-chip Real
Monitor software and high speed tracing of instruction execution.
4. USB 2.0 Full Speed compliant Device Controller with 2 kB of endpoint RAM. In addition, the LPC2146/8
provides 8 kB of on-chip RAM accessible to USB by DMA.
5. One or two (LPC2141/2 vs. LPC2144/6/8) 10-bit A/D converters provide a total of 6/14analog inputs, with
conversion times as low as 2.44 us per channel.
6. Single 10-bit D/A converter provides variable analog output.
7. Two 32-bit timers/external event counters (with four capture and four compare channels each), PWM unit
(six outputs) and watchdog.
8. Low power real-time clock with independent power and dedicated 32 kHz clock input.
9. Multiple serial interfaces including two UARTs (16C550), two Fast I2C-bus (400 kbit/s), SPI and SSP with
buffering and variable data length capabilities.
10. Vectored interrupt controller with configurable priorities and vector addresses.
11. Up to 45 of 5 V tolerant fast general purpose I/O pins in a tiny LQFP64 package.
12. Up to nine edge or level sensitive external interrupt pins available.
13. On-chip integrated oscillator operates with an external crystal in range from 1 MHz to30 MHz and with
an external oscillator up to 50 MHz
14. Power saving modes include Idle and Power-down.
15. Individual enable/disable of peripheral functions as well as peripheral clock scaling for additional power
optimization.
16. Processor wake-up from Power-down mode via external interrupt, USB, Brown-Out Detect (BOD) or
Real-Time Clock (RTC).




9 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


First Step- Hardware Requirement:
Pin configuration of LPC 2148.

Hardware requirement of LPC2148:
1. LPC2148 need minimum below listed hardware to work properly
2. Power Supply
3. Crystal Oscillator
4. Reset Circuit
5. RTC crystal oscillator
6. UART
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Power Supply:
LPC2148 works on 3.3 V power supply. LM 117 can be used for generating 3.3 V supply. However,
basic peripherals like LCD, ULN 2003 (Motor Driver IC) etc. works on 5V. So AC mains supply is converted
into 5V using below mentioned circuit and after that LM 117 is used to convert 5V into 3.3V.
Block diagram of power Supply

Transformer: It is used to step down 230V AC to 9V AC supply and provides isolation between power grids
and circuit.
Rectifier: It is used to convert AC supply into DC.
Filter: It is used to reduce ripple factor of DC output available from rectifier end.
Regulator: It is used to regulate DC supply output.

11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Circuit Diagram:

Regulator IC 7805 is used to provide fix 5V dc supply.
LM 117 is used for generating 3.3V supply from 5V.

12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Calculations:

From the datasheet of LM117

Taking R 2= 240?, we get R 1=392?
Reset Circuit:
Reset button is essential in a system to avoid programming pitfalls and manually bring back the system
to the initialization mode. MCP 130T is a special IC used for providing stable RESET signal to LPC 2148.


13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Oscillator Circuit:

The value of capacitors C20 & C21 depends upon the frequency of crystal Y3. General circuit and
its equivalent circuit is as shown below.

14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Recommended values are as shown in table:

UART:
LPC 2148 has inbuilt ISP which means we can program it within the system using serial
communication on COM0. It has also COM1 for serial communication. MAX 232/233 IC must be used for
voltage logic conversion. Related connections are as given below.

Once the above listed circuit design is ready, we are ready to go further.



15 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Result:
ARM Evaluation system and the configuration of LPC2148 has been studied fully. The minimal setup
required for the functioning of the ARM processor is studied.
Outcomes:
1. Able to understand the ARM controller, its basic components inside and its features.
2. Able to know the components required for the working of ARM LPC2148

Applications:
ARM controller LPC2148 is used in no. of devices such as
1. Smart phones
2. Net books
3. E Readers
4. Digital TV
5. Home Gateways


1. What are the basic units of ARM 7?
2. What is the address system supported by ARM?
3. Define - RISC
4. What are the instructions used to access the memory in ARM?
5. What are the basic units of Microprocessor?
6. What is an Instruction?
7. What is clock cycle?
8. Define - Pipelining
9. What is cache miss?
10. What is meant by memory mapped I/O?
11. Define ? interrupt
12. What is meant by Exception?
13. What is meant by little ? endian mode?
14. What is meant by big ? endian mode?
15. What is the function of CPSR?
16. What is register - indirect addressing?
Viva-voce




16 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 2 ANALOG TO DIGITAL CONVERTOR
INTERFACING
Aim:
To write an embedded c program for interfacing an on chip ADC with LPC2148 ARM processor and
convert the given input voltage into corresponding decimal values.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. PC
Theory:
Analog to Digital converter (ADC) is a device that converts continuously varying analog signals from
instruments that monitor such conditions as movement, temperature, sound, etc., into binary code for the
computer. It may be either a single chip or can be one circuit within a chip. Analog to Digital conversion is
the process of changing continuously varying data, such as voltage, current, or shaft rotation, into discrete
digital quantities that represent the magnitude of the data compared to a standard or reference at the
moment the conversion is made. According to the method of conversion, ADCs can be classified into
Direct-Conversion ADCs, Successive Approximation ADCs, Integrating ADC and Sigma-Delta ADCs.
The LPC 2148 has 10-bit successive approximation analog to digital converter. Basic clocking for the
A/D converters is provided by the VPB clock. A programmable divider is included in each converter, to
scale this clock to the 4.5 MHz (max) clock needed by the successive approximation process. A fully
accurate conversion requires 11 of these clocks. The ADC cell can measure the voltage on any of the ADC
input signals. It is noted that these analog inputs are always connected to their pins, even if the Pin function
Select register assigns them to port pins. A simple self-test of the ADC can be done by driving these pins
as port outputs.



17 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Circuit diagram:




18 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus, an embedded c program for interfacing on-chip ADC with ARM processor is written and
executed. The decimal values of the converted voltage are seen in the WinXTalk screen.
Outcome:
Able to interface A/D convertors with ARM system and check its working by connecting an analog
quantity as input.
Applications:
1. ADC used in MODEM for converting analog signals to digital.
2. A fast video ADC in TV tuner cards
3. ADC used in digital storage oscilloscopes
4. Used in music reproduction technology.
5. Used in DSP if input is analog


1. What are the ADC operating modes in LPC2148?
2. What is meant by conversion time?
3. Why are internal ADCs preferred over external ADCs?
4. Why has 16-bit ADC more resolution than from 10-bit and 8-bit ADC?
5. What are ADC & its Resolution?
6. What is Burst conversion mode?
7. What is the function of A/D Control Register?
8. What is the function of A/D Global Data Register?
9. What is the function of A/D Status Register?
10. What is analog-to-digital (ADC) conversion error?
11. What is the function of Sample-and-hold circuits in analog-to digital converters?
12. What is the disadvantage of the flash analog-to digital converter?
Viva-voce




19 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 3 GENERATION OF RAMP AND SQUARE
WAVE USING ON-CHIP DAC
Aim:
To write and execute an embedded c program to generate ramp wave and square wave using on-chip
DAC of LPC2148 ARM controller.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
A digital-to-analog converter is a device for converting a digital signal into an analog signal (current or
voltage). Digital-to-Analog Converters are the interface between the abstract digital world and the analog
real world. Simple switches, a network of resistors, current sources or capacitors may be used to
implement this conversion. A DAC inputs a binary number and outputs an analog voltage or current signal.
The Microchip Technology Inc. MCP4921 is 2.7 ? 5.5V, low-power, 12-Bit Digital-to-Analog Converter
(DAC) with SPI interface. The MCP4921 DAC provides high accuracy and low noise performance for
industrial applications where calibration or compensation of signals is required. With an SPI connection
there is always one master device (usually a microcontroller) which controls the peripheral devices.
Typically there are three lines common to all the devices,
Master In Slave Out (MISO) ? The Slave line for sending data to the master,
Master Out Slave In (MOSI) ? The Master line for sending data to the peripherals,
Serial Clock (SCK) ? The clock pulses which synchronize data transmission generated by the
master and slave
Slave Select pin ? the pin on each device that the master can use to enable and disable specific
devices. When a device Slave Select pin is low, it communicates with the master. When it is high, it ignores
the master. In SPI, the clock signal is controlled by the master device LPC2148. All data is clocked in and
out using this pin. These lines need to be connected to the relevant pins on the LPC21xx processor. Any
unused GIO pin can be used for CS, instead pull this pin high. Conversion speed is the time it takes for the



20 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

DAC to provide an analog output when the digital input word is changed. The MCP4291 DAC ? SPI
connections with LPC21xx have four I/O lines (P0.4 ? P0.7) required. The analog output is generated by
using these four lines.
Circuit diagram:


Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the embedded c programs for generating ramp wave and square wave using ARM LPC2148 are
written and executed successfully and the waveforms are viewed in oscilloscope.
Outcome:
Able to program the DAC in-built inside the ARM controller and get the waveforms using it.




21 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications :
1. DAC used in Audio amplifier.
2. Video encoder
3. Display electronics
4. Data Acquistion systems
5. Motor control



1. What are the features of LPC2148 DAC?
2. What is the function of DAC register?
3. Which pin provides a voltage reference level for the D/A converter?
4. What are the applications of DAC in signal processing applications?
5. What is GIO?
6. What is the resolution of a digital-to-analog converter (DAC)?
7. What is the major advantage of the R/2R ladder digital-to-analog (DAC), as compared to a binary-
weighted digital-to-analog DAC converter?
8. What is the resolution of a 0?5 V 6-bit digital-to-analog converter (DAC) ?
9. What are DAC configurations?
10. What are the different types of DAC Circuits?
11. What are the Limitations of the Binary Weighted DAC?
12. What are the General DAC Characteristics?
13. Define reference voltage in DAC.
14. What is full scale voltage?
15. What is settling time?
VIVA-VOCE




22 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 4 LED DIMMING USING PWM

Aim:
To write an embedded c program for implementing PWM using ARM controller and verify the same by
dimming of LEDs.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
LPC2148 supports 2 types of PWM:
1) Single Edge PWM ? Pulse starts with new Period i.e pulse is always at the beginning
2) Double Edge PWM ? Pulse can be anywhere within the Period
A PWM block, like a Timer block , has a Timer Counter and an associated Pre-scale Register along
with Match Registers. These work exactly the same way as in the case of Timers. Match Registers 1 to 6
(except 0) are pinned on LPC214x i.e. the corresponding outputs are diverted to actual Pins on LPC214x
MCU. The PWM function must be selected for these Pins to get the PWM output.
The basic setup is to simply replace Servo by a LED and no external 5V source is needed. The
anode of LED is connected to P0.0 and cathode to ground. Pulse Widths corresponding to the switches
connected to P0.1/2/3/4 will be 2.5ms/5ms/7.5ms/10ms respectively. As the Pulse Width Increases LED
will keep on getting brighter and the reverse will happen if Pulse Width is decreased.



23 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus embedded c program for implementing Pulse Width Modulation is written and executed and
output has been verified in LED display.
Outcome:
Able to implement PWM using the ARM controller and verify the same in the form of dimming of
LEDS.



24 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Applications :
1. In Visual signals to covey a message
2. Illumination where light is reflected from objects
3. In Narrow band sensors



1. What factors determine the LED dimming performance?
2. What is meant by analog dimming?
3. What is flickering effect?
4. What is the factor determines dimming of the LED
5. Why Silicon is not suitable for fabrication of light-emitting diodes?
6. Why Silicon diode is less suited for low voltage rectifier operation?
7. What is the principle of zener diode?
8. What are the materials used to make LED?
9. What type of diodes is used in FM receivers?
10. Which diode suffers an avalanche breakdown?
11. What happens if the junction temperature of LED is increased?
12. How a transfer characteristic of a diode does is related?
13. What is the requirement of a clipping action of a diode?
14. What type of rectifier circuit requires four diodes?
15. Why are the pulse width modulated outputs required in most of the applications?
16. How do the variations in an average value get affected by PWM period?
17. Name the common formats available for LED display.
18. What are the types of seven segment display?
19. What is PWM?
20. What are the applications of PWM?

Viva-voce

FirstRanker.com - FirstRanker's Choice
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00






?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING

VII SEMESTER - R 2013

EC6711 ? EMBEDDED LABORATORY






Name : _______________________________________
Register No : _______________________________________
Section : _______________________________________
LABORATORY MANUAL



2 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00




is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and
training.

? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different
levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on
heart and soul
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

To impart professional education integrated with human values to the younger generation, so as to
shape them as proficient and dedicated engineers, capable of providing comprehensive solutions to the
challenges in deploying technology for the service of humanity

? To educate the students with the state-of-art technologies to meet the growing challenges of the
electronics industry
? To carry out research through continuous interaction with research institutes and industry, on
advances in communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning,
innovation and ethical practices
VISION
VISION
MISSION
MISSION



3 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

PROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To provide students with a solid foundation in Mathematics, Science and fundamentals of
engineering, enabling them to apply, to find solutions for engineering problems and use this knowledge
to acquire higher education
2. Core Competence
To train the students in Electronics and Communication technologies so that they apply their
knowledge and training to compare, and to analyze various engineering industrial problems to find
solutions
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice which
enables them to find solutions for the real time problems in industry, and to design products
4. Professionalism
To inculcate professional and effective communication skills, leadership qualities and team spirit in
the students to make them multi-faceted personalities and develop their ability to relate engineering
issues to broader social context
5. Lifelong Learning/Ethics
To demonstrate and practice ethical and professional responsibilities in the industry and society in
the large, through commitment and lifelong learning needed for successful professional career


4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
PROGRAMME OUTCOMES (POs)
a) To demonstrate and apply knowledge of Mathematics, Science and engineering fundamentals in
Electronics and Communication Engineering field
b) To design a component, a system or a process to meet the specific needs within the realistic
constraints such as economics, environment, ethics, health, safety and manufacturability
c) To demonstrate the competency to use software tools for computation, simulation and testing of electronics
and communication engineering circuits
d) To identify, formulate and solve electronic and communication engineering problems
e) To demonstrate an ability to visualize and work on laboratory and multidisciplinary tasks
f) To function as a member or a leader in multidisciplinary activities
g) To communicate in verbal and written form with fellow engineers and society at large
h) To understand the impact of Electronics and Communication Engineering in the society and demonstrate
awareness of contemporary issues and commitment to give solutions exhibiting social responsibility
i) To demonstrate professional & ethical responsibilities
j) To exhibit confidence in self-education and ability for lifelong learning
k) To participate and succeed in competitive exams


5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
SYLLABUS

? Learn the working of ARM processor
? Understand the Building Blocks of Embedded Systems
? Learn the concept of memory map and memory interface
? Know the characteristics of Real Time Systems
? Write programs to interface memory, I/Os with processor
? Study the interrupt performance
LIST OF EXPERIMENTS:
1. Study of ARM evaluation system
2. Interfacing ADC and DAC
3. Interfacing LED and PWM
4. Interfacing real time clock and serial port
5. Interfacing keyboard and LCD
6. Interfacing EPROM and interrupt
7. Mailbox
8. Interrupt performance characteristics of ARM and FPGA
9. Flashing of LEDS
10. Interfacing stepper motor and temperature sensor
11. Implementing zigbee protocol with ARM



? Write programs in ARM for a specific Application
? Interface memory and Write programs related to memory operations
? Interface A/D and D/A convertors with ARM system
? Analyze the performance of interrupt
? Write programmes for interfacing keyboard, display, motor and sensor.
? Formulate a mini project using embedded system
COURSE OBJECTIVES
COURSE OUTCOMES
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
CONTENTS
Sl. No. Name of the Experiment Page No.
CYCLE 1 ? EXPERIMENTS
1
Study of ARM evaluation system 7
2
Analog to Digital Convertor interfacing 16
3
Generation of ramp and square wave using on-Chip DAC 19
4
LED dimming using PWM 22
5
Interfacing real time clock and serial port 25
6
Interfacing keypad and LCD 28
7
Interfacing EPROM and interrupt 31
CYCLE 2 ? EXPERIMENTS
8 Implementation of Mailbox Function using LPC 2148 35
9 Interrupt Performance Characteristics of Arm and FPGA 37
10 Flashing of LEDs 40
11 Stepper Motor Interface with ARM ? 7 LPC2148 43
12 LM35 Temperature Sensor Interface with ARM ? 7 LPC2148 47
13
Implementation of Wireless Communication Protocol using ZIGBEE Wireless
Module
50
ADDITIONAL EXPERIMENTS BEYOND THE SYYLABUS
14 Buzzer Interface with ARM ? 7 54
15 Relay interface with ARM? 7 57
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Expt. No. 1 STUDY OF ARM EVALUATION SYSTEM
Aim:
To study the building blocks of ARM7 system, its features, pin configuration and the components
required for functioning of ARM controller.
Architecture Overview:
A RISC-based computer design approach means ARM processors require significantly fewer transistors
than typical processors in average computers. This approach reduces cost, heat and power usage. These
are desirable traits for light, portable, battery-powered devices (smart phones, laptops, tablet and notepad
computers), and other embedded systems. A simpler design facilitates more efficient multi-core CPUs and
higher core counts at lower cost, providing higher processing power and improved energy efficiency for
servers and supercomputers.
In 2005, about 98% of all mobile phones sold used at least one ARM processor. The low power
consumption of ARM processors has made them very popular: 37 billion ARM processors have been
produced as of 2013, up from 10 billion in 2008. The ARM architecture (32-bit) is the most widely used
architecture in mobile devices, and most popular 32-bit one in embedded systems.
According to ARM Holdings, in 2010 alone, producers of chips based on ARM architectures
reported shipments of 6.1 billion ARM based processors, representing 95% of smart phones, 35% of digital
televisions and set-top boxes and 10% of mobile computers. It is the most widely used 32-bit instruction set
architecture in terms of quantity produced.
LPC 2148:
LPC2148 is the widely used IC from ARM-7 family. It is manufactured by Philips and it is pre-loaded
with many inbuilt peripherals making it more efficient and a reliable option for the beginners as well as high
end application developer.




8 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Features of LPC214x series controllers:
1. 8 to 40 kB of on-chip static RAM and 32 to 512 kB of on-chip flash program memory.128 bit wide
interface/accelerator enables high speed 60 MHz operation.
2. In-System/In-Application Programming (ISP/IAP) via on-chip boot-loader software. Single flash sector or
full chip erase in 400 ms and programming of 256 bytes in 1ms.
3. Embedded ICE RT and Embedded Trace interfaces offer real-time debugging with the on-chip Real
Monitor software and high speed tracing of instruction execution.
4. USB 2.0 Full Speed compliant Device Controller with 2 kB of endpoint RAM. In addition, the LPC2146/8
provides 8 kB of on-chip RAM accessible to USB by DMA.
5. One or two (LPC2141/2 vs. LPC2144/6/8) 10-bit A/D converters provide a total of 6/14analog inputs, with
conversion times as low as 2.44 us per channel.
6. Single 10-bit D/A converter provides variable analog output.
7. Two 32-bit timers/external event counters (with four capture and four compare channels each), PWM unit
(six outputs) and watchdog.
8. Low power real-time clock with independent power and dedicated 32 kHz clock input.
9. Multiple serial interfaces including two UARTs (16C550), two Fast I2C-bus (400 kbit/s), SPI and SSP with
buffering and variable data length capabilities.
10. Vectored interrupt controller with configurable priorities and vector addresses.
11. Up to 45 of 5 V tolerant fast general purpose I/O pins in a tiny LQFP64 package.
12. Up to nine edge or level sensitive external interrupt pins available.
13. On-chip integrated oscillator operates with an external crystal in range from 1 MHz to30 MHz and with
an external oscillator up to 50 MHz
14. Power saving modes include Idle and Power-down.
15. Individual enable/disable of peripheral functions as well as peripheral clock scaling for additional power
optimization.
16. Processor wake-up from Power-down mode via external interrupt, USB, Brown-Out Detect (BOD) or
Real-Time Clock (RTC).




9 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


First Step- Hardware Requirement:
Pin configuration of LPC 2148.

Hardware requirement of LPC2148:
1. LPC2148 need minimum below listed hardware to work properly
2. Power Supply
3. Crystal Oscillator
4. Reset Circuit
5. RTC crystal oscillator
6. UART
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Power Supply:
LPC2148 works on 3.3 V power supply. LM 117 can be used for generating 3.3 V supply. However,
basic peripherals like LCD, ULN 2003 (Motor Driver IC) etc. works on 5V. So AC mains supply is converted
into 5V using below mentioned circuit and after that LM 117 is used to convert 5V into 3.3V.
Block diagram of power Supply

Transformer: It is used to step down 230V AC to 9V AC supply and provides isolation between power grids
and circuit.
Rectifier: It is used to convert AC supply into DC.
Filter: It is used to reduce ripple factor of DC output available from rectifier end.
Regulator: It is used to regulate DC supply output.

11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Circuit Diagram:

Regulator IC 7805 is used to provide fix 5V dc supply.
LM 117 is used for generating 3.3V supply from 5V.

12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Calculations:

From the datasheet of LM117

Taking R 2= 240?, we get R 1=392?
Reset Circuit:
Reset button is essential in a system to avoid programming pitfalls and manually bring back the system
to the initialization mode. MCP 130T is a special IC used for providing stable RESET signal to LPC 2148.


13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Oscillator Circuit:

The value of capacitors C20 & C21 depends upon the frequency of crystal Y3. General circuit and
its equivalent circuit is as shown below.

14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Recommended values are as shown in table:

UART:
LPC 2148 has inbuilt ISP which means we can program it within the system using serial
communication on COM0. It has also COM1 for serial communication. MAX 232/233 IC must be used for
voltage logic conversion. Related connections are as given below.

Once the above listed circuit design is ready, we are ready to go further.



15 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Result:
ARM Evaluation system and the configuration of LPC2148 has been studied fully. The minimal setup
required for the functioning of the ARM processor is studied.
Outcomes:
1. Able to understand the ARM controller, its basic components inside and its features.
2. Able to know the components required for the working of ARM LPC2148

Applications:
ARM controller LPC2148 is used in no. of devices such as
1. Smart phones
2. Net books
3. E Readers
4. Digital TV
5. Home Gateways


1. What are the basic units of ARM 7?
2. What is the address system supported by ARM?
3. Define - RISC
4. What are the instructions used to access the memory in ARM?
5. What are the basic units of Microprocessor?
6. What is an Instruction?
7. What is clock cycle?
8. Define - Pipelining
9. What is cache miss?
10. What is meant by memory mapped I/O?
11. Define ? interrupt
12. What is meant by Exception?
13. What is meant by little ? endian mode?
14. What is meant by big ? endian mode?
15. What is the function of CPSR?
16. What is register - indirect addressing?
Viva-voce




16 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 2 ANALOG TO DIGITAL CONVERTOR
INTERFACING
Aim:
To write an embedded c program for interfacing an on chip ADC with LPC2148 ARM processor and
convert the given input voltage into corresponding decimal values.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. PC
Theory:
Analog to Digital converter (ADC) is a device that converts continuously varying analog signals from
instruments that monitor such conditions as movement, temperature, sound, etc., into binary code for the
computer. It may be either a single chip or can be one circuit within a chip. Analog to Digital conversion is
the process of changing continuously varying data, such as voltage, current, or shaft rotation, into discrete
digital quantities that represent the magnitude of the data compared to a standard or reference at the
moment the conversion is made. According to the method of conversion, ADCs can be classified into
Direct-Conversion ADCs, Successive Approximation ADCs, Integrating ADC and Sigma-Delta ADCs.
The LPC 2148 has 10-bit successive approximation analog to digital converter. Basic clocking for the
A/D converters is provided by the VPB clock. A programmable divider is included in each converter, to
scale this clock to the 4.5 MHz (max) clock needed by the successive approximation process. A fully
accurate conversion requires 11 of these clocks. The ADC cell can measure the voltage on any of the ADC
input signals. It is noted that these analog inputs are always connected to their pins, even if the Pin function
Select register assigns them to port pins. A simple self-test of the ADC can be done by driving these pins
as port outputs.



17 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Circuit diagram:




18 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus, an embedded c program for interfacing on-chip ADC with ARM processor is written and
executed. The decimal values of the converted voltage are seen in the WinXTalk screen.
Outcome:
Able to interface A/D convertors with ARM system and check its working by connecting an analog
quantity as input.
Applications:
1. ADC used in MODEM for converting analog signals to digital.
2. A fast video ADC in TV tuner cards
3. ADC used in digital storage oscilloscopes
4. Used in music reproduction technology.
5. Used in DSP if input is analog


1. What are the ADC operating modes in LPC2148?
2. What is meant by conversion time?
3. Why are internal ADCs preferred over external ADCs?
4. Why has 16-bit ADC more resolution than from 10-bit and 8-bit ADC?
5. What are ADC & its Resolution?
6. What is Burst conversion mode?
7. What is the function of A/D Control Register?
8. What is the function of A/D Global Data Register?
9. What is the function of A/D Status Register?
10. What is analog-to-digital (ADC) conversion error?
11. What is the function of Sample-and-hold circuits in analog-to digital converters?
12. What is the disadvantage of the flash analog-to digital converter?
Viva-voce




19 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 3 GENERATION OF RAMP AND SQUARE
WAVE USING ON-CHIP DAC
Aim:
To write and execute an embedded c program to generate ramp wave and square wave using on-chip
DAC of LPC2148 ARM controller.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
A digital-to-analog converter is a device for converting a digital signal into an analog signal (current or
voltage). Digital-to-Analog Converters are the interface between the abstract digital world and the analog
real world. Simple switches, a network of resistors, current sources or capacitors may be used to
implement this conversion. A DAC inputs a binary number and outputs an analog voltage or current signal.
The Microchip Technology Inc. MCP4921 is 2.7 ? 5.5V, low-power, 12-Bit Digital-to-Analog Converter
(DAC) with SPI interface. The MCP4921 DAC provides high accuracy and low noise performance for
industrial applications where calibration or compensation of signals is required. With an SPI connection
there is always one master device (usually a microcontroller) which controls the peripheral devices.
Typically there are three lines common to all the devices,
Master In Slave Out (MISO) ? The Slave line for sending data to the master,
Master Out Slave In (MOSI) ? The Master line for sending data to the peripherals,
Serial Clock (SCK) ? The clock pulses which synchronize data transmission generated by the
master and slave
Slave Select pin ? the pin on each device that the master can use to enable and disable specific
devices. When a device Slave Select pin is low, it communicates with the master. When it is high, it ignores
the master. In SPI, the clock signal is controlled by the master device LPC2148. All data is clocked in and
out using this pin. These lines need to be connected to the relevant pins on the LPC21xx processor. Any
unused GIO pin can be used for CS, instead pull this pin high. Conversion speed is the time it takes for the



20 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

DAC to provide an analog output when the digital input word is changed. The MCP4291 DAC ? SPI
connections with LPC21xx have four I/O lines (P0.4 ? P0.7) required. The analog output is generated by
using these four lines.
Circuit diagram:


Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the embedded c programs for generating ramp wave and square wave using ARM LPC2148 are
written and executed successfully and the waveforms are viewed in oscilloscope.
Outcome:
Able to program the DAC in-built inside the ARM controller and get the waveforms using it.




21 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications :
1. DAC used in Audio amplifier.
2. Video encoder
3. Display electronics
4. Data Acquistion systems
5. Motor control



1. What are the features of LPC2148 DAC?
2. What is the function of DAC register?
3. Which pin provides a voltage reference level for the D/A converter?
4. What are the applications of DAC in signal processing applications?
5. What is GIO?
6. What is the resolution of a digital-to-analog converter (DAC)?
7. What is the major advantage of the R/2R ladder digital-to-analog (DAC), as compared to a binary-
weighted digital-to-analog DAC converter?
8. What is the resolution of a 0?5 V 6-bit digital-to-analog converter (DAC) ?
9. What are DAC configurations?
10. What are the different types of DAC Circuits?
11. What are the Limitations of the Binary Weighted DAC?
12. What are the General DAC Characteristics?
13. Define reference voltage in DAC.
14. What is full scale voltage?
15. What is settling time?
VIVA-VOCE




22 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 4 LED DIMMING USING PWM

Aim:
To write an embedded c program for implementing PWM using ARM controller and verify the same by
dimming of LEDs.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
LPC2148 supports 2 types of PWM:
1) Single Edge PWM ? Pulse starts with new Period i.e pulse is always at the beginning
2) Double Edge PWM ? Pulse can be anywhere within the Period
A PWM block, like a Timer block , has a Timer Counter and an associated Pre-scale Register along
with Match Registers. These work exactly the same way as in the case of Timers. Match Registers 1 to 6
(except 0) are pinned on LPC214x i.e. the corresponding outputs are diverted to actual Pins on LPC214x
MCU. The PWM function must be selected for these Pins to get the PWM output.
The basic setup is to simply replace Servo by a LED and no external 5V source is needed. The
anode of LED is connected to P0.0 and cathode to ground. Pulse Widths corresponding to the switches
connected to P0.1/2/3/4 will be 2.5ms/5ms/7.5ms/10ms respectively. As the Pulse Width Increases LED
will keep on getting brighter and the reverse will happen if Pulse Width is decreased.



23 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus embedded c program for implementing Pulse Width Modulation is written and executed and
output has been verified in LED display.
Outcome:
Able to implement PWM using the ARM controller and verify the same in the form of dimming of
LEDS.



24 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Applications :
1. In Visual signals to covey a message
2. Illumination where light is reflected from objects
3. In Narrow band sensors



1. What factors determine the LED dimming performance?
2. What is meant by analog dimming?
3. What is flickering effect?
4. What is the factor determines dimming of the LED
5. Why Silicon is not suitable for fabrication of light-emitting diodes?
6. Why Silicon diode is less suited for low voltage rectifier operation?
7. What is the principle of zener diode?
8. What are the materials used to make LED?
9. What type of diodes is used in FM receivers?
10. Which diode suffers an avalanche breakdown?
11. What happens if the junction temperature of LED is increased?
12. How a transfer characteristic of a diode does is related?
13. What is the requirement of a clipping action of a diode?
14. What type of rectifier circuit requires four diodes?
15. Why are the pulse width modulated outputs required in most of the applications?
16. How do the variations in an average value get affected by PWM period?
17. Name the common formats available for LED display.
18. What are the types of seven segment display?
19. What is PWM?
20. What are the applications of PWM?

Viva-voce




25 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 5 INTERFACING REAL TIME CLOCK
AND SERIAL PORT
Aim:
To write and execute an embedded c program to interface DS1307 RTC using I2C protocol with ARM
controller
Apparatus Required:
1. LPC2148 ARM development board
2. Stepper motor
3. Interfacing cables
4. PC
Theory:
A clock, which is based on the interrupts at preset intervals, is Real Time Clock (RTC). An interrupt
service routine executes on each timeout (overflow) of this clock. This timing device once started never
resets or never reloaded with another value. Once it is set, it is not modified later. It is used in a system to
save the time and date.










FirstRanker.com - FirstRanker's Choice
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00






?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING

VII SEMESTER - R 2013

EC6711 ? EMBEDDED LABORATORY






Name : _______________________________________
Register No : _______________________________________
Section : _______________________________________
LABORATORY MANUAL



2 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00




is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and
training.

? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different
levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on
heart and soul
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

To impart professional education integrated with human values to the younger generation, so as to
shape them as proficient and dedicated engineers, capable of providing comprehensive solutions to the
challenges in deploying technology for the service of humanity

? To educate the students with the state-of-art technologies to meet the growing challenges of the
electronics industry
? To carry out research through continuous interaction with research institutes and industry, on
advances in communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning,
innovation and ethical practices
VISION
VISION
MISSION
MISSION



3 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

PROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To provide students with a solid foundation in Mathematics, Science and fundamentals of
engineering, enabling them to apply, to find solutions for engineering problems and use this knowledge
to acquire higher education
2. Core Competence
To train the students in Electronics and Communication technologies so that they apply their
knowledge and training to compare, and to analyze various engineering industrial problems to find
solutions
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice which
enables them to find solutions for the real time problems in industry, and to design products
4. Professionalism
To inculcate professional and effective communication skills, leadership qualities and team spirit in
the students to make them multi-faceted personalities and develop their ability to relate engineering
issues to broader social context
5. Lifelong Learning/Ethics
To demonstrate and practice ethical and professional responsibilities in the industry and society in
the large, through commitment and lifelong learning needed for successful professional career


4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
PROGRAMME OUTCOMES (POs)
a) To demonstrate and apply knowledge of Mathematics, Science and engineering fundamentals in
Electronics and Communication Engineering field
b) To design a component, a system or a process to meet the specific needs within the realistic
constraints such as economics, environment, ethics, health, safety and manufacturability
c) To demonstrate the competency to use software tools for computation, simulation and testing of electronics
and communication engineering circuits
d) To identify, formulate and solve electronic and communication engineering problems
e) To demonstrate an ability to visualize and work on laboratory and multidisciplinary tasks
f) To function as a member or a leader in multidisciplinary activities
g) To communicate in verbal and written form with fellow engineers and society at large
h) To understand the impact of Electronics and Communication Engineering in the society and demonstrate
awareness of contemporary issues and commitment to give solutions exhibiting social responsibility
i) To demonstrate professional & ethical responsibilities
j) To exhibit confidence in self-education and ability for lifelong learning
k) To participate and succeed in competitive exams


5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
SYLLABUS

? Learn the working of ARM processor
? Understand the Building Blocks of Embedded Systems
? Learn the concept of memory map and memory interface
? Know the characteristics of Real Time Systems
? Write programs to interface memory, I/Os with processor
? Study the interrupt performance
LIST OF EXPERIMENTS:
1. Study of ARM evaluation system
2. Interfacing ADC and DAC
3. Interfacing LED and PWM
4. Interfacing real time clock and serial port
5. Interfacing keyboard and LCD
6. Interfacing EPROM and interrupt
7. Mailbox
8. Interrupt performance characteristics of ARM and FPGA
9. Flashing of LEDS
10. Interfacing stepper motor and temperature sensor
11. Implementing zigbee protocol with ARM



? Write programs in ARM for a specific Application
? Interface memory and Write programs related to memory operations
? Interface A/D and D/A convertors with ARM system
? Analyze the performance of interrupt
? Write programmes for interfacing keyboard, display, motor and sensor.
? Formulate a mini project using embedded system
COURSE OBJECTIVES
COURSE OUTCOMES
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
CONTENTS
Sl. No. Name of the Experiment Page No.
CYCLE 1 ? EXPERIMENTS
1
Study of ARM evaluation system 7
2
Analog to Digital Convertor interfacing 16
3
Generation of ramp and square wave using on-Chip DAC 19
4
LED dimming using PWM 22
5
Interfacing real time clock and serial port 25
6
Interfacing keypad and LCD 28
7
Interfacing EPROM and interrupt 31
CYCLE 2 ? EXPERIMENTS
8 Implementation of Mailbox Function using LPC 2148 35
9 Interrupt Performance Characteristics of Arm and FPGA 37
10 Flashing of LEDs 40
11 Stepper Motor Interface with ARM ? 7 LPC2148 43
12 LM35 Temperature Sensor Interface with ARM ? 7 LPC2148 47
13
Implementation of Wireless Communication Protocol using ZIGBEE Wireless
Module
50
ADDITIONAL EXPERIMENTS BEYOND THE SYYLABUS
14 Buzzer Interface with ARM ? 7 54
15 Relay interface with ARM? 7 57
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Expt. No. 1 STUDY OF ARM EVALUATION SYSTEM
Aim:
To study the building blocks of ARM7 system, its features, pin configuration and the components
required for functioning of ARM controller.
Architecture Overview:
A RISC-based computer design approach means ARM processors require significantly fewer transistors
than typical processors in average computers. This approach reduces cost, heat and power usage. These
are desirable traits for light, portable, battery-powered devices (smart phones, laptops, tablet and notepad
computers), and other embedded systems. A simpler design facilitates more efficient multi-core CPUs and
higher core counts at lower cost, providing higher processing power and improved energy efficiency for
servers and supercomputers.
In 2005, about 98% of all mobile phones sold used at least one ARM processor. The low power
consumption of ARM processors has made them very popular: 37 billion ARM processors have been
produced as of 2013, up from 10 billion in 2008. The ARM architecture (32-bit) is the most widely used
architecture in mobile devices, and most popular 32-bit one in embedded systems.
According to ARM Holdings, in 2010 alone, producers of chips based on ARM architectures
reported shipments of 6.1 billion ARM based processors, representing 95% of smart phones, 35% of digital
televisions and set-top boxes and 10% of mobile computers. It is the most widely used 32-bit instruction set
architecture in terms of quantity produced.
LPC 2148:
LPC2148 is the widely used IC from ARM-7 family. It is manufactured by Philips and it is pre-loaded
with many inbuilt peripherals making it more efficient and a reliable option for the beginners as well as high
end application developer.




8 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Features of LPC214x series controllers:
1. 8 to 40 kB of on-chip static RAM and 32 to 512 kB of on-chip flash program memory.128 bit wide
interface/accelerator enables high speed 60 MHz operation.
2. In-System/In-Application Programming (ISP/IAP) via on-chip boot-loader software. Single flash sector or
full chip erase in 400 ms and programming of 256 bytes in 1ms.
3. Embedded ICE RT and Embedded Trace interfaces offer real-time debugging with the on-chip Real
Monitor software and high speed tracing of instruction execution.
4. USB 2.0 Full Speed compliant Device Controller with 2 kB of endpoint RAM. In addition, the LPC2146/8
provides 8 kB of on-chip RAM accessible to USB by DMA.
5. One or two (LPC2141/2 vs. LPC2144/6/8) 10-bit A/D converters provide a total of 6/14analog inputs, with
conversion times as low as 2.44 us per channel.
6. Single 10-bit D/A converter provides variable analog output.
7. Two 32-bit timers/external event counters (with four capture and four compare channels each), PWM unit
(six outputs) and watchdog.
8. Low power real-time clock with independent power and dedicated 32 kHz clock input.
9. Multiple serial interfaces including two UARTs (16C550), two Fast I2C-bus (400 kbit/s), SPI and SSP with
buffering and variable data length capabilities.
10. Vectored interrupt controller with configurable priorities and vector addresses.
11. Up to 45 of 5 V tolerant fast general purpose I/O pins in a tiny LQFP64 package.
12. Up to nine edge or level sensitive external interrupt pins available.
13. On-chip integrated oscillator operates with an external crystal in range from 1 MHz to30 MHz and with
an external oscillator up to 50 MHz
14. Power saving modes include Idle and Power-down.
15. Individual enable/disable of peripheral functions as well as peripheral clock scaling for additional power
optimization.
16. Processor wake-up from Power-down mode via external interrupt, USB, Brown-Out Detect (BOD) or
Real-Time Clock (RTC).




9 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


First Step- Hardware Requirement:
Pin configuration of LPC 2148.

Hardware requirement of LPC2148:
1. LPC2148 need minimum below listed hardware to work properly
2. Power Supply
3. Crystal Oscillator
4. Reset Circuit
5. RTC crystal oscillator
6. UART
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Power Supply:
LPC2148 works on 3.3 V power supply. LM 117 can be used for generating 3.3 V supply. However,
basic peripherals like LCD, ULN 2003 (Motor Driver IC) etc. works on 5V. So AC mains supply is converted
into 5V using below mentioned circuit and after that LM 117 is used to convert 5V into 3.3V.
Block diagram of power Supply

Transformer: It is used to step down 230V AC to 9V AC supply and provides isolation between power grids
and circuit.
Rectifier: It is used to convert AC supply into DC.
Filter: It is used to reduce ripple factor of DC output available from rectifier end.
Regulator: It is used to regulate DC supply output.

11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Circuit Diagram:

Regulator IC 7805 is used to provide fix 5V dc supply.
LM 117 is used for generating 3.3V supply from 5V.

12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Calculations:

From the datasheet of LM117

Taking R 2= 240?, we get R 1=392?
Reset Circuit:
Reset button is essential in a system to avoid programming pitfalls and manually bring back the system
to the initialization mode. MCP 130T is a special IC used for providing stable RESET signal to LPC 2148.


13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Oscillator Circuit:

The value of capacitors C20 & C21 depends upon the frequency of crystal Y3. General circuit and
its equivalent circuit is as shown below.

14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Recommended values are as shown in table:

UART:
LPC 2148 has inbuilt ISP which means we can program it within the system using serial
communication on COM0. It has also COM1 for serial communication. MAX 232/233 IC must be used for
voltage logic conversion. Related connections are as given below.

Once the above listed circuit design is ready, we are ready to go further.



15 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Result:
ARM Evaluation system and the configuration of LPC2148 has been studied fully. The minimal setup
required for the functioning of the ARM processor is studied.
Outcomes:
1. Able to understand the ARM controller, its basic components inside and its features.
2. Able to know the components required for the working of ARM LPC2148

Applications:
ARM controller LPC2148 is used in no. of devices such as
1. Smart phones
2. Net books
3. E Readers
4. Digital TV
5. Home Gateways


1. What are the basic units of ARM 7?
2. What is the address system supported by ARM?
3. Define - RISC
4. What are the instructions used to access the memory in ARM?
5. What are the basic units of Microprocessor?
6. What is an Instruction?
7. What is clock cycle?
8. Define - Pipelining
9. What is cache miss?
10. What is meant by memory mapped I/O?
11. Define ? interrupt
12. What is meant by Exception?
13. What is meant by little ? endian mode?
14. What is meant by big ? endian mode?
15. What is the function of CPSR?
16. What is register - indirect addressing?
Viva-voce




16 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 2 ANALOG TO DIGITAL CONVERTOR
INTERFACING
Aim:
To write an embedded c program for interfacing an on chip ADC with LPC2148 ARM processor and
convert the given input voltage into corresponding decimal values.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. PC
Theory:
Analog to Digital converter (ADC) is a device that converts continuously varying analog signals from
instruments that monitor such conditions as movement, temperature, sound, etc., into binary code for the
computer. It may be either a single chip or can be one circuit within a chip. Analog to Digital conversion is
the process of changing continuously varying data, such as voltage, current, or shaft rotation, into discrete
digital quantities that represent the magnitude of the data compared to a standard or reference at the
moment the conversion is made. According to the method of conversion, ADCs can be classified into
Direct-Conversion ADCs, Successive Approximation ADCs, Integrating ADC and Sigma-Delta ADCs.
The LPC 2148 has 10-bit successive approximation analog to digital converter. Basic clocking for the
A/D converters is provided by the VPB clock. A programmable divider is included in each converter, to
scale this clock to the 4.5 MHz (max) clock needed by the successive approximation process. A fully
accurate conversion requires 11 of these clocks. The ADC cell can measure the voltage on any of the ADC
input signals. It is noted that these analog inputs are always connected to their pins, even if the Pin function
Select register assigns them to port pins. A simple self-test of the ADC can be done by driving these pins
as port outputs.



17 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Circuit diagram:




18 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus, an embedded c program for interfacing on-chip ADC with ARM processor is written and
executed. The decimal values of the converted voltage are seen in the WinXTalk screen.
Outcome:
Able to interface A/D convertors with ARM system and check its working by connecting an analog
quantity as input.
Applications:
1. ADC used in MODEM for converting analog signals to digital.
2. A fast video ADC in TV tuner cards
3. ADC used in digital storage oscilloscopes
4. Used in music reproduction technology.
5. Used in DSP if input is analog


1. What are the ADC operating modes in LPC2148?
2. What is meant by conversion time?
3. Why are internal ADCs preferred over external ADCs?
4. Why has 16-bit ADC more resolution than from 10-bit and 8-bit ADC?
5. What are ADC & its Resolution?
6. What is Burst conversion mode?
7. What is the function of A/D Control Register?
8. What is the function of A/D Global Data Register?
9. What is the function of A/D Status Register?
10. What is analog-to-digital (ADC) conversion error?
11. What is the function of Sample-and-hold circuits in analog-to digital converters?
12. What is the disadvantage of the flash analog-to digital converter?
Viva-voce




19 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 3 GENERATION OF RAMP AND SQUARE
WAVE USING ON-CHIP DAC
Aim:
To write and execute an embedded c program to generate ramp wave and square wave using on-chip
DAC of LPC2148 ARM controller.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
A digital-to-analog converter is a device for converting a digital signal into an analog signal (current or
voltage). Digital-to-Analog Converters are the interface between the abstract digital world and the analog
real world. Simple switches, a network of resistors, current sources or capacitors may be used to
implement this conversion. A DAC inputs a binary number and outputs an analog voltage or current signal.
The Microchip Technology Inc. MCP4921 is 2.7 ? 5.5V, low-power, 12-Bit Digital-to-Analog Converter
(DAC) with SPI interface. The MCP4921 DAC provides high accuracy and low noise performance for
industrial applications where calibration or compensation of signals is required. With an SPI connection
there is always one master device (usually a microcontroller) which controls the peripheral devices.
Typically there are three lines common to all the devices,
Master In Slave Out (MISO) ? The Slave line for sending data to the master,
Master Out Slave In (MOSI) ? The Master line for sending data to the peripherals,
Serial Clock (SCK) ? The clock pulses which synchronize data transmission generated by the
master and slave
Slave Select pin ? the pin on each device that the master can use to enable and disable specific
devices. When a device Slave Select pin is low, it communicates with the master. When it is high, it ignores
the master. In SPI, the clock signal is controlled by the master device LPC2148. All data is clocked in and
out using this pin. These lines need to be connected to the relevant pins on the LPC21xx processor. Any
unused GIO pin can be used for CS, instead pull this pin high. Conversion speed is the time it takes for the



20 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

DAC to provide an analog output when the digital input word is changed. The MCP4291 DAC ? SPI
connections with LPC21xx have four I/O lines (P0.4 ? P0.7) required. The analog output is generated by
using these four lines.
Circuit diagram:


Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the embedded c programs for generating ramp wave and square wave using ARM LPC2148 are
written and executed successfully and the waveforms are viewed in oscilloscope.
Outcome:
Able to program the DAC in-built inside the ARM controller and get the waveforms using it.




21 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications :
1. DAC used in Audio amplifier.
2. Video encoder
3. Display electronics
4. Data Acquistion systems
5. Motor control



1. What are the features of LPC2148 DAC?
2. What is the function of DAC register?
3. Which pin provides a voltage reference level for the D/A converter?
4. What are the applications of DAC in signal processing applications?
5. What is GIO?
6. What is the resolution of a digital-to-analog converter (DAC)?
7. What is the major advantage of the R/2R ladder digital-to-analog (DAC), as compared to a binary-
weighted digital-to-analog DAC converter?
8. What is the resolution of a 0?5 V 6-bit digital-to-analog converter (DAC) ?
9. What are DAC configurations?
10. What are the different types of DAC Circuits?
11. What are the Limitations of the Binary Weighted DAC?
12. What are the General DAC Characteristics?
13. Define reference voltage in DAC.
14. What is full scale voltage?
15. What is settling time?
VIVA-VOCE




22 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 4 LED DIMMING USING PWM

Aim:
To write an embedded c program for implementing PWM using ARM controller and verify the same by
dimming of LEDs.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
LPC2148 supports 2 types of PWM:
1) Single Edge PWM ? Pulse starts with new Period i.e pulse is always at the beginning
2) Double Edge PWM ? Pulse can be anywhere within the Period
A PWM block, like a Timer block , has a Timer Counter and an associated Pre-scale Register along
with Match Registers. These work exactly the same way as in the case of Timers. Match Registers 1 to 6
(except 0) are pinned on LPC214x i.e. the corresponding outputs are diverted to actual Pins on LPC214x
MCU. The PWM function must be selected for these Pins to get the PWM output.
The basic setup is to simply replace Servo by a LED and no external 5V source is needed. The
anode of LED is connected to P0.0 and cathode to ground. Pulse Widths corresponding to the switches
connected to P0.1/2/3/4 will be 2.5ms/5ms/7.5ms/10ms respectively. As the Pulse Width Increases LED
will keep on getting brighter and the reverse will happen if Pulse Width is decreased.



23 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus embedded c program for implementing Pulse Width Modulation is written and executed and
output has been verified in LED display.
Outcome:
Able to implement PWM using the ARM controller and verify the same in the form of dimming of
LEDS.



24 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Applications :
1. In Visual signals to covey a message
2. Illumination where light is reflected from objects
3. In Narrow band sensors



1. What factors determine the LED dimming performance?
2. What is meant by analog dimming?
3. What is flickering effect?
4. What is the factor determines dimming of the LED
5. Why Silicon is not suitable for fabrication of light-emitting diodes?
6. Why Silicon diode is less suited for low voltage rectifier operation?
7. What is the principle of zener diode?
8. What are the materials used to make LED?
9. What type of diodes is used in FM receivers?
10. Which diode suffers an avalanche breakdown?
11. What happens if the junction temperature of LED is increased?
12. How a transfer characteristic of a diode does is related?
13. What is the requirement of a clipping action of a diode?
14. What type of rectifier circuit requires four diodes?
15. Why are the pulse width modulated outputs required in most of the applications?
16. How do the variations in an average value get affected by PWM period?
17. Name the common formats available for LED display.
18. What are the types of seven segment display?
19. What is PWM?
20. What are the applications of PWM?

Viva-voce




25 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 5 INTERFACING REAL TIME CLOCK
AND SERIAL PORT
Aim:
To write and execute an embedded c program to interface DS1307 RTC using I2C protocol with ARM
controller
Apparatus Required:
1. LPC2148 ARM development board
2. Stepper motor
3. Interfacing cables
4. PC
Theory:
A clock, which is based on the interrupts at preset intervals, is Real Time Clock (RTC). An interrupt
service routine executes on each timeout (overflow) of this clock. This timing device once started never
resets or never reloaded with another value. Once it is set, it is not modified later. It is used in a system to
save the time and date.













26 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the program for interfacing real time clock with ARM controller is written and executed and the
date and time are verified on the screen.
Outcome:
Able to interface real time clock DS1307 with ARM controller and thereby display date and time
Applications :
1. I2C In ARM and PIC microcontrollers
2. Used as serial communication protocol with MASTER and SLAVE operation.

FirstRanker.com - FirstRanker's Choice
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00






?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING

VII SEMESTER - R 2013

EC6711 ? EMBEDDED LABORATORY






Name : _______________________________________
Register No : _______________________________________
Section : _______________________________________
LABORATORY MANUAL



2 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00




is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and
training.

? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different
levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on
heart and soul
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

To impart professional education integrated with human values to the younger generation, so as to
shape them as proficient and dedicated engineers, capable of providing comprehensive solutions to the
challenges in deploying technology for the service of humanity

? To educate the students with the state-of-art technologies to meet the growing challenges of the
electronics industry
? To carry out research through continuous interaction with research institutes and industry, on
advances in communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning,
innovation and ethical practices
VISION
VISION
MISSION
MISSION



3 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

PROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To provide students with a solid foundation in Mathematics, Science and fundamentals of
engineering, enabling them to apply, to find solutions for engineering problems and use this knowledge
to acquire higher education
2. Core Competence
To train the students in Electronics and Communication technologies so that they apply their
knowledge and training to compare, and to analyze various engineering industrial problems to find
solutions
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice which
enables them to find solutions for the real time problems in industry, and to design products
4. Professionalism
To inculcate professional and effective communication skills, leadership qualities and team spirit in
the students to make them multi-faceted personalities and develop their ability to relate engineering
issues to broader social context
5. Lifelong Learning/Ethics
To demonstrate and practice ethical and professional responsibilities in the industry and society in
the large, through commitment and lifelong learning needed for successful professional career


4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
PROGRAMME OUTCOMES (POs)
a) To demonstrate and apply knowledge of Mathematics, Science and engineering fundamentals in
Electronics and Communication Engineering field
b) To design a component, a system or a process to meet the specific needs within the realistic
constraints such as economics, environment, ethics, health, safety and manufacturability
c) To demonstrate the competency to use software tools for computation, simulation and testing of electronics
and communication engineering circuits
d) To identify, formulate and solve electronic and communication engineering problems
e) To demonstrate an ability to visualize and work on laboratory and multidisciplinary tasks
f) To function as a member or a leader in multidisciplinary activities
g) To communicate in verbal and written form with fellow engineers and society at large
h) To understand the impact of Electronics and Communication Engineering in the society and demonstrate
awareness of contemporary issues and commitment to give solutions exhibiting social responsibility
i) To demonstrate professional & ethical responsibilities
j) To exhibit confidence in self-education and ability for lifelong learning
k) To participate and succeed in competitive exams


5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
SYLLABUS

? Learn the working of ARM processor
? Understand the Building Blocks of Embedded Systems
? Learn the concept of memory map and memory interface
? Know the characteristics of Real Time Systems
? Write programs to interface memory, I/Os with processor
? Study the interrupt performance
LIST OF EXPERIMENTS:
1. Study of ARM evaluation system
2. Interfacing ADC and DAC
3. Interfacing LED and PWM
4. Interfacing real time clock and serial port
5. Interfacing keyboard and LCD
6. Interfacing EPROM and interrupt
7. Mailbox
8. Interrupt performance characteristics of ARM and FPGA
9. Flashing of LEDS
10. Interfacing stepper motor and temperature sensor
11. Implementing zigbee protocol with ARM



? Write programs in ARM for a specific Application
? Interface memory and Write programs related to memory operations
? Interface A/D and D/A convertors with ARM system
? Analyze the performance of interrupt
? Write programmes for interfacing keyboard, display, motor and sensor.
? Formulate a mini project using embedded system
COURSE OBJECTIVES
COURSE OUTCOMES
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
CONTENTS
Sl. No. Name of the Experiment Page No.
CYCLE 1 ? EXPERIMENTS
1
Study of ARM evaluation system 7
2
Analog to Digital Convertor interfacing 16
3
Generation of ramp and square wave using on-Chip DAC 19
4
LED dimming using PWM 22
5
Interfacing real time clock and serial port 25
6
Interfacing keypad and LCD 28
7
Interfacing EPROM and interrupt 31
CYCLE 2 ? EXPERIMENTS
8 Implementation of Mailbox Function using LPC 2148 35
9 Interrupt Performance Characteristics of Arm and FPGA 37
10 Flashing of LEDs 40
11 Stepper Motor Interface with ARM ? 7 LPC2148 43
12 LM35 Temperature Sensor Interface with ARM ? 7 LPC2148 47
13
Implementation of Wireless Communication Protocol using ZIGBEE Wireless
Module
50
ADDITIONAL EXPERIMENTS BEYOND THE SYYLABUS
14 Buzzer Interface with ARM ? 7 54
15 Relay interface with ARM? 7 57
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Expt. No. 1 STUDY OF ARM EVALUATION SYSTEM
Aim:
To study the building blocks of ARM7 system, its features, pin configuration and the components
required for functioning of ARM controller.
Architecture Overview:
A RISC-based computer design approach means ARM processors require significantly fewer transistors
than typical processors in average computers. This approach reduces cost, heat and power usage. These
are desirable traits for light, portable, battery-powered devices (smart phones, laptops, tablet and notepad
computers), and other embedded systems. A simpler design facilitates more efficient multi-core CPUs and
higher core counts at lower cost, providing higher processing power and improved energy efficiency for
servers and supercomputers.
In 2005, about 98% of all mobile phones sold used at least one ARM processor. The low power
consumption of ARM processors has made them very popular: 37 billion ARM processors have been
produced as of 2013, up from 10 billion in 2008. The ARM architecture (32-bit) is the most widely used
architecture in mobile devices, and most popular 32-bit one in embedded systems.
According to ARM Holdings, in 2010 alone, producers of chips based on ARM architectures
reported shipments of 6.1 billion ARM based processors, representing 95% of smart phones, 35% of digital
televisions and set-top boxes and 10% of mobile computers. It is the most widely used 32-bit instruction set
architecture in terms of quantity produced.
LPC 2148:
LPC2148 is the widely used IC from ARM-7 family. It is manufactured by Philips and it is pre-loaded
with many inbuilt peripherals making it more efficient and a reliable option for the beginners as well as high
end application developer.




8 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Features of LPC214x series controllers:
1. 8 to 40 kB of on-chip static RAM and 32 to 512 kB of on-chip flash program memory.128 bit wide
interface/accelerator enables high speed 60 MHz operation.
2. In-System/In-Application Programming (ISP/IAP) via on-chip boot-loader software. Single flash sector or
full chip erase in 400 ms and programming of 256 bytes in 1ms.
3. Embedded ICE RT and Embedded Trace interfaces offer real-time debugging with the on-chip Real
Monitor software and high speed tracing of instruction execution.
4. USB 2.0 Full Speed compliant Device Controller with 2 kB of endpoint RAM. In addition, the LPC2146/8
provides 8 kB of on-chip RAM accessible to USB by DMA.
5. One or two (LPC2141/2 vs. LPC2144/6/8) 10-bit A/D converters provide a total of 6/14analog inputs, with
conversion times as low as 2.44 us per channel.
6. Single 10-bit D/A converter provides variable analog output.
7. Two 32-bit timers/external event counters (with four capture and four compare channels each), PWM unit
(six outputs) and watchdog.
8. Low power real-time clock with independent power and dedicated 32 kHz clock input.
9. Multiple serial interfaces including two UARTs (16C550), two Fast I2C-bus (400 kbit/s), SPI and SSP with
buffering and variable data length capabilities.
10. Vectored interrupt controller with configurable priorities and vector addresses.
11. Up to 45 of 5 V tolerant fast general purpose I/O pins in a tiny LQFP64 package.
12. Up to nine edge or level sensitive external interrupt pins available.
13. On-chip integrated oscillator operates with an external crystal in range from 1 MHz to30 MHz and with
an external oscillator up to 50 MHz
14. Power saving modes include Idle and Power-down.
15. Individual enable/disable of peripheral functions as well as peripheral clock scaling for additional power
optimization.
16. Processor wake-up from Power-down mode via external interrupt, USB, Brown-Out Detect (BOD) or
Real-Time Clock (RTC).




9 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


First Step- Hardware Requirement:
Pin configuration of LPC 2148.

Hardware requirement of LPC2148:
1. LPC2148 need minimum below listed hardware to work properly
2. Power Supply
3. Crystal Oscillator
4. Reset Circuit
5. RTC crystal oscillator
6. UART
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Power Supply:
LPC2148 works on 3.3 V power supply. LM 117 can be used for generating 3.3 V supply. However,
basic peripherals like LCD, ULN 2003 (Motor Driver IC) etc. works on 5V. So AC mains supply is converted
into 5V using below mentioned circuit and after that LM 117 is used to convert 5V into 3.3V.
Block diagram of power Supply

Transformer: It is used to step down 230V AC to 9V AC supply and provides isolation between power grids
and circuit.
Rectifier: It is used to convert AC supply into DC.
Filter: It is used to reduce ripple factor of DC output available from rectifier end.
Regulator: It is used to regulate DC supply output.

11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Circuit Diagram:

Regulator IC 7805 is used to provide fix 5V dc supply.
LM 117 is used for generating 3.3V supply from 5V.

12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Calculations:

From the datasheet of LM117

Taking R 2= 240?, we get R 1=392?
Reset Circuit:
Reset button is essential in a system to avoid programming pitfalls and manually bring back the system
to the initialization mode. MCP 130T is a special IC used for providing stable RESET signal to LPC 2148.


13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Oscillator Circuit:

The value of capacitors C20 & C21 depends upon the frequency of crystal Y3. General circuit and
its equivalent circuit is as shown below.

14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Recommended values are as shown in table:

UART:
LPC 2148 has inbuilt ISP which means we can program it within the system using serial
communication on COM0. It has also COM1 for serial communication. MAX 232/233 IC must be used for
voltage logic conversion. Related connections are as given below.

Once the above listed circuit design is ready, we are ready to go further.



15 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Result:
ARM Evaluation system and the configuration of LPC2148 has been studied fully. The minimal setup
required for the functioning of the ARM processor is studied.
Outcomes:
1. Able to understand the ARM controller, its basic components inside and its features.
2. Able to know the components required for the working of ARM LPC2148

Applications:
ARM controller LPC2148 is used in no. of devices such as
1. Smart phones
2. Net books
3. E Readers
4. Digital TV
5. Home Gateways


1. What are the basic units of ARM 7?
2. What is the address system supported by ARM?
3. Define - RISC
4. What are the instructions used to access the memory in ARM?
5. What are the basic units of Microprocessor?
6. What is an Instruction?
7. What is clock cycle?
8. Define - Pipelining
9. What is cache miss?
10. What is meant by memory mapped I/O?
11. Define ? interrupt
12. What is meant by Exception?
13. What is meant by little ? endian mode?
14. What is meant by big ? endian mode?
15. What is the function of CPSR?
16. What is register - indirect addressing?
Viva-voce




16 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 2 ANALOG TO DIGITAL CONVERTOR
INTERFACING
Aim:
To write an embedded c program for interfacing an on chip ADC with LPC2148 ARM processor and
convert the given input voltage into corresponding decimal values.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. PC
Theory:
Analog to Digital converter (ADC) is a device that converts continuously varying analog signals from
instruments that monitor such conditions as movement, temperature, sound, etc., into binary code for the
computer. It may be either a single chip or can be one circuit within a chip. Analog to Digital conversion is
the process of changing continuously varying data, such as voltage, current, or shaft rotation, into discrete
digital quantities that represent the magnitude of the data compared to a standard or reference at the
moment the conversion is made. According to the method of conversion, ADCs can be classified into
Direct-Conversion ADCs, Successive Approximation ADCs, Integrating ADC and Sigma-Delta ADCs.
The LPC 2148 has 10-bit successive approximation analog to digital converter. Basic clocking for the
A/D converters is provided by the VPB clock. A programmable divider is included in each converter, to
scale this clock to the 4.5 MHz (max) clock needed by the successive approximation process. A fully
accurate conversion requires 11 of these clocks. The ADC cell can measure the voltage on any of the ADC
input signals. It is noted that these analog inputs are always connected to their pins, even if the Pin function
Select register assigns them to port pins. A simple self-test of the ADC can be done by driving these pins
as port outputs.



17 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Circuit diagram:




18 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus, an embedded c program for interfacing on-chip ADC with ARM processor is written and
executed. The decimal values of the converted voltage are seen in the WinXTalk screen.
Outcome:
Able to interface A/D convertors with ARM system and check its working by connecting an analog
quantity as input.
Applications:
1. ADC used in MODEM for converting analog signals to digital.
2. A fast video ADC in TV tuner cards
3. ADC used in digital storage oscilloscopes
4. Used in music reproduction technology.
5. Used in DSP if input is analog


1. What are the ADC operating modes in LPC2148?
2. What is meant by conversion time?
3. Why are internal ADCs preferred over external ADCs?
4. Why has 16-bit ADC more resolution than from 10-bit and 8-bit ADC?
5. What are ADC & its Resolution?
6. What is Burst conversion mode?
7. What is the function of A/D Control Register?
8. What is the function of A/D Global Data Register?
9. What is the function of A/D Status Register?
10. What is analog-to-digital (ADC) conversion error?
11. What is the function of Sample-and-hold circuits in analog-to digital converters?
12. What is the disadvantage of the flash analog-to digital converter?
Viva-voce




19 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 3 GENERATION OF RAMP AND SQUARE
WAVE USING ON-CHIP DAC
Aim:
To write and execute an embedded c program to generate ramp wave and square wave using on-chip
DAC of LPC2148 ARM controller.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
A digital-to-analog converter is a device for converting a digital signal into an analog signal (current or
voltage). Digital-to-Analog Converters are the interface between the abstract digital world and the analog
real world. Simple switches, a network of resistors, current sources or capacitors may be used to
implement this conversion. A DAC inputs a binary number and outputs an analog voltage or current signal.
The Microchip Technology Inc. MCP4921 is 2.7 ? 5.5V, low-power, 12-Bit Digital-to-Analog Converter
(DAC) with SPI interface. The MCP4921 DAC provides high accuracy and low noise performance for
industrial applications where calibration or compensation of signals is required. With an SPI connection
there is always one master device (usually a microcontroller) which controls the peripheral devices.
Typically there are three lines common to all the devices,
Master In Slave Out (MISO) ? The Slave line for sending data to the master,
Master Out Slave In (MOSI) ? The Master line for sending data to the peripherals,
Serial Clock (SCK) ? The clock pulses which synchronize data transmission generated by the
master and slave
Slave Select pin ? the pin on each device that the master can use to enable and disable specific
devices. When a device Slave Select pin is low, it communicates with the master. When it is high, it ignores
the master. In SPI, the clock signal is controlled by the master device LPC2148. All data is clocked in and
out using this pin. These lines need to be connected to the relevant pins on the LPC21xx processor. Any
unused GIO pin can be used for CS, instead pull this pin high. Conversion speed is the time it takes for the



20 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

DAC to provide an analog output when the digital input word is changed. The MCP4291 DAC ? SPI
connections with LPC21xx have four I/O lines (P0.4 ? P0.7) required. The analog output is generated by
using these four lines.
Circuit diagram:


Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the embedded c programs for generating ramp wave and square wave using ARM LPC2148 are
written and executed successfully and the waveforms are viewed in oscilloscope.
Outcome:
Able to program the DAC in-built inside the ARM controller and get the waveforms using it.




21 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications :
1. DAC used in Audio amplifier.
2. Video encoder
3. Display electronics
4. Data Acquistion systems
5. Motor control



1. What are the features of LPC2148 DAC?
2. What is the function of DAC register?
3. Which pin provides a voltage reference level for the D/A converter?
4. What are the applications of DAC in signal processing applications?
5. What is GIO?
6. What is the resolution of a digital-to-analog converter (DAC)?
7. What is the major advantage of the R/2R ladder digital-to-analog (DAC), as compared to a binary-
weighted digital-to-analog DAC converter?
8. What is the resolution of a 0?5 V 6-bit digital-to-analog converter (DAC) ?
9. What are DAC configurations?
10. What are the different types of DAC Circuits?
11. What are the Limitations of the Binary Weighted DAC?
12. What are the General DAC Characteristics?
13. Define reference voltage in DAC.
14. What is full scale voltage?
15. What is settling time?
VIVA-VOCE




22 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 4 LED DIMMING USING PWM

Aim:
To write an embedded c program for implementing PWM using ARM controller and verify the same by
dimming of LEDs.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
LPC2148 supports 2 types of PWM:
1) Single Edge PWM ? Pulse starts with new Period i.e pulse is always at the beginning
2) Double Edge PWM ? Pulse can be anywhere within the Period
A PWM block, like a Timer block , has a Timer Counter and an associated Pre-scale Register along
with Match Registers. These work exactly the same way as in the case of Timers. Match Registers 1 to 6
(except 0) are pinned on LPC214x i.e. the corresponding outputs are diverted to actual Pins on LPC214x
MCU. The PWM function must be selected for these Pins to get the PWM output.
The basic setup is to simply replace Servo by a LED and no external 5V source is needed. The
anode of LED is connected to P0.0 and cathode to ground. Pulse Widths corresponding to the switches
connected to P0.1/2/3/4 will be 2.5ms/5ms/7.5ms/10ms respectively. As the Pulse Width Increases LED
will keep on getting brighter and the reverse will happen if Pulse Width is decreased.



23 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus embedded c program for implementing Pulse Width Modulation is written and executed and
output has been verified in LED display.
Outcome:
Able to implement PWM using the ARM controller and verify the same in the form of dimming of
LEDS.



24 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Applications :
1. In Visual signals to covey a message
2. Illumination where light is reflected from objects
3. In Narrow band sensors



1. What factors determine the LED dimming performance?
2. What is meant by analog dimming?
3. What is flickering effect?
4. What is the factor determines dimming of the LED
5. Why Silicon is not suitable for fabrication of light-emitting diodes?
6. Why Silicon diode is less suited for low voltage rectifier operation?
7. What is the principle of zener diode?
8. What are the materials used to make LED?
9. What type of diodes is used in FM receivers?
10. Which diode suffers an avalanche breakdown?
11. What happens if the junction temperature of LED is increased?
12. How a transfer characteristic of a diode does is related?
13. What is the requirement of a clipping action of a diode?
14. What type of rectifier circuit requires four diodes?
15. Why are the pulse width modulated outputs required in most of the applications?
16. How do the variations in an average value get affected by PWM period?
17. Name the common formats available for LED display.
18. What are the types of seven segment display?
19. What is PWM?
20. What are the applications of PWM?

Viva-voce




25 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 5 INTERFACING REAL TIME CLOCK
AND SERIAL PORT
Aim:
To write and execute an embedded c program to interface DS1307 RTC using I2C protocol with ARM
controller
Apparatus Required:
1. LPC2148 ARM development board
2. Stepper motor
3. Interfacing cables
4. PC
Theory:
A clock, which is based on the interrupts at preset intervals, is Real Time Clock (RTC). An interrupt
service routine executes on each timeout (overflow) of this clock. This timing device once started never
resets or never reloaded with another value. Once it is set, it is not modified later. It is used in a system to
save the time and date.













26 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the program for interfacing real time clock with ARM controller is written and executed and the
date and time are verified on the screen.
Outcome:
Able to interface real time clock DS1307 with ARM controller and thereby display date and time
Applications :
1. I2C In ARM and PIC microcontrollers
2. Used as serial communication protocol with MASTER and SLAVE operation.

27 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
27 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00




1. What is I2C and how does it work?
2. What are the features of I2C in LPC2148 ARM7 microcontroller?
3. What is the function of I2C0CONSET register?
4. What is I2C0STAT?
5. What is the function of I2C0 Data Register?
6. What is RTC?
7. List the advantages of RTC
8. Through which port the date and time is displayed in RTC?
9. What is a serial port?
10. List the registers used to transfer data in serial port.
11. List the modes used for data transmission.
12. What is a simplex mode?
13. Which pin is used to transmit a character?
14. What is the baud rate of serial port?
15. What is the disadvantage of RS-232C?














Viva-voce

FirstRanker.com - FirstRanker's Choice
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00






?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING

VII SEMESTER - R 2013

EC6711 ? EMBEDDED LABORATORY






Name : _______________________________________
Register No : _______________________________________
Section : _______________________________________
LABORATORY MANUAL



2 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00




is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and
training.

? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different
levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on
heart and soul
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

To impart professional education integrated with human values to the younger generation, so as to
shape them as proficient and dedicated engineers, capable of providing comprehensive solutions to the
challenges in deploying technology for the service of humanity

? To educate the students with the state-of-art technologies to meet the growing challenges of the
electronics industry
? To carry out research through continuous interaction with research institutes and industry, on
advances in communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning,
innovation and ethical practices
VISION
VISION
MISSION
MISSION



3 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

PROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To provide students with a solid foundation in Mathematics, Science and fundamentals of
engineering, enabling them to apply, to find solutions for engineering problems and use this knowledge
to acquire higher education
2. Core Competence
To train the students in Electronics and Communication technologies so that they apply their
knowledge and training to compare, and to analyze various engineering industrial problems to find
solutions
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice which
enables them to find solutions for the real time problems in industry, and to design products
4. Professionalism
To inculcate professional and effective communication skills, leadership qualities and team spirit in
the students to make them multi-faceted personalities and develop their ability to relate engineering
issues to broader social context
5. Lifelong Learning/Ethics
To demonstrate and practice ethical and professional responsibilities in the industry and society in
the large, through commitment and lifelong learning needed for successful professional career


4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
PROGRAMME OUTCOMES (POs)
a) To demonstrate and apply knowledge of Mathematics, Science and engineering fundamentals in
Electronics and Communication Engineering field
b) To design a component, a system or a process to meet the specific needs within the realistic
constraints such as economics, environment, ethics, health, safety and manufacturability
c) To demonstrate the competency to use software tools for computation, simulation and testing of electronics
and communication engineering circuits
d) To identify, formulate and solve electronic and communication engineering problems
e) To demonstrate an ability to visualize and work on laboratory and multidisciplinary tasks
f) To function as a member or a leader in multidisciplinary activities
g) To communicate in verbal and written form with fellow engineers and society at large
h) To understand the impact of Electronics and Communication Engineering in the society and demonstrate
awareness of contemporary issues and commitment to give solutions exhibiting social responsibility
i) To demonstrate professional & ethical responsibilities
j) To exhibit confidence in self-education and ability for lifelong learning
k) To participate and succeed in competitive exams


5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
SYLLABUS

? Learn the working of ARM processor
? Understand the Building Blocks of Embedded Systems
? Learn the concept of memory map and memory interface
? Know the characteristics of Real Time Systems
? Write programs to interface memory, I/Os with processor
? Study the interrupt performance
LIST OF EXPERIMENTS:
1. Study of ARM evaluation system
2. Interfacing ADC and DAC
3. Interfacing LED and PWM
4. Interfacing real time clock and serial port
5. Interfacing keyboard and LCD
6. Interfacing EPROM and interrupt
7. Mailbox
8. Interrupt performance characteristics of ARM and FPGA
9. Flashing of LEDS
10. Interfacing stepper motor and temperature sensor
11. Implementing zigbee protocol with ARM



? Write programs in ARM for a specific Application
? Interface memory and Write programs related to memory operations
? Interface A/D and D/A convertors with ARM system
? Analyze the performance of interrupt
? Write programmes for interfacing keyboard, display, motor and sensor.
? Formulate a mini project using embedded system
COURSE OBJECTIVES
COURSE OUTCOMES
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
CONTENTS
Sl. No. Name of the Experiment Page No.
CYCLE 1 ? EXPERIMENTS
1
Study of ARM evaluation system 7
2
Analog to Digital Convertor interfacing 16
3
Generation of ramp and square wave using on-Chip DAC 19
4
LED dimming using PWM 22
5
Interfacing real time clock and serial port 25
6
Interfacing keypad and LCD 28
7
Interfacing EPROM and interrupt 31
CYCLE 2 ? EXPERIMENTS
8 Implementation of Mailbox Function using LPC 2148 35
9 Interrupt Performance Characteristics of Arm and FPGA 37
10 Flashing of LEDs 40
11 Stepper Motor Interface with ARM ? 7 LPC2148 43
12 LM35 Temperature Sensor Interface with ARM ? 7 LPC2148 47
13
Implementation of Wireless Communication Protocol using ZIGBEE Wireless
Module
50
ADDITIONAL EXPERIMENTS BEYOND THE SYYLABUS
14 Buzzer Interface with ARM ? 7 54
15 Relay interface with ARM? 7 57
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Expt. No. 1 STUDY OF ARM EVALUATION SYSTEM
Aim:
To study the building blocks of ARM7 system, its features, pin configuration and the components
required for functioning of ARM controller.
Architecture Overview:
A RISC-based computer design approach means ARM processors require significantly fewer transistors
than typical processors in average computers. This approach reduces cost, heat and power usage. These
are desirable traits for light, portable, battery-powered devices (smart phones, laptops, tablet and notepad
computers), and other embedded systems. A simpler design facilitates more efficient multi-core CPUs and
higher core counts at lower cost, providing higher processing power and improved energy efficiency for
servers and supercomputers.
In 2005, about 98% of all mobile phones sold used at least one ARM processor. The low power
consumption of ARM processors has made them very popular: 37 billion ARM processors have been
produced as of 2013, up from 10 billion in 2008. The ARM architecture (32-bit) is the most widely used
architecture in mobile devices, and most popular 32-bit one in embedded systems.
According to ARM Holdings, in 2010 alone, producers of chips based on ARM architectures
reported shipments of 6.1 billion ARM based processors, representing 95% of smart phones, 35% of digital
televisions and set-top boxes and 10% of mobile computers. It is the most widely used 32-bit instruction set
architecture in terms of quantity produced.
LPC 2148:
LPC2148 is the widely used IC from ARM-7 family. It is manufactured by Philips and it is pre-loaded
with many inbuilt peripherals making it more efficient and a reliable option for the beginners as well as high
end application developer.




8 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Features of LPC214x series controllers:
1. 8 to 40 kB of on-chip static RAM and 32 to 512 kB of on-chip flash program memory.128 bit wide
interface/accelerator enables high speed 60 MHz operation.
2. In-System/In-Application Programming (ISP/IAP) via on-chip boot-loader software. Single flash sector or
full chip erase in 400 ms and programming of 256 bytes in 1ms.
3. Embedded ICE RT and Embedded Trace interfaces offer real-time debugging with the on-chip Real
Monitor software and high speed tracing of instruction execution.
4. USB 2.0 Full Speed compliant Device Controller with 2 kB of endpoint RAM. In addition, the LPC2146/8
provides 8 kB of on-chip RAM accessible to USB by DMA.
5. One or two (LPC2141/2 vs. LPC2144/6/8) 10-bit A/D converters provide a total of 6/14analog inputs, with
conversion times as low as 2.44 us per channel.
6. Single 10-bit D/A converter provides variable analog output.
7. Two 32-bit timers/external event counters (with four capture and four compare channels each), PWM unit
(six outputs) and watchdog.
8. Low power real-time clock with independent power and dedicated 32 kHz clock input.
9. Multiple serial interfaces including two UARTs (16C550), two Fast I2C-bus (400 kbit/s), SPI and SSP with
buffering and variable data length capabilities.
10. Vectored interrupt controller with configurable priorities and vector addresses.
11. Up to 45 of 5 V tolerant fast general purpose I/O pins in a tiny LQFP64 package.
12. Up to nine edge or level sensitive external interrupt pins available.
13. On-chip integrated oscillator operates with an external crystal in range from 1 MHz to30 MHz and with
an external oscillator up to 50 MHz
14. Power saving modes include Idle and Power-down.
15. Individual enable/disable of peripheral functions as well as peripheral clock scaling for additional power
optimization.
16. Processor wake-up from Power-down mode via external interrupt, USB, Brown-Out Detect (BOD) or
Real-Time Clock (RTC).




9 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


First Step- Hardware Requirement:
Pin configuration of LPC 2148.

Hardware requirement of LPC2148:
1. LPC2148 need minimum below listed hardware to work properly
2. Power Supply
3. Crystal Oscillator
4. Reset Circuit
5. RTC crystal oscillator
6. UART
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Power Supply:
LPC2148 works on 3.3 V power supply. LM 117 can be used for generating 3.3 V supply. However,
basic peripherals like LCD, ULN 2003 (Motor Driver IC) etc. works on 5V. So AC mains supply is converted
into 5V using below mentioned circuit and after that LM 117 is used to convert 5V into 3.3V.
Block diagram of power Supply

Transformer: It is used to step down 230V AC to 9V AC supply and provides isolation between power grids
and circuit.
Rectifier: It is used to convert AC supply into DC.
Filter: It is used to reduce ripple factor of DC output available from rectifier end.
Regulator: It is used to regulate DC supply output.

11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Circuit Diagram:

Regulator IC 7805 is used to provide fix 5V dc supply.
LM 117 is used for generating 3.3V supply from 5V.

12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Calculations:

From the datasheet of LM117

Taking R 2= 240?, we get R 1=392?
Reset Circuit:
Reset button is essential in a system to avoid programming pitfalls and manually bring back the system
to the initialization mode. MCP 130T is a special IC used for providing stable RESET signal to LPC 2148.


13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Oscillator Circuit:

The value of capacitors C20 & C21 depends upon the frequency of crystal Y3. General circuit and
its equivalent circuit is as shown below.

14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Recommended values are as shown in table:

UART:
LPC 2148 has inbuilt ISP which means we can program it within the system using serial
communication on COM0. It has also COM1 for serial communication. MAX 232/233 IC must be used for
voltage logic conversion. Related connections are as given below.

Once the above listed circuit design is ready, we are ready to go further.



15 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Result:
ARM Evaluation system and the configuration of LPC2148 has been studied fully. The minimal setup
required for the functioning of the ARM processor is studied.
Outcomes:
1. Able to understand the ARM controller, its basic components inside and its features.
2. Able to know the components required for the working of ARM LPC2148

Applications:
ARM controller LPC2148 is used in no. of devices such as
1. Smart phones
2. Net books
3. E Readers
4. Digital TV
5. Home Gateways


1. What are the basic units of ARM 7?
2. What is the address system supported by ARM?
3. Define - RISC
4. What are the instructions used to access the memory in ARM?
5. What are the basic units of Microprocessor?
6. What is an Instruction?
7. What is clock cycle?
8. Define - Pipelining
9. What is cache miss?
10. What is meant by memory mapped I/O?
11. Define ? interrupt
12. What is meant by Exception?
13. What is meant by little ? endian mode?
14. What is meant by big ? endian mode?
15. What is the function of CPSR?
16. What is register - indirect addressing?
Viva-voce




16 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 2 ANALOG TO DIGITAL CONVERTOR
INTERFACING
Aim:
To write an embedded c program for interfacing an on chip ADC with LPC2148 ARM processor and
convert the given input voltage into corresponding decimal values.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. PC
Theory:
Analog to Digital converter (ADC) is a device that converts continuously varying analog signals from
instruments that monitor such conditions as movement, temperature, sound, etc., into binary code for the
computer. It may be either a single chip or can be one circuit within a chip. Analog to Digital conversion is
the process of changing continuously varying data, such as voltage, current, or shaft rotation, into discrete
digital quantities that represent the magnitude of the data compared to a standard or reference at the
moment the conversion is made. According to the method of conversion, ADCs can be classified into
Direct-Conversion ADCs, Successive Approximation ADCs, Integrating ADC and Sigma-Delta ADCs.
The LPC 2148 has 10-bit successive approximation analog to digital converter. Basic clocking for the
A/D converters is provided by the VPB clock. A programmable divider is included in each converter, to
scale this clock to the 4.5 MHz (max) clock needed by the successive approximation process. A fully
accurate conversion requires 11 of these clocks. The ADC cell can measure the voltage on any of the ADC
input signals. It is noted that these analog inputs are always connected to their pins, even if the Pin function
Select register assigns them to port pins. A simple self-test of the ADC can be done by driving these pins
as port outputs.



17 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Circuit diagram:




18 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus, an embedded c program for interfacing on-chip ADC with ARM processor is written and
executed. The decimal values of the converted voltage are seen in the WinXTalk screen.
Outcome:
Able to interface A/D convertors with ARM system and check its working by connecting an analog
quantity as input.
Applications:
1. ADC used in MODEM for converting analog signals to digital.
2. A fast video ADC in TV tuner cards
3. ADC used in digital storage oscilloscopes
4. Used in music reproduction technology.
5. Used in DSP if input is analog


1. What are the ADC operating modes in LPC2148?
2. What is meant by conversion time?
3. Why are internal ADCs preferred over external ADCs?
4. Why has 16-bit ADC more resolution than from 10-bit and 8-bit ADC?
5. What are ADC & its Resolution?
6. What is Burst conversion mode?
7. What is the function of A/D Control Register?
8. What is the function of A/D Global Data Register?
9. What is the function of A/D Status Register?
10. What is analog-to-digital (ADC) conversion error?
11. What is the function of Sample-and-hold circuits in analog-to digital converters?
12. What is the disadvantage of the flash analog-to digital converter?
Viva-voce




19 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 3 GENERATION OF RAMP AND SQUARE
WAVE USING ON-CHIP DAC
Aim:
To write and execute an embedded c program to generate ramp wave and square wave using on-chip
DAC of LPC2148 ARM controller.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
A digital-to-analog converter is a device for converting a digital signal into an analog signal (current or
voltage). Digital-to-Analog Converters are the interface between the abstract digital world and the analog
real world. Simple switches, a network of resistors, current sources or capacitors may be used to
implement this conversion. A DAC inputs a binary number and outputs an analog voltage or current signal.
The Microchip Technology Inc. MCP4921 is 2.7 ? 5.5V, low-power, 12-Bit Digital-to-Analog Converter
(DAC) with SPI interface. The MCP4921 DAC provides high accuracy and low noise performance for
industrial applications where calibration or compensation of signals is required. With an SPI connection
there is always one master device (usually a microcontroller) which controls the peripheral devices.
Typically there are three lines common to all the devices,
Master In Slave Out (MISO) ? The Slave line for sending data to the master,
Master Out Slave In (MOSI) ? The Master line for sending data to the peripherals,
Serial Clock (SCK) ? The clock pulses which synchronize data transmission generated by the
master and slave
Slave Select pin ? the pin on each device that the master can use to enable and disable specific
devices. When a device Slave Select pin is low, it communicates with the master. When it is high, it ignores
the master. In SPI, the clock signal is controlled by the master device LPC2148. All data is clocked in and
out using this pin. These lines need to be connected to the relevant pins on the LPC21xx processor. Any
unused GIO pin can be used for CS, instead pull this pin high. Conversion speed is the time it takes for the



20 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

DAC to provide an analog output when the digital input word is changed. The MCP4291 DAC ? SPI
connections with LPC21xx have four I/O lines (P0.4 ? P0.7) required. The analog output is generated by
using these four lines.
Circuit diagram:


Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the embedded c programs for generating ramp wave and square wave using ARM LPC2148 are
written and executed successfully and the waveforms are viewed in oscilloscope.
Outcome:
Able to program the DAC in-built inside the ARM controller and get the waveforms using it.




21 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications :
1. DAC used in Audio amplifier.
2. Video encoder
3. Display electronics
4. Data Acquistion systems
5. Motor control



1. What are the features of LPC2148 DAC?
2. What is the function of DAC register?
3. Which pin provides a voltage reference level for the D/A converter?
4. What are the applications of DAC in signal processing applications?
5. What is GIO?
6. What is the resolution of a digital-to-analog converter (DAC)?
7. What is the major advantage of the R/2R ladder digital-to-analog (DAC), as compared to a binary-
weighted digital-to-analog DAC converter?
8. What is the resolution of a 0?5 V 6-bit digital-to-analog converter (DAC) ?
9. What are DAC configurations?
10. What are the different types of DAC Circuits?
11. What are the Limitations of the Binary Weighted DAC?
12. What are the General DAC Characteristics?
13. Define reference voltage in DAC.
14. What is full scale voltage?
15. What is settling time?
VIVA-VOCE




22 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 4 LED DIMMING USING PWM

Aim:
To write an embedded c program for implementing PWM using ARM controller and verify the same by
dimming of LEDs.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
LPC2148 supports 2 types of PWM:
1) Single Edge PWM ? Pulse starts with new Period i.e pulse is always at the beginning
2) Double Edge PWM ? Pulse can be anywhere within the Period
A PWM block, like a Timer block , has a Timer Counter and an associated Pre-scale Register along
with Match Registers. These work exactly the same way as in the case of Timers. Match Registers 1 to 6
(except 0) are pinned on LPC214x i.e. the corresponding outputs are diverted to actual Pins on LPC214x
MCU. The PWM function must be selected for these Pins to get the PWM output.
The basic setup is to simply replace Servo by a LED and no external 5V source is needed. The
anode of LED is connected to P0.0 and cathode to ground. Pulse Widths corresponding to the switches
connected to P0.1/2/3/4 will be 2.5ms/5ms/7.5ms/10ms respectively. As the Pulse Width Increases LED
will keep on getting brighter and the reverse will happen if Pulse Width is decreased.



23 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus embedded c program for implementing Pulse Width Modulation is written and executed and
output has been verified in LED display.
Outcome:
Able to implement PWM using the ARM controller and verify the same in the form of dimming of
LEDS.



24 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Applications :
1. In Visual signals to covey a message
2. Illumination where light is reflected from objects
3. In Narrow band sensors



1. What factors determine the LED dimming performance?
2. What is meant by analog dimming?
3. What is flickering effect?
4. What is the factor determines dimming of the LED
5. Why Silicon is not suitable for fabrication of light-emitting diodes?
6. Why Silicon diode is less suited for low voltage rectifier operation?
7. What is the principle of zener diode?
8. What are the materials used to make LED?
9. What type of diodes is used in FM receivers?
10. Which diode suffers an avalanche breakdown?
11. What happens if the junction temperature of LED is increased?
12. How a transfer characteristic of a diode does is related?
13. What is the requirement of a clipping action of a diode?
14. What type of rectifier circuit requires four diodes?
15. Why are the pulse width modulated outputs required in most of the applications?
16. How do the variations in an average value get affected by PWM period?
17. Name the common formats available for LED display.
18. What are the types of seven segment display?
19. What is PWM?
20. What are the applications of PWM?

Viva-voce




25 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 5 INTERFACING REAL TIME CLOCK
AND SERIAL PORT
Aim:
To write and execute an embedded c program to interface DS1307 RTC using I2C protocol with ARM
controller
Apparatus Required:
1. LPC2148 ARM development board
2. Stepper motor
3. Interfacing cables
4. PC
Theory:
A clock, which is based on the interrupts at preset intervals, is Real Time Clock (RTC). An interrupt
service routine executes on each timeout (overflow) of this clock. This timing device once started never
resets or never reloaded with another value. Once it is set, it is not modified later. It is used in a system to
save the time and date.













26 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the program for interfacing real time clock with ARM controller is written and executed and the
date and time are verified on the screen.
Outcome:
Able to interface real time clock DS1307 with ARM controller and thereby display date and time
Applications :
1. I2C In ARM and PIC microcontrollers
2. Used as serial communication protocol with MASTER and SLAVE operation.

27 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
27 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00




1. What is I2C and how does it work?
2. What are the features of I2C in LPC2148 ARM7 microcontroller?
3. What is the function of I2C0CONSET register?
4. What is I2C0STAT?
5. What is the function of I2C0 Data Register?
6. What is RTC?
7. List the advantages of RTC
8. Through which port the date and time is displayed in RTC?
9. What is a serial port?
10. List the registers used to transfer data in serial port.
11. List the modes used for data transmission.
12. What is a simplex mode?
13. Which pin is used to transmit a character?
14. What is the baud rate of serial port?
15. What is the disadvantage of RS-232C?














Viva-voce




28 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 6 INTERFACING KEYPAD AND LCD

Aim:
To write an embedded c program to interface 4 x 4 matrix keypad with ARM processor and display the
pressed key in an LCD.
Apparatus Required:
1. LPC2148 ARM development board
2. Interfacing cables
3. PC
Theory:

In matrix keypad, keys are connected in rows and columns. When any switch is pressed, rows and
columns come into contact, which is that detected by controller to identify which key has been pressed. A
4?4 matrix keypad consists of 4 rows and 4 columns. There is a switch connecting each row and column.
So the combinations of rows and columns make up the 16 inputs.Initially all the switches are open (not
connected). When any one button is pressed, the switch is closed (connected),hence there is a connection
between the row and column. The first 4 pins are connected to the column as INPUT. The other 4 pins are
connected to the row as OUTPUT. Matrix keypad is a good substitution to normal push button.









FirstRanker.com - FirstRanker's Choice
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00






?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING

VII SEMESTER - R 2013

EC6711 ? EMBEDDED LABORATORY






Name : _______________________________________
Register No : _______________________________________
Section : _______________________________________
LABORATORY MANUAL



2 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00




is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and
training.

? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different
levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on
heart and soul
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

To impart professional education integrated with human values to the younger generation, so as to
shape them as proficient and dedicated engineers, capable of providing comprehensive solutions to the
challenges in deploying technology for the service of humanity

? To educate the students with the state-of-art technologies to meet the growing challenges of the
electronics industry
? To carry out research through continuous interaction with research institutes and industry, on
advances in communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning,
innovation and ethical practices
VISION
VISION
MISSION
MISSION



3 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

PROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To provide students with a solid foundation in Mathematics, Science and fundamentals of
engineering, enabling them to apply, to find solutions for engineering problems and use this knowledge
to acquire higher education
2. Core Competence
To train the students in Electronics and Communication technologies so that they apply their
knowledge and training to compare, and to analyze various engineering industrial problems to find
solutions
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice which
enables them to find solutions for the real time problems in industry, and to design products
4. Professionalism
To inculcate professional and effective communication skills, leadership qualities and team spirit in
the students to make them multi-faceted personalities and develop their ability to relate engineering
issues to broader social context
5. Lifelong Learning/Ethics
To demonstrate and practice ethical and professional responsibilities in the industry and society in
the large, through commitment and lifelong learning needed for successful professional career


4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
PROGRAMME OUTCOMES (POs)
a) To demonstrate and apply knowledge of Mathematics, Science and engineering fundamentals in
Electronics and Communication Engineering field
b) To design a component, a system or a process to meet the specific needs within the realistic
constraints such as economics, environment, ethics, health, safety and manufacturability
c) To demonstrate the competency to use software tools for computation, simulation and testing of electronics
and communication engineering circuits
d) To identify, formulate and solve electronic and communication engineering problems
e) To demonstrate an ability to visualize and work on laboratory and multidisciplinary tasks
f) To function as a member or a leader in multidisciplinary activities
g) To communicate in verbal and written form with fellow engineers and society at large
h) To understand the impact of Electronics and Communication Engineering in the society and demonstrate
awareness of contemporary issues and commitment to give solutions exhibiting social responsibility
i) To demonstrate professional & ethical responsibilities
j) To exhibit confidence in self-education and ability for lifelong learning
k) To participate and succeed in competitive exams


5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
SYLLABUS

? Learn the working of ARM processor
? Understand the Building Blocks of Embedded Systems
? Learn the concept of memory map and memory interface
? Know the characteristics of Real Time Systems
? Write programs to interface memory, I/Os with processor
? Study the interrupt performance
LIST OF EXPERIMENTS:
1. Study of ARM evaluation system
2. Interfacing ADC and DAC
3. Interfacing LED and PWM
4. Interfacing real time clock and serial port
5. Interfacing keyboard and LCD
6. Interfacing EPROM and interrupt
7. Mailbox
8. Interrupt performance characteristics of ARM and FPGA
9. Flashing of LEDS
10. Interfacing stepper motor and temperature sensor
11. Implementing zigbee protocol with ARM



? Write programs in ARM for a specific Application
? Interface memory and Write programs related to memory operations
? Interface A/D and D/A convertors with ARM system
? Analyze the performance of interrupt
? Write programmes for interfacing keyboard, display, motor and sensor.
? Formulate a mini project using embedded system
COURSE OBJECTIVES
COURSE OUTCOMES
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
CONTENTS
Sl. No. Name of the Experiment Page No.
CYCLE 1 ? EXPERIMENTS
1
Study of ARM evaluation system 7
2
Analog to Digital Convertor interfacing 16
3
Generation of ramp and square wave using on-Chip DAC 19
4
LED dimming using PWM 22
5
Interfacing real time clock and serial port 25
6
Interfacing keypad and LCD 28
7
Interfacing EPROM and interrupt 31
CYCLE 2 ? EXPERIMENTS
8 Implementation of Mailbox Function using LPC 2148 35
9 Interrupt Performance Characteristics of Arm and FPGA 37
10 Flashing of LEDs 40
11 Stepper Motor Interface with ARM ? 7 LPC2148 43
12 LM35 Temperature Sensor Interface with ARM ? 7 LPC2148 47
13
Implementation of Wireless Communication Protocol using ZIGBEE Wireless
Module
50
ADDITIONAL EXPERIMENTS BEYOND THE SYYLABUS
14 Buzzer Interface with ARM ? 7 54
15 Relay interface with ARM? 7 57
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Expt. No. 1 STUDY OF ARM EVALUATION SYSTEM
Aim:
To study the building blocks of ARM7 system, its features, pin configuration and the components
required for functioning of ARM controller.
Architecture Overview:
A RISC-based computer design approach means ARM processors require significantly fewer transistors
than typical processors in average computers. This approach reduces cost, heat and power usage. These
are desirable traits for light, portable, battery-powered devices (smart phones, laptops, tablet and notepad
computers), and other embedded systems. A simpler design facilitates more efficient multi-core CPUs and
higher core counts at lower cost, providing higher processing power and improved energy efficiency for
servers and supercomputers.
In 2005, about 98% of all mobile phones sold used at least one ARM processor. The low power
consumption of ARM processors has made them very popular: 37 billion ARM processors have been
produced as of 2013, up from 10 billion in 2008. The ARM architecture (32-bit) is the most widely used
architecture in mobile devices, and most popular 32-bit one in embedded systems.
According to ARM Holdings, in 2010 alone, producers of chips based on ARM architectures
reported shipments of 6.1 billion ARM based processors, representing 95% of smart phones, 35% of digital
televisions and set-top boxes and 10% of mobile computers. It is the most widely used 32-bit instruction set
architecture in terms of quantity produced.
LPC 2148:
LPC2148 is the widely used IC from ARM-7 family. It is manufactured by Philips and it is pre-loaded
with many inbuilt peripherals making it more efficient and a reliable option for the beginners as well as high
end application developer.




8 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Features of LPC214x series controllers:
1. 8 to 40 kB of on-chip static RAM and 32 to 512 kB of on-chip flash program memory.128 bit wide
interface/accelerator enables high speed 60 MHz operation.
2. In-System/In-Application Programming (ISP/IAP) via on-chip boot-loader software. Single flash sector or
full chip erase in 400 ms and programming of 256 bytes in 1ms.
3. Embedded ICE RT and Embedded Trace interfaces offer real-time debugging with the on-chip Real
Monitor software and high speed tracing of instruction execution.
4. USB 2.0 Full Speed compliant Device Controller with 2 kB of endpoint RAM. In addition, the LPC2146/8
provides 8 kB of on-chip RAM accessible to USB by DMA.
5. One or two (LPC2141/2 vs. LPC2144/6/8) 10-bit A/D converters provide a total of 6/14analog inputs, with
conversion times as low as 2.44 us per channel.
6. Single 10-bit D/A converter provides variable analog output.
7. Two 32-bit timers/external event counters (with four capture and four compare channels each), PWM unit
(six outputs) and watchdog.
8. Low power real-time clock with independent power and dedicated 32 kHz clock input.
9. Multiple serial interfaces including two UARTs (16C550), two Fast I2C-bus (400 kbit/s), SPI and SSP with
buffering and variable data length capabilities.
10. Vectored interrupt controller with configurable priorities and vector addresses.
11. Up to 45 of 5 V tolerant fast general purpose I/O pins in a tiny LQFP64 package.
12. Up to nine edge or level sensitive external interrupt pins available.
13. On-chip integrated oscillator operates with an external crystal in range from 1 MHz to30 MHz and with
an external oscillator up to 50 MHz
14. Power saving modes include Idle and Power-down.
15. Individual enable/disable of peripheral functions as well as peripheral clock scaling for additional power
optimization.
16. Processor wake-up from Power-down mode via external interrupt, USB, Brown-Out Detect (BOD) or
Real-Time Clock (RTC).




9 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


First Step- Hardware Requirement:
Pin configuration of LPC 2148.

Hardware requirement of LPC2148:
1. LPC2148 need minimum below listed hardware to work properly
2. Power Supply
3. Crystal Oscillator
4. Reset Circuit
5. RTC crystal oscillator
6. UART
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Power Supply:
LPC2148 works on 3.3 V power supply. LM 117 can be used for generating 3.3 V supply. However,
basic peripherals like LCD, ULN 2003 (Motor Driver IC) etc. works on 5V. So AC mains supply is converted
into 5V using below mentioned circuit and after that LM 117 is used to convert 5V into 3.3V.
Block diagram of power Supply

Transformer: It is used to step down 230V AC to 9V AC supply and provides isolation between power grids
and circuit.
Rectifier: It is used to convert AC supply into DC.
Filter: It is used to reduce ripple factor of DC output available from rectifier end.
Regulator: It is used to regulate DC supply output.

11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Circuit Diagram:

Regulator IC 7805 is used to provide fix 5V dc supply.
LM 117 is used for generating 3.3V supply from 5V.

12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Calculations:

From the datasheet of LM117

Taking R 2= 240?, we get R 1=392?
Reset Circuit:
Reset button is essential in a system to avoid programming pitfalls and manually bring back the system
to the initialization mode. MCP 130T is a special IC used for providing stable RESET signal to LPC 2148.


13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Oscillator Circuit:

The value of capacitors C20 & C21 depends upon the frequency of crystal Y3. General circuit and
its equivalent circuit is as shown below.

14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Recommended values are as shown in table:

UART:
LPC 2148 has inbuilt ISP which means we can program it within the system using serial
communication on COM0. It has also COM1 for serial communication. MAX 232/233 IC must be used for
voltage logic conversion. Related connections are as given below.

Once the above listed circuit design is ready, we are ready to go further.



15 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Result:
ARM Evaluation system and the configuration of LPC2148 has been studied fully. The minimal setup
required for the functioning of the ARM processor is studied.
Outcomes:
1. Able to understand the ARM controller, its basic components inside and its features.
2. Able to know the components required for the working of ARM LPC2148

Applications:
ARM controller LPC2148 is used in no. of devices such as
1. Smart phones
2. Net books
3. E Readers
4. Digital TV
5. Home Gateways


1. What are the basic units of ARM 7?
2. What is the address system supported by ARM?
3. Define - RISC
4. What are the instructions used to access the memory in ARM?
5. What are the basic units of Microprocessor?
6. What is an Instruction?
7. What is clock cycle?
8. Define - Pipelining
9. What is cache miss?
10. What is meant by memory mapped I/O?
11. Define ? interrupt
12. What is meant by Exception?
13. What is meant by little ? endian mode?
14. What is meant by big ? endian mode?
15. What is the function of CPSR?
16. What is register - indirect addressing?
Viva-voce




16 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 2 ANALOG TO DIGITAL CONVERTOR
INTERFACING
Aim:
To write an embedded c program for interfacing an on chip ADC with LPC2148 ARM processor and
convert the given input voltage into corresponding decimal values.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. PC
Theory:
Analog to Digital converter (ADC) is a device that converts continuously varying analog signals from
instruments that monitor such conditions as movement, temperature, sound, etc., into binary code for the
computer. It may be either a single chip or can be one circuit within a chip. Analog to Digital conversion is
the process of changing continuously varying data, such as voltage, current, or shaft rotation, into discrete
digital quantities that represent the magnitude of the data compared to a standard or reference at the
moment the conversion is made. According to the method of conversion, ADCs can be classified into
Direct-Conversion ADCs, Successive Approximation ADCs, Integrating ADC and Sigma-Delta ADCs.
The LPC 2148 has 10-bit successive approximation analog to digital converter. Basic clocking for the
A/D converters is provided by the VPB clock. A programmable divider is included in each converter, to
scale this clock to the 4.5 MHz (max) clock needed by the successive approximation process. A fully
accurate conversion requires 11 of these clocks. The ADC cell can measure the voltage on any of the ADC
input signals. It is noted that these analog inputs are always connected to their pins, even if the Pin function
Select register assigns them to port pins. A simple self-test of the ADC can be done by driving these pins
as port outputs.



17 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Circuit diagram:




18 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus, an embedded c program for interfacing on-chip ADC with ARM processor is written and
executed. The decimal values of the converted voltage are seen in the WinXTalk screen.
Outcome:
Able to interface A/D convertors with ARM system and check its working by connecting an analog
quantity as input.
Applications:
1. ADC used in MODEM for converting analog signals to digital.
2. A fast video ADC in TV tuner cards
3. ADC used in digital storage oscilloscopes
4. Used in music reproduction technology.
5. Used in DSP if input is analog


1. What are the ADC operating modes in LPC2148?
2. What is meant by conversion time?
3. Why are internal ADCs preferred over external ADCs?
4. Why has 16-bit ADC more resolution than from 10-bit and 8-bit ADC?
5. What are ADC & its Resolution?
6. What is Burst conversion mode?
7. What is the function of A/D Control Register?
8. What is the function of A/D Global Data Register?
9. What is the function of A/D Status Register?
10. What is analog-to-digital (ADC) conversion error?
11. What is the function of Sample-and-hold circuits in analog-to digital converters?
12. What is the disadvantage of the flash analog-to digital converter?
Viva-voce




19 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 3 GENERATION OF RAMP AND SQUARE
WAVE USING ON-CHIP DAC
Aim:
To write and execute an embedded c program to generate ramp wave and square wave using on-chip
DAC of LPC2148 ARM controller.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
A digital-to-analog converter is a device for converting a digital signal into an analog signal (current or
voltage). Digital-to-Analog Converters are the interface between the abstract digital world and the analog
real world. Simple switches, a network of resistors, current sources or capacitors may be used to
implement this conversion. A DAC inputs a binary number and outputs an analog voltage or current signal.
The Microchip Technology Inc. MCP4921 is 2.7 ? 5.5V, low-power, 12-Bit Digital-to-Analog Converter
(DAC) with SPI interface. The MCP4921 DAC provides high accuracy and low noise performance for
industrial applications where calibration or compensation of signals is required. With an SPI connection
there is always one master device (usually a microcontroller) which controls the peripheral devices.
Typically there are three lines common to all the devices,
Master In Slave Out (MISO) ? The Slave line for sending data to the master,
Master Out Slave In (MOSI) ? The Master line for sending data to the peripherals,
Serial Clock (SCK) ? The clock pulses which synchronize data transmission generated by the
master and slave
Slave Select pin ? the pin on each device that the master can use to enable and disable specific
devices. When a device Slave Select pin is low, it communicates with the master. When it is high, it ignores
the master. In SPI, the clock signal is controlled by the master device LPC2148. All data is clocked in and
out using this pin. These lines need to be connected to the relevant pins on the LPC21xx processor. Any
unused GIO pin can be used for CS, instead pull this pin high. Conversion speed is the time it takes for the



20 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

DAC to provide an analog output when the digital input word is changed. The MCP4291 DAC ? SPI
connections with LPC21xx have four I/O lines (P0.4 ? P0.7) required. The analog output is generated by
using these four lines.
Circuit diagram:


Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the embedded c programs for generating ramp wave and square wave using ARM LPC2148 are
written and executed successfully and the waveforms are viewed in oscilloscope.
Outcome:
Able to program the DAC in-built inside the ARM controller and get the waveforms using it.




21 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications :
1. DAC used in Audio amplifier.
2. Video encoder
3. Display electronics
4. Data Acquistion systems
5. Motor control



1. What are the features of LPC2148 DAC?
2. What is the function of DAC register?
3. Which pin provides a voltage reference level for the D/A converter?
4. What are the applications of DAC in signal processing applications?
5. What is GIO?
6. What is the resolution of a digital-to-analog converter (DAC)?
7. What is the major advantage of the R/2R ladder digital-to-analog (DAC), as compared to a binary-
weighted digital-to-analog DAC converter?
8. What is the resolution of a 0?5 V 6-bit digital-to-analog converter (DAC) ?
9. What are DAC configurations?
10. What are the different types of DAC Circuits?
11. What are the Limitations of the Binary Weighted DAC?
12. What are the General DAC Characteristics?
13. Define reference voltage in DAC.
14. What is full scale voltage?
15. What is settling time?
VIVA-VOCE




22 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 4 LED DIMMING USING PWM

Aim:
To write an embedded c program for implementing PWM using ARM controller and verify the same by
dimming of LEDs.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
LPC2148 supports 2 types of PWM:
1) Single Edge PWM ? Pulse starts with new Period i.e pulse is always at the beginning
2) Double Edge PWM ? Pulse can be anywhere within the Period
A PWM block, like a Timer block , has a Timer Counter and an associated Pre-scale Register along
with Match Registers. These work exactly the same way as in the case of Timers. Match Registers 1 to 6
(except 0) are pinned on LPC214x i.e. the corresponding outputs are diverted to actual Pins on LPC214x
MCU. The PWM function must be selected for these Pins to get the PWM output.
The basic setup is to simply replace Servo by a LED and no external 5V source is needed. The
anode of LED is connected to P0.0 and cathode to ground. Pulse Widths corresponding to the switches
connected to P0.1/2/3/4 will be 2.5ms/5ms/7.5ms/10ms respectively. As the Pulse Width Increases LED
will keep on getting brighter and the reverse will happen if Pulse Width is decreased.



23 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus embedded c program for implementing Pulse Width Modulation is written and executed and
output has been verified in LED display.
Outcome:
Able to implement PWM using the ARM controller and verify the same in the form of dimming of
LEDS.



24 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Applications :
1. In Visual signals to covey a message
2. Illumination where light is reflected from objects
3. In Narrow band sensors



1. What factors determine the LED dimming performance?
2. What is meant by analog dimming?
3. What is flickering effect?
4. What is the factor determines dimming of the LED
5. Why Silicon is not suitable for fabrication of light-emitting diodes?
6. Why Silicon diode is less suited for low voltage rectifier operation?
7. What is the principle of zener diode?
8. What are the materials used to make LED?
9. What type of diodes is used in FM receivers?
10. Which diode suffers an avalanche breakdown?
11. What happens if the junction temperature of LED is increased?
12. How a transfer characteristic of a diode does is related?
13. What is the requirement of a clipping action of a diode?
14. What type of rectifier circuit requires four diodes?
15. Why are the pulse width modulated outputs required in most of the applications?
16. How do the variations in an average value get affected by PWM period?
17. Name the common formats available for LED display.
18. What are the types of seven segment display?
19. What is PWM?
20. What are the applications of PWM?

Viva-voce




25 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 5 INTERFACING REAL TIME CLOCK
AND SERIAL PORT
Aim:
To write and execute an embedded c program to interface DS1307 RTC using I2C protocol with ARM
controller
Apparatus Required:
1. LPC2148 ARM development board
2. Stepper motor
3. Interfacing cables
4. PC
Theory:
A clock, which is based on the interrupts at preset intervals, is Real Time Clock (RTC). An interrupt
service routine executes on each timeout (overflow) of this clock. This timing device once started never
resets or never reloaded with another value. Once it is set, it is not modified later. It is used in a system to
save the time and date.













26 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the program for interfacing real time clock with ARM controller is written and executed and the
date and time are verified on the screen.
Outcome:
Able to interface real time clock DS1307 with ARM controller and thereby display date and time
Applications :
1. I2C In ARM and PIC microcontrollers
2. Used as serial communication protocol with MASTER and SLAVE operation.

27 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
27 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00




1. What is I2C and how does it work?
2. What are the features of I2C in LPC2148 ARM7 microcontroller?
3. What is the function of I2C0CONSET register?
4. What is I2C0STAT?
5. What is the function of I2C0 Data Register?
6. What is RTC?
7. List the advantages of RTC
8. Through which port the date and time is displayed in RTC?
9. What is a serial port?
10. List the registers used to transfer data in serial port.
11. List the modes used for data transmission.
12. What is a simplex mode?
13. Which pin is used to transmit a character?
14. What is the baud rate of serial port?
15. What is the disadvantage of RS-232C?














Viva-voce




28 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 6 INTERFACING KEYPAD AND LCD

Aim:
To write an embedded c program to interface 4 x 4 matrix keypad with ARM processor and display the
pressed key in an LCD.
Apparatus Required:
1. LPC2148 ARM development board
2. Interfacing cables
3. PC
Theory:

In matrix keypad, keys are connected in rows and columns. When any switch is pressed, rows and
columns come into contact, which is that detected by controller to identify which key has been pressed. A
4?4 matrix keypad consists of 4 rows and 4 columns. There is a switch connecting each row and column.
So the combinations of rows and columns make up the 16 inputs.Initially all the switches are open (not
connected). When any one button is pressed, the switch is closed (connected),hence there is a connection
between the row and column. The first 4 pins are connected to the column as INPUT. The other 4 pins are
connected to the row as OUTPUT. Matrix keypad is a good substitution to normal push button.












29 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Circuit Diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus program for interfacing matrix keypad with ARM controller is written and executed and the key
pressed is seen in the LCD.
FirstRanker.com - FirstRanker's Choice
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00






?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING

VII SEMESTER - R 2013

EC6711 ? EMBEDDED LABORATORY






Name : _______________________________________
Register No : _______________________________________
Section : _______________________________________
LABORATORY MANUAL



2 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00




is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and
training.

? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different
levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on
heart and soul
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

To impart professional education integrated with human values to the younger generation, so as to
shape them as proficient and dedicated engineers, capable of providing comprehensive solutions to the
challenges in deploying technology for the service of humanity

? To educate the students with the state-of-art technologies to meet the growing challenges of the
electronics industry
? To carry out research through continuous interaction with research institutes and industry, on
advances in communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning,
innovation and ethical practices
VISION
VISION
MISSION
MISSION



3 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

PROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To provide students with a solid foundation in Mathematics, Science and fundamentals of
engineering, enabling them to apply, to find solutions for engineering problems and use this knowledge
to acquire higher education
2. Core Competence
To train the students in Electronics and Communication technologies so that they apply their
knowledge and training to compare, and to analyze various engineering industrial problems to find
solutions
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice which
enables them to find solutions for the real time problems in industry, and to design products
4. Professionalism
To inculcate professional and effective communication skills, leadership qualities and team spirit in
the students to make them multi-faceted personalities and develop their ability to relate engineering
issues to broader social context
5. Lifelong Learning/Ethics
To demonstrate and practice ethical and professional responsibilities in the industry and society in
the large, through commitment and lifelong learning needed for successful professional career


4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
PROGRAMME OUTCOMES (POs)
a) To demonstrate and apply knowledge of Mathematics, Science and engineering fundamentals in
Electronics and Communication Engineering field
b) To design a component, a system or a process to meet the specific needs within the realistic
constraints such as economics, environment, ethics, health, safety and manufacturability
c) To demonstrate the competency to use software tools for computation, simulation and testing of electronics
and communication engineering circuits
d) To identify, formulate and solve electronic and communication engineering problems
e) To demonstrate an ability to visualize and work on laboratory and multidisciplinary tasks
f) To function as a member or a leader in multidisciplinary activities
g) To communicate in verbal and written form with fellow engineers and society at large
h) To understand the impact of Electronics and Communication Engineering in the society and demonstrate
awareness of contemporary issues and commitment to give solutions exhibiting social responsibility
i) To demonstrate professional & ethical responsibilities
j) To exhibit confidence in self-education and ability for lifelong learning
k) To participate and succeed in competitive exams


5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
SYLLABUS

? Learn the working of ARM processor
? Understand the Building Blocks of Embedded Systems
? Learn the concept of memory map and memory interface
? Know the characteristics of Real Time Systems
? Write programs to interface memory, I/Os with processor
? Study the interrupt performance
LIST OF EXPERIMENTS:
1. Study of ARM evaluation system
2. Interfacing ADC and DAC
3. Interfacing LED and PWM
4. Interfacing real time clock and serial port
5. Interfacing keyboard and LCD
6. Interfacing EPROM and interrupt
7. Mailbox
8. Interrupt performance characteristics of ARM and FPGA
9. Flashing of LEDS
10. Interfacing stepper motor and temperature sensor
11. Implementing zigbee protocol with ARM



? Write programs in ARM for a specific Application
? Interface memory and Write programs related to memory operations
? Interface A/D and D/A convertors with ARM system
? Analyze the performance of interrupt
? Write programmes for interfacing keyboard, display, motor and sensor.
? Formulate a mini project using embedded system
COURSE OBJECTIVES
COURSE OUTCOMES
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
CONTENTS
Sl. No. Name of the Experiment Page No.
CYCLE 1 ? EXPERIMENTS
1
Study of ARM evaluation system 7
2
Analog to Digital Convertor interfacing 16
3
Generation of ramp and square wave using on-Chip DAC 19
4
LED dimming using PWM 22
5
Interfacing real time clock and serial port 25
6
Interfacing keypad and LCD 28
7
Interfacing EPROM and interrupt 31
CYCLE 2 ? EXPERIMENTS
8 Implementation of Mailbox Function using LPC 2148 35
9 Interrupt Performance Characteristics of Arm and FPGA 37
10 Flashing of LEDs 40
11 Stepper Motor Interface with ARM ? 7 LPC2148 43
12 LM35 Temperature Sensor Interface with ARM ? 7 LPC2148 47
13
Implementation of Wireless Communication Protocol using ZIGBEE Wireless
Module
50
ADDITIONAL EXPERIMENTS BEYOND THE SYYLABUS
14 Buzzer Interface with ARM ? 7 54
15 Relay interface with ARM? 7 57
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Expt. No. 1 STUDY OF ARM EVALUATION SYSTEM
Aim:
To study the building blocks of ARM7 system, its features, pin configuration and the components
required for functioning of ARM controller.
Architecture Overview:
A RISC-based computer design approach means ARM processors require significantly fewer transistors
than typical processors in average computers. This approach reduces cost, heat and power usage. These
are desirable traits for light, portable, battery-powered devices (smart phones, laptops, tablet and notepad
computers), and other embedded systems. A simpler design facilitates more efficient multi-core CPUs and
higher core counts at lower cost, providing higher processing power and improved energy efficiency for
servers and supercomputers.
In 2005, about 98% of all mobile phones sold used at least one ARM processor. The low power
consumption of ARM processors has made them very popular: 37 billion ARM processors have been
produced as of 2013, up from 10 billion in 2008. The ARM architecture (32-bit) is the most widely used
architecture in mobile devices, and most popular 32-bit one in embedded systems.
According to ARM Holdings, in 2010 alone, producers of chips based on ARM architectures
reported shipments of 6.1 billion ARM based processors, representing 95% of smart phones, 35% of digital
televisions and set-top boxes and 10% of mobile computers. It is the most widely used 32-bit instruction set
architecture in terms of quantity produced.
LPC 2148:
LPC2148 is the widely used IC from ARM-7 family. It is manufactured by Philips and it is pre-loaded
with many inbuilt peripherals making it more efficient and a reliable option for the beginners as well as high
end application developer.




8 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Features of LPC214x series controllers:
1. 8 to 40 kB of on-chip static RAM and 32 to 512 kB of on-chip flash program memory.128 bit wide
interface/accelerator enables high speed 60 MHz operation.
2. In-System/In-Application Programming (ISP/IAP) via on-chip boot-loader software. Single flash sector or
full chip erase in 400 ms and programming of 256 bytes in 1ms.
3. Embedded ICE RT and Embedded Trace interfaces offer real-time debugging with the on-chip Real
Monitor software and high speed tracing of instruction execution.
4. USB 2.0 Full Speed compliant Device Controller with 2 kB of endpoint RAM. In addition, the LPC2146/8
provides 8 kB of on-chip RAM accessible to USB by DMA.
5. One or two (LPC2141/2 vs. LPC2144/6/8) 10-bit A/D converters provide a total of 6/14analog inputs, with
conversion times as low as 2.44 us per channel.
6. Single 10-bit D/A converter provides variable analog output.
7. Two 32-bit timers/external event counters (with four capture and four compare channels each), PWM unit
(six outputs) and watchdog.
8. Low power real-time clock with independent power and dedicated 32 kHz clock input.
9. Multiple serial interfaces including two UARTs (16C550), two Fast I2C-bus (400 kbit/s), SPI and SSP with
buffering and variable data length capabilities.
10. Vectored interrupt controller with configurable priorities and vector addresses.
11. Up to 45 of 5 V tolerant fast general purpose I/O pins in a tiny LQFP64 package.
12. Up to nine edge or level sensitive external interrupt pins available.
13. On-chip integrated oscillator operates with an external crystal in range from 1 MHz to30 MHz and with
an external oscillator up to 50 MHz
14. Power saving modes include Idle and Power-down.
15. Individual enable/disable of peripheral functions as well as peripheral clock scaling for additional power
optimization.
16. Processor wake-up from Power-down mode via external interrupt, USB, Brown-Out Detect (BOD) or
Real-Time Clock (RTC).




9 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


First Step- Hardware Requirement:
Pin configuration of LPC 2148.

Hardware requirement of LPC2148:
1. LPC2148 need minimum below listed hardware to work properly
2. Power Supply
3. Crystal Oscillator
4. Reset Circuit
5. RTC crystal oscillator
6. UART
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Power Supply:
LPC2148 works on 3.3 V power supply. LM 117 can be used for generating 3.3 V supply. However,
basic peripherals like LCD, ULN 2003 (Motor Driver IC) etc. works on 5V. So AC mains supply is converted
into 5V using below mentioned circuit and after that LM 117 is used to convert 5V into 3.3V.
Block diagram of power Supply

Transformer: It is used to step down 230V AC to 9V AC supply and provides isolation between power grids
and circuit.
Rectifier: It is used to convert AC supply into DC.
Filter: It is used to reduce ripple factor of DC output available from rectifier end.
Regulator: It is used to regulate DC supply output.

11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Circuit Diagram:

Regulator IC 7805 is used to provide fix 5V dc supply.
LM 117 is used for generating 3.3V supply from 5V.

12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Calculations:

From the datasheet of LM117

Taking R 2= 240?, we get R 1=392?
Reset Circuit:
Reset button is essential in a system to avoid programming pitfalls and manually bring back the system
to the initialization mode. MCP 130T is a special IC used for providing stable RESET signal to LPC 2148.


13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Oscillator Circuit:

The value of capacitors C20 & C21 depends upon the frequency of crystal Y3. General circuit and
its equivalent circuit is as shown below.

14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Recommended values are as shown in table:

UART:
LPC 2148 has inbuilt ISP which means we can program it within the system using serial
communication on COM0. It has also COM1 for serial communication. MAX 232/233 IC must be used for
voltage logic conversion. Related connections are as given below.

Once the above listed circuit design is ready, we are ready to go further.



15 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Result:
ARM Evaluation system and the configuration of LPC2148 has been studied fully. The minimal setup
required for the functioning of the ARM processor is studied.
Outcomes:
1. Able to understand the ARM controller, its basic components inside and its features.
2. Able to know the components required for the working of ARM LPC2148

Applications:
ARM controller LPC2148 is used in no. of devices such as
1. Smart phones
2. Net books
3. E Readers
4. Digital TV
5. Home Gateways


1. What are the basic units of ARM 7?
2. What is the address system supported by ARM?
3. Define - RISC
4. What are the instructions used to access the memory in ARM?
5. What are the basic units of Microprocessor?
6. What is an Instruction?
7. What is clock cycle?
8. Define - Pipelining
9. What is cache miss?
10. What is meant by memory mapped I/O?
11. Define ? interrupt
12. What is meant by Exception?
13. What is meant by little ? endian mode?
14. What is meant by big ? endian mode?
15. What is the function of CPSR?
16. What is register - indirect addressing?
Viva-voce




16 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 2 ANALOG TO DIGITAL CONVERTOR
INTERFACING
Aim:
To write an embedded c program for interfacing an on chip ADC with LPC2148 ARM processor and
convert the given input voltage into corresponding decimal values.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. PC
Theory:
Analog to Digital converter (ADC) is a device that converts continuously varying analog signals from
instruments that monitor such conditions as movement, temperature, sound, etc., into binary code for the
computer. It may be either a single chip or can be one circuit within a chip. Analog to Digital conversion is
the process of changing continuously varying data, such as voltage, current, or shaft rotation, into discrete
digital quantities that represent the magnitude of the data compared to a standard or reference at the
moment the conversion is made. According to the method of conversion, ADCs can be classified into
Direct-Conversion ADCs, Successive Approximation ADCs, Integrating ADC and Sigma-Delta ADCs.
The LPC 2148 has 10-bit successive approximation analog to digital converter. Basic clocking for the
A/D converters is provided by the VPB clock. A programmable divider is included in each converter, to
scale this clock to the 4.5 MHz (max) clock needed by the successive approximation process. A fully
accurate conversion requires 11 of these clocks. The ADC cell can measure the voltage on any of the ADC
input signals. It is noted that these analog inputs are always connected to their pins, even if the Pin function
Select register assigns them to port pins. A simple self-test of the ADC can be done by driving these pins
as port outputs.



17 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Circuit diagram:




18 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus, an embedded c program for interfacing on-chip ADC with ARM processor is written and
executed. The decimal values of the converted voltage are seen in the WinXTalk screen.
Outcome:
Able to interface A/D convertors with ARM system and check its working by connecting an analog
quantity as input.
Applications:
1. ADC used in MODEM for converting analog signals to digital.
2. A fast video ADC in TV tuner cards
3. ADC used in digital storage oscilloscopes
4. Used in music reproduction technology.
5. Used in DSP if input is analog


1. What are the ADC operating modes in LPC2148?
2. What is meant by conversion time?
3. Why are internal ADCs preferred over external ADCs?
4. Why has 16-bit ADC more resolution than from 10-bit and 8-bit ADC?
5. What are ADC & its Resolution?
6. What is Burst conversion mode?
7. What is the function of A/D Control Register?
8. What is the function of A/D Global Data Register?
9. What is the function of A/D Status Register?
10. What is analog-to-digital (ADC) conversion error?
11. What is the function of Sample-and-hold circuits in analog-to digital converters?
12. What is the disadvantage of the flash analog-to digital converter?
Viva-voce




19 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 3 GENERATION OF RAMP AND SQUARE
WAVE USING ON-CHIP DAC
Aim:
To write and execute an embedded c program to generate ramp wave and square wave using on-chip
DAC of LPC2148 ARM controller.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
A digital-to-analog converter is a device for converting a digital signal into an analog signal (current or
voltage). Digital-to-Analog Converters are the interface between the abstract digital world and the analog
real world. Simple switches, a network of resistors, current sources or capacitors may be used to
implement this conversion. A DAC inputs a binary number and outputs an analog voltage or current signal.
The Microchip Technology Inc. MCP4921 is 2.7 ? 5.5V, low-power, 12-Bit Digital-to-Analog Converter
(DAC) with SPI interface. The MCP4921 DAC provides high accuracy and low noise performance for
industrial applications where calibration or compensation of signals is required. With an SPI connection
there is always one master device (usually a microcontroller) which controls the peripheral devices.
Typically there are three lines common to all the devices,
Master In Slave Out (MISO) ? The Slave line for sending data to the master,
Master Out Slave In (MOSI) ? The Master line for sending data to the peripherals,
Serial Clock (SCK) ? The clock pulses which synchronize data transmission generated by the
master and slave
Slave Select pin ? the pin on each device that the master can use to enable and disable specific
devices. When a device Slave Select pin is low, it communicates with the master. When it is high, it ignores
the master. In SPI, the clock signal is controlled by the master device LPC2148. All data is clocked in and
out using this pin. These lines need to be connected to the relevant pins on the LPC21xx processor. Any
unused GIO pin can be used for CS, instead pull this pin high. Conversion speed is the time it takes for the



20 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

DAC to provide an analog output when the digital input word is changed. The MCP4291 DAC ? SPI
connections with LPC21xx have four I/O lines (P0.4 ? P0.7) required. The analog output is generated by
using these four lines.
Circuit diagram:


Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the embedded c programs for generating ramp wave and square wave using ARM LPC2148 are
written and executed successfully and the waveforms are viewed in oscilloscope.
Outcome:
Able to program the DAC in-built inside the ARM controller and get the waveforms using it.




21 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications :
1. DAC used in Audio amplifier.
2. Video encoder
3. Display electronics
4. Data Acquistion systems
5. Motor control



1. What are the features of LPC2148 DAC?
2. What is the function of DAC register?
3. Which pin provides a voltage reference level for the D/A converter?
4. What are the applications of DAC in signal processing applications?
5. What is GIO?
6. What is the resolution of a digital-to-analog converter (DAC)?
7. What is the major advantage of the R/2R ladder digital-to-analog (DAC), as compared to a binary-
weighted digital-to-analog DAC converter?
8. What is the resolution of a 0?5 V 6-bit digital-to-analog converter (DAC) ?
9. What are DAC configurations?
10. What are the different types of DAC Circuits?
11. What are the Limitations of the Binary Weighted DAC?
12. What are the General DAC Characteristics?
13. Define reference voltage in DAC.
14. What is full scale voltage?
15. What is settling time?
VIVA-VOCE




22 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 4 LED DIMMING USING PWM

Aim:
To write an embedded c program for implementing PWM using ARM controller and verify the same by
dimming of LEDs.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
LPC2148 supports 2 types of PWM:
1) Single Edge PWM ? Pulse starts with new Period i.e pulse is always at the beginning
2) Double Edge PWM ? Pulse can be anywhere within the Period
A PWM block, like a Timer block , has a Timer Counter and an associated Pre-scale Register along
with Match Registers. These work exactly the same way as in the case of Timers. Match Registers 1 to 6
(except 0) are pinned on LPC214x i.e. the corresponding outputs are diverted to actual Pins on LPC214x
MCU. The PWM function must be selected for these Pins to get the PWM output.
The basic setup is to simply replace Servo by a LED and no external 5V source is needed. The
anode of LED is connected to P0.0 and cathode to ground. Pulse Widths corresponding to the switches
connected to P0.1/2/3/4 will be 2.5ms/5ms/7.5ms/10ms respectively. As the Pulse Width Increases LED
will keep on getting brighter and the reverse will happen if Pulse Width is decreased.



23 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus embedded c program for implementing Pulse Width Modulation is written and executed and
output has been verified in LED display.
Outcome:
Able to implement PWM using the ARM controller and verify the same in the form of dimming of
LEDS.



24 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Applications :
1. In Visual signals to covey a message
2. Illumination where light is reflected from objects
3. In Narrow band sensors



1. What factors determine the LED dimming performance?
2. What is meant by analog dimming?
3. What is flickering effect?
4. What is the factor determines dimming of the LED
5. Why Silicon is not suitable for fabrication of light-emitting diodes?
6. Why Silicon diode is less suited for low voltage rectifier operation?
7. What is the principle of zener diode?
8. What are the materials used to make LED?
9. What type of diodes is used in FM receivers?
10. Which diode suffers an avalanche breakdown?
11. What happens if the junction temperature of LED is increased?
12. How a transfer characteristic of a diode does is related?
13. What is the requirement of a clipping action of a diode?
14. What type of rectifier circuit requires four diodes?
15. Why are the pulse width modulated outputs required in most of the applications?
16. How do the variations in an average value get affected by PWM period?
17. Name the common formats available for LED display.
18. What are the types of seven segment display?
19. What is PWM?
20. What are the applications of PWM?

Viva-voce




25 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 5 INTERFACING REAL TIME CLOCK
AND SERIAL PORT
Aim:
To write and execute an embedded c program to interface DS1307 RTC using I2C protocol with ARM
controller
Apparatus Required:
1. LPC2148 ARM development board
2. Stepper motor
3. Interfacing cables
4. PC
Theory:
A clock, which is based on the interrupts at preset intervals, is Real Time Clock (RTC). An interrupt
service routine executes on each timeout (overflow) of this clock. This timing device once started never
resets or never reloaded with another value. Once it is set, it is not modified later. It is used in a system to
save the time and date.













26 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the program for interfacing real time clock with ARM controller is written and executed and the
date and time are verified on the screen.
Outcome:
Able to interface real time clock DS1307 with ARM controller and thereby display date and time
Applications :
1. I2C In ARM and PIC microcontrollers
2. Used as serial communication protocol with MASTER and SLAVE operation.

27 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
27 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00




1. What is I2C and how does it work?
2. What are the features of I2C in LPC2148 ARM7 microcontroller?
3. What is the function of I2C0CONSET register?
4. What is I2C0STAT?
5. What is the function of I2C0 Data Register?
6. What is RTC?
7. List the advantages of RTC
8. Through which port the date and time is displayed in RTC?
9. What is a serial port?
10. List the registers used to transfer data in serial port.
11. List the modes used for data transmission.
12. What is a simplex mode?
13. Which pin is used to transmit a character?
14. What is the baud rate of serial port?
15. What is the disadvantage of RS-232C?














Viva-voce




28 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 6 INTERFACING KEYPAD AND LCD

Aim:
To write an embedded c program to interface 4 x 4 matrix keypad with ARM processor and display the
pressed key in an LCD.
Apparatus Required:
1. LPC2148 ARM development board
2. Interfacing cables
3. PC
Theory:

In matrix keypad, keys are connected in rows and columns. When any switch is pressed, rows and
columns come into contact, which is that detected by controller to identify which key has been pressed. A
4?4 matrix keypad consists of 4 rows and 4 columns. There is a switch connecting each row and column.
So the combinations of rows and columns make up the 16 inputs.Initially all the switches are open (not
connected). When any one button is pressed, the switch is closed (connected),hence there is a connection
between the row and column. The first 4 pins are connected to the column as INPUT. The other 4 pins are
connected to the row as OUTPUT. Matrix keypad is a good substitution to normal push button.












29 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Circuit Diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus program for interfacing matrix keypad with ARM controller is written and executed and the key
pressed is seen in the LCD.



30 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Outcome:
Able to interface keypad with ARM controller and see the pressed key in the LCD display.
Applications :
1. Used in password based door locking system
2. Security system with user changeable
3. Used in laptops, computer games
4. Used in portable video games and cell phones



1. What is Matrix keypad?
2. What is the concept behind keypad interface?
3. What are the functions of pull- up resistors?
4. What is key de bouncing?
5. List the steps involved when the key in a 4 x 4 keyboard matrix is being pressed.
6. What is the value obtained if no key is pressed?
7. What kind of interrupt is generated if a key has to be operated in an interrupt mode?
8. How will you identify that the key is pressed?
9. What are the steps involved in Keyboard Interfacing?
10. List the registers used to store the keyboard, display modes and other operations programmed by
CPU.
11. Name the mode when a data is entered from the left side of the display unit.
12. How many rows and columns are present in a 16 x 2 alphanumeric LCD?
13. How many data lines are there in a 16 x 2 alphanumeric LCD?
14. Which pin of the LCD is used for adjusting its contrast?
15. Which command of an LCD is used to shift the entire display to the right?
16. Which command is used to select the 2 lines and 5 x 7 matrix of an LCD?
17. What changes are to be made to send data to an LCD?
18. For reading operation from an LCD what changes in the software are introduced?
19. Which instruction is used to select the first row first column of an LCD?
Viva-voce

FirstRanker.com - FirstRanker's Choice
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00






?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING

VII SEMESTER - R 2013

EC6711 ? EMBEDDED LABORATORY






Name : _______________________________________
Register No : _______________________________________
Section : _______________________________________
LABORATORY MANUAL



2 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00




is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and
training.

? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different
levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on
heart and soul
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

To impart professional education integrated with human values to the younger generation, so as to
shape them as proficient and dedicated engineers, capable of providing comprehensive solutions to the
challenges in deploying technology for the service of humanity

? To educate the students with the state-of-art technologies to meet the growing challenges of the
electronics industry
? To carry out research through continuous interaction with research institutes and industry, on
advances in communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning,
innovation and ethical practices
VISION
VISION
MISSION
MISSION



3 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

PROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To provide students with a solid foundation in Mathematics, Science and fundamentals of
engineering, enabling them to apply, to find solutions for engineering problems and use this knowledge
to acquire higher education
2. Core Competence
To train the students in Electronics and Communication technologies so that they apply their
knowledge and training to compare, and to analyze various engineering industrial problems to find
solutions
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice which
enables them to find solutions for the real time problems in industry, and to design products
4. Professionalism
To inculcate professional and effective communication skills, leadership qualities and team spirit in
the students to make them multi-faceted personalities and develop their ability to relate engineering
issues to broader social context
5. Lifelong Learning/Ethics
To demonstrate and practice ethical and professional responsibilities in the industry and society in
the large, through commitment and lifelong learning needed for successful professional career


4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
PROGRAMME OUTCOMES (POs)
a) To demonstrate and apply knowledge of Mathematics, Science and engineering fundamentals in
Electronics and Communication Engineering field
b) To design a component, a system or a process to meet the specific needs within the realistic
constraints such as economics, environment, ethics, health, safety and manufacturability
c) To demonstrate the competency to use software tools for computation, simulation and testing of electronics
and communication engineering circuits
d) To identify, formulate and solve electronic and communication engineering problems
e) To demonstrate an ability to visualize and work on laboratory and multidisciplinary tasks
f) To function as a member or a leader in multidisciplinary activities
g) To communicate in verbal and written form with fellow engineers and society at large
h) To understand the impact of Electronics and Communication Engineering in the society and demonstrate
awareness of contemporary issues and commitment to give solutions exhibiting social responsibility
i) To demonstrate professional & ethical responsibilities
j) To exhibit confidence in self-education and ability for lifelong learning
k) To participate and succeed in competitive exams


5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
SYLLABUS

? Learn the working of ARM processor
? Understand the Building Blocks of Embedded Systems
? Learn the concept of memory map and memory interface
? Know the characteristics of Real Time Systems
? Write programs to interface memory, I/Os with processor
? Study the interrupt performance
LIST OF EXPERIMENTS:
1. Study of ARM evaluation system
2. Interfacing ADC and DAC
3. Interfacing LED and PWM
4. Interfacing real time clock and serial port
5. Interfacing keyboard and LCD
6. Interfacing EPROM and interrupt
7. Mailbox
8. Interrupt performance characteristics of ARM and FPGA
9. Flashing of LEDS
10. Interfacing stepper motor and temperature sensor
11. Implementing zigbee protocol with ARM



? Write programs in ARM for a specific Application
? Interface memory and Write programs related to memory operations
? Interface A/D and D/A convertors with ARM system
? Analyze the performance of interrupt
? Write programmes for interfacing keyboard, display, motor and sensor.
? Formulate a mini project using embedded system
COURSE OBJECTIVES
COURSE OUTCOMES
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
CONTENTS
Sl. No. Name of the Experiment Page No.
CYCLE 1 ? EXPERIMENTS
1
Study of ARM evaluation system 7
2
Analog to Digital Convertor interfacing 16
3
Generation of ramp and square wave using on-Chip DAC 19
4
LED dimming using PWM 22
5
Interfacing real time clock and serial port 25
6
Interfacing keypad and LCD 28
7
Interfacing EPROM and interrupt 31
CYCLE 2 ? EXPERIMENTS
8 Implementation of Mailbox Function using LPC 2148 35
9 Interrupt Performance Characteristics of Arm and FPGA 37
10 Flashing of LEDs 40
11 Stepper Motor Interface with ARM ? 7 LPC2148 43
12 LM35 Temperature Sensor Interface with ARM ? 7 LPC2148 47
13
Implementation of Wireless Communication Protocol using ZIGBEE Wireless
Module
50
ADDITIONAL EXPERIMENTS BEYOND THE SYYLABUS
14 Buzzer Interface with ARM ? 7 54
15 Relay interface with ARM? 7 57
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Expt. No. 1 STUDY OF ARM EVALUATION SYSTEM
Aim:
To study the building blocks of ARM7 system, its features, pin configuration and the components
required for functioning of ARM controller.
Architecture Overview:
A RISC-based computer design approach means ARM processors require significantly fewer transistors
than typical processors in average computers. This approach reduces cost, heat and power usage. These
are desirable traits for light, portable, battery-powered devices (smart phones, laptops, tablet and notepad
computers), and other embedded systems. A simpler design facilitates more efficient multi-core CPUs and
higher core counts at lower cost, providing higher processing power and improved energy efficiency for
servers and supercomputers.
In 2005, about 98% of all mobile phones sold used at least one ARM processor. The low power
consumption of ARM processors has made them very popular: 37 billion ARM processors have been
produced as of 2013, up from 10 billion in 2008. The ARM architecture (32-bit) is the most widely used
architecture in mobile devices, and most popular 32-bit one in embedded systems.
According to ARM Holdings, in 2010 alone, producers of chips based on ARM architectures
reported shipments of 6.1 billion ARM based processors, representing 95% of smart phones, 35% of digital
televisions and set-top boxes and 10% of mobile computers. It is the most widely used 32-bit instruction set
architecture in terms of quantity produced.
LPC 2148:
LPC2148 is the widely used IC from ARM-7 family. It is manufactured by Philips and it is pre-loaded
with many inbuilt peripherals making it more efficient and a reliable option for the beginners as well as high
end application developer.




8 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Features of LPC214x series controllers:
1. 8 to 40 kB of on-chip static RAM and 32 to 512 kB of on-chip flash program memory.128 bit wide
interface/accelerator enables high speed 60 MHz operation.
2. In-System/In-Application Programming (ISP/IAP) via on-chip boot-loader software. Single flash sector or
full chip erase in 400 ms and programming of 256 bytes in 1ms.
3. Embedded ICE RT and Embedded Trace interfaces offer real-time debugging with the on-chip Real
Monitor software and high speed tracing of instruction execution.
4. USB 2.0 Full Speed compliant Device Controller with 2 kB of endpoint RAM. In addition, the LPC2146/8
provides 8 kB of on-chip RAM accessible to USB by DMA.
5. One or two (LPC2141/2 vs. LPC2144/6/8) 10-bit A/D converters provide a total of 6/14analog inputs, with
conversion times as low as 2.44 us per channel.
6. Single 10-bit D/A converter provides variable analog output.
7. Two 32-bit timers/external event counters (with four capture and four compare channels each), PWM unit
(six outputs) and watchdog.
8. Low power real-time clock with independent power and dedicated 32 kHz clock input.
9. Multiple serial interfaces including two UARTs (16C550), two Fast I2C-bus (400 kbit/s), SPI and SSP with
buffering and variable data length capabilities.
10. Vectored interrupt controller with configurable priorities and vector addresses.
11. Up to 45 of 5 V tolerant fast general purpose I/O pins in a tiny LQFP64 package.
12. Up to nine edge or level sensitive external interrupt pins available.
13. On-chip integrated oscillator operates with an external crystal in range from 1 MHz to30 MHz and with
an external oscillator up to 50 MHz
14. Power saving modes include Idle and Power-down.
15. Individual enable/disable of peripheral functions as well as peripheral clock scaling for additional power
optimization.
16. Processor wake-up from Power-down mode via external interrupt, USB, Brown-Out Detect (BOD) or
Real-Time Clock (RTC).




9 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


First Step- Hardware Requirement:
Pin configuration of LPC 2148.

Hardware requirement of LPC2148:
1. LPC2148 need minimum below listed hardware to work properly
2. Power Supply
3. Crystal Oscillator
4. Reset Circuit
5. RTC crystal oscillator
6. UART
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Power Supply:
LPC2148 works on 3.3 V power supply. LM 117 can be used for generating 3.3 V supply. However,
basic peripherals like LCD, ULN 2003 (Motor Driver IC) etc. works on 5V. So AC mains supply is converted
into 5V using below mentioned circuit and after that LM 117 is used to convert 5V into 3.3V.
Block diagram of power Supply

Transformer: It is used to step down 230V AC to 9V AC supply and provides isolation between power grids
and circuit.
Rectifier: It is used to convert AC supply into DC.
Filter: It is used to reduce ripple factor of DC output available from rectifier end.
Regulator: It is used to regulate DC supply output.

11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Circuit Diagram:

Regulator IC 7805 is used to provide fix 5V dc supply.
LM 117 is used for generating 3.3V supply from 5V.

12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Calculations:

From the datasheet of LM117

Taking R 2= 240?, we get R 1=392?
Reset Circuit:
Reset button is essential in a system to avoid programming pitfalls and manually bring back the system
to the initialization mode. MCP 130T is a special IC used for providing stable RESET signal to LPC 2148.


13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Oscillator Circuit:

The value of capacitors C20 & C21 depends upon the frequency of crystal Y3. General circuit and
its equivalent circuit is as shown below.

14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Recommended values are as shown in table:

UART:
LPC 2148 has inbuilt ISP which means we can program it within the system using serial
communication on COM0. It has also COM1 for serial communication. MAX 232/233 IC must be used for
voltage logic conversion. Related connections are as given below.

Once the above listed circuit design is ready, we are ready to go further.



15 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Result:
ARM Evaluation system and the configuration of LPC2148 has been studied fully. The minimal setup
required for the functioning of the ARM processor is studied.
Outcomes:
1. Able to understand the ARM controller, its basic components inside and its features.
2. Able to know the components required for the working of ARM LPC2148

Applications:
ARM controller LPC2148 is used in no. of devices such as
1. Smart phones
2. Net books
3. E Readers
4. Digital TV
5. Home Gateways


1. What are the basic units of ARM 7?
2. What is the address system supported by ARM?
3. Define - RISC
4. What are the instructions used to access the memory in ARM?
5. What are the basic units of Microprocessor?
6. What is an Instruction?
7. What is clock cycle?
8. Define - Pipelining
9. What is cache miss?
10. What is meant by memory mapped I/O?
11. Define ? interrupt
12. What is meant by Exception?
13. What is meant by little ? endian mode?
14. What is meant by big ? endian mode?
15. What is the function of CPSR?
16. What is register - indirect addressing?
Viva-voce




16 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 2 ANALOG TO DIGITAL CONVERTOR
INTERFACING
Aim:
To write an embedded c program for interfacing an on chip ADC with LPC2148 ARM processor and
convert the given input voltage into corresponding decimal values.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. PC
Theory:
Analog to Digital converter (ADC) is a device that converts continuously varying analog signals from
instruments that monitor such conditions as movement, temperature, sound, etc., into binary code for the
computer. It may be either a single chip or can be one circuit within a chip. Analog to Digital conversion is
the process of changing continuously varying data, such as voltage, current, or shaft rotation, into discrete
digital quantities that represent the magnitude of the data compared to a standard or reference at the
moment the conversion is made. According to the method of conversion, ADCs can be classified into
Direct-Conversion ADCs, Successive Approximation ADCs, Integrating ADC and Sigma-Delta ADCs.
The LPC 2148 has 10-bit successive approximation analog to digital converter. Basic clocking for the
A/D converters is provided by the VPB clock. A programmable divider is included in each converter, to
scale this clock to the 4.5 MHz (max) clock needed by the successive approximation process. A fully
accurate conversion requires 11 of these clocks. The ADC cell can measure the voltage on any of the ADC
input signals. It is noted that these analog inputs are always connected to their pins, even if the Pin function
Select register assigns them to port pins. A simple self-test of the ADC can be done by driving these pins
as port outputs.



17 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Circuit diagram:




18 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus, an embedded c program for interfacing on-chip ADC with ARM processor is written and
executed. The decimal values of the converted voltage are seen in the WinXTalk screen.
Outcome:
Able to interface A/D convertors with ARM system and check its working by connecting an analog
quantity as input.
Applications:
1. ADC used in MODEM for converting analog signals to digital.
2. A fast video ADC in TV tuner cards
3. ADC used in digital storage oscilloscopes
4. Used in music reproduction technology.
5. Used in DSP if input is analog


1. What are the ADC operating modes in LPC2148?
2. What is meant by conversion time?
3. Why are internal ADCs preferred over external ADCs?
4. Why has 16-bit ADC more resolution than from 10-bit and 8-bit ADC?
5. What are ADC & its Resolution?
6. What is Burst conversion mode?
7. What is the function of A/D Control Register?
8. What is the function of A/D Global Data Register?
9. What is the function of A/D Status Register?
10. What is analog-to-digital (ADC) conversion error?
11. What is the function of Sample-and-hold circuits in analog-to digital converters?
12. What is the disadvantage of the flash analog-to digital converter?
Viva-voce




19 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 3 GENERATION OF RAMP AND SQUARE
WAVE USING ON-CHIP DAC
Aim:
To write and execute an embedded c program to generate ramp wave and square wave using on-chip
DAC of LPC2148 ARM controller.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
A digital-to-analog converter is a device for converting a digital signal into an analog signal (current or
voltage). Digital-to-Analog Converters are the interface between the abstract digital world and the analog
real world. Simple switches, a network of resistors, current sources or capacitors may be used to
implement this conversion. A DAC inputs a binary number and outputs an analog voltage or current signal.
The Microchip Technology Inc. MCP4921 is 2.7 ? 5.5V, low-power, 12-Bit Digital-to-Analog Converter
(DAC) with SPI interface. The MCP4921 DAC provides high accuracy and low noise performance for
industrial applications where calibration or compensation of signals is required. With an SPI connection
there is always one master device (usually a microcontroller) which controls the peripheral devices.
Typically there are three lines common to all the devices,
Master In Slave Out (MISO) ? The Slave line for sending data to the master,
Master Out Slave In (MOSI) ? The Master line for sending data to the peripherals,
Serial Clock (SCK) ? The clock pulses which synchronize data transmission generated by the
master and slave
Slave Select pin ? the pin on each device that the master can use to enable and disable specific
devices. When a device Slave Select pin is low, it communicates with the master. When it is high, it ignores
the master. In SPI, the clock signal is controlled by the master device LPC2148. All data is clocked in and
out using this pin. These lines need to be connected to the relevant pins on the LPC21xx processor. Any
unused GIO pin can be used for CS, instead pull this pin high. Conversion speed is the time it takes for the



20 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

DAC to provide an analog output when the digital input word is changed. The MCP4291 DAC ? SPI
connections with LPC21xx have four I/O lines (P0.4 ? P0.7) required. The analog output is generated by
using these four lines.
Circuit diagram:


Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the embedded c programs for generating ramp wave and square wave using ARM LPC2148 are
written and executed successfully and the waveforms are viewed in oscilloscope.
Outcome:
Able to program the DAC in-built inside the ARM controller and get the waveforms using it.




21 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications :
1. DAC used in Audio amplifier.
2. Video encoder
3. Display electronics
4. Data Acquistion systems
5. Motor control



1. What are the features of LPC2148 DAC?
2. What is the function of DAC register?
3. Which pin provides a voltage reference level for the D/A converter?
4. What are the applications of DAC in signal processing applications?
5. What is GIO?
6. What is the resolution of a digital-to-analog converter (DAC)?
7. What is the major advantage of the R/2R ladder digital-to-analog (DAC), as compared to a binary-
weighted digital-to-analog DAC converter?
8. What is the resolution of a 0?5 V 6-bit digital-to-analog converter (DAC) ?
9. What are DAC configurations?
10. What are the different types of DAC Circuits?
11. What are the Limitations of the Binary Weighted DAC?
12. What are the General DAC Characteristics?
13. Define reference voltage in DAC.
14. What is full scale voltage?
15. What is settling time?
VIVA-VOCE




22 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 4 LED DIMMING USING PWM

Aim:
To write an embedded c program for implementing PWM using ARM controller and verify the same by
dimming of LEDs.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
LPC2148 supports 2 types of PWM:
1) Single Edge PWM ? Pulse starts with new Period i.e pulse is always at the beginning
2) Double Edge PWM ? Pulse can be anywhere within the Period
A PWM block, like a Timer block , has a Timer Counter and an associated Pre-scale Register along
with Match Registers. These work exactly the same way as in the case of Timers. Match Registers 1 to 6
(except 0) are pinned on LPC214x i.e. the corresponding outputs are diverted to actual Pins on LPC214x
MCU. The PWM function must be selected for these Pins to get the PWM output.
The basic setup is to simply replace Servo by a LED and no external 5V source is needed. The
anode of LED is connected to P0.0 and cathode to ground. Pulse Widths corresponding to the switches
connected to P0.1/2/3/4 will be 2.5ms/5ms/7.5ms/10ms respectively. As the Pulse Width Increases LED
will keep on getting brighter and the reverse will happen if Pulse Width is decreased.



23 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus embedded c program for implementing Pulse Width Modulation is written and executed and
output has been verified in LED display.
Outcome:
Able to implement PWM using the ARM controller and verify the same in the form of dimming of
LEDS.



24 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Applications :
1. In Visual signals to covey a message
2. Illumination where light is reflected from objects
3. In Narrow band sensors



1. What factors determine the LED dimming performance?
2. What is meant by analog dimming?
3. What is flickering effect?
4. What is the factor determines dimming of the LED
5. Why Silicon is not suitable for fabrication of light-emitting diodes?
6. Why Silicon diode is less suited for low voltage rectifier operation?
7. What is the principle of zener diode?
8. What are the materials used to make LED?
9. What type of diodes is used in FM receivers?
10. Which diode suffers an avalanche breakdown?
11. What happens if the junction temperature of LED is increased?
12. How a transfer characteristic of a diode does is related?
13. What is the requirement of a clipping action of a diode?
14. What type of rectifier circuit requires four diodes?
15. Why are the pulse width modulated outputs required in most of the applications?
16. How do the variations in an average value get affected by PWM period?
17. Name the common formats available for LED display.
18. What are the types of seven segment display?
19. What is PWM?
20. What are the applications of PWM?

Viva-voce




25 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 5 INTERFACING REAL TIME CLOCK
AND SERIAL PORT
Aim:
To write and execute an embedded c program to interface DS1307 RTC using I2C protocol with ARM
controller
Apparatus Required:
1. LPC2148 ARM development board
2. Stepper motor
3. Interfacing cables
4. PC
Theory:
A clock, which is based on the interrupts at preset intervals, is Real Time Clock (RTC). An interrupt
service routine executes on each timeout (overflow) of this clock. This timing device once started never
resets or never reloaded with another value. Once it is set, it is not modified later. It is used in a system to
save the time and date.













26 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the program for interfacing real time clock with ARM controller is written and executed and the
date and time are verified on the screen.
Outcome:
Able to interface real time clock DS1307 with ARM controller and thereby display date and time
Applications :
1. I2C In ARM and PIC microcontrollers
2. Used as serial communication protocol with MASTER and SLAVE operation.

27 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
27 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00




1. What is I2C and how does it work?
2. What are the features of I2C in LPC2148 ARM7 microcontroller?
3. What is the function of I2C0CONSET register?
4. What is I2C0STAT?
5. What is the function of I2C0 Data Register?
6. What is RTC?
7. List the advantages of RTC
8. Through which port the date and time is displayed in RTC?
9. What is a serial port?
10. List the registers used to transfer data in serial port.
11. List the modes used for data transmission.
12. What is a simplex mode?
13. Which pin is used to transmit a character?
14. What is the baud rate of serial port?
15. What is the disadvantage of RS-232C?














Viva-voce




28 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 6 INTERFACING KEYPAD AND LCD

Aim:
To write an embedded c program to interface 4 x 4 matrix keypad with ARM processor and display the
pressed key in an LCD.
Apparatus Required:
1. LPC2148 ARM development board
2. Interfacing cables
3. PC
Theory:

In matrix keypad, keys are connected in rows and columns. When any switch is pressed, rows and
columns come into contact, which is that detected by controller to identify which key has been pressed. A
4?4 matrix keypad consists of 4 rows and 4 columns. There is a switch connecting each row and column.
So the combinations of rows and columns make up the 16 inputs.Initially all the switches are open (not
connected). When any one button is pressed, the switch is closed (connected),hence there is a connection
between the row and column. The first 4 pins are connected to the column as INPUT. The other 4 pins are
connected to the row as OUTPUT. Matrix keypad is a good substitution to normal push button.












29 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Circuit Diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus program for interfacing matrix keypad with ARM controller is written and executed and the key
pressed is seen in the LCD.



30 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Outcome:
Able to interface keypad with ARM controller and see the pressed key in the LCD display.
Applications :
1. Used in password based door locking system
2. Security system with user changeable
3. Used in laptops, computer games
4. Used in portable video games and cell phones



1. What is Matrix keypad?
2. What is the concept behind keypad interface?
3. What are the functions of pull- up resistors?
4. What is key de bouncing?
5. List the steps involved when the key in a 4 x 4 keyboard matrix is being pressed.
6. What is the value obtained if no key is pressed?
7. What kind of interrupt is generated if a key has to be operated in an interrupt mode?
8. How will you identify that the key is pressed?
9. What are the steps involved in Keyboard Interfacing?
10. List the registers used to store the keyboard, display modes and other operations programmed by
CPU.
11. Name the mode when a data is entered from the left side of the display unit.
12. How many rows and columns are present in a 16 x 2 alphanumeric LCD?
13. How many data lines are there in a 16 x 2 alphanumeric LCD?
14. Which pin of the LCD is used for adjusting its contrast?
15. Which command of an LCD is used to shift the entire display to the right?
16. Which command is used to select the 2 lines and 5 x 7 matrix of an LCD?
17. What changes are to be made to send data to an LCD?
18. For reading operation from an LCD what changes in the software are introduced?
19. Which instruction is used to select the first row first column of an LCD?
Viva-voce

31 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
31 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Expt. No. 7 INTERFACING EEPROM AND INTERRUPT

Aim:
To write a program to interface EEPROM using I2C protocol with ARM controller and retrieve the stored
messages inside EEPROM.
Apparatus Required:
1. LPC2148 ARM development board
2. Interfacing cables
3. PC
Theory:
I2C (Inter Integrated Circuit):
The I2C (Inter-IC) bus is a bi-directional two-wire serial bus that provides a communication link between
integrated circuits (ICs).I2C is a synchronous protocol that allows a master device to initiate communication
with a slave device. Data is exchanged between these devices.
EEPROM:
EEPROM (electrically erasable programmable read-only memory) is user-modifiable read-only
memory (ROM) that can be erased and reprogrammed (written to) repeatedly through the application of
higher than normal electrical voltage. It is a type of non-volatile memory used in computers and other
electronic devices to store small amounts of data that must be saved when power is removed, e.g.,
calibration tables or device configuration
Read, write and Erase EEPROM by using I2C in LPC2148 Primer Board. Wiring up an I2C based
EEPROM to the I2C port is relatively simple. The basic operation of the I2C based EEPROM's is to send a
command, such as WRITE, followed by an address and the data. In WRITE operation, the EEPROM is
used to store the data. In LPC2148 Primer Kit, 2 nos. of EEPROM lines are controlled by I2C Enabled
drivers. I2C Lines serial clock SCL (P0.2), serial data SDA (P0.3) connected to the I2C based serial
EEPROM IC. The EEPROM read & write operations are done in LPC2148 Primer Kit by using these SDA &
SCL I2C lines.
FirstRanker.com - FirstRanker's Choice
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00






?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING

VII SEMESTER - R 2013

EC6711 ? EMBEDDED LABORATORY






Name : _______________________________________
Register No : _______________________________________
Section : _______________________________________
LABORATORY MANUAL



2 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00




is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and
training.

? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different
levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on
heart and soul
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

To impart professional education integrated with human values to the younger generation, so as to
shape them as proficient and dedicated engineers, capable of providing comprehensive solutions to the
challenges in deploying technology for the service of humanity

? To educate the students with the state-of-art technologies to meet the growing challenges of the
electronics industry
? To carry out research through continuous interaction with research institutes and industry, on
advances in communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning,
innovation and ethical practices
VISION
VISION
MISSION
MISSION



3 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

PROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To provide students with a solid foundation in Mathematics, Science and fundamentals of
engineering, enabling them to apply, to find solutions for engineering problems and use this knowledge
to acquire higher education
2. Core Competence
To train the students in Electronics and Communication technologies so that they apply their
knowledge and training to compare, and to analyze various engineering industrial problems to find
solutions
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice which
enables them to find solutions for the real time problems in industry, and to design products
4. Professionalism
To inculcate professional and effective communication skills, leadership qualities and team spirit in
the students to make them multi-faceted personalities and develop their ability to relate engineering
issues to broader social context
5. Lifelong Learning/Ethics
To demonstrate and practice ethical and professional responsibilities in the industry and society in
the large, through commitment and lifelong learning needed for successful professional career


4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
PROGRAMME OUTCOMES (POs)
a) To demonstrate and apply knowledge of Mathematics, Science and engineering fundamentals in
Electronics and Communication Engineering field
b) To design a component, a system or a process to meet the specific needs within the realistic
constraints such as economics, environment, ethics, health, safety and manufacturability
c) To demonstrate the competency to use software tools for computation, simulation and testing of electronics
and communication engineering circuits
d) To identify, formulate and solve electronic and communication engineering problems
e) To demonstrate an ability to visualize and work on laboratory and multidisciplinary tasks
f) To function as a member or a leader in multidisciplinary activities
g) To communicate in verbal and written form with fellow engineers and society at large
h) To understand the impact of Electronics and Communication Engineering in the society and demonstrate
awareness of contemporary issues and commitment to give solutions exhibiting social responsibility
i) To demonstrate professional & ethical responsibilities
j) To exhibit confidence in self-education and ability for lifelong learning
k) To participate and succeed in competitive exams


5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
SYLLABUS

? Learn the working of ARM processor
? Understand the Building Blocks of Embedded Systems
? Learn the concept of memory map and memory interface
? Know the characteristics of Real Time Systems
? Write programs to interface memory, I/Os with processor
? Study the interrupt performance
LIST OF EXPERIMENTS:
1. Study of ARM evaluation system
2. Interfacing ADC and DAC
3. Interfacing LED and PWM
4. Interfacing real time clock and serial port
5. Interfacing keyboard and LCD
6. Interfacing EPROM and interrupt
7. Mailbox
8. Interrupt performance characteristics of ARM and FPGA
9. Flashing of LEDS
10. Interfacing stepper motor and temperature sensor
11. Implementing zigbee protocol with ARM



? Write programs in ARM for a specific Application
? Interface memory and Write programs related to memory operations
? Interface A/D and D/A convertors with ARM system
? Analyze the performance of interrupt
? Write programmes for interfacing keyboard, display, motor and sensor.
? Formulate a mini project using embedded system
COURSE OBJECTIVES
COURSE OUTCOMES
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
CONTENTS
Sl. No. Name of the Experiment Page No.
CYCLE 1 ? EXPERIMENTS
1
Study of ARM evaluation system 7
2
Analog to Digital Convertor interfacing 16
3
Generation of ramp and square wave using on-Chip DAC 19
4
LED dimming using PWM 22
5
Interfacing real time clock and serial port 25
6
Interfacing keypad and LCD 28
7
Interfacing EPROM and interrupt 31
CYCLE 2 ? EXPERIMENTS
8 Implementation of Mailbox Function using LPC 2148 35
9 Interrupt Performance Characteristics of Arm and FPGA 37
10 Flashing of LEDs 40
11 Stepper Motor Interface with ARM ? 7 LPC2148 43
12 LM35 Temperature Sensor Interface with ARM ? 7 LPC2148 47
13
Implementation of Wireless Communication Protocol using ZIGBEE Wireless
Module
50
ADDITIONAL EXPERIMENTS BEYOND THE SYYLABUS
14 Buzzer Interface with ARM ? 7 54
15 Relay interface with ARM? 7 57
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Expt. No. 1 STUDY OF ARM EVALUATION SYSTEM
Aim:
To study the building blocks of ARM7 system, its features, pin configuration and the components
required for functioning of ARM controller.
Architecture Overview:
A RISC-based computer design approach means ARM processors require significantly fewer transistors
than typical processors in average computers. This approach reduces cost, heat and power usage. These
are desirable traits for light, portable, battery-powered devices (smart phones, laptops, tablet and notepad
computers), and other embedded systems. A simpler design facilitates more efficient multi-core CPUs and
higher core counts at lower cost, providing higher processing power and improved energy efficiency for
servers and supercomputers.
In 2005, about 98% of all mobile phones sold used at least one ARM processor. The low power
consumption of ARM processors has made them very popular: 37 billion ARM processors have been
produced as of 2013, up from 10 billion in 2008. The ARM architecture (32-bit) is the most widely used
architecture in mobile devices, and most popular 32-bit one in embedded systems.
According to ARM Holdings, in 2010 alone, producers of chips based on ARM architectures
reported shipments of 6.1 billion ARM based processors, representing 95% of smart phones, 35% of digital
televisions and set-top boxes and 10% of mobile computers. It is the most widely used 32-bit instruction set
architecture in terms of quantity produced.
LPC 2148:
LPC2148 is the widely used IC from ARM-7 family. It is manufactured by Philips and it is pre-loaded
with many inbuilt peripherals making it more efficient and a reliable option for the beginners as well as high
end application developer.




8 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Features of LPC214x series controllers:
1. 8 to 40 kB of on-chip static RAM and 32 to 512 kB of on-chip flash program memory.128 bit wide
interface/accelerator enables high speed 60 MHz operation.
2. In-System/In-Application Programming (ISP/IAP) via on-chip boot-loader software. Single flash sector or
full chip erase in 400 ms and programming of 256 bytes in 1ms.
3. Embedded ICE RT and Embedded Trace interfaces offer real-time debugging with the on-chip Real
Monitor software and high speed tracing of instruction execution.
4. USB 2.0 Full Speed compliant Device Controller with 2 kB of endpoint RAM. In addition, the LPC2146/8
provides 8 kB of on-chip RAM accessible to USB by DMA.
5. One or two (LPC2141/2 vs. LPC2144/6/8) 10-bit A/D converters provide a total of 6/14analog inputs, with
conversion times as low as 2.44 us per channel.
6. Single 10-bit D/A converter provides variable analog output.
7. Two 32-bit timers/external event counters (with four capture and four compare channels each), PWM unit
(six outputs) and watchdog.
8. Low power real-time clock with independent power and dedicated 32 kHz clock input.
9. Multiple serial interfaces including two UARTs (16C550), two Fast I2C-bus (400 kbit/s), SPI and SSP with
buffering and variable data length capabilities.
10. Vectored interrupt controller with configurable priorities and vector addresses.
11. Up to 45 of 5 V tolerant fast general purpose I/O pins in a tiny LQFP64 package.
12. Up to nine edge or level sensitive external interrupt pins available.
13. On-chip integrated oscillator operates with an external crystal in range from 1 MHz to30 MHz and with
an external oscillator up to 50 MHz
14. Power saving modes include Idle and Power-down.
15. Individual enable/disable of peripheral functions as well as peripheral clock scaling for additional power
optimization.
16. Processor wake-up from Power-down mode via external interrupt, USB, Brown-Out Detect (BOD) or
Real-Time Clock (RTC).




9 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


First Step- Hardware Requirement:
Pin configuration of LPC 2148.

Hardware requirement of LPC2148:
1. LPC2148 need minimum below listed hardware to work properly
2. Power Supply
3. Crystal Oscillator
4. Reset Circuit
5. RTC crystal oscillator
6. UART
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Power Supply:
LPC2148 works on 3.3 V power supply. LM 117 can be used for generating 3.3 V supply. However,
basic peripherals like LCD, ULN 2003 (Motor Driver IC) etc. works on 5V. So AC mains supply is converted
into 5V using below mentioned circuit and after that LM 117 is used to convert 5V into 3.3V.
Block diagram of power Supply

Transformer: It is used to step down 230V AC to 9V AC supply and provides isolation between power grids
and circuit.
Rectifier: It is used to convert AC supply into DC.
Filter: It is used to reduce ripple factor of DC output available from rectifier end.
Regulator: It is used to regulate DC supply output.

11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Circuit Diagram:

Regulator IC 7805 is used to provide fix 5V dc supply.
LM 117 is used for generating 3.3V supply from 5V.

12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Calculations:

From the datasheet of LM117

Taking R 2= 240?, we get R 1=392?
Reset Circuit:
Reset button is essential in a system to avoid programming pitfalls and manually bring back the system
to the initialization mode. MCP 130T is a special IC used for providing stable RESET signal to LPC 2148.


13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Oscillator Circuit:

The value of capacitors C20 & C21 depends upon the frequency of crystal Y3. General circuit and
its equivalent circuit is as shown below.

14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Recommended values are as shown in table:

UART:
LPC 2148 has inbuilt ISP which means we can program it within the system using serial
communication on COM0. It has also COM1 for serial communication. MAX 232/233 IC must be used for
voltage logic conversion. Related connections are as given below.

Once the above listed circuit design is ready, we are ready to go further.



15 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Result:
ARM Evaluation system and the configuration of LPC2148 has been studied fully. The minimal setup
required for the functioning of the ARM processor is studied.
Outcomes:
1. Able to understand the ARM controller, its basic components inside and its features.
2. Able to know the components required for the working of ARM LPC2148

Applications:
ARM controller LPC2148 is used in no. of devices such as
1. Smart phones
2. Net books
3. E Readers
4. Digital TV
5. Home Gateways


1. What are the basic units of ARM 7?
2. What is the address system supported by ARM?
3. Define - RISC
4. What are the instructions used to access the memory in ARM?
5. What are the basic units of Microprocessor?
6. What is an Instruction?
7. What is clock cycle?
8. Define - Pipelining
9. What is cache miss?
10. What is meant by memory mapped I/O?
11. Define ? interrupt
12. What is meant by Exception?
13. What is meant by little ? endian mode?
14. What is meant by big ? endian mode?
15. What is the function of CPSR?
16. What is register - indirect addressing?
Viva-voce




16 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 2 ANALOG TO DIGITAL CONVERTOR
INTERFACING
Aim:
To write an embedded c program for interfacing an on chip ADC with LPC2148 ARM processor and
convert the given input voltage into corresponding decimal values.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. PC
Theory:
Analog to Digital converter (ADC) is a device that converts continuously varying analog signals from
instruments that monitor such conditions as movement, temperature, sound, etc., into binary code for the
computer. It may be either a single chip or can be one circuit within a chip. Analog to Digital conversion is
the process of changing continuously varying data, such as voltage, current, or shaft rotation, into discrete
digital quantities that represent the magnitude of the data compared to a standard or reference at the
moment the conversion is made. According to the method of conversion, ADCs can be classified into
Direct-Conversion ADCs, Successive Approximation ADCs, Integrating ADC and Sigma-Delta ADCs.
The LPC 2148 has 10-bit successive approximation analog to digital converter. Basic clocking for the
A/D converters is provided by the VPB clock. A programmable divider is included in each converter, to
scale this clock to the 4.5 MHz (max) clock needed by the successive approximation process. A fully
accurate conversion requires 11 of these clocks. The ADC cell can measure the voltage on any of the ADC
input signals. It is noted that these analog inputs are always connected to their pins, even if the Pin function
Select register assigns them to port pins. A simple self-test of the ADC can be done by driving these pins
as port outputs.



17 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Circuit diagram:




18 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus, an embedded c program for interfacing on-chip ADC with ARM processor is written and
executed. The decimal values of the converted voltage are seen in the WinXTalk screen.
Outcome:
Able to interface A/D convertors with ARM system and check its working by connecting an analog
quantity as input.
Applications:
1. ADC used in MODEM for converting analog signals to digital.
2. A fast video ADC in TV tuner cards
3. ADC used in digital storage oscilloscopes
4. Used in music reproduction technology.
5. Used in DSP if input is analog


1. What are the ADC operating modes in LPC2148?
2. What is meant by conversion time?
3. Why are internal ADCs preferred over external ADCs?
4. Why has 16-bit ADC more resolution than from 10-bit and 8-bit ADC?
5. What are ADC & its Resolution?
6. What is Burst conversion mode?
7. What is the function of A/D Control Register?
8. What is the function of A/D Global Data Register?
9. What is the function of A/D Status Register?
10. What is analog-to-digital (ADC) conversion error?
11. What is the function of Sample-and-hold circuits in analog-to digital converters?
12. What is the disadvantage of the flash analog-to digital converter?
Viva-voce




19 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 3 GENERATION OF RAMP AND SQUARE
WAVE USING ON-CHIP DAC
Aim:
To write and execute an embedded c program to generate ramp wave and square wave using on-chip
DAC of LPC2148 ARM controller.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
A digital-to-analog converter is a device for converting a digital signal into an analog signal (current or
voltage). Digital-to-Analog Converters are the interface between the abstract digital world and the analog
real world. Simple switches, a network of resistors, current sources or capacitors may be used to
implement this conversion. A DAC inputs a binary number and outputs an analog voltage or current signal.
The Microchip Technology Inc. MCP4921 is 2.7 ? 5.5V, low-power, 12-Bit Digital-to-Analog Converter
(DAC) with SPI interface. The MCP4921 DAC provides high accuracy and low noise performance for
industrial applications where calibration or compensation of signals is required. With an SPI connection
there is always one master device (usually a microcontroller) which controls the peripheral devices.
Typically there are three lines common to all the devices,
Master In Slave Out (MISO) ? The Slave line for sending data to the master,
Master Out Slave In (MOSI) ? The Master line for sending data to the peripherals,
Serial Clock (SCK) ? The clock pulses which synchronize data transmission generated by the
master and slave
Slave Select pin ? the pin on each device that the master can use to enable and disable specific
devices. When a device Slave Select pin is low, it communicates with the master. When it is high, it ignores
the master. In SPI, the clock signal is controlled by the master device LPC2148. All data is clocked in and
out using this pin. These lines need to be connected to the relevant pins on the LPC21xx processor. Any
unused GIO pin can be used for CS, instead pull this pin high. Conversion speed is the time it takes for the



20 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

DAC to provide an analog output when the digital input word is changed. The MCP4291 DAC ? SPI
connections with LPC21xx have four I/O lines (P0.4 ? P0.7) required. The analog output is generated by
using these four lines.
Circuit diagram:


Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the embedded c programs for generating ramp wave and square wave using ARM LPC2148 are
written and executed successfully and the waveforms are viewed in oscilloscope.
Outcome:
Able to program the DAC in-built inside the ARM controller and get the waveforms using it.




21 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications :
1. DAC used in Audio amplifier.
2. Video encoder
3. Display electronics
4. Data Acquistion systems
5. Motor control



1. What are the features of LPC2148 DAC?
2. What is the function of DAC register?
3. Which pin provides a voltage reference level for the D/A converter?
4. What are the applications of DAC in signal processing applications?
5. What is GIO?
6. What is the resolution of a digital-to-analog converter (DAC)?
7. What is the major advantage of the R/2R ladder digital-to-analog (DAC), as compared to a binary-
weighted digital-to-analog DAC converter?
8. What is the resolution of a 0?5 V 6-bit digital-to-analog converter (DAC) ?
9. What are DAC configurations?
10. What are the different types of DAC Circuits?
11. What are the Limitations of the Binary Weighted DAC?
12. What are the General DAC Characteristics?
13. Define reference voltage in DAC.
14. What is full scale voltage?
15. What is settling time?
VIVA-VOCE




22 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 4 LED DIMMING USING PWM

Aim:
To write an embedded c program for implementing PWM using ARM controller and verify the same by
dimming of LEDs.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
LPC2148 supports 2 types of PWM:
1) Single Edge PWM ? Pulse starts with new Period i.e pulse is always at the beginning
2) Double Edge PWM ? Pulse can be anywhere within the Period
A PWM block, like a Timer block , has a Timer Counter and an associated Pre-scale Register along
with Match Registers. These work exactly the same way as in the case of Timers. Match Registers 1 to 6
(except 0) are pinned on LPC214x i.e. the corresponding outputs are diverted to actual Pins on LPC214x
MCU. The PWM function must be selected for these Pins to get the PWM output.
The basic setup is to simply replace Servo by a LED and no external 5V source is needed. The
anode of LED is connected to P0.0 and cathode to ground. Pulse Widths corresponding to the switches
connected to P0.1/2/3/4 will be 2.5ms/5ms/7.5ms/10ms respectively. As the Pulse Width Increases LED
will keep on getting brighter and the reverse will happen if Pulse Width is decreased.



23 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus embedded c program for implementing Pulse Width Modulation is written and executed and
output has been verified in LED display.
Outcome:
Able to implement PWM using the ARM controller and verify the same in the form of dimming of
LEDS.



24 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Applications :
1. In Visual signals to covey a message
2. Illumination where light is reflected from objects
3. In Narrow band sensors



1. What factors determine the LED dimming performance?
2. What is meant by analog dimming?
3. What is flickering effect?
4. What is the factor determines dimming of the LED
5. Why Silicon is not suitable for fabrication of light-emitting diodes?
6. Why Silicon diode is less suited for low voltage rectifier operation?
7. What is the principle of zener diode?
8. What are the materials used to make LED?
9. What type of diodes is used in FM receivers?
10. Which diode suffers an avalanche breakdown?
11. What happens if the junction temperature of LED is increased?
12. How a transfer characteristic of a diode does is related?
13. What is the requirement of a clipping action of a diode?
14. What type of rectifier circuit requires four diodes?
15. Why are the pulse width modulated outputs required in most of the applications?
16. How do the variations in an average value get affected by PWM period?
17. Name the common formats available for LED display.
18. What are the types of seven segment display?
19. What is PWM?
20. What are the applications of PWM?

Viva-voce




25 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 5 INTERFACING REAL TIME CLOCK
AND SERIAL PORT
Aim:
To write and execute an embedded c program to interface DS1307 RTC using I2C protocol with ARM
controller
Apparatus Required:
1. LPC2148 ARM development board
2. Stepper motor
3. Interfacing cables
4. PC
Theory:
A clock, which is based on the interrupts at preset intervals, is Real Time Clock (RTC). An interrupt
service routine executes on each timeout (overflow) of this clock. This timing device once started never
resets or never reloaded with another value. Once it is set, it is not modified later. It is used in a system to
save the time and date.













26 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the program for interfacing real time clock with ARM controller is written and executed and the
date and time are verified on the screen.
Outcome:
Able to interface real time clock DS1307 with ARM controller and thereby display date and time
Applications :
1. I2C In ARM and PIC microcontrollers
2. Used as serial communication protocol with MASTER and SLAVE operation.

27 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
27 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00




1. What is I2C and how does it work?
2. What are the features of I2C in LPC2148 ARM7 microcontroller?
3. What is the function of I2C0CONSET register?
4. What is I2C0STAT?
5. What is the function of I2C0 Data Register?
6. What is RTC?
7. List the advantages of RTC
8. Through which port the date and time is displayed in RTC?
9. What is a serial port?
10. List the registers used to transfer data in serial port.
11. List the modes used for data transmission.
12. What is a simplex mode?
13. Which pin is used to transmit a character?
14. What is the baud rate of serial port?
15. What is the disadvantage of RS-232C?














Viva-voce




28 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 6 INTERFACING KEYPAD AND LCD

Aim:
To write an embedded c program to interface 4 x 4 matrix keypad with ARM processor and display the
pressed key in an LCD.
Apparatus Required:
1. LPC2148 ARM development board
2. Interfacing cables
3. PC
Theory:

In matrix keypad, keys are connected in rows and columns. When any switch is pressed, rows and
columns come into contact, which is that detected by controller to identify which key has been pressed. A
4?4 matrix keypad consists of 4 rows and 4 columns. There is a switch connecting each row and column.
So the combinations of rows and columns make up the 16 inputs.Initially all the switches are open (not
connected). When any one button is pressed, the switch is closed (connected),hence there is a connection
between the row and column. The first 4 pins are connected to the column as INPUT. The other 4 pins are
connected to the row as OUTPUT. Matrix keypad is a good substitution to normal push button.












29 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Circuit Diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus program for interfacing matrix keypad with ARM controller is written and executed and the key
pressed is seen in the LCD.



30 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Outcome:
Able to interface keypad with ARM controller and see the pressed key in the LCD display.
Applications :
1. Used in password based door locking system
2. Security system with user changeable
3. Used in laptops, computer games
4. Used in portable video games and cell phones



1. What is Matrix keypad?
2. What is the concept behind keypad interface?
3. What are the functions of pull- up resistors?
4. What is key de bouncing?
5. List the steps involved when the key in a 4 x 4 keyboard matrix is being pressed.
6. What is the value obtained if no key is pressed?
7. What kind of interrupt is generated if a key has to be operated in an interrupt mode?
8. How will you identify that the key is pressed?
9. What are the steps involved in Keyboard Interfacing?
10. List the registers used to store the keyboard, display modes and other operations programmed by
CPU.
11. Name the mode when a data is entered from the left side of the display unit.
12. How many rows and columns are present in a 16 x 2 alphanumeric LCD?
13. How many data lines are there in a 16 x 2 alphanumeric LCD?
14. Which pin of the LCD is used for adjusting its contrast?
15. Which command of an LCD is used to shift the entire display to the right?
16. Which command is used to select the 2 lines and 5 x 7 matrix of an LCD?
17. What changes are to be made to send data to an LCD?
18. For reading operation from an LCD what changes in the software are introduced?
19. Which instruction is used to select the first row first column of an LCD?
Viva-voce

31 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
31 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Expt. No. 7 INTERFACING EEPROM AND INTERRUPT

Aim:
To write a program to interface EEPROM using I2C protocol with ARM controller and retrieve the stored
messages inside EEPROM.
Apparatus Required:
1. LPC2148 ARM development board
2. Interfacing cables
3. PC
Theory:
I2C (Inter Integrated Circuit):
The I2C (Inter-IC) bus is a bi-directional two-wire serial bus that provides a communication link between
integrated circuits (ICs).I2C is a synchronous protocol that allows a master device to initiate communication
with a slave device. Data is exchanged between these devices.
EEPROM:
EEPROM (electrically erasable programmable read-only memory) is user-modifiable read-only
memory (ROM) that can be erased and reprogrammed (written to) repeatedly through the application of
higher than normal electrical voltage. It is a type of non-volatile memory used in computers and other
electronic devices to store small amounts of data that must be saved when power is removed, e.g.,
calibration tables or device configuration
Read, write and Erase EEPROM by using I2C in LPC2148 Primer Board. Wiring up an I2C based
EEPROM to the I2C port is relatively simple. The basic operation of the I2C based EEPROM's is to send a
command, such as WRITE, followed by an address and the data. In WRITE operation, the EEPROM is
used to store the data. In LPC2148 Primer Kit, 2 nos. of EEPROM lines are controlled by I2C Enabled
drivers. I2C Lines serial clock SCL (P0.2), serial data SDA (P0.3) connected to the I2C based serial
EEPROM IC. The EEPROM read & write operations are done in LPC2148 Primer Kit by using these SDA &
SCL I2C lines.
32 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
32 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To down load and run this program: Refer General procedure given in Page No: 60
Result:
Thus, the program for interfacing I2C based EEPROM with ARM processor has been written and
executed successfully and the memory content is verified on Win x talk terminal.
Outcome:
Able to interface memory ICs with ARM controller and perform the read and write operations.
FirstRanker.com - FirstRanker's Choice
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00






?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING

VII SEMESTER - R 2013

EC6711 ? EMBEDDED LABORATORY






Name : _______________________________________
Register No : _______________________________________
Section : _______________________________________
LABORATORY MANUAL



2 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00




is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and
training.

? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different
levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on
heart and soul
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

To impart professional education integrated with human values to the younger generation, so as to
shape them as proficient and dedicated engineers, capable of providing comprehensive solutions to the
challenges in deploying technology for the service of humanity

? To educate the students with the state-of-art technologies to meet the growing challenges of the
electronics industry
? To carry out research through continuous interaction with research institutes and industry, on
advances in communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning,
innovation and ethical practices
VISION
VISION
MISSION
MISSION



3 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

PROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To provide students with a solid foundation in Mathematics, Science and fundamentals of
engineering, enabling them to apply, to find solutions for engineering problems and use this knowledge
to acquire higher education
2. Core Competence
To train the students in Electronics and Communication technologies so that they apply their
knowledge and training to compare, and to analyze various engineering industrial problems to find
solutions
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice which
enables them to find solutions for the real time problems in industry, and to design products
4. Professionalism
To inculcate professional and effective communication skills, leadership qualities and team spirit in
the students to make them multi-faceted personalities and develop their ability to relate engineering
issues to broader social context
5. Lifelong Learning/Ethics
To demonstrate and practice ethical and professional responsibilities in the industry and society in
the large, through commitment and lifelong learning needed for successful professional career


4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
PROGRAMME OUTCOMES (POs)
a) To demonstrate and apply knowledge of Mathematics, Science and engineering fundamentals in
Electronics and Communication Engineering field
b) To design a component, a system or a process to meet the specific needs within the realistic
constraints such as economics, environment, ethics, health, safety and manufacturability
c) To demonstrate the competency to use software tools for computation, simulation and testing of electronics
and communication engineering circuits
d) To identify, formulate and solve electronic and communication engineering problems
e) To demonstrate an ability to visualize and work on laboratory and multidisciplinary tasks
f) To function as a member or a leader in multidisciplinary activities
g) To communicate in verbal and written form with fellow engineers and society at large
h) To understand the impact of Electronics and Communication Engineering in the society and demonstrate
awareness of contemporary issues and commitment to give solutions exhibiting social responsibility
i) To demonstrate professional & ethical responsibilities
j) To exhibit confidence in self-education and ability for lifelong learning
k) To participate and succeed in competitive exams


5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
SYLLABUS

? Learn the working of ARM processor
? Understand the Building Blocks of Embedded Systems
? Learn the concept of memory map and memory interface
? Know the characteristics of Real Time Systems
? Write programs to interface memory, I/Os with processor
? Study the interrupt performance
LIST OF EXPERIMENTS:
1. Study of ARM evaluation system
2. Interfacing ADC and DAC
3. Interfacing LED and PWM
4. Interfacing real time clock and serial port
5. Interfacing keyboard and LCD
6. Interfacing EPROM and interrupt
7. Mailbox
8. Interrupt performance characteristics of ARM and FPGA
9. Flashing of LEDS
10. Interfacing stepper motor and temperature sensor
11. Implementing zigbee protocol with ARM



? Write programs in ARM for a specific Application
? Interface memory and Write programs related to memory operations
? Interface A/D and D/A convertors with ARM system
? Analyze the performance of interrupt
? Write programmes for interfacing keyboard, display, motor and sensor.
? Formulate a mini project using embedded system
COURSE OBJECTIVES
COURSE OUTCOMES
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
CONTENTS
Sl. No. Name of the Experiment Page No.
CYCLE 1 ? EXPERIMENTS
1
Study of ARM evaluation system 7
2
Analog to Digital Convertor interfacing 16
3
Generation of ramp and square wave using on-Chip DAC 19
4
LED dimming using PWM 22
5
Interfacing real time clock and serial port 25
6
Interfacing keypad and LCD 28
7
Interfacing EPROM and interrupt 31
CYCLE 2 ? EXPERIMENTS
8 Implementation of Mailbox Function using LPC 2148 35
9 Interrupt Performance Characteristics of Arm and FPGA 37
10 Flashing of LEDs 40
11 Stepper Motor Interface with ARM ? 7 LPC2148 43
12 LM35 Temperature Sensor Interface with ARM ? 7 LPC2148 47
13
Implementation of Wireless Communication Protocol using ZIGBEE Wireless
Module
50
ADDITIONAL EXPERIMENTS BEYOND THE SYYLABUS
14 Buzzer Interface with ARM ? 7 54
15 Relay interface with ARM? 7 57
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Expt. No. 1 STUDY OF ARM EVALUATION SYSTEM
Aim:
To study the building blocks of ARM7 system, its features, pin configuration and the components
required for functioning of ARM controller.
Architecture Overview:
A RISC-based computer design approach means ARM processors require significantly fewer transistors
than typical processors in average computers. This approach reduces cost, heat and power usage. These
are desirable traits for light, portable, battery-powered devices (smart phones, laptops, tablet and notepad
computers), and other embedded systems. A simpler design facilitates more efficient multi-core CPUs and
higher core counts at lower cost, providing higher processing power and improved energy efficiency for
servers and supercomputers.
In 2005, about 98% of all mobile phones sold used at least one ARM processor. The low power
consumption of ARM processors has made them very popular: 37 billion ARM processors have been
produced as of 2013, up from 10 billion in 2008. The ARM architecture (32-bit) is the most widely used
architecture in mobile devices, and most popular 32-bit one in embedded systems.
According to ARM Holdings, in 2010 alone, producers of chips based on ARM architectures
reported shipments of 6.1 billion ARM based processors, representing 95% of smart phones, 35% of digital
televisions and set-top boxes and 10% of mobile computers. It is the most widely used 32-bit instruction set
architecture in terms of quantity produced.
LPC 2148:
LPC2148 is the widely used IC from ARM-7 family. It is manufactured by Philips and it is pre-loaded
with many inbuilt peripherals making it more efficient and a reliable option for the beginners as well as high
end application developer.




8 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Features of LPC214x series controllers:
1. 8 to 40 kB of on-chip static RAM and 32 to 512 kB of on-chip flash program memory.128 bit wide
interface/accelerator enables high speed 60 MHz operation.
2. In-System/In-Application Programming (ISP/IAP) via on-chip boot-loader software. Single flash sector or
full chip erase in 400 ms and programming of 256 bytes in 1ms.
3. Embedded ICE RT and Embedded Trace interfaces offer real-time debugging with the on-chip Real
Monitor software and high speed tracing of instruction execution.
4. USB 2.0 Full Speed compliant Device Controller with 2 kB of endpoint RAM. In addition, the LPC2146/8
provides 8 kB of on-chip RAM accessible to USB by DMA.
5. One or two (LPC2141/2 vs. LPC2144/6/8) 10-bit A/D converters provide a total of 6/14analog inputs, with
conversion times as low as 2.44 us per channel.
6. Single 10-bit D/A converter provides variable analog output.
7. Two 32-bit timers/external event counters (with four capture and four compare channels each), PWM unit
(six outputs) and watchdog.
8. Low power real-time clock with independent power and dedicated 32 kHz clock input.
9. Multiple serial interfaces including two UARTs (16C550), two Fast I2C-bus (400 kbit/s), SPI and SSP with
buffering and variable data length capabilities.
10. Vectored interrupt controller with configurable priorities and vector addresses.
11. Up to 45 of 5 V tolerant fast general purpose I/O pins in a tiny LQFP64 package.
12. Up to nine edge or level sensitive external interrupt pins available.
13. On-chip integrated oscillator operates with an external crystal in range from 1 MHz to30 MHz and with
an external oscillator up to 50 MHz
14. Power saving modes include Idle and Power-down.
15. Individual enable/disable of peripheral functions as well as peripheral clock scaling for additional power
optimization.
16. Processor wake-up from Power-down mode via external interrupt, USB, Brown-Out Detect (BOD) or
Real-Time Clock (RTC).




9 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


First Step- Hardware Requirement:
Pin configuration of LPC 2148.

Hardware requirement of LPC2148:
1. LPC2148 need minimum below listed hardware to work properly
2. Power Supply
3. Crystal Oscillator
4. Reset Circuit
5. RTC crystal oscillator
6. UART
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Power Supply:
LPC2148 works on 3.3 V power supply. LM 117 can be used for generating 3.3 V supply. However,
basic peripherals like LCD, ULN 2003 (Motor Driver IC) etc. works on 5V. So AC mains supply is converted
into 5V using below mentioned circuit and after that LM 117 is used to convert 5V into 3.3V.
Block diagram of power Supply

Transformer: It is used to step down 230V AC to 9V AC supply and provides isolation between power grids
and circuit.
Rectifier: It is used to convert AC supply into DC.
Filter: It is used to reduce ripple factor of DC output available from rectifier end.
Regulator: It is used to regulate DC supply output.

11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Circuit Diagram:

Regulator IC 7805 is used to provide fix 5V dc supply.
LM 117 is used for generating 3.3V supply from 5V.

12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Calculations:

From the datasheet of LM117

Taking R 2= 240?, we get R 1=392?
Reset Circuit:
Reset button is essential in a system to avoid programming pitfalls and manually bring back the system
to the initialization mode. MCP 130T is a special IC used for providing stable RESET signal to LPC 2148.


13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Oscillator Circuit:

The value of capacitors C20 & C21 depends upon the frequency of crystal Y3. General circuit and
its equivalent circuit is as shown below.

14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Recommended values are as shown in table:

UART:
LPC 2148 has inbuilt ISP which means we can program it within the system using serial
communication on COM0. It has also COM1 for serial communication. MAX 232/233 IC must be used for
voltage logic conversion. Related connections are as given below.

Once the above listed circuit design is ready, we are ready to go further.



15 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Result:
ARM Evaluation system and the configuration of LPC2148 has been studied fully. The minimal setup
required for the functioning of the ARM processor is studied.
Outcomes:
1. Able to understand the ARM controller, its basic components inside and its features.
2. Able to know the components required for the working of ARM LPC2148

Applications:
ARM controller LPC2148 is used in no. of devices such as
1. Smart phones
2. Net books
3. E Readers
4. Digital TV
5. Home Gateways


1. What are the basic units of ARM 7?
2. What is the address system supported by ARM?
3. Define - RISC
4. What are the instructions used to access the memory in ARM?
5. What are the basic units of Microprocessor?
6. What is an Instruction?
7. What is clock cycle?
8. Define - Pipelining
9. What is cache miss?
10. What is meant by memory mapped I/O?
11. Define ? interrupt
12. What is meant by Exception?
13. What is meant by little ? endian mode?
14. What is meant by big ? endian mode?
15. What is the function of CPSR?
16. What is register - indirect addressing?
Viva-voce




16 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 2 ANALOG TO DIGITAL CONVERTOR
INTERFACING
Aim:
To write an embedded c program for interfacing an on chip ADC with LPC2148 ARM processor and
convert the given input voltage into corresponding decimal values.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. PC
Theory:
Analog to Digital converter (ADC) is a device that converts continuously varying analog signals from
instruments that monitor such conditions as movement, temperature, sound, etc., into binary code for the
computer. It may be either a single chip or can be one circuit within a chip. Analog to Digital conversion is
the process of changing continuously varying data, such as voltage, current, or shaft rotation, into discrete
digital quantities that represent the magnitude of the data compared to a standard or reference at the
moment the conversion is made. According to the method of conversion, ADCs can be classified into
Direct-Conversion ADCs, Successive Approximation ADCs, Integrating ADC and Sigma-Delta ADCs.
The LPC 2148 has 10-bit successive approximation analog to digital converter. Basic clocking for the
A/D converters is provided by the VPB clock. A programmable divider is included in each converter, to
scale this clock to the 4.5 MHz (max) clock needed by the successive approximation process. A fully
accurate conversion requires 11 of these clocks. The ADC cell can measure the voltage on any of the ADC
input signals. It is noted that these analog inputs are always connected to their pins, even if the Pin function
Select register assigns them to port pins. A simple self-test of the ADC can be done by driving these pins
as port outputs.



17 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Circuit diagram:




18 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus, an embedded c program for interfacing on-chip ADC with ARM processor is written and
executed. The decimal values of the converted voltage are seen in the WinXTalk screen.
Outcome:
Able to interface A/D convertors with ARM system and check its working by connecting an analog
quantity as input.
Applications:
1. ADC used in MODEM for converting analog signals to digital.
2. A fast video ADC in TV tuner cards
3. ADC used in digital storage oscilloscopes
4. Used in music reproduction technology.
5. Used in DSP if input is analog


1. What are the ADC operating modes in LPC2148?
2. What is meant by conversion time?
3. Why are internal ADCs preferred over external ADCs?
4. Why has 16-bit ADC more resolution than from 10-bit and 8-bit ADC?
5. What are ADC & its Resolution?
6. What is Burst conversion mode?
7. What is the function of A/D Control Register?
8. What is the function of A/D Global Data Register?
9. What is the function of A/D Status Register?
10. What is analog-to-digital (ADC) conversion error?
11. What is the function of Sample-and-hold circuits in analog-to digital converters?
12. What is the disadvantage of the flash analog-to digital converter?
Viva-voce




19 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 3 GENERATION OF RAMP AND SQUARE
WAVE USING ON-CHIP DAC
Aim:
To write and execute an embedded c program to generate ramp wave and square wave using on-chip
DAC of LPC2148 ARM controller.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
A digital-to-analog converter is a device for converting a digital signal into an analog signal (current or
voltage). Digital-to-Analog Converters are the interface between the abstract digital world and the analog
real world. Simple switches, a network of resistors, current sources or capacitors may be used to
implement this conversion. A DAC inputs a binary number and outputs an analog voltage or current signal.
The Microchip Technology Inc. MCP4921 is 2.7 ? 5.5V, low-power, 12-Bit Digital-to-Analog Converter
(DAC) with SPI interface. The MCP4921 DAC provides high accuracy and low noise performance for
industrial applications where calibration or compensation of signals is required. With an SPI connection
there is always one master device (usually a microcontroller) which controls the peripheral devices.
Typically there are three lines common to all the devices,
Master In Slave Out (MISO) ? The Slave line for sending data to the master,
Master Out Slave In (MOSI) ? The Master line for sending data to the peripherals,
Serial Clock (SCK) ? The clock pulses which synchronize data transmission generated by the
master and slave
Slave Select pin ? the pin on each device that the master can use to enable and disable specific
devices. When a device Slave Select pin is low, it communicates with the master. When it is high, it ignores
the master. In SPI, the clock signal is controlled by the master device LPC2148. All data is clocked in and
out using this pin. These lines need to be connected to the relevant pins on the LPC21xx processor. Any
unused GIO pin can be used for CS, instead pull this pin high. Conversion speed is the time it takes for the



20 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

DAC to provide an analog output when the digital input word is changed. The MCP4291 DAC ? SPI
connections with LPC21xx have four I/O lines (P0.4 ? P0.7) required. The analog output is generated by
using these four lines.
Circuit diagram:


Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the embedded c programs for generating ramp wave and square wave using ARM LPC2148 are
written and executed successfully and the waveforms are viewed in oscilloscope.
Outcome:
Able to program the DAC in-built inside the ARM controller and get the waveforms using it.




21 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications :
1. DAC used in Audio amplifier.
2. Video encoder
3. Display electronics
4. Data Acquistion systems
5. Motor control



1. What are the features of LPC2148 DAC?
2. What is the function of DAC register?
3. Which pin provides a voltage reference level for the D/A converter?
4. What are the applications of DAC in signal processing applications?
5. What is GIO?
6. What is the resolution of a digital-to-analog converter (DAC)?
7. What is the major advantage of the R/2R ladder digital-to-analog (DAC), as compared to a binary-
weighted digital-to-analog DAC converter?
8. What is the resolution of a 0?5 V 6-bit digital-to-analog converter (DAC) ?
9. What are DAC configurations?
10. What are the different types of DAC Circuits?
11. What are the Limitations of the Binary Weighted DAC?
12. What are the General DAC Characteristics?
13. Define reference voltage in DAC.
14. What is full scale voltage?
15. What is settling time?
VIVA-VOCE




22 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 4 LED DIMMING USING PWM

Aim:
To write an embedded c program for implementing PWM using ARM controller and verify the same by
dimming of LEDs.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
LPC2148 supports 2 types of PWM:
1) Single Edge PWM ? Pulse starts with new Period i.e pulse is always at the beginning
2) Double Edge PWM ? Pulse can be anywhere within the Period
A PWM block, like a Timer block , has a Timer Counter and an associated Pre-scale Register along
with Match Registers. These work exactly the same way as in the case of Timers. Match Registers 1 to 6
(except 0) are pinned on LPC214x i.e. the corresponding outputs are diverted to actual Pins on LPC214x
MCU. The PWM function must be selected for these Pins to get the PWM output.
The basic setup is to simply replace Servo by a LED and no external 5V source is needed. The
anode of LED is connected to P0.0 and cathode to ground. Pulse Widths corresponding to the switches
connected to P0.1/2/3/4 will be 2.5ms/5ms/7.5ms/10ms respectively. As the Pulse Width Increases LED
will keep on getting brighter and the reverse will happen if Pulse Width is decreased.



23 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus embedded c program for implementing Pulse Width Modulation is written and executed and
output has been verified in LED display.
Outcome:
Able to implement PWM using the ARM controller and verify the same in the form of dimming of
LEDS.



24 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Applications :
1. In Visual signals to covey a message
2. Illumination where light is reflected from objects
3. In Narrow band sensors



1. What factors determine the LED dimming performance?
2. What is meant by analog dimming?
3. What is flickering effect?
4. What is the factor determines dimming of the LED
5. Why Silicon is not suitable for fabrication of light-emitting diodes?
6. Why Silicon diode is less suited for low voltage rectifier operation?
7. What is the principle of zener diode?
8. What are the materials used to make LED?
9. What type of diodes is used in FM receivers?
10. Which diode suffers an avalanche breakdown?
11. What happens if the junction temperature of LED is increased?
12. How a transfer characteristic of a diode does is related?
13. What is the requirement of a clipping action of a diode?
14. What type of rectifier circuit requires four diodes?
15. Why are the pulse width modulated outputs required in most of the applications?
16. How do the variations in an average value get affected by PWM period?
17. Name the common formats available for LED display.
18. What are the types of seven segment display?
19. What is PWM?
20. What are the applications of PWM?

Viva-voce




25 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 5 INTERFACING REAL TIME CLOCK
AND SERIAL PORT
Aim:
To write and execute an embedded c program to interface DS1307 RTC using I2C protocol with ARM
controller
Apparatus Required:
1. LPC2148 ARM development board
2. Stepper motor
3. Interfacing cables
4. PC
Theory:
A clock, which is based on the interrupts at preset intervals, is Real Time Clock (RTC). An interrupt
service routine executes on each timeout (overflow) of this clock. This timing device once started never
resets or never reloaded with another value. Once it is set, it is not modified later. It is used in a system to
save the time and date.













26 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the program for interfacing real time clock with ARM controller is written and executed and the
date and time are verified on the screen.
Outcome:
Able to interface real time clock DS1307 with ARM controller and thereby display date and time
Applications :
1. I2C In ARM and PIC microcontrollers
2. Used as serial communication protocol with MASTER and SLAVE operation.

27 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
27 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00




1. What is I2C and how does it work?
2. What are the features of I2C in LPC2148 ARM7 microcontroller?
3. What is the function of I2C0CONSET register?
4. What is I2C0STAT?
5. What is the function of I2C0 Data Register?
6. What is RTC?
7. List the advantages of RTC
8. Through which port the date and time is displayed in RTC?
9. What is a serial port?
10. List the registers used to transfer data in serial port.
11. List the modes used for data transmission.
12. What is a simplex mode?
13. Which pin is used to transmit a character?
14. What is the baud rate of serial port?
15. What is the disadvantage of RS-232C?














Viva-voce




28 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 6 INTERFACING KEYPAD AND LCD

Aim:
To write an embedded c program to interface 4 x 4 matrix keypad with ARM processor and display the
pressed key in an LCD.
Apparatus Required:
1. LPC2148 ARM development board
2. Interfacing cables
3. PC
Theory:

In matrix keypad, keys are connected in rows and columns. When any switch is pressed, rows and
columns come into contact, which is that detected by controller to identify which key has been pressed. A
4?4 matrix keypad consists of 4 rows and 4 columns. There is a switch connecting each row and column.
So the combinations of rows and columns make up the 16 inputs.Initially all the switches are open (not
connected). When any one button is pressed, the switch is closed (connected),hence there is a connection
between the row and column. The first 4 pins are connected to the column as INPUT. The other 4 pins are
connected to the row as OUTPUT. Matrix keypad is a good substitution to normal push button.












29 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Circuit Diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus program for interfacing matrix keypad with ARM controller is written and executed and the key
pressed is seen in the LCD.



30 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Outcome:
Able to interface keypad with ARM controller and see the pressed key in the LCD display.
Applications :
1. Used in password based door locking system
2. Security system with user changeable
3. Used in laptops, computer games
4. Used in portable video games and cell phones



1. What is Matrix keypad?
2. What is the concept behind keypad interface?
3. What are the functions of pull- up resistors?
4. What is key de bouncing?
5. List the steps involved when the key in a 4 x 4 keyboard matrix is being pressed.
6. What is the value obtained if no key is pressed?
7. What kind of interrupt is generated if a key has to be operated in an interrupt mode?
8. How will you identify that the key is pressed?
9. What are the steps involved in Keyboard Interfacing?
10. List the registers used to store the keyboard, display modes and other operations programmed by
CPU.
11. Name the mode when a data is entered from the left side of the display unit.
12. How many rows and columns are present in a 16 x 2 alphanumeric LCD?
13. How many data lines are there in a 16 x 2 alphanumeric LCD?
14. Which pin of the LCD is used for adjusting its contrast?
15. Which command of an LCD is used to shift the entire display to the right?
16. Which command is used to select the 2 lines and 5 x 7 matrix of an LCD?
17. What changes are to be made to send data to an LCD?
18. For reading operation from an LCD what changes in the software are introduced?
19. Which instruction is used to select the first row first column of an LCD?
Viva-voce

31 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
31 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Expt. No. 7 INTERFACING EEPROM AND INTERRUPT

Aim:
To write a program to interface EEPROM using I2C protocol with ARM controller and retrieve the stored
messages inside EEPROM.
Apparatus Required:
1. LPC2148 ARM development board
2. Interfacing cables
3. PC
Theory:
I2C (Inter Integrated Circuit):
The I2C (Inter-IC) bus is a bi-directional two-wire serial bus that provides a communication link between
integrated circuits (ICs).I2C is a synchronous protocol that allows a master device to initiate communication
with a slave device. Data is exchanged between these devices.
EEPROM:
EEPROM (electrically erasable programmable read-only memory) is user-modifiable read-only
memory (ROM) that can be erased and reprogrammed (written to) repeatedly through the application of
higher than normal electrical voltage. It is a type of non-volatile memory used in computers and other
electronic devices to store small amounts of data that must be saved when power is removed, e.g.,
calibration tables or device configuration
Read, write and Erase EEPROM by using I2C in LPC2148 Primer Board. Wiring up an I2C based
EEPROM to the I2C port is relatively simple. The basic operation of the I2C based EEPROM's is to send a
command, such as WRITE, followed by an address and the data. In WRITE operation, the EEPROM is
used to store the data. In LPC2148 Primer Kit, 2 nos. of EEPROM lines are controlled by I2C Enabled
drivers. I2C Lines serial clock SCL (P0.2), serial data SDA (P0.3) connected to the I2C based serial
EEPROM IC. The EEPROM read & write operations are done in LPC2148 Primer Kit by using these SDA &
SCL I2C lines.
32 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
32 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To down load and run this program: Refer General procedure given in Page No: 60
Result:
Thus, the program for interfacing I2C based EEPROM with ARM processor has been written and
executed successfully and the memory content is verified on Win x talk terminal.
Outcome:
Able to interface memory ICs with ARM controller and perform the read and write operations.



33 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications:
1. ROM used in toys,automobiles to store data when power is off
2. In calculators and peripheral devices
3. In laser printers
4. And also in embedded systems where program need not to be changed.


1. How does I2C protocol work?
2. What is EEPROM?
3. What is meant by master slave mode?
4. What is meant by non-volatile memory?
5. What is an interrupt?
6. How does an interrupt request works?
7. What is a nested interrupt?
8. What are the registers used for enabling an interrupt?
9. What is PROM?
10. What is EPROM?
11. What is mask ROM?
12. Which memory allows simultaneous read and write operations?
13. Which memory has the shortest access times?
14. Which interrupt has the highest priority?
15. What is non maskable interrupt?
16. Which is the first level of memory access by the microprocessor?
17. List the types of cache memories.
18. What is the use of an interrupt?
19. What is the use of converting an interrupt to threads in a microprocessor?
20. What are the bits used to control an external interrupts?


Viva-voce

FirstRanker.com - FirstRanker's Choice
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00






?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING

VII SEMESTER - R 2013

EC6711 ? EMBEDDED LABORATORY






Name : _______________________________________
Register No : _______________________________________
Section : _______________________________________
LABORATORY MANUAL



2 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00




is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and
training.

? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different
levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on
heart and soul
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

To impart professional education integrated with human values to the younger generation, so as to
shape them as proficient and dedicated engineers, capable of providing comprehensive solutions to the
challenges in deploying technology for the service of humanity

? To educate the students with the state-of-art technologies to meet the growing challenges of the
electronics industry
? To carry out research through continuous interaction with research institutes and industry, on
advances in communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning,
innovation and ethical practices
VISION
VISION
MISSION
MISSION



3 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

PROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To provide students with a solid foundation in Mathematics, Science and fundamentals of
engineering, enabling them to apply, to find solutions for engineering problems and use this knowledge
to acquire higher education
2. Core Competence
To train the students in Electronics and Communication technologies so that they apply their
knowledge and training to compare, and to analyze various engineering industrial problems to find
solutions
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice which
enables them to find solutions for the real time problems in industry, and to design products
4. Professionalism
To inculcate professional and effective communication skills, leadership qualities and team spirit in
the students to make them multi-faceted personalities and develop their ability to relate engineering
issues to broader social context
5. Lifelong Learning/Ethics
To demonstrate and practice ethical and professional responsibilities in the industry and society in
the large, through commitment and lifelong learning needed for successful professional career


4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
PROGRAMME OUTCOMES (POs)
a) To demonstrate and apply knowledge of Mathematics, Science and engineering fundamentals in
Electronics and Communication Engineering field
b) To design a component, a system or a process to meet the specific needs within the realistic
constraints such as economics, environment, ethics, health, safety and manufacturability
c) To demonstrate the competency to use software tools for computation, simulation and testing of electronics
and communication engineering circuits
d) To identify, formulate and solve electronic and communication engineering problems
e) To demonstrate an ability to visualize and work on laboratory and multidisciplinary tasks
f) To function as a member or a leader in multidisciplinary activities
g) To communicate in verbal and written form with fellow engineers and society at large
h) To understand the impact of Electronics and Communication Engineering in the society and demonstrate
awareness of contemporary issues and commitment to give solutions exhibiting social responsibility
i) To demonstrate professional & ethical responsibilities
j) To exhibit confidence in self-education and ability for lifelong learning
k) To participate and succeed in competitive exams


5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
SYLLABUS

? Learn the working of ARM processor
? Understand the Building Blocks of Embedded Systems
? Learn the concept of memory map and memory interface
? Know the characteristics of Real Time Systems
? Write programs to interface memory, I/Os with processor
? Study the interrupt performance
LIST OF EXPERIMENTS:
1. Study of ARM evaluation system
2. Interfacing ADC and DAC
3. Interfacing LED and PWM
4. Interfacing real time clock and serial port
5. Interfacing keyboard and LCD
6. Interfacing EPROM and interrupt
7. Mailbox
8. Interrupt performance characteristics of ARM and FPGA
9. Flashing of LEDS
10. Interfacing stepper motor and temperature sensor
11. Implementing zigbee protocol with ARM



? Write programs in ARM for a specific Application
? Interface memory and Write programs related to memory operations
? Interface A/D and D/A convertors with ARM system
? Analyze the performance of interrupt
? Write programmes for interfacing keyboard, display, motor and sensor.
? Formulate a mini project using embedded system
COURSE OBJECTIVES
COURSE OUTCOMES
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
CONTENTS
Sl. No. Name of the Experiment Page No.
CYCLE 1 ? EXPERIMENTS
1
Study of ARM evaluation system 7
2
Analog to Digital Convertor interfacing 16
3
Generation of ramp and square wave using on-Chip DAC 19
4
LED dimming using PWM 22
5
Interfacing real time clock and serial port 25
6
Interfacing keypad and LCD 28
7
Interfacing EPROM and interrupt 31
CYCLE 2 ? EXPERIMENTS
8 Implementation of Mailbox Function using LPC 2148 35
9 Interrupt Performance Characteristics of Arm and FPGA 37
10 Flashing of LEDs 40
11 Stepper Motor Interface with ARM ? 7 LPC2148 43
12 LM35 Temperature Sensor Interface with ARM ? 7 LPC2148 47
13
Implementation of Wireless Communication Protocol using ZIGBEE Wireless
Module
50
ADDITIONAL EXPERIMENTS BEYOND THE SYYLABUS
14 Buzzer Interface with ARM ? 7 54
15 Relay interface with ARM? 7 57
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Expt. No. 1 STUDY OF ARM EVALUATION SYSTEM
Aim:
To study the building blocks of ARM7 system, its features, pin configuration and the components
required for functioning of ARM controller.
Architecture Overview:
A RISC-based computer design approach means ARM processors require significantly fewer transistors
than typical processors in average computers. This approach reduces cost, heat and power usage. These
are desirable traits for light, portable, battery-powered devices (smart phones, laptops, tablet and notepad
computers), and other embedded systems. A simpler design facilitates more efficient multi-core CPUs and
higher core counts at lower cost, providing higher processing power and improved energy efficiency for
servers and supercomputers.
In 2005, about 98% of all mobile phones sold used at least one ARM processor. The low power
consumption of ARM processors has made them very popular: 37 billion ARM processors have been
produced as of 2013, up from 10 billion in 2008. The ARM architecture (32-bit) is the most widely used
architecture in mobile devices, and most popular 32-bit one in embedded systems.
According to ARM Holdings, in 2010 alone, producers of chips based on ARM architectures
reported shipments of 6.1 billion ARM based processors, representing 95% of smart phones, 35% of digital
televisions and set-top boxes and 10% of mobile computers. It is the most widely used 32-bit instruction set
architecture in terms of quantity produced.
LPC 2148:
LPC2148 is the widely used IC from ARM-7 family. It is manufactured by Philips and it is pre-loaded
with many inbuilt peripherals making it more efficient and a reliable option for the beginners as well as high
end application developer.




8 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Features of LPC214x series controllers:
1. 8 to 40 kB of on-chip static RAM and 32 to 512 kB of on-chip flash program memory.128 bit wide
interface/accelerator enables high speed 60 MHz operation.
2. In-System/In-Application Programming (ISP/IAP) via on-chip boot-loader software. Single flash sector or
full chip erase in 400 ms and programming of 256 bytes in 1ms.
3. Embedded ICE RT and Embedded Trace interfaces offer real-time debugging with the on-chip Real
Monitor software and high speed tracing of instruction execution.
4. USB 2.0 Full Speed compliant Device Controller with 2 kB of endpoint RAM. In addition, the LPC2146/8
provides 8 kB of on-chip RAM accessible to USB by DMA.
5. One or two (LPC2141/2 vs. LPC2144/6/8) 10-bit A/D converters provide a total of 6/14analog inputs, with
conversion times as low as 2.44 us per channel.
6. Single 10-bit D/A converter provides variable analog output.
7. Two 32-bit timers/external event counters (with four capture and four compare channels each), PWM unit
(six outputs) and watchdog.
8. Low power real-time clock with independent power and dedicated 32 kHz clock input.
9. Multiple serial interfaces including two UARTs (16C550), two Fast I2C-bus (400 kbit/s), SPI and SSP with
buffering and variable data length capabilities.
10. Vectored interrupt controller with configurable priorities and vector addresses.
11. Up to 45 of 5 V tolerant fast general purpose I/O pins in a tiny LQFP64 package.
12. Up to nine edge or level sensitive external interrupt pins available.
13. On-chip integrated oscillator operates with an external crystal in range from 1 MHz to30 MHz and with
an external oscillator up to 50 MHz
14. Power saving modes include Idle and Power-down.
15. Individual enable/disable of peripheral functions as well as peripheral clock scaling for additional power
optimization.
16. Processor wake-up from Power-down mode via external interrupt, USB, Brown-Out Detect (BOD) or
Real-Time Clock (RTC).




9 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


First Step- Hardware Requirement:
Pin configuration of LPC 2148.

Hardware requirement of LPC2148:
1. LPC2148 need minimum below listed hardware to work properly
2. Power Supply
3. Crystal Oscillator
4. Reset Circuit
5. RTC crystal oscillator
6. UART
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Power Supply:
LPC2148 works on 3.3 V power supply. LM 117 can be used for generating 3.3 V supply. However,
basic peripherals like LCD, ULN 2003 (Motor Driver IC) etc. works on 5V. So AC mains supply is converted
into 5V using below mentioned circuit and after that LM 117 is used to convert 5V into 3.3V.
Block diagram of power Supply

Transformer: It is used to step down 230V AC to 9V AC supply and provides isolation between power grids
and circuit.
Rectifier: It is used to convert AC supply into DC.
Filter: It is used to reduce ripple factor of DC output available from rectifier end.
Regulator: It is used to regulate DC supply output.

11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Circuit Diagram:

Regulator IC 7805 is used to provide fix 5V dc supply.
LM 117 is used for generating 3.3V supply from 5V.

12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Calculations:

From the datasheet of LM117

Taking R 2= 240?, we get R 1=392?
Reset Circuit:
Reset button is essential in a system to avoid programming pitfalls and manually bring back the system
to the initialization mode. MCP 130T is a special IC used for providing stable RESET signal to LPC 2148.


13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Oscillator Circuit:

The value of capacitors C20 & C21 depends upon the frequency of crystal Y3. General circuit and
its equivalent circuit is as shown below.

14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Recommended values are as shown in table:

UART:
LPC 2148 has inbuilt ISP which means we can program it within the system using serial
communication on COM0. It has also COM1 for serial communication. MAX 232/233 IC must be used for
voltage logic conversion. Related connections are as given below.

Once the above listed circuit design is ready, we are ready to go further.



15 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Result:
ARM Evaluation system and the configuration of LPC2148 has been studied fully. The minimal setup
required for the functioning of the ARM processor is studied.
Outcomes:
1. Able to understand the ARM controller, its basic components inside and its features.
2. Able to know the components required for the working of ARM LPC2148

Applications:
ARM controller LPC2148 is used in no. of devices such as
1. Smart phones
2. Net books
3. E Readers
4. Digital TV
5. Home Gateways


1. What are the basic units of ARM 7?
2. What is the address system supported by ARM?
3. Define - RISC
4. What are the instructions used to access the memory in ARM?
5. What are the basic units of Microprocessor?
6. What is an Instruction?
7. What is clock cycle?
8. Define - Pipelining
9. What is cache miss?
10. What is meant by memory mapped I/O?
11. Define ? interrupt
12. What is meant by Exception?
13. What is meant by little ? endian mode?
14. What is meant by big ? endian mode?
15. What is the function of CPSR?
16. What is register - indirect addressing?
Viva-voce




16 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 2 ANALOG TO DIGITAL CONVERTOR
INTERFACING
Aim:
To write an embedded c program for interfacing an on chip ADC with LPC2148 ARM processor and
convert the given input voltage into corresponding decimal values.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. PC
Theory:
Analog to Digital converter (ADC) is a device that converts continuously varying analog signals from
instruments that monitor such conditions as movement, temperature, sound, etc., into binary code for the
computer. It may be either a single chip or can be one circuit within a chip. Analog to Digital conversion is
the process of changing continuously varying data, such as voltage, current, or shaft rotation, into discrete
digital quantities that represent the magnitude of the data compared to a standard or reference at the
moment the conversion is made. According to the method of conversion, ADCs can be classified into
Direct-Conversion ADCs, Successive Approximation ADCs, Integrating ADC and Sigma-Delta ADCs.
The LPC 2148 has 10-bit successive approximation analog to digital converter. Basic clocking for the
A/D converters is provided by the VPB clock. A programmable divider is included in each converter, to
scale this clock to the 4.5 MHz (max) clock needed by the successive approximation process. A fully
accurate conversion requires 11 of these clocks. The ADC cell can measure the voltage on any of the ADC
input signals. It is noted that these analog inputs are always connected to their pins, even if the Pin function
Select register assigns them to port pins. A simple self-test of the ADC can be done by driving these pins
as port outputs.



17 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Circuit diagram:




18 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus, an embedded c program for interfacing on-chip ADC with ARM processor is written and
executed. The decimal values of the converted voltage are seen in the WinXTalk screen.
Outcome:
Able to interface A/D convertors with ARM system and check its working by connecting an analog
quantity as input.
Applications:
1. ADC used in MODEM for converting analog signals to digital.
2. A fast video ADC in TV tuner cards
3. ADC used in digital storage oscilloscopes
4. Used in music reproduction technology.
5. Used in DSP if input is analog


1. What are the ADC operating modes in LPC2148?
2. What is meant by conversion time?
3. Why are internal ADCs preferred over external ADCs?
4. Why has 16-bit ADC more resolution than from 10-bit and 8-bit ADC?
5. What are ADC & its Resolution?
6. What is Burst conversion mode?
7. What is the function of A/D Control Register?
8. What is the function of A/D Global Data Register?
9. What is the function of A/D Status Register?
10. What is analog-to-digital (ADC) conversion error?
11. What is the function of Sample-and-hold circuits in analog-to digital converters?
12. What is the disadvantage of the flash analog-to digital converter?
Viva-voce




19 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 3 GENERATION OF RAMP AND SQUARE
WAVE USING ON-CHIP DAC
Aim:
To write and execute an embedded c program to generate ramp wave and square wave using on-chip
DAC of LPC2148 ARM controller.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
A digital-to-analog converter is a device for converting a digital signal into an analog signal (current or
voltage). Digital-to-Analog Converters are the interface between the abstract digital world and the analog
real world. Simple switches, a network of resistors, current sources or capacitors may be used to
implement this conversion. A DAC inputs a binary number and outputs an analog voltage or current signal.
The Microchip Technology Inc. MCP4921 is 2.7 ? 5.5V, low-power, 12-Bit Digital-to-Analog Converter
(DAC) with SPI interface. The MCP4921 DAC provides high accuracy and low noise performance for
industrial applications where calibration or compensation of signals is required. With an SPI connection
there is always one master device (usually a microcontroller) which controls the peripheral devices.
Typically there are three lines common to all the devices,
Master In Slave Out (MISO) ? The Slave line for sending data to the master,
Master Out Slave In (MOSI) ? The Master line for sending data to the peripherals,
Serial Clock (SCK) ? The clock pulses which synchronize data transmission generated by the
master and slave
Slave Select pin ? the pin on each device that the master can use to enable and disable specific
devices. When a device Slave Select pin is low, it communicates with the master. When it is high, it ignores
the master. In SPI, the clock signal is controlled by the master device LPC2148. All data is clocked in and
out using this pin. These lines need to be connected to the relevant pins on the LPC21xx processor. Any
unused GIO pin can be used for CS, instead pull this pin high. Conversion speed is the time it takes for the



20 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

DAC to provide an analog output when the digital input word is changed. The MCP4291 DAC ? SPI
connections with LPC21xx have four I/O lines (P0.4 ? P0.7) required. The analog output is generated by
using these four lines.
Circuit diagram:


Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the embedded c programs for generating ramp wave and square wave using ARM LPC2148 are
written and executed successfully and the waveforms are viewed in oscilloscope.
Outcome:
Able to program the DAC in-built inside the ARM controller and get the waveforms using it.




21 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications :
1. DAC used in Audio amplifier.
2. Video encoder
3. Display electronics
4. Data Acquistion systems
5. Motor control



1. What are the features of LPC2148 DAC?
2. What is the function of DAC register?
3. Which pin provides a voltage reference level for the D/A converter?
4. What are the applications of DAC in signal processing applications?
5. What is GIO?
6. What is the resolution of a digital-to-analog converter (DAC)?
7. What is the major advantage of the R/2R ladder digital-to-analog (DAC), as compared to a binary-
weighted digital-to-analog DAC converter?
8. What is the resolution of a 0?5 V 6-bit digital-to-analog converter (DAC) ?
9. What are DAC configurations?
10. What are the different types of DAC Circuits?
11. What are the Limitations of the Binary Weighted DAC?
12. What are the General DAC Characteristics?
13. Define reference voltage in DAC.
14. What is full scale voltage?
15. What is settling time?
VIVA-VOCE




22 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 4 LED DIMMING USING PWM

Aim:
To write an embedded c program for implementing PWM using ARM controller and verify the same by
dimming of LEDs.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
LPC2148 supports 2 types of PWM:
1) Single Edge PWM ? Pulse starts with new Period i.e pulse is always at the beginning
2) Double Edge PWM ? Pulse can be anywhere within the Period
A PWM block, like a Timer block , has a Timer Counter and an associated Pre-scale Register along
with Match Registers. These work exactly the same way as in the case of Timers. Match Registers 1 to 6
(except 0) are pinned on LPC214x i.e. the corresponding outputs are diverted to actual Pins on LPC214x
MCU. The PWM function must be selected for these Pins to get the PWM output.
The basic setup is to simply replace Servo by a LED and no external 5V source is needed. The
anode of LED is connected to P0.0 and cathode to ground. Pulse Widths corresponding to the switches
connected to P0.1/2/3/4 will be 2.5ms/5ms/7.5ms/10ms respectively. As the Pulse Width Increases LED
will keep on getting brighter and the reverse will happen if Pulse Width is decreased.



23 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus embedded c program for implementing Pulse Width Modulation is written and executed and
output has been verified in LED display.
Outcome:
Able to implement PWM using the ARM controller and verify the same in the form of dimming of
LEDS.



24 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Applications :
1. In Visual signals to covey a message
2. Illumination where light is reflected from objects
3. In Narrow band sensors



1. What factors determine the LED dimming performance?
2. What is meant by analog dimming?
3. What is flickering effect?
4. What is the factor determines dimming of the LED
5. Why Silicon is not suitable for fabrication of light-emitting diodes?
6. Why Silicon diode is less suited for low voltage rectifier operation?
7. What is the principle of zener diode?
8. What are the materials used to make LED?
9. What type of diodes is used in FM receivers?
10. Which diode suffers an avalanche breakdown?
11. What happens if the junction temperature of LED is increased?
12. How a transfer characteristic of a diode does is related?
13. What is the requirement of a clipping action of a diode?
14. What type of rectifier circuit requires four diodes?
15. Why are the pulse width modulated outputs required in most of the applications?
16. How do the variations in an average value get affected by PWM period?
17. Name the common formats available for LED display.
18. What are the types of seven segment display?
19. What is PWM?
20. What are the applications of PWM?

Viva-voce




25 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 5 INTERFACING REAL TIME CLOCK
AND SERIAL PORT
Aim:
To write and execute an embedded c program to interface DS1307 RTC using I2C protocol with ARM
controller
Apparatus Required:
1. LPC2148 ARM development board
2. Stepper motor
3. Interfacing cables
4. PC
Theory:
A clock, which is based on the interrupts at preset intervals, is Real Time Clock (RTC). An interrupt
service routine executes on each timeout (overflow) of this clock. This timing device once started never
resets or never reloaded with another value. Once it is set, it is not modified later. It is used in a system to
save the time and date.













26 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the program for interfacing real time clock with ARM controller is written and executed and the
date and time are verified on the screen.
Outcome:
Able to interface real time clock DS1307 with ARM controller and thereby display date and time
Applications :
1. I2C In ARM and PIC microcontrollers
2. Used as serial communication protocol with MASTER and SLAVE operation.

27 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
27 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00




1. What is I2C and how does it work?
2. What are the features of I2C in LPC2148 ARM7 microcontroller?
3. What is the function of I2C0CONSET register?
4. What is I2C0STAT?
5. What is the function of I2C0 Data Register?
6. What is RTC?
7. List the advantages of RTC
8. Through which port the date and time is displayed in RTC?
9. What is a serial port?
10. List the registers used to transfer data in serial port.
11. List the modes used for data transmission.
12. What is a simplex mode?
13. Which pin is used to transmit a character?
14. What is the baud rate of serial port?
15. What is the disadvantage of RS-232C?














Viva-voce




28 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 6 INTERFACING KEYPAD AND LCD

Aim:
To write an embedded c program to interface 4 x 4 matrix keypad with ARM processor and display the
pressed key in an LCD.
Apparatus Required:
1. LPC2148 ARM development board
2. Interfacing cables
3. PC
Theory:

In matrix keypad, keys are connected in rows and columns. When any switch is pressed, rows and
columns come into contact, which is that detected by controller to identify which key has been pressed. A
4?4 matrix keypad consists of 4 rows and 4 columns. There is a switch connecting each row and column.
So the combinations of rows and columns make up the 16 inputs.Initially all the switches are open (not
connected). When any one button is pressed, the switch is closed (connected),hence there is a connection
between the row and column. The first 4 pins are connected to the column as INPUT. The other 4 pins are
connected to the row as OUTPUT. Matrix keypad is a good substitution to normal push button.












29 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Circuit Diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus program for interfacing matrix keypad with ARM controller is written and executed and the key
pressed is seen in the LCD.



30 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Outcome:
Able to interface keypad with ARM controller and see the pressed key in the LCD display.
Applications :
1. Used in password based door locking system
2. Security system with user changeable
3. Used in laptops, computer games
4. Used in portable video games and cell phones



1. What is Matrix keypad?
2. What is the concept behind keypad interface?
3. What are the functions of pull- up resistors?
4. What is key de bouncing?
5. List the steps involved when the key in a 4 x 4 keyboard matrix is being pressed.
6. What is the value obtained if no key is pressed?
7. What kind of interrupt is generated if a key has to be operated in an interrupt mode?
8. How will you identify that the key is pressed?
9. What are the steps involved in Keyboard Interfacing?
10. List the registers used to store the keyboard, display modes and other operations programmed by
CPU.
11. Name the mode when a data is entered from the left side of the display unit.
12. How many rows and columns are present in a 16 x 2 alphanumeric LCD?
13. How many data lines are there in a 16 x 2 alphanumeric LCD?
14. Which pin of the LCD is used for adjusting its contrast?
15. Which command of an LCD is used to shift the entire display to the right?
16. Which command is used to select the 2 lines and 5 x 7 matrix of an LCD?
17. What changes are to be made to send data to an LCD?
18. For reading operation from an LCD what changes in the software are introduced?
19. Which instruction is used to select the first row first column of an LCD?
Viva-voce

31 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
31 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Expt. No. 7 INTERFACING EEPROM AND INTERRUPT

Aim:
To write a program to interface EEPROM using I2C protocol with ARM controller and retrieve the stored
messages inside EEPROM.
Apparatus Required:
1. LPC2148 ARM development board
2. Interfacing cables
3. PC
Theory:
I2C (Inter Integrated Circuit):
The I2C (Inter-IC) bus is a bi-directional two-wire serial bus that provides a communication link between
integrated circuits (ICs).I2C is a synchronous protocol that allows a master device to initiate communication
with a slave device. Data is exchanged between these devices.
EEPROM:
EEPROM (electrically erasable programmable read-only memory) is user-modifiable read-only
memory (ROM) that can be erased and reprogrammed (written to) repeatedly through the application of
higher than normal electrical voltage. It is a type of non-volatile memory used in computers and other
electronic devices to store small amounts of data that must be saved when power is removed, e.g.,
calibration tables or device configuration
Read, write and Erase EEPROM by using I2C in LPC2148 Primer Board. Wiring up an I2C based
EEPROM to the I2C port is relatively simple. The basic operation of the I2C based EEPROM's is to send a
command, such as WRITE, followed by an address and the data. In WRITE operation, the EEPROM is
used to store the data. In LPC2148 Primer Kit, 2 nos. of EEPROM lines are controlled by I2C Enabled
drivers. I2C Lines serial clock SCL (P0.2), serial data SDA (P0.3) connected to the I2C based serial
EEPROM IC. The EEPROM read & write operations are done in LPC2148 Primer Kit by using these SDA &
SCL I2C lines.
32 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
32 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To down load and run this program: Refer General procedure given in Page No: 60
Result:
Thus, the program for interfacing I2C based EEPROM with ARM processor has been written and
executed successfully and the memory content is verified on Win x talk terminal.
Outcome:
Able to interface memory ICs with ARM controller and perform the read and write operations.



33 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications:
1. ROM used in toys,automobiles to store data when power is off
2. In calculators and peripheral devices
3. In laser printers
4. And also in embedded systems where program need not to be changed.


1. How does I2C protocol work?
2. What is EEPROM?
3. What is meant by master slave mode?
4. What is meant by non-volatile memory?
5. What is an interrupt?
6. How does an interrupt request works?
7. What is a nested interrupt?
8. What are the registers used for enabling an interrupt?
9. What is PROM?
10. What is EPROM?
11. What is mask ROM?
12. Which memory allows simultaneous read and write operations?
13. Which memory has the shortest access times?
14. Which interrupt has the highest priority?
15. What is non maskable interrupt?
16. Which is the first level of memory access by the microprocessor?
17. List the types of cache memories.
18. What is the use of an interrupt?
19. What is the use of converting an interrupt to threads in a microprocessor?
20. What are the bits used to control an external interrupts?


Viva-voce




34 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00










CYCLE 2 - EXPERIMENTS

FirstRanker.com - FirstRanker's Choice
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00






?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING

VII SEMESTER - R 2013

EC6711 ? EMBEDDED LABORATORY






Name : _______________________________________
Register No : _______________________________________
Section : _______________________________________
LABORATORY MANUAL



2 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00




is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and
training.

? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different
levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on
heart and soul
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

To impart professional education integrated with human values to the younger generation, so as to
shape them as proficient and dedicated engineers, capable of providing comprehensive solutions to the
challenges in deploying technology for the service of humanity

? To educate the students with the state-of-art technologies to meet the growing challenges of the
electronics industry
? To carry out research through continuous interaction with research institutes and industry, on
advances in communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning,
innovation and ethical practices
VISION
VISION
MISSION
MISSION



3 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

PROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To provide students with a solid foundation in Mathematics, Science and fundamentals of
engineering, enabling them to apply, to find solutions for engineering problems and use this knowledge
to acquire higher education
2. Core Competence
To train the students in Electronics and Communication technologies so that they apply their
knowledge and training to compare, and to analyze various engineering industrial problems to find
solutions
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice which
enables them to find solutions for the real time problems in industry, and to design products
4. Professionalism
To inculcate professional and effective communication skills, leadership qualities and team spirit in
the students to make them multi-faceted personalities and develop their ability to relate engineering
issues to broader social context
5. Lifelong Learning/Ethics
To demonstrate and practice ethical and professional responsibilities in the industry and society in
the large, through commitment and lifelong learning needed for successful professional career


4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
PROGRAMME OUTCOMES (POs)
a) To demonstrate and apply knowledge of Mathematics, Science and engineering fundamentals in
Electronics and Communication Engineering field
b) To design a component, a system or a process to meet the specific needs within the realistic
constraints such as economics, environment, ethics, health, safety and manufacturability
c) To demonstrate the competency to use software tools for computation, simulation and testing of electronics
and communication engineering circuits
d) To identify, formulate and solve electronic and communication engineering problems
e) To demonstrate an ability to visualize and work on laboratory and multidisciplinary tasks
f) To function as a member or a leader in multidisciplinary activities
g) To communicate in verbal and written form with fellow engineers and society at large
h) To understand the impact of Electronics and Communication Engineering in the society and demonstrate
awareness of contemporary issues and commitment to give solutions exhibiting social responsibility
i) To demonstrate professional & ethical responsibilities
j) To exhibit confidence in self-education and ability for lifelong learning
k) To participate and succeed in competitive exams


5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
SYLLABUS

? Learn the working of ARM processor
? Understand the Building Blocks of Embedded Systems
? Learn the concept of memory map and memory interface
? Know the characteristics of Real Time Systems
? Write programs to interface memory, I/Os with processor
? Study the interrupt performance
LIST OF EXPERIMENTS:
1. Study of ARM evaluation system
2. Interfacing ADC and DAC
3. Interfacing LED and PWM
4. Interfacing real time clock and serial port
5. Interfacing keyboard and LCD
6. Interfacing EPROM and interrupt
7. Mailbox
8. Interrupt performance characteristics of ARM and FPGA
9. Flashing of LEDS
10. Interfacing stepper motor and temperature sensor
11. Implementing zigbee protocol with ARM



? Write programs in ARM for a specific Application
? Interface memory and Write programs related to memory operations
? Interface A/D and D/A convertors with ARM system
? Analyze the performance of interrupt
? Write programmes for interfacing keyboard, display, motor and sensor.
? Formulate a mini project using embedded system
COURSE OBJECTIVES
COURSE OUTCOMES
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
CONTENTS
Sl. No. Name of the Experiment Page No.
CYCLE 1 ? EXPERIMENTS
1
Study of ARM evaluation system 7
2
Analog to Digital Convertor interfacing 16
3
Generation of ramp and square wave using on-Chip DAC 19
4
LED dimming using PWM 22
5
Interfacing real time clock and serial port 25
6
Interfacing keypad and LCD 28
7
Interfacing EPROM and interrupt 31
CYCLE 2 ? EXPERIMENTS
8 Implementation of Mailbox Function using LPC 2148 35
9 Interrupt Performance Characteristics of Arm and FPGA 37
10 Flashing of LEDs 40
11 Stepper Motor Interface with ARM ? 7 LPC2148 43
12 LM35 Temperature Sensor Interface with ARM ? 7 LPC2148 47
13
Implementation of Wireless Communication Protocol using ZIGBEE Wireless
Module
50
ADDITIONAL EXPERIMENTS BEYOND THE SYYLABUS
14 Buzzer Interface with ARM ? 7 54
15 Relay interface with ARM? 7 57
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Expt. No. 1 STUDY OF ARM EVALUATION SYSTEM
Aim:
To study the building blocks of ARM7 system, its features, pin configuration and the components
required for functioning of ARM controller.
Architecture Overview:
A RISC-based computer design approach means ARM processors require significantly fewer transistors
than typical processors in average computers. This approach reduces cost, heat and power usage. These
are desirable traits for light, portable, battery-powered devices (smart phones, laptops, tablet and notepad
computers), and other embedded systems. A simpler design facilitates more efficient multi-core CPUs and
higher core counts at lower cost, providing higher processing power and improved energy efficiency for
servers and supercomputers.
In 2005, about 98% of all mobile phones sold used at least one ARM processor. The low power
consumption of ARM processors has made them very popular: 37 billion ARM processors have been
produced as of 2013, up from 10 billion in 2008. The ARM architecture (32-bit) is the most widely used
architecture in mobile devices, and most popular 32-bit one in embedded systems.
According to ARM Holdings, in 2010 alone, producers of chips based on ARM architectures
reported shipments of 6.1 billion ARM based processors, representing 95% of smart phones, 35% of digital
televisions and set-top boxes and 10% of mobile computers. It is the most widely used 32-bit instruction set
architecture in terms of quantity produced.
LPC 2148:
LPC2148 is the widely used IC from ARM-7 family. It is manufactured by Philips and it is pre-loaded
with many inbuilt peripherals making it more efficient and a reliable option for the beginners as well as high
end application developer.




8 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Features of LPC214x series controllers:
1. 8 to 40 kB of on-chip static RAM and 32 to 512 kB of on-chip flash program memory.128 bit wide
interface/accelerator enables high speed 60 MHz operation.
2. In-System/In-Application Programming (ISP/IAP) via on-chip boot-loader software. Single flash sector or
full chip erase in 400 ms and programming of 256 bytes in 1ms.
3. Embedded ICE RT and Embedded Trace interfaces offer real-time debugging with the on-chip Real
Monitor software and high speed tracing of instruction execution.
4. USB 2.0 Full Speed compliant Device Controller with 2 kB of endpoint RAM. In addition, the LPC2146/8
provides 8 kB of on-chip RAM accessible to USB by DMA.
5. One or two (LPC2141/2 vs. LPC2144/6/8) 10-bit A/D converters provide a total of 6/14analog inputs, with
conversion times as low as 2.44 us per channel.
6. Single 10-bit D/A converter provides variable analog output.
7. Two 32-bit timers/external event counters (with four capture and four compare channels each), PWM unit
(six outputs) and watchdog.
8. Low power real-time clock with independent power and dedicated 32 kHz clock input.
9. Multiple serial interfaces including two UARTs (16C550), two Fast I2C-bus (400 kbit/s), SPI and SSP with
buffering and variable data length capabilities.
10. Vectored interrupt controller with configurable priorities and vector addresses.
11. Up to 45 of 5 V tolerant fast general purpose I/O pins in a tiny LQFP64 package.
12. Up to nine edge or level sensitive external interrupt pins available.
13. On-chip integrated oscillator operates with an external crystal in range from 1 MHz to30 MHz and with
an external oscillator up to 50 MHz
14. Power saving modes include Idle and Power-down.
15. Individual enable/disable of peripheral functions as well as peripheral clock scaling for additional power
optimization.
16. Processor wake-up from Power-down mode via external interrupt, USB, Brown-Out Detect (BOD) or
Real-Time Clock (RTC).




9 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


First Step- Hardware Requirement:
Pin configuration of LPC 2148.

Hardware requirement of LPC2148:
1. LPC2148 need minimum below listed hardware to work properly
2. Power Supply
3. Crystal Oscillator
4. Reset Circuit
5. RTC crystal oscillator
6. UART
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Power Supply:
LPC2148 works on 3.3 V power supply. LM 117 can be used for generating 3.3 V supply. However,
basic peripherals like LCD, ULN 2003 (Motor Driver IC) etc. works on 5V. So AC mains supply is converted
into 5V using below mentioned circuit and after that LM 117 is used to convert 5V into 3.3V.
Block diagram of power Supply

Transformer: It is used to step down 230V AC to 9V AC supply and provides isolation between power grids
and circuit.
Rectifier: It is used to convert AC supply into DC.
Filter: It is used to reduce ripple factor of DC output available from rectifier end.
Regulator: It is used to regulate DC supply output.

11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Circuit Diagram:

Regulator IC 7805 is used to provide fix 5V dc supply.
LM 117 is used for generating 3.3V supply from 5V.

12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Calculations:

From the datasheet of LM117

Taking R 2= 240?, we get R 1=392?
Reset Circuit:
Reset button is essential in a system to avoid programming pitfalls and manually bring back the system
to the initialization mode. MCP 130T is a special IC used for providing stable RESET signal to LPC 2148.


13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Oscillator Circuit:

The value of capacitors C20 & C21 depends upon the frequency of crystal Y3. General circuit and
its equivalent circuit is as shown below.

14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Recommended values are as shown in table:

UART:
LPC 2148 has inbuilt ISP which means we can program it within the system using serial
communication on COM0. It has also COM1 for serial communication. MAX 232/233 IC must be used for
voltage logic conversion. Related connections are as given below.

Once the above listed circuit design is ready, we are ready to go further.



15 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Result:
ARM Evaluation system and the configuration of LPC2148 has been studied fully. The minimal setup
required for the functioning of the ARM processor is studied.
Outcomes:
1. Able to understand the ARM controller, its basic components inside and its features.
2. Able to know the components required for the working of ARM LPC2148

Applications:
ARM controller LPC2148 is used in no. of devices such as
1. Smart phones
2. Net books
3. E Readers
4. Digital TV
5. Home Gateways


1. What are the basic units of ARM 7?
2. What is the address system supported by ARM?
3. Define - RISC
4. What are the instructions used to access the memory in ARM?
5. What are the basic units of Microprocessor?
6. What is an Instruction?
7. What is clock cycle?
8. Define - Pipelining
9. What is cache miss?
10. What is meant by memory mapped I/O?
11. Define ? interrupt
12. What is meant by Exception?
13. What is meant by little ? endian mode?
14. What is meant by big ? endian mode?
15. What is the function of CPSR?
16. What is register - indirect addressing?
Viva-voce




16 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 2 ANALOG TO DIGITAL CONVERTOR
INTERFACING
Aim:
To write an embedded c program for interfacing an on chip ADC with LPC2148 ARM processor and
convert the given input voltage into corresponding decimal values.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. PC
Theory:
Analog to Digital converter (ADC) is a device that converts continuously varying analog signals from
instruments that monitor such conditions as movement, temperature, sound, etc., into binary code for the
computer. It may be either a single chip or can be one circuit within a chip. Analog to Digital conversion is
the process of changing continuously varying data, such as voltage, current, or shaft rotation, into discrete
digital quantities that represent the magnitude of the data compared to a standard or reference at the
moment the conversion is made. According to the method of conversion, ADCs can be classified into
Direct-Conversion ADCs, Successive Approximation ADCs, Integrating ADC and Sigma-Delta ADCs.
The LPC 2148 has 10-bit successive approximation analog to digital converter. Basic clocking for the
A/D converters is provided by the VPB clock. A programmable divider is included in each converter, to
scale this clock to the 4.5 MHz (max) clock needed by the successive approximation process. A fully
accurate conversion requires 11 of these clocks. The ADC cell can measure the voltage on any of the ADC
input signals. It is noted that these analog inputs are always connected to their pins, even if the Pin function
Select register assigns them to port pins. A simple self-test of the ADC can be done by driving these pins
as port outputs.



17 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Circuit diagram:




18 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus, an embedded c program for interfacing on-chip ADC with ARM processor is written and
executed. The decimal values of the converted voltage are seen in the WinXTalk screen.
Outcome:
Able to interface A/D convertors with ARM system and check its working by connecting an analog
quantity as input.
Applications:
1. ADC used in MODEM for converting analog signals to digital.
2. A fast video ADC in TV tuner cards
3. ADC used in digital storage oscilloscopes
4. Used in music reproduction technology.
5. Used in DSP if input is analog


1. What are the ADC operating modes in LPC2148?
2. What is meant by conversion time?
3. Why are internal ADCs preferred over external ADCs?
4. Why has 16-bit ADC more resolution than from 10-bit and 8-bit ADC?
5. What are ADC & its Resolution?
6. What is Burst conversion mode?
7. What is the function of A/D Control Register?
8. What is the function of A/D Global Data Register?
9. What is the function of A/D Status Register?
10. What is analog-to-digital (ADC) conversion error?
11. What is the function of Sample-and-hold circuits in analog-to digital converters?
12. What is the disadvantage of the flash analog-to digital converter?
Viva-voce




19 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 3 GENERATION OF RAMP AND SQUARE
WAVE USING ON-CHIP DAC
Aim:
To write and execute an embedded c program to generate ramp wave and square wave using on-chip
DAC of LPC2148 ARM controller.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
A digital-to-analog converter is a device for converting a digital signal into an analog signal (current or
voltage). Digital-to-Analog Converters are the interface between the abstract digital world and the analog
real world. Simple switches, a network of resistors, current sources or capacitors may be used to
implement this conversion. A DAC inputs a binary number and outputs an analog voltage or current signal.
The Microchip Technology Inc. MCP4921 is 2.7 ? 5.5V, low-power, 12-Bit Digital-to-Analog Converter
(DAC) with SPI interface. The MCP4921 DAC provides high accuracy and low noise performance for
industrial applications where calibration or compensation of signals is required. With an SPI connection
there is always one master device (usually a microcontroller) which controls the peripheral devices.
Typically there are three lines common to all the devices,
Master In Slave Out (MISO) ? The Slave line for sending data to the master,
Master Out Slave In (MOSI) ? The Master line for sending data to the peripherals,
Serial Clock (SCK) ? The clock pulses which synchronize data transmission generated by the
master and slave
Slave Select pin ? the pin on each device that the master can use to enable and disable specific
devices. When a device Slave Select pin is low, it communicates with the master. When it is high, it ignores
the master. In SPI, the clock signal is controlled by the master device LPC2148. All data is clocked in and
out using this pin. These lines need to be connected to the relevant pins on the LPC21xx processor. Any
unused GIO pin can be used for CS, instead pull this pin high. Conversion speed is the time it takes for the



20 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

DAC to provide an analog output when the digital input word is changed. The MCP4291 DAC ? SPI
connections with LPC21xx have four I/O lines (P0.4 ? P0.7) required. The analog output is generated by
using these four lines.
Circuit diagram:


Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the embedded c programs for generating ramp wave and square wave using ARM LPC2148 are
written and executed successfully and the waveforms are viewed in oscilloscope.
Outcome:
Able to program the DAC in-built inside the ARM controller and get the waveforms using it.




21 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications :
1. DAC used in Audio amplifier.
2. Video encoder
3. Display electronics
4. Data Acquistion systems
5. Motor control



1. What are the features of LPC2148 DAC?
2. What is the function of DAC register?
3. Which pin provides a voltage reference level for the D/A converter?
4. What are the applications of DAC in signal processing applications?
5. What is GIO?
6. What is the resolution of a digital-to-analog converter (DAC)?
7. What is the major advantage of the R/2R ladder digital-to-analog (DAC), as compared to a binary-
weighted digital-to-analog DAC converter?
8. What is the resolution of a 0?5 V 6-bit digital-to-analog converter (DAC) ?
9. What are DAC configurations?
10. What are the different types of DAC Circuits?
11. What are the Limitations of the Binary Weighted DAC?
12. What are the General DAC Characteristics?
13. Define reference voltage in DAC.
14. What is full scale voltage?
15. What is settling time?
VIVA-VOCE




22 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 4 LED DIMMING USING PWM

Aim:
To write an embedded c program for implementing PWM using ARM controller and verify the same by
dimming of LEDs.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
LPC2148 supports 2 types of PWM:
1) Single Edge PWM ? Pulse starts with new Period i.e pulse is always at the beginning
2) Double Edge PWM ? Pulse can be anywhere within the Period
A PWM block, like a Timer block , has a Timer Counter and an associated Pre-scale Register along
with Match Registers. These work exactly the same way as in the case of Timers. Match Registers 1 to 6
(except 0) are pinned on LPC214x i.e. the corresponding outputs are diverted to actual Pins on LPC214x
MCU. The PWM function must be selected for these Pins to get the PWM output.
The basic setup is to simply replace Servo by a LED and no external 5V source is needed. The
anode of LED is connected to P0.0 and cathode to ground. Pulse Widths corresponding to the switches
connected to P0.1/2/3/4 will be 2.5ms/5ms/7.5ms/10ms respectively. As the Pulse Width Increases LED
will keep on getting brighter and the reverse will happen if Pulse Width is decreased.



23 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus embedded c program for implementing Pulse Width Modulation is written and executed and
output has been verified in LED display.
Outcome:
Able to implement PWM using the ARM controller and verify the same in the form of dimming of
LEDS.



24 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Applications :
1. In Visual signals to covey a message
2. Illumination where light is reflected from objects
3. In Narrow band sensors



1. What factors determine the LED dimming performance?
2. What is meant by analog dimming?
3. What is flickering effect?
4. What is the factor determines dimming of the LED
5. Why Silicon is not suitable for fabrication of light-emitting diodes?
6. Why Silicon diode is less suited for low voltage rectifier operation?
7. What is the principle of zener diode?
8. What are the materials used to make LED?
9. What type of diodes is used in FM receivers?
10. Which diode suffers an avalanche breakdown?
11. What happens if the junction temperature of LED is increased?
12. How a transfer characteristic of a diode does is related?
13. What is the requirement of a clipping action of a diode?
14. What type of rectifier circuit requires four diodes?
15. Why are the pulse width modulated outputs required in most of the applications?
16. How do the variations in an average value get affected by PWM period?
17. Name the common formats available for LED display.
18. What are the types of seven segment display?
19. What is PWM?
20. What are the applications of PWM?

Viva-voce




25 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 5 INTERFACING REAL TIME CLOCK
AND SERIAL PORT
Aim:
To write and execute an embedded c program to interface DS1307 RTC using I2C protocol with ARM
controller
Apparatus Required:
1. LPC2148 ARM development board
2. Stepper motor
3. Interfacing cables
4. PC
Theory:
A clock, which is based on the interrupts at preset intervals, is Real Time Clock (RTC). An interrupt
service routine executes on each timeout (overflow) of this clock. This timing device once started never
resets or never reloaded with another value. Once it is set, it is not modified later. It is used in a system to
save the time and date.













26 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the program for interfacing real time clock with ARM controller is written and executed and the
date and time are verified on the screen.
Outcome:
Able to interface real time clock DS1307 with ARM controller and thereby display date and time
Applications :
1. I2C In ARM and PIC microcontrollers
2. Used as serial communication protocol with MASTER and SLAVE operation.

27 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
27 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00




1. What is I2C and how does it work?
2. What are the features of I2C in LPC2148 ARM7 microcontroller?
3. What is the function of I2C0CONSET register?
4. What is I2C0STAT?
5. What is the function of I2C0 Data Register?
6. What is RTC?
7. List the advantages of RTC
8. Through which port the date and time is displayed in RTC?
9. What is a serial port?
10. List the registers used to transfer data in serial port.
11. List the modes used for data transmission.
12. What is a simplex mode?
13. Which pin is used to transmit a character?
14. What is the baud rate of serial port?
15. What is the disadvantage of RS-232C?














Viva-voce




28 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 6 INTERFACING KEYPAD AND LCD

Aim:
To write an embedded c program to interface 4 x 4 matrix keypad with ARM processor and display the
pressed key in an LCD.
Apparatus Required:
1. LPC2148 ARM development board
2. Interfacing cables
3. PC
Theory:

In matrix keypad, keys are connected in rows and columns. When any switch is pressed, rows and
columns come into contact, which is that detected by controller to identify which key has been pressed. A
4?4 matrix keypad consists of 4 rows and 4 columns. There is a switch connecting each row and column.
So the combinations of rows and columns make up the 16 inputs.Initially all the switches are open (not
connected). When any one button is pressed, the switch is closed (connected),hence there is a connection
between the row and column. The first 4 pins are connected to the column as INPUT. The other 4 pins are
connected to the row as OUTPUT. Matrix keypad is a good substitution to normal push button.












29 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Circuit Diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus program for interfacing matrix keypad with ARM controller is written and executed and the key
pressed is seen in the LCD.



30 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Outcome:
Able to interface keypad with ARM controller and see the pressed key in the LCD display.
Applications :
1. Used in password based door locking system
2. Security system with user changeable
3. Used in laptops, computer games
4. Used in portable video games and cell phones



1. What is Matrix keypad?
2. What is the concept behind keypad interface?
3. What are the functions of pull- up resistors?
4. What is key de bouncing?
5. List the steps involved when the key in a 4 x 4 keyboard matrix is being pressed.
6. What is the value obtained if no key is pressed?
7. What kind of interrupt is generated if a key has to be operated in an interrupt mode?
8. How will you identify that the key is pressed?
9. What are the steps involved in Keyboard Interfacing?
10. List the registers used to store the keyboard, display modes and other operations programmed by
CPU.
11. Name the mode when a data is entered from the left side of the display unit.
12. How many rows and columns are present in a 16 x 2 alphanumeric LCD?
13. How many data lines are there in a 16 x 2 alphanumeric LCD?
14. Which pin of the LCD is used for adjusting its contrast?
15. Which command of an LCD is used to shift the entire display to the right?
16. Which command is used to select the 2 lines and 5 x 7 matrix of an LCD?
17. What changes are to be made to send data to an LCD?
18. For reading operation from an LCD what changes in the software are introduced?
19. Which instruction is used to select the first row first column of an LCD?
Viva-voce

31 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
31 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Expt. No. 7 INTERFACING EEPROM AND INTERRUPT

Aim:
To write a program to interface EEPROM using I2C protocol with ARM controller and retrieve the stored
messages inside EEPROM.
Apparatus Required:
1. LPC2148 ARM development board
2. Interfacing cables
3. PC
Theory:
I2C (Inter Integrated Circuit):
The I2C (Inter-IC) bus is a bi-directional two-wire serial bus that provides a communication link between
integrated circuits (ICs).I2C is a synchronous protocol that allows a master device to initiate communication
with a slave device. Data is exchanged between these devices.
EEPROM:
EEPROM (electrically erasable programmable read-only memory) is user-modifiable read-only
memory (ROM) that can be erased and reprogrammed (written to) repeatedly through the application of
higher than normal electrical voltage. It is a type of non-volatile memory used in computers and other
electronic devices to store small amounts of data that must be saved when power is removed, e.g.,
calibration tables or device configuration
Read, write and Erase EEPROM by using I2C in LPC2148 Primer Board. Wiring up an I2C based
EEPROM to the I2C port is relatively simple. The basic operation of the I2C based EEPROM's is to send a
command, such as WRITE, followed by an address and the data. In WRITE operation, the EEPROM is
used to store the data. In LPC2148 Primer Kit, 2 nos. of EEPROM lines are controlled by I2C Enabled
drivers. I2C Lines serial clock SCL (P0.2), serial data SDA (P0.3) connected to the I2C based serial
EEPROM IC. The EEPROM read & write operations are done in LPC2148 Primer Kit by using these SDA &
SCL I2C lines.
32 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
32 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To down load and run this program: Refer General procedure given in Page No: 60
Result:
Thus, the program for interfacing I2C based EEPROM with ARM processor has been written and
executed successfully and the memory content is verified on Win x talk terminal.
Outcome:
Able to interface memory ICs with ARM controller and perform the read and write operations.



33 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications:
1. ROM used in toys,automobiles to store data when power is off
2. In calculators and peripheral devices
3. In laser printers
4. And also in embedded systems where program need not to be changed.


1. How does I2C protocol work?
2. What is EEPROM?
3. What is meant by master slave mode?
4. What is meant by non-volatile memory?
5. What is an interrupt?
6. How does an interrupt request works?
7. What is a nested interrupt?
8. What are the registers used for enabling an interrupt?
9. What is PROM?
10. What is EPROM?
11. What is mask ROM?
12. Which memory allows simultaneous read and write operations?
13. Which memory has the shortest access times?
14. Which interrupt has the highest priority?
15. What is non maskable interrupt?
16. Which is the first level of memory access by the microprocessor?
17. List the types of cache memories.
18. What is the use of an interrupt?
19. What is the use of converting an interrupt to threads in a microprocessor?
20. What are the bits used to control an external interrupts?


Viva-voce




34 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00










CYCLE 2 - EXPERIMENTS




35 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 8 IMPLEMENTATION OF MAILBOX FUNCTION
USING LPC2148
Aim:
To create a mailbox in Micro C/OS ? II using LPC2148 ARM Controller
Apparatus Required:
1. LPC2148 ARM development board
2. Interfacing cables
3. PC
Theory:
System or the user code can send a message by the core services. A typical mail message, also
known as the exchange of information, refers to a task or an ISR using a pointer variable, through the core
services to put a message (that is, a pointer) into the mailbox. Similarly, one or more tasks can receive this
message by the core services. The tasks sending and receiving the message promise that the content that
the pointer points to is just that piece of message.
The mailbox of CooCox CoOS is a typical message mailbox which is composed of two parts: one is
the information which expressed by a pointer of void; the other is the waiting list which composed of the
tasks waiting for this mailbox. The waiting list supports two kinds of sorting: FIFO and preemptive priority.
The sorting mode is determined by the user when creating the mailbox.
Procedure:
To Edit / Compile / generate Hex file: Refer General procedure in Page No: 58
To down load and run this program: Refer General procedure in Page No: 60
Result:
Thus, the mailbox was created in Micro C/OS ?II and implemented using LPC2148.
Outcome:
Able to understand the concept of mail box in embedded systems and its significance in real time
systems


FirstRanker.com - FirstRanker's Choice
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00






?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING

VII SEMESTER - R 2013

EC6711 ? EMBEDDED LABORATORY






Name : _______________________________________
Register No : _______________________________________
Section : _______________________________________
LABORATORY MANUAL



2 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00




is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and
training.

? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different
levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on
heart and soul
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

To impart professional education integrated with human values to the younger generation, so as to
shape them as proficient and dedicated engineers, capable of providing comprehensive solutions to the
challenges in deploying technology for the service of humanity

? To educate the students with the state-of-art technologies to meet the growing challenges of the
electronics industry
? To carry out research through continuous interaction with research institutes and industry, on
advances in communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning,
innovation and ethical practices
VISION
VISION
MISSION
MISSION



3 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

PROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To provide students with a solid foundation in Mathematics, Science and fundamentals of
engineering, enabling them to apply, to find solutions for engineering problems and use this knowledge
to acquire higher education
2. Core Competence
To train the students in Electronics and Communication technologies so that they apply their
knowledge and training to compare, and to analyze various engineering industrial problems to find
solutions
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice which
enables them to find solutions for the real time problems in industry, and to design products
4. Professionalism
To inculcate professional and effective communication skills, leadership qualities and team spirit in
the students to make them multi-faceted personalities and develop their ability to relate engineering
issues to broader social context
5. Lifelong Learning/Ethics
To demonstrate and practice ethical and professional responsibilities in the industry and society in
the large, through commitment and lifelong learning needed for successful professional career


4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
PROGRAMME OUTCOMES (POs)
a) To demonstrate and apply knowledge of Mathematics, Science and engineering fundamentals in
Electronics and Communication Engineering field
b) To design a component, a system or a process to meet the specific needs within the realistic
constraints such as economics, environment, ethics, health, safety and manufacturability
c) To demonstrate the competency to use software tools for computation, simulation and testing of electronics
and communication engineering circuits
d) To identify, formulate and solve electronic and communication engineering problems
e) To demonstrate an ability to visualize and work on laboratory and multidisciplinary tasks
f) To function as a member or a leader in multidisciplinary activities
g) To communicate in verbal and written form with fellow engineers and society at large
h) To understand the impact of Electronics and Communication Engineering in the society and demonstrate
awareness of contemporary issues and commitment to give solutions exhibiting social responsibility
i) To demonstrate professional & ethical responsibilities
j) To exhibit confidence in self-education and ability for lifelong learning
k) To participate and succeed in competitive exams


5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
SYLLABUS

? Learn the working of ARM processor
? Understand the Building Blocks of Embedded Systems
? Learn the concept of memory map and memory interface
? Know the characteristics of Real Time Systems
? Write programs to interface memory, I/Os with processor
? Study the interrupt performance
LIST OF EXPERIMENTS:
1. Study of ARM evaluation system
2. Interfacing ADC and DAC
3. Interfacing LED and PWM
4. Interfacing real time clock and serial port
5. Interfacing keyboard and LCD
6. Interfacing EPROM and interrupt
7. Mailbox
8. Interrupt performance characteristics of ARM and FPGA
9. Flashing of LEDS
10. Interfacing stepper motor and temperature sensor
11. Implementing zigbee protocol with ARM



? Write programs in ARM for a specific Application
? Interface memory and Write programs related to memory operations
? Interface A/D and D/A convertors with ARM system
? Analyze the performance of interrupt
? Write programmes for interfacing keyboard, display, motor and sensor.
? Formulate a mini project using embedded system
COURSE OBJECTIVES
COURSE OUTCOMES
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
CONTENTS
Sl. No. Name of the Experiment Page No.
CYCLE 1 ? EXPERIMENTS
1
Study of ARM evaluation system 7
2
Analog to Digital Convertor interfacing 16
3
Generation of ramp and square wave using on-Chip DAC 19
4
LED dimming using PWM 22
5
Interfacing real time clock and serial port 25
6
Interfacing keypad and LCD 28
7
Interfacing EPROM and interrupt 31
CYCLE 2 ? EXPERIMENTS
8 Implementation of Mailbox Function using LPC 2148 35
9 Interrupt Performance Characteristics of Arm and FPGA 37
10 Flashing of LEDs 40
11 Stepper Motor Interface with ARM ? 7 LPC2148 43
12 LM35 Temperature Sensor Interface with ARM ? 7 LPC2148 47
13
Implementation of Wireless Communication Protocol using ZIGBEE Wireless
Module
50
ADDITIONAL EXPERIMENTS BEYOND THE SYYLABUS
14 Buzzer Interface with ARM ? 7 54
15 Relay interface with ARM? 7 57
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Expt. No. 1 STUDY OF ARM EVALUATION SYSTEM
Aim:
To study the building blocks of ARM7 system, its features, pin configuration and the components
required for functioning of ARM controller.
Architecture Overview:
A RISC-based computer design approach means ARM processors require significantly fewer transistors
than typical processors in average computers. This approach reduces cost, heat and power usage. These
are desirable traits for light, portable, battery-powered devices (smart phones, laptops, tablet and notepad
computers), and other embedded systems. A simpler design facilitates more efficient multi-core CPUs and
higher core counts at lower cost, providing higher processing power and improved energy efficiency for
servers and supercomputers.
In 2005, about 98% of all mobile phones sold used at least one ARM processor. The low power
consumption of ARM processors has made them very popular: 37 billion ARM processors have been
produced as of 2013, up from 10 billion in 2008. The ARM architecture (32-bit) is the most widely used
architecture in mobile devices, and most popular 32-bit one in embedded systems.
According to ARM Holdings, in 2010 alone, producers of chips based on ARM architectures
reported shipments of 6.1 billion ARM based processors, representing 95% of smart phones, 35% of digital
televisions and set-top boxes and 10% of mobile computers. It is the most widely used 32-bit instruction set
architecture in terms of quantity produced.
LPC 2148:
LPC2148 is the widely used IC from ARM-7 family. It is manufactured by Philips and it is pre-loaded
with many inbuilt peripherals making it more efficient and a reliable option for the beginners as well as high
end application developer.




8 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Features of LPC214x series controllers:
1. 8 to 40 kB of on-chip static RAM and 32 to 512 kB of on-chip flash program memory.128 bit wide
interface/accelerator enables high speed 60 MHz operation.
2. In-System/In-Application Programming (ISP/IAP) via on-chip boot-loader software. Single flash sector or
full chip erase in 400 ms and programming of 256 bytes in 1ms.
3. Embedded ICE RT and Embedded Trace interfaces offer real-time debugging with the on-chip Real
Monitor software and high speed tracing of instruction execution.
4. USB 2.0 Full Speed compliant Device Controller with 2 kB of endpoint RAM. In addition, the LPC2146/8
provides 8 kB of on-chip RAM accessible to USB by DMA.
5. One or two (LPC2141/2 vs. LPC2144/6/8) 10-bit A/D converters provide a total of 6/14analog inputs, with
conversion times as low as 2.44 us per channel.
6. Single 10-bit D/A converter provides variable analog output.
7. Two 32-bit timers/external event counters (with four capture and four compare channels each), PWM unit
(six outputs) and watchdog.
8. Low power real-time clock with independent power and dedicated 32 kHz clock input.
9. Multiple serial interfaces including two UARTs (16C550), two Fast I2C-bus (400 kbit/s), SPI and SSP with
buffering and variable data length capabilities.
10. Vectored interrupt controller with configurable priorities and vector addresses.
11. Up to 45 of 5 V tolerant fast general purpose I/O pins in a tiny LQFP64 package.
12. Up to nine edge or level sensitive external interrupt pins available.
13. On-chip integrated oscillator operates with an external crystal in range from 1 MHz to30 MHz and with
an external oscillator up to 50 MHz
14. Power saving modes include Idle and Power-down.
15. Individual enable/disable of peripheral functions as well as peripheral clock scaling for additional power
optimization.
16. Processor wake-up from Power-down mode via external interrupt, USB, Brown-Out Detect (BOD) or
Real-Time Clock (RTC).




9 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


First Step- Hardware Requirement:
Pin configuration of LPC 2148.

Hardware requirement of LPC2148:
1. LPC2148 need minimum below listed hardware to work properly
2. Power Supply
3. Crystal Oscillator
4. Reset Circuit
5. RTC crystal oscillator
6. UART
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Power Supply:
LPC2148 works on 3.3 V power supply. LM 117 can be used for generating 3.3 V supply. However,
basic peripherals like LCD, ULN 2003 (Motor Driver IC) etc. works on 5V. So AC mains supply is converted
into 5V using below mentioned circuit and after that LM 117 is used to convert 5V into 3.3V.
Block diagram of power Supply

Transformer: It is used to step down 230V AC to 9V AC supply and provides isolation between power grids
and circuit.
Rectifier: It is used to convert AC supply into DC.
Filter: It is used to reduce ripple factor of DC output available from rectifier end.
Regulator: It is used to regulate DC supply output.

11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Circuit Diagram:

Regulator IC 7805 is used to provide fix 5V dc supply.
LM 117 is used for generating 3.3V supply from 5V.

12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Calculations:

From the datasheet of LM117

Taking R 2= 240?, we get R 1=392?
Reset Circuit:
Reset button is essential in a system to avoid programming pitfalls and manually bring back the system
to the initialization mode. MCP 130T is a special IC used for providing stable RESET signal to LPC 2148.


13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Oscillator Circuit:

The value of capacitors C20 & C21 depends upon the frequency of crystal Y3. General circuit and
its equivalent circuit is as shown below.

14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Recommended values are as shown in table:

UART:
LPC 2148 has inbuilt ISP which means we can program it within the system using serial
communication on COM0. It has also COM1 for serial communication. MAX 232/233 IC must be used for
voltage logic conversion. Related connections are as given below.

Once the above listed circuit design is ready, we are ready to go further.



15 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Result:
ARM Evaluation system and the configuration of LPC2148 has been studied fully. The minimal setup
required for the functioning of the ARM processor is studied.
Outcomes:
1. Able to understand the ARM controller, its basic components inside and its features.
2. Able to know the components required for the working of ARM LPC2148

Applications:
ARM controller LPC2148 is used in no. of devices such as
1. Smart phones
2. Net books
3. E Readers
4. Digital TV
5. Home Gateways


1. What are the basic units of ARM 7?
2. What is the address system supported by ARM?
3. Define - RISC
4. What are the instructions used to access the memory in ARM?
5. What are the basic units of Microprocessor?
6. What is an Instruction?
7. What is clock cycle?
8. Define - Pipelining
9. What is cache miss?
10. What is meant by memory mapped I/O?
11. Define ? interrupt
12. What is meant by Exception?
13. What is meant by little ? endian mode?
14. What is meant by big ? endian mode?
15. What is the function of CPSR?
16. What is register - indirect addressing?
Viva-voce




16 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 2 ANALOG TO DIGITAL CONVERTOR
INTERFACING
Aim:
To write an embedded c program for interfacing an on chip ADC with LPC2148 ARM processor and
convert the given input voltage into corresponding decimal values.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. PC
Theory:
Analog to Digital converter (ADC) is a device that converts continuously varying analog signals from
instruments that monitor such conditions as movement, temperature, sound, etc., into binary code for the
computer. It may be either a single chip or can be one circuit within a chip. Analog to Digital conversion is
the process of changing continuously varying data, such as voltage, current, or shaft rotation, into discrete
digital quantities that represent the magnitude of the data compared to a standard or reference at the
moment the conversion is made. According to the method of conversion, ADCs can be classified into
Direct-Conversion ADCs, Successive Approximation ADCs, Integrating ADC and Sigma-Delta ADCs.
The LPC 2148 has 10-bit successive approximation analog to digital converter. Basic clocking for the
A/D converters is provided by the VPB clock. A programmable divider is included in each converter, to
scale this clock to the 4.5 MHz (max) clock needed by the successive approximation process. A fully
accurate conversion requires 11 of these clocks. The ADC cell can measure the voltage on any of the ADC
input signals. It is noted that these analog inputs are always connected to their pins, even if the Pin function
Select register assigns them to port pins. A simple self-test of the ADC can be done by driving these pins
as port outputs.



17 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Circuit diagram:




18 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus, an embedded c program for interfacing on-chip ADC with ARM processor is written and
executed. The decimal values of the converted voltage are seen in the WinXTalk screen.
Outcome:
Able to interface A/D convertors with ARM system and check its working by connecting an analog
quantity as input.
Applications:
1. ADC used in MODEM for converting analog signals to digital.
2. A fast video ADC in TV tuner cards
3. ADC used in digital storage oscilloscopes
4. Used in music reproduction technology.
5. Used in DSP if input is analog


1. What are the ADC operating modes in LPC2148?
2. What is meant by conversion time?
3. Why are internal ADCs preferred over external ADCs?
4. Why has 16-bit ADC more resolution than from 10-bit and 8-bit ADC?
5. What are ADC & its Resolution?
6. What is Burst conversion mode?
7. What is the function of A/D Control Register?
8. What is the function of A/D Global Data Register?
9. What is the function of A/D Status Register?
10. What is analog-to-digital (ADC) conversion error?
11. What is the function of Sample-and-hold circuits in analog-to digital converters?
12. What is the disadvantage of the flash analog-to digital converter?
Viva-voce




19 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 3 GENERATION OF RAMP AND SQUARE
WAVE USING ON-CHIP DAC
Aim:
To write and execute an embedded c program to generate ramp wave and square wave using on-chip
DAC of LPC2148 ARM controller.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
A digital-to-analog converter is a device for converting a digital signal into an analog signal (current or
voltage). Digital-to-Analog Converters are the interface between the abstract digital world and the analog
real world. Simple switches, a network of resistors, current sources or capacitors may be used to
implement this conversion. A DAC inputs a binary number and outputs an analog voltage or current signal.
The Microchip Technology Inc. MCP4921 is 2.7 ? 5.5V, low-power, 12-Bit Digital-to-Analog Converter
(DAC) with SPI interface. The MCP4921 DAC provides high accuracy and low noise performance for
industrial applications where calibration or compensation of signals is required. With an SPI connection
there is always one master device (usually a microcontroller) which controls the peripheral devices.
Typically there are three lines common to all the devices,
Master In Slave Out (MISO) ? The Slave line for sending data to the master,
Master Out Slave In (MOSI) ? The Master line for sending data to the peripherals,
Serial Clock (SCK) ? The clock pulses which synchronize data transmission generated by the
master and slave
Slave Select pin ? the pin on each device that the master can use to enable and disable specific
devices. When a device Slave Select pin is low, it communicates with the master. When it is high, it ignores
the master. In SPI, the clock signal is controlled by the master device LPC2148. All data is clocked in and
out using this pin. These lines need to be connected to the relevant pins on the LPC21xx processor. Any
unused GIO pin can be used for CS, instead pull this pin high. Conversion speed is the time it takes for the



20 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

DAC to provide an analog output when the digital input word is changed. The MCP4291 DAC ? SPI
connections with LPC21xx have four I/O lines (P0.4 ? P0.7) required. The analog output is generated by
using these four lines.
Circuit diagram:


Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the embedded c programs for generating ramp wave and square wave using ARM LPC2148 are
written and executed successfully and the waveforms are viewed in oscilloscope.
Outcome:
Able to program the DAC in-built inside the ARM controller and get the waveforms using it.




21 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications :
1. DAC used in Audio amplifier.
2. Video encoder
3. Display electronics
4. Data Acquistion systems
5. Motor control



1. What are the features of LPC2148 DAC?
2. What is the function of DAC register?
3. Which pin provides a voltage reference level for the D/A converter?
4. What are the applications of DAC in signal processing applications?
5. What is GIO?
6. What is the resolution of a digital-to-analog converter (DAC)?
7. What is the major advantage of the R/2R ladder digital-to-analog (DAC), as compared to a binary-
weighted digital-to-analog DAC converter?
8. What is the resolution of a 0?5 V 6-bit digital-to-analog converter (DAC) ?
9. What are DAC configurations?
10. What are the different types of DAC Circuits?
11. What are the Limitations of the Binary Weighted DAC?
12. What are the General DAC Characteristics?
13. Define reference voltage in DAC.
14. What is full scale voltage?
15. What is settling time?
VIVA-VOCE




22 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 4 LED DIMMING USING PWM

Aim:
To write an embedded c program for implementing PWM using ARM controller and verify the same by
dimming of LEDs.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
LPC2148 supports 2 types of PWM:
1) Single Edge PWM ? Pulse starts with new Period i.e pulse is always at the beginning
2) Double Edge PWM ? Pulse can be anywhere within the Period
A PWM block, like a Timer block , has a Timer Counter and an associated Pre-scale Register along
with Match Registers. These work exactly the same way as in the case of Timers. Match Registers 1 to 6
(except 0) are pinned on LPC214x i.e. the corresponding outputs are diverted to actual Pins on LPC214x
MCU. The PWM function must be selected for these Pins to get the PWM output.
The basic setup is to simply replace Servo by a LED and no external 5V source is needed. The
anode of LED is connected to P0.0 and cathode to ground. Pulse Widths corresponding to the switches
connected to P0.1/2/3/4 will be 2.5ms/5ms/7.5ms/10ms respectively. As the Pulse Width Increases LED
will keep on getting brighter and the reverse will happen if Pulse Width is decreased.



23 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus embedded c program for implementing Pulse Width Modulation is written and executed and
output has been verified in LED display.
Outcome:
Able to implement PWM using the ARM controller and verify the same in the form of dimming of
LEDS.



24 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Applications :
1. In Visual signals to covey a message
2. Illumination where light is reflected from objects
3. In Narrow band sensors



1. What factors determine the LED dimming performance?
2. What is meant by analog dimming?
3. What is flickering effect?
4. What is the factor determines dimming of the LED
5. Why Silicon is not suitable for fabrication of light-emitting diodes?
6. Why Silicon diode is less suited for low voltage rectifier operation?
7. What is the principle of zener diode?
8. What are the materials used to make LED?
9. What type of diodes is used in FM receivers?
10. Which diode suffers an avalanche breakdown?
11. What happens if the junction temperature of LED is increased?
12. How a transfer characteristic of a diode does is related?
13. What is the requirement of a clipping action of a diode?
14. What type of rectifier circuit requires four diodes?
15. Why are the pulse width modulated outputs required in most of the applications?
16. How do the variations in an average value get affected by PWM period?
17. Name the common formats available for LED display.
18. What are the types of seven segment display?
19. What is PWM?
20. What are the applications of PWM?

Viva-voce




25 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 5 INTERFACING REAL TIME CLOCK
AND SERIAL PORT
Aim:
To write and execute an embedded c program to interface DS1307 RTC using I2C protocol with ARM
controller
Apparatus Required:
1. LPC2148 ARM development board
2. Stepper motor
3. Interfacing cables
4. PC
Theory:
A clock, which is based on the interrupts at preset intervals, is Real Time Clock (RTC). An interrupt
service routine executes on each timeout (overflow) of this clock. This timing device once started never
resets or never reloaded with another value. Once it is set, it is not modified later. It is used in a system to
save the time and date.













26 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the program for interfacing real time clock with ARM controller is written and executed and the
date and time are verified on the screen.
Outcome:
Able to interface real time clock DS1307 with ARM controller and thereby display date and time
Applications :
1. I2C In ARM and PIC microcontrollers
2. Used as serial communication protocol with MASTER and SLAVE operation.

27 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
27 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00




1. What is I2C and how does it work?
2. What are the features of I2C in LPC2148 ARM7 microcontroller?
3. What is the function of I2C0CONSET register?
4. What is I2C0STAT?
5. What is the function of I2C0 Data Register?
6. What is RTC?
7. List the advantages of RTC
8. Through which port the date and time is displayed in RTC?
9. What is a serial port?
10. List the registers used to transfer data in serial port.
11. List the modes used for data transmission.
12. What is a simplex mode?
13. Which pin is used to transmit a character?
14. What is the baud rate of serial port?
15. What is the disadvantage of RS-232C?














Viva-voce




28 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 6 INTERFACING KEYPAD AND LCD

Aim:
To write an embedded c program to interface 4 x 4 matrix keypad with ARM processor and display the
pressed key in an LCD.
Apparatus Required:
1. LPC2148 ARM development board
2. Interfacing cables
3. PC
Theory:

In matrix keypad, keys are connected in rows and columns. When any switch is pressed, rows and
columns come into contact, which is that detected by controller to identify which key has been pressed. A
4?4 matrix keypad consists of 4 rows and 4 columns. There is a switch connecting each row and column.
So the combinations of rows and columns make up the 16 inputs.Initially all the switches are open (not
connected). When any one button is pressed, the switch is closed (connected),hence there is a connection
between the row and column. The first 4 pins are connected to the column as INPUT. The other 4 pins are
connected to the row as OUTPUT. Matrix keypad is a good substitution to normal push button.












29 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Circuit Diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus program for interfacing matrix keypad with ARM controller is written and executed and the key
pressed is seen in the LCD.



30 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Outcome:
Able to interface keypad with ARM controller and see the pressed key in the LCD display.
Applications :
1. Used in password based door locking system
2. Security system with user changeable
3. Used in laptops, computer games
4. Used in portable video games and cell phones



1. What is Matrix keypad?
2. What is the concept behind keypad interface?
3. What are the functions of pull- up resistors?
4. What is key de bouncing?
5. List the steps involved when the key in a 4 x 4 keyboard matrix is being pressed.
6. What is the value obtained if no key is pressed?
7. What kind of interrupt is generated if a key has to be operated in an interrupt mode?
8. How will you identify that the key is pressed?
9. What are the steps involved in Keyboard Interfacing?
10. List the registers used to store the keyboard, display modes and other operations programmed by
CPU.
11. Name the mode when a data is entered from the left side of the display unit.
12. How many rows and columns are present in a 16 x 2 alphanumeric LCD?
13. How many data lines are there in a 16 x 2 alphanumeric LCD?
14. Which pin of the LCD is used for adjusting its contrast?
15. Which command of an LCD is used to shift the entire display to the right?
16. Which command is used to select the 2 lines and 5 x 7 matrix of an LCD?
17. What changes are to be made to send data to an LCD?
18. For reading operation from an LCD what changes in the software are introduced?
19. Which instruction is used to select the first row first column of an LCD?
Viva-voce

31 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
31 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Expt. No. 7 INTERFACING EEPROM AND INTERRUPT

Aim:
To write a program to interface EEPROM using I2C protocol with ARM controller and retrieve the stored
messages inside EEPROM.
Apparatus Required:
1. LPC2148 ARM development board
2. Interfacing cables
3. PC
Theory:
I2C (Inter Integrated Circuit):
The I2C (Inter-IC) bus is a bi-directional two-wire serial bus that provides a communication link between
integrated circuits (ICs).I2C is a synchronous protocol that allows a master device to initiate communication
with a slave device. Data is exchanged between these devices.
EEPROM:
EEPROM (electrically erasable programmable read-only memory) is user-modifiable read-only
memory (ROM) that can be erased and reprogrammed (written to) repeatedly through the application of
higher than normal electrical voltage. It is a type of non-volatile memory used in computers and other
electronic devices to store small amounts of data that must be saved when power is removed, e.g.,
calibration tables or device configuration
Read, write and Erase EEPROM by using I2C in LPC2148 Primer Board. Wiring up an I2C based
EEPROM to the I2C port is relatively simple. The basic operation of the I2C based EEPROM's is to send a
command, such as WRITE, followed by an address and the data. In WRITE operation, the EEPROM is
used to store the data. In LPC2148 Primer Kit, 2 nos. of EEPROM lines are controlled by I2C Enabled
drivers. I2C Lines serial clock SCL (P0.2), serial data SDA (P0.3) connected to the I2C based serial
EEPROM IC. The EEPROM read & write operations are done in LPC2148 Primer Kit by using these SDA &
SCL I2C lines.
32 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
32 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To down load and run this program: Refer General procedure given in Page No: 60
Result:
Thus, the program for interfacing I2C based EEPROM with ARM processor has been written and
executed successfully and the memory content is verified on Win x talk terminal.
Outcome:
Able to interface memory ICs with ARM controller and perform the read and write operations.



33 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications:
1. ROM used in toys,automobiles to store data when power is off
2. In calculators and peripheral devices
3. In laser printers
4. And also in embedded systems where program need not to be changed.


1. How does I2C protocol work?
2. What is EEPROM?
3. What is meant by master slave mode?
4. What is meant by non-volatile memory?
5. What is an interrupt?
6. How does an interrupt request works?
7. What is a nested interrupt?
8. What are the registers used for enabling an interrupt?
9. What is PROM?
10. What is EPROM?
11. What is mask ROM?
12. Which memory allows simultaneous read and write operations?
13. Which memory has the shortest access times?
14. Which interrupt has the highest priority?
15. What is non maskable interrupt?
16. Which is the first level of memory access by the microprocessor?
17. List the types of cache memories.
18. What is the use of an interrupt?
19. What is the use of converting an interrupt to threads in a microprocessor?
20. What are the bits used to control an external interrupts?


Viva-voce




34 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00










CYCLE 2 - EXPERIMENTS




35 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 8 IMPLEMENTATION OF MAILBOX FUNCTION
USING LPC2148
Aim:
To create a mailbox in Micro C/OS ? II using LPC2148 ARM Controller
Apparatus Required:
1. LPC2148 ARM development board
2. Interfacing cables
3. PC
Theory:
System or the user code can send a message by the core services. A typical mail message, also
known as the exchange of information, refers to a task or an ISR using a pointer variable, through the core
services to put a message (that is, a pointer) into the mailbox. Similarly, one or more tasks can receive this
message by the core services. The tasks sending and receiving the message promise that the content that
the pointer points to is just that piece of message.
The mailbox of CooCox CoOS is a typical message mailbox which is composed of two parts: one is
the information which expressed by a pointer of void; the other is the waiting list which composed of the
tasks waiting for this mailbox. The waiting list supports two kinds of sorting: FIFO and preemptive priority.
The sorting mode is determined by the user when creating the mailbox.
Procedure:
To Edit / Compile / generate Hex file: Refer General procedure in Page No: 58
To down load and run this program: Refer General procedure in Page No: 60
Result:
Thus, the mailbox was created in Micro C/OS ?II and implemented using LPC2148.
Outcome:
Able to understand the concept of mail box in embedded systems and its significance in real time
systems





36 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications:
1. Used in Acorn RISC PC700
2. Used in ZIPIT wireless messenger
3. Used in Meizu M6 MINI player


1. What is IPC?
2. Define Queue.
3. What are the different types of mail box functions?
4. What is half duplex mode?
5. How many synchronous and asynchronous modes are there in serial port?
6. List the bits used to generate serial port interrupt
7. What is branch prediction?
8. Mention any two features of ?C/OS ? II.
9. Write the function for creating task in ?C/OS ? II.
10. Mention any two support devices for ?C/OS ? II.
11. How many user tasks can be handled by ?C/OS ? II?



















Viva-voce

FirstRanker.com - FirstRanker's Choice
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00






?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING

VII SEMESTER - R 2013

EC6711 ? EMBEDDED LABORATORY






Name : _______________________________________
Register No : _______________________________________
Section : _______________________________________
LABORATORY MANUAL



2 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00




is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and
training.

? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different
levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on
heart and soul
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

To impart professional education integrated with human values to the younger generation, so as to
shape them as proficient and dedicated engineers, capable of providing comprehensive solutions to the
challenges in deploying technology for the service of humanity

? To educate the students with the state-of-art technologies to meet the growing challenges of the
electronics industry
? To carry out research through continuous interaction with research institutes and industry, on
advances in communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning,
innovation and ethical practices
VISION
VISION
MISSION
MISSION



3 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

PROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To provide students with a solid foundation in Mathematics, Science and fundamentals of
engineering, enabling them to apply, to find solutions for engineering problems and use this knowledge
to acquire higher education
2. Core Competence
To train the students in Electronics and Communication technologies so that they apply their
knowledge and training to compare, and to analyze various engineering industrial problems to find
solutions
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice which
enables them to find solutions for the real time problems in industry, and to design products
4. Professionalism
To inculcate professional and effective communication skills, leadership qualities and team spirit in
the students to make them multi-faceted personalities and develop their ability to relate engineering
issues to broader social context
5. Lifelong Learning/Ethics
To demonstrate and practice ethical and professional responsibilities in the industry and society in
the large, through commitment and lifelong learning needed for successful professional career


4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
PROGRAMME OUTCOMES (POs)
a) To demonstrate and apply knowledge of Mathematics, Science and engineering fundamentals in
Electronics and Communication Engineering field
b) To design a component, a system or a process to meet the specific needs within the realistic
constraints such as economics, environment, ethics, health, safety and manufacturability
c) To demonstrate the competency to use software tools for computation, simulation and testing of electronics
and communication engineering circuits
d) To identify, formulate and solve electronic and communication engineering problems
e) To demonstrate an ability to visualize and work on laboratory and multidisciplinary tasks
f) To function as a member or a leader in multidisciplinary activities
g) To communicate in verbal and written form with fellow engineers and society at large
h) To understand the impact of Electronics and Communication Engineering in the society and demonstrate
awareness of contemporary issues and commitment to give solutions exhibiting social responsibility
i) To demonstrate professional & ethical responsibilities
j) To exhibit confidence in self-education and ability for lifelong learning
k) To participate and succeed in competitive exams


5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
SYLLABUS

? Learn the working of ARM processor
? Understand the Building Blocks of Embedded Systems
? Learn the concept of memory map and memory interface
? Know the characteristics of Real Time Systems
? Write programs to interface memory, I/Os with processor
? Study the interrupt performance
LIST OF EXPERIMENTS:
1. Study of ARM evaluation system
2. Interfacing ADC and DAC
3. Interfacing LED and PWM
4. Interfacing real time clock and serial port
5. Interfacing keyboard and LCD
6. Interfacing EPROM and interrupt
7. Mailbox
8. Interrupt performance characteristics of ARM and FPGA
9. Flashing of LEDS
10. Interfacing stepper motor and temperature sensor
11. Implementing zigbee protocol with ARM



? Write programs in ARM for a specific Application
? Interface memory and Write programs related to memory operations
? Interface A/D and D/A convertors with ARM system
? Analyze the performance of interrupt
? Write programmes for interfacing keyboard, display, motor and sensor.
? Formulate a mini project using embedded system
COURSE OBJECTIVES
COURSE OUTCOMES
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
CONTENTS
Sl. No. Name of the Experiment Page No.
CYCLE 1 ? EXPERIMENTS
1
Study of ARM evaluation system 7
2
Analog to Digital Convertor interfacing 16
3
Generation of ramp and square wave using on-Chip DAC 19
4
LED dimming using PWM 22
5
Interfacing real time clock and serial port 25
6
Interfacing keypad and LCD 28
7
Interfacing EPROM and interrupt 31
CYCLE 2 ? EXPERIMENTS
8 Implementation of Mailbox Function using LPC 2148 35
9 Interrupt Performance Characteristics of Arm and FPGA 37
10 Flashing of LEDs 40
11 Stepper Motor Interface with ARM ? 7 LPC2148 43
12 LM35 Temperature Sensor Interface with ARM ? 7 LPC2148 47
13
Implementation of Wireless Communication Protocol using ZIGBEE Wireless
Module
50
ADDITIONAL EXPERIMENTS BEYOND THE SYYLABUS
14 Buzzer Interface with ARM ? 7 54
15 Relay interface with ARM? 7 57
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Expt. No. 1 STUDY OF ARM EVALUATION SYSTEM
Aim:
To study the building blocks of ARM7 system, its features, pin configuration and the components
required for functioning of ARM controller.
Architecture Overview:
A RISC-based computer design approach means ARM processors require significantly fewer transistors
than typical processors in average computers. This approach reduces cost, heat and power usage. These
are desirable traits for light, portable, battery-powered devices (smart phones, laptops, tablet and notepad
computers), and other embedded systems. A simpler design facilitates more efficient multi-core CPUs and
higher core counts at lower cost, providing higher processing power and improved energy efficiency for
servers and supercomputers.
In 2005, about 98% of all mobile phones sold used at least one ARM processor. The low power
consumption of ARM processors has made them very popular: 37 billion ARM processors have been
produced as of 2013, up from 10 billion in 2008. The ARM architecture (32-bit) is the most widely used
architecture in mobile devices, and most popular 32-bit one in embedded systems.
According to ARM Holdings, in 2010 alone, producers of chips based on ARM architectures
reported shipments of 6.1 billion ARM based processors, representing 95% of smart phones, 35% of digital
televisions and set-top boxes and 10% of mobile computers. It is the most widely used 32-bit instruction set
architecture in terms of quantity produced.
LPC 2148:
LPC2148 is the widely used IC from ARM-7 family. It is manufactured by Philips and it is pre-loaded
with many inbuilt peripherals making it more efficient and a reliable option for the beginners as well as high
end application developer.




8 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Features of LPC214x series controllers:
1. 8 to 40 kB of on-chip static RAM and 32 to 512 kB of on-chip flash program memory.128 bit wide
interface/accelerator enables high speed 60 MHz operation.
2. In-System/In-Application Programming (ISP/IAP) via on-chip boot-loader software. Single flash sector or
full chip erase in 400 ms and programming of 256 bytes in 1ms.
3. Embedded ICE RT and Embedded Trace interfaces offer real-time debugging with the on-chip Real
Monitor software and high speed tracing of instruction execution.
4. USB 2.0 Full Speed compliant Device Controller with 2 kB of endpoint RAM. In addition, the LPC2146/8
provides 8 kB of on-chip RAM accessible to USB by DMA.
5. One or two (LPC2141/2 vs. LPC2144/6/8) 10-bit A/D converters provide a total of 6/14analog inputs, with
conversion times as low as 2.44 us per channel.
6. Single 10-bit D/A converter provides variable analog output.
7. Two 32-bit timers/external event counters (with four capture and four compare channels each), PWM unit
(six outputs) and watchdog.
8. Low power real-time clock with independent power and dedicated 32 kHz clock input.
9. Multiple serial interfaces including two UARTs (16C550), two Fast I2C-bus (400 kbit/s), SPI and SSP with
buffering and variable data length capabilities.
10. Vectored interrupt controller with configurable priorities and vector addresses.
11. Up to 45 of 5 V tolerant fast general purpose I/O pins in a tiny LQFP64 package.
12. Up to nine edge or level sensitive external interrupt pins available.
13. On-chip integrated oscillator operates with an external crystal in range from 1 MHz to30 MHz and with
an external oscillator up to 50 MHz
14. Power saving modes include Idle and Power-down.
15. Individual enable/disable of peripheral functions as well as peripheral clock scaling for additional power
optimization.
16. Processor wake-up from Power-down mode via external interrupt, USB, Brown-Out Detect (BOD) or
Real-Time Clock (RTC).




9 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


First Step- Hardware Requirement:
Pin configuration of LPC 2148.

Hardware requirement of LPC2148:
1. LPC2148 need minimum below listed hardware to work properly
2. Power Supply
3. Crystal Oscillator
4. Reset Circuit
5. RTC crystal oscillator
6. UART
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Power Supply:
LPC2148 works on 3.3 V power supply. LM 117 can be used for generating 3.3 V supply. However,
basic peripherals like LCD, ULN 2003 (Motor Driver IC) etc. works on 5V. So AC mains supply is converted
into 5V using below mentioned circuit and after that LM 117 is used to convert 5V into 3.3V.
Block diagram of power Supply

Transformer: It is used to step down 230V AC to 9V AC supply and provides isolation between power grids
and circuit.
Rectifier: It is used to convert AC supply into DC.
Filter: It is used to reduce ripple factor of DC output available from rectifier end.
Regulator: It is used to regulate DC supply output.

11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Circuit Diagram:

Regulator IC 7805 is used to provide fix 5V dc supply.
LM 117 is used for generating 3.3V supply from 5V.

12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Calculations:

From the datasheet of LM117

Taking R 2= 240?, we get R 1=392?
Reset Circuit:
Reset button is essential in a system to avoid programming pitfalls and manually bring back the system
to the initialization mode. MCP 130T is a special IC used for providing stable RESET signal to LPC 2148.


13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Oscillator Circuit:

The value of capacitors C20 & C21 depends upon the frequency of crystal Y3. General circuit and
its equivalent circuit is as shown below.

14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Recommended values are as shown in table:

UART:
LPC 2148 has inbuilt ISP which means we can program it within the system using serial
communication on COM0. It has also COM1 for serial communication. MAX 232/233 IC must be used for
voltage logic conversion. Related connections are as given below.

Once the above listed circuit design is ready, we are ready to go further.



15 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Result:
ARM Evaluation system and the configuration of LPC2148 has been studied fully. The minimal setup
required for the functioning of the ARM processor is studied.
Outcomes:
1. Able to understand the ARM controller, its basic components inside and its features.
2. Able to know the components required for the working of ARM LPC2148

Applications:
ARM controller LPC2148 is used in no. of devices such as
1. Smart phones
2. Net books
3. E Readers
4. Digital TV
5. Home Gateways


1. What are the basic units of ARM 7?
2. What is the address system supported by ARM?
3. Define - RISC
4. What are the instructions used to access the memory in ARM?
5. What are the basic units of Microprocessor?
6. What is an Instruction?
7. What is clock cycle?
8. Define - Pipelining
9. What is cache miss?
10. What is meant by memory mapped I/O?
11. Define ? interrupt
12. What is meant by Exception?
13. What is meant by little ? endian mode?
14. What is meant by big ? endian mode?
15. What is the function of CPSR?
16. What is register - indirect addressing?
Viva-voce




16 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 2 ANALOG TO DIGITAL CONVERTOR
INTERFACING
Aim:
To write an embedded c program for interfacing an on chip ADC with LPC2148 ARM processor and
convert the given input voltage into corresponding decimal values.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. PC
Theory:
Analog to Digital converter (ADC) is a device that converts continuously varying analog signals from
instruments that monitor such conditions as movement, temperature, sound, etc., into binary code for the
computer. It may be either a single chip or can be one circuit within a chip. Analog to Digital conversion is
the process of changing continuously varying data, such as voltage, current, or shaft rotation, into discrete
digital quantities that represent the magnitude of the data compared to a standard or reference at the
moment the conversion is made. According to the method of conversion, ADCs can be classified into
Direct-Conversion ADCs, Successive Approximation ADCs, Integrating ADC and Sigma-Delta ADCs.
The LPC 2148 has 10-bit successive approximation analog to digital converter. Basic clocking for the
A/D converters is provided by the VPB clock. A programmable divider is included in each converter, to
scale this clock to the 4.5 MHz (max) clock needed by the successive approximation process. A fully
accurate conversion requires 11 of these clocks. The ADC cell can measure the voltage on any of the ADC
input signals. It is noted that these analog inputs are always connected to their pins, even if the Pin function
Select register assigns them to port pins. A simple self-test of the ADC can be done by driving these pins
as port outputs.



17 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Circuit diagram:




18 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus, an embedded c program for interfacing on-chip ADC with ARM processor is written and
executed. The decimal values of the converted voltage are seen in the WinXTalk screen.
Outcome:
Able to interface A/D convertors with ARM system and check its working by connecting an analog
quantity as input.
Applications:
1. ADC used in MODEM for converting analog signals to digital.
2. A fast video ADC in TV tuner cards
3. ADC used in digital storage oscilloscopes
4. Used in music reproduction technology.
5. Used in DSP if input is analog


1. What are the ADC operating modes in LPC2148?
2. What is meant by conversion time?
3. Why are internal ADCs preferred over external ADCs?
4. Why has 16-bit ADC more resolution than from 10-bit and 8-bit ADC?
5. What are ADC & its Resolution?
6. What is Burst conversion mode?
7. What is the function of A/D Control Register?
8. What is the function of A/D Global Data Register?
9. What is the function of A/D Status Register?
10. What is analog-to-digital (ADC) conversion error?
11. What is the function of Sample-and-hold circuits in analog-to digital converters?
12. What is the disadvantage of the flash analog-to digital converter?
Viva-voce




19 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 3 GENERATION OF RAMP AND SQUARE
WAVE USING ON-CHIP DAC
Aim:
To write and execute an embedded c program to generate ramp wave and square wave using on-chip
DAC of LPC2148 ARM controller.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
A digital-to-analog converter is a device for converting a digital signal into an analog signal (current or
voltage). Digital-to-Analog Converters are the interface between the abstract digital world and the analog
real world. Simple switches, a network of resistors, current sources or capacitors may be used to
implement this conversion. A DAC inputs a binary number and outputs an analog voltage or current signal.
The Microchip Technology Inc. MCP4921 is 2.7 ? 5.5V, low-power, 12-Bit Digital-to-Analog Converter
(DAC) with SPI interface. The MCP4921 DAC provides high accuracy and low noise performance for
industrial applications where calibration or compensation of signals is required. With an SPI connection
there is always one master device (usually a microcontroller) which controls the peripheral devices.
Typically there are three lines common to all the devices,
Master In Slave Out (MISO) ? The Slave line for sending data to the master,
Master Out Slave In (MOSI) ? The Master line for sending data to the peripherals,
Serial Clock (SCK) ? The clock pulses which synchronize data transmission generated by the
master and slave
Slave Select pin ? the pin on each device that the master can use to enable and disable specific
devices. When a device Slave Select pin is low, it communicates with the master. When it is high, it ignores
the master. In SPI, the clock signal is controlled by the master device LPC2148. All data is clocked in and
out using this pin. These lines need to be connected to the relevant pins on the LPC21xx processor. Any
unused GIO pin can be used for CS, instead pull this pin high. Conversion speed is the time it takes for the



20 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

DAC to provide an analog output when the digital input word is changed. The MCP4291 DAC ? SPI
connections with LPC21xx have four I/O lines (P0.4 ? P0.7) required. The analog output is generated by
using these four lines.
Circuit diagram:


Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the embedded c programs for generating ramp wave and square wave using ARM LPC2148 are
written and executed successfully and the waveforms are viewed in oscilloscope.
Outcome:
Able to program the DAC in-built inside the ARM controller and get the waveforms using it.




21 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications :
1. DAC used in Audio amplifier.
2. Video encoder
3. Display electronics
4. Data Acquistion systems
5. Motor control



1. What are the features of LPC2148 DAC?
2. What is the function of DAC register?
3. Which pin provides a voltage reference level for the D/A converter?
4. What are the applications of DAC in signal processing applications?
5. What is GIO?
6. What is the resolution of a digital-to-analog converter (DAC)?
7. What is the major advantage of the R/2R ladder digital-to-analog (DAC), as compared to a binary-
weighted digital-to-analog DAC converter?
8. What is the resolution of a 0?5 V 6-bit digital-to-analog converter (DAC) ?
9. What are DAC configurations?
10. What are the different types of DAC Circuits?
11. What are the Limitations of the Binary Weighted DAC?
12. What are the General DAC Characteristics?
13. Define reference voltage in DAC.
14. What is full scale voltage?
15. What is settling time?
VIVA-VOCE




22 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 4 LED DIMMING USING PWM

Aim:
To write an embedded c program for implementing PWM using ARM controller and verify the same by
dimming of LEDs.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
LPC2148 supports 2 types of PWM:
1) Single Edge PWM ? Pulse starts with new Period i.e pulse is always at the beginning
2) Double Edge PWM ? Pulse can be anywhere within the Period
A PWM block, like a Timer block , has a Timer Counter and an associated Pre-scale Register along
with Match Registers. These work exactly the same way as in the case of Timers. Match Registers 1 to 6
(except 0) are pinned on LPC214x i.e. the corresponding outputs are diverted to actual Pins on LPC214x
MCU. The PWM function must be selected for these Pins to get the PWM output.
The basic setup is to simply replace Servo by a LED and no external 5V source is needed. The
anode of LED is connected to P0.0 and cathode to ground. Pulse Widths corresponding to the switches
connected to P0.1/2/3/4 will be 2.5ms/5ms/7.5ms/10ms respectively. As the Pulse Width Increases LED
will keep on getting brighter and the reverse will happen if Pulse Width is decreased.



23 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus embedded c program for implementing Pulse Width Modulation is written and executed and
output has been verified in LED display.
Outcome:
Able to implement PWM using the ARM controller and verify the same in the form of dimming of
LEDS.



24 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Applications :
1. In Visual signals to covey a message
2. Illumination where light is reflected from objects
3. In Narrow band sensors



1. What factors determine the LED dimming performance?
2. What is meant by analog dimming?
3. What is flickering effect?
4. What is the factor determines dimming of the LED
5. Why Silicon is not suitable for fabrication of light-emitting diodes?
6. Why Silicon diode is less suited for low voltage rectifier operation?
7. What is the principle of zener diode?
8. What are the materials used to make LED?
9. What type of diodes is used in FM receivers?
10. Which diode suffers an avalanche breakdown?
11. What happens if the junction temperature of LED is increased?
12. How a transfer characteristic of a diode does is related?
13. What is the requirement of a clipping action of a diode?
14. What type of rectifier circuit requires four diodes?
15. Why are the pulse width modulated outputs required in most of the applications?
16. How do the variations in an average value get affected by PWM period?
17. Name the common formats available for LED display.
18. What are the types of seven segment display?
19. What is PWM?
20. What are the applications of PWM?

Viva-voce




25 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 5 INTERFACING REAL TIME CLOCK
AND SERIAL PORT
Aim:
To write and execute an embedded c program to interface DS1307 RTC using I2C protocol with ARM
controller
Apparatus Required:
1. LPC2148 ARM development board
2. Stepper motor
3. Interfacing cables
4. PC
Theory:
A clock, which is based on the interrupts at preset intervals, is Real Time Clock (RTC). An interrupt
service routine executes on each timeout (overflow) of this clock. This timing device once started never
resets or never reloaded with another value. Once it is set, it is not modified later. It is used in a system to
save the time and date.













26 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the program for interfacing real time clock with ARM controller is written and executed and the
date and time are verified on the screen.
Outcome:
Able to interface real time clock DS1307 with ARM controller and thereby display date and time
Applications :
1. I2C In ARM and PIC microcontrollers
2. Used as serial communication protocol with MASTER and SLAVE operation.

27 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
27 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00




1. What is I2C and how does it work?
2. What are the features of I2C in LPC2148 ARM7 microcontroller?
3. What is the function of I2C0CONSET register?
4. What is I2C0STAT?
5. What is the function of I2C0 Data Register?
6. What is RTC?
7. List the advantages of RTC
8. Through which port the date and time is displayed in RTC?
9. What is a serial port?
10. List the registers used to transfer data in serial port.
11. List the modes used for data transmission.
12. What is a simplex mode?
13. Which pin is used to transmit a character?
14. What is the baud rate of serial port?
15. What is the disadvantage of RS-232C?














Viva-voce




28 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 6 INTERFACING KEYPAD AND LCD

Aim:
To write an embedded c program to interface 4 x 4 matrix keypad with ARM processor and display the
pressed key in an LCD.
Apparatus Required:
1. LPC2148 ARM development board
2. Interfacing cables
3. PC
Theory:

In matrix keypad, keys are connected in rows and columns. When any switch is pressed, rows and
columns come into contact, which is that detected by controller to identify which key has been pressed. A
4?4 matrix keypad consists of 4 rows and 4 columns. There is a switch connecting each row and column.
So the combinations of rows and columns make up the 16 inputs.Initially all the switches are open (not
connected). When any one button is pressed, the switch is closed (connected),hence there is a connection
between the row and column. The first 4 pins are connected to the column as INPUT. The other 4 pins are
connected to the row as OUTPUT. Matrix keypad is a good substitution to normal push button.












29 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Circuit Diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus program for interfacing matrix keypad with ARM controller is written and executed and the key
pressed is seen in the LCD.



30 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Outcome:
Able to interface keypad with ARM controller and see the pressed key in the LCD display.
Applications :
1. Used in password based door locking system
2. Security system with user changeable
3. Used in laptops, computer games
4. Used in portable video games and cell phones



1. What is Matrix keypad?
2. What is the concept behind keypad interface?
3. What are the functions of pull- up resistors?
4. What is key de bouncing?
5. List the steps involved when the key in a 4 x 4 keyboard matrix is being pressed.
6. What is the value obtained if no key is pressed?
7. What kind of interrupt is generated if a key has to be operated in an interrupt mode?
8. How will you identify that the key is pressed?
9. What are the steps involved in Keyboard Interfacing?
10. List the registers used to store the keyboard, display modes and other operations programmed by
CPU.
11. Name the mode when a data is entered from the left side of the display unit.
12. How many rows and columns are present in a 16 x 2 alphanumeric LCD?
13. How many data lines are there in a 16 x 2 alphanumeric LCD?
14. Which pin of the LCD is used for adjusting its contrast?
15. Which command of an LCD is used to shift the entire display to the right?
16. Which command is used to select the 2 lines and 5 x 7 matrix of an LCD?
17. What changes are to be made to send data to an LCD?
18. For reading operation from an LCD what changes in the software are introduced?
19. Which instruction is used to select the first row first column of an LCD?
Viva-voce

31 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
31 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Expt. No. 7 INTERFACING EEPROM AND INTERRUPT

Aim:
To write a program to interface EEPROM using I2C protocol with ARM controller and retrieve the stored
messages inside EEPROM.
Apparatus Required:
1. LPC2148 ARM development board
2. Interfacing cables
3. PC
Theory:
I2C (Inter Integrated Circuit):
The I2C (Inter-IC) bus is a bi-directional two-wire serial bus that provides a communication link between
integrated circuits (ICs).I2C is a synchronous protocol that allows a master device to initiate communication
with a slave device. Data is exchanged between these devices.
EEPROM:
EEPROM (electrically erasable programmable read-only memory) is user-modifiable read-only
memory (ROM) that can be erased and reprogrammed (written to) repeatedly through the application of
higher than normal electrical voltage. It is a type of non-volatile memory used in computers and other
electronic devices to store small amounts of data that must be saved when power is removed, e.g.,
calibration tables or device configuration
Read, write and Erase EEPROM by using I2C in LPC2148 Primer Board. Wiring up an I2C based
EEPROM to the I2C port is relatively simple. The basic operation of the I2C based EEPROM's is to send a
command, such as WRITE, followed by an address and the data. In WRITE operation, the EEPROM is
used to store the data. In LPC2148 Primer Kit, 2 nos. of EEPROM lines are controlled by I2C Enabled
drivers. I2C Lines serial clock SCL (P0.2), serial data SDA (P0.3) connected to the I2C based serial
EEPROM IC. The EEPROM read & write operations are done in LPC2148 Primer Kit by using these SDA &
SCL I2C lines.
32 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
32 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To down load and run this program: Refer General procedure given in Page No: 60
Result:
Thus, the program for interfacing I2C based EEPROM with ARM processor has been written and
executed successfully and the memory content is verified on Win x talk terminal.
Outcome:
Able to interface memory ICs with ARM controller and perform the read and write operations.



33 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications:
1. ROM used in toys,automobiles to store data when power is off
2. In calculators and peripheral devices
3. In laser printers
4. And also in embedded systems where program need not to be changed.


1. How does I2C protocol work?
2. What is EEPROM?
3. What is meant by master slave mode?
4. What is meant by non-volatile memory?
5. What is an interrupt?
6. How does an interrupt request works?
7. What is a nested interrupt?
8. What are the registers used for enabling an interrupt?
9. What is PROM?
10. What is EPROM?
11. What is mask ROM?
12. Which memory allows simultaneous read and write operations?
13. Which memory has the shortest access times?
14. Which interrupt has the highest priority?
15. What is non maskable interrupt?
16. Which is the first level of memory access by the microprocessor?
17. List the types of cache memories.
18. What is the use of an interrupt?
19. What is the use of converting an interrupt to threads in a microprocessor?
20. What are the bits used to control an external interrupts?


Viva-voce




34 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00










CYCLE 2 - EXPERIMENTS




35 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 8 IMPLEMENTATION OF MAILBOX FUNCTION
USING LPC2148
Aim:
To create a mailbox in Micro C/OS ? II using LPC2148 ARM Controller
Apparatus Required:
1. LPC2148 ARM development board
2. Interfacing cables
3. PC
Theory:
System or the user code can send a message by the core services. A typical mail message, also
known as the exchange of information, refers to a task or an ISR using a pointer variable, through the core
services to put a message (that is, a pointer) into the mailbox. Similarly, one or more tasks can receive this
message by the core services. The tasks sending and receiving the message promise that the content that
the pointer points to is just that piece of message.
The mailbox of CooCox CoOS is a typical message mailbox which is composed of two parts: one is
the information which expressed by a pointer of void; the other is the waiting list which composed of the
tasks waiting for this mailbox. The waiting list supports two kinds of sorting: FIFO and preemptive priority.
The sorting mode is determined by the user when creating the mailbox.
Procedure:
To Edit / Compile / generate Hex file: Refer General procedure in Page No: 58
To down load and run this program: Refer General procedure in Page No: 60
Result:
Thus, the mailbox was created in Micro C/OS ?II and implemented using LPC2148.
Outcome:
Able to understand the concept of mail box in embedded systems and its significance in real time
systems





36 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications:
1. Used in Acorn RISC PC700
2. Used in ZIPIT wireless messenger
3. Used in Meizu M6 MINI player


1. What is IPC?
2. Define Queue.
3. What are the different types of mail box functions?
4. What is half duplex mode?
5. How many synchronous and asynchronous modes are there in serial port?
6. List the bits used to generate serial port interrupt
7. What is branch prediction?
8. Mention any two features of ?C/OS ? II.
9. Write the function for creating task in ?C/OS ? II.
10. Mention any two support devices for ?C/OS ? II.
11. How many user tasks can be handled by ?C/OS ? II?



















Viva-voce




37 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 9 INTERRUPT PERFORMANCE
CHARACTERISTICSOF ARM AND FPGA

Aim:
To study the interrupt performance characteristics of ARM and FPGA by using ARM controller kit and
FPGA kit separately.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
External Interrupts:
An interrupt caused by an external source such as the computer operator, external sensor or
monitoring device, or another computer. Interrupts are special events that require immediate attention.
Interfacing External Interrupts with LPC2148:
When an external interrupt signal occurs in LPC2148 Primer Board, the message "LOW" will be
displayed on PC. The interrupt signal occurs using switches. When the switch is pressed to LOW, then the
external interrupt occurs. The Vectored Interrupt Controller (VIC) takes 32 interrupt request inputs and
programmable assigns them into 3 categories, FIQ, vectored IRQ, and non-vectored IRQ. The ARM7
LPC2148 Primer board has two numbers of External Interrupts, connected with I/O Port lines (P0.14 &
P0.15) as switches.




FirstRanker.com - FirstRanker's Choice
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00






?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING

VII SEMESTER - R 2013

EC6711 ? EMBEDDED LABORATORY






Name : _______________________________________
Register No : _______________________________________
Section : _______________________________________
LABORATORY MANUAL



2 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00




is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and
training.

? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different
levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on
heart and soul
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

To impart professional education integrated with human values to the younger generation, so as to
shape them as proficient and dedicated engineers, capable of providing comprehensive solutions to the
challenges in deploying technology for the service of humanity

? To educate the students with the state-of-art technologies to meet the growing challenges of the
electronics industry
? To carry out research through continuous interaction with research institutes and industry, on
advances in communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning,
innovation and ethical practices
VISION
VISION
MISSION
MISSION



3 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

PROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To provide students with a solid foundation in Mathematics, Science and fundamentals of
engineering, enabling them to apply, to find solutions for engineering problems and use this knowledge
to acquire higher education
2. Core Competence
To train the students in Electronics and Communication technologies so that they apply their
knowledge and training to compare, and to analyze various engineering industrial problems to find
solutions
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice which
enables them to find solutions for the real time problems in industry, and to design products
4. Professionalism
To inculcate professional and effective communication skills, leadership qualities and team spirit in
the students to make them multi-faceted personalities and develop their ability to relate engineering
issues to broader social context
5. Lifelong Learning/Ethics
To demonstrate and practice ethical and professional responsibilities in the industry and society in
the large, through commitment and lifelong learning needed for successful professional career


4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
PROGRAMME OUTCOMES (POs)
a) To demonstrate and apply knowledge of Mathematics, Science and engineering fundamentals in
Electronics and Communication Engineering field
b) To design a component, a system or a process to meet the specific needs within the realistic
constraints such as economics, environment, ethics, health, safety and manufacturability
c) To demonstrate the competency to use software tools for computation, simulation and testing of electronics
and communication engineering circuits
d) To identify, formulate and solve electronic and communication engineering problems
e) To demonstrate an ability to visualize and work on laboratory and multidisciplinary tasks
f) To function as a member or a leader in multidisciplinary activities
g) To communicate in verbal and written form with fellow engineers and society at large
h) To understand the impact of Electronics and Communication Engineering in the society and demonstrate
awareness of contemporary issues and commitment to give solutions exhibiting social responsibility
i) To demonstrate professional & ethical responsibilities
j) To exhibit confidence in self-education and ability for lifelong learning
k) To participate and succeed in competitive exams


5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
SYLLABUS

? Learn the working of ARM processor
? Understand the Building Blocks of Embedded Systems
? Learn the concept of memory map and memory interface
? Know the characteristics of Real Time Systems
? Write programs to interface memory, I/Os with processor
? Study the interrupt performance
LIST OF EXPERIMENTS:
1. Study of ARM evaluation system
2. Interfacing ADC and DAC
3. Interfacing LED and PWM
4. Interfacing real time clock and serial port
5. Interfacing keyboard and LCD
6. Interfacing EPROM and interrupt
7. Mailbox
8. Interrupt performance characteristics of ARM and FPGA
9. Flashing of LEDS
10. Interfacing stepper motor and temperature sensor
11. Implementing zigbee protocol with ARM



? Write programs in ARM for a specific Application
? Interface memory and Write programs related to memory operations
? Interface A/D and D/A convertors with ARM system
? Analyze the performance of interrupt
? Write programmes for interfacing keyboard, display, motor and sensor.
? Formulate a mini project using embedded system
COURSE OBJECTIVES
COURSE OUTCOMES
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
CONTENTS
Sl. No. Name of the Experiment Page No.
CYCLE 1 ? EXPERIMENTS
1
Study of ARM evaluation system 7
2
Analog to Digital Convertor interfacing 16
3
Generation of ramp and square wave using on-Chip DAC 19
4
LED dimming using PWM 22
5
Interfacing real time clock and serial port 25
6
Interfacing keypad and LCD 28
7
Interfacing EPROM and interrupt 31
CYCLE 2 ? EXPERIMENTS
8 Implementation of Mailbox Function using LPC 2148 35
9 Interrupt Performance Characteristics of Arm and FPGA 37
10 Flashing of LEDs 40
11 Stepper Motor Interface with ARM ? 7 LPC2148 43
12 LM35 Temperature Sensor Interface with ARM ? 7 LPC2148 47
13
Implementation of Wireless Communication Protocol using ZIGBEE Wireless
Module
50
ADDITIONAL EXPERIMENTS BEYOND THE SYYLABUS
14 Buzzer Interface with ARM ? 7 54
15 Relay interface with ARM? 7 57
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Expt. No. 1 STUDY OF ARM EVALUATION SYSTEM
Aim:
To study the building blocks of ARM7 system, its features, pin configuration and the components
required for functioning of ARM controller.
Architecture Overview:
A RISC-based computer design approach means ARM processors require significantly fewer transistors
than typical processors in average computers. This approach reduces cost, heat and power usage. These
are desirable traits for light, portable, battery-powered devices (smart phones, laptops, tablet and notepad
computers), and other embedded systems. A simpler design facilitates more efficient multi-core CPUs and
higher core counts at lower cost, providing higher processing power and improved energy efficiency for
servers and supercomputers.
In 2005, about 98% of all mobile phones sold used at least one ARM processor. The low power
consumption of ARM processors has made them very popular: 37 billion ARM processors have been
produced as of 2013, up from 10 billion in 2008. The ARM architecture (32-bit) is the most widely used
architecture in mobile devices, and most popular 32-bit one in embedded systems.
According to ARM Holdings, in 2010 alone, producers of chips based on ARM architectures
reported shipments of 6.1 billion ARM based processors, representing 95% of smart phones, 35% of digital
televisions and set-top boxes and 10% of mobile computers. It is the most widely used 32-bit instruction set
architecture in terms of quantity produced.
LPC 2148:
LPC2148 is the widely used IC from ARM-7 family. It is manufactured by Philips and it is pre-loaded
with many inbuilt peripherals making it more efficient and a reliable option for the beginners as well as high
end application developer.




8 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Features of LPC214x series controllers:
1. 8 to 40 kB of on-chip static RAM and 32 to 512 kB of on-chip flash program memory.128 bit wide
interface/accelerator enables high speed 60 MHz operation.
2. In-System/In-Application Programming (ISP/IAP) via on-chip boot-loader software. Single flash sector or
full chip erase in 400 ms and programming of 256 bytes in 1ms.
3. Embedded ICE RT and Embedded Trace interfaces offer real-time debugging with the on-chip Real
Monitor software and high speed tracing of instruction execution.
4. USB 2.0 Full Speed compliant Device Controller with 2 kB of endpoint RAM. In addition, the LPC2146/8
provides 8 kB of on-chip RAM accessible to USB by DMA.
5. One or two (LPC2141/2 vs. LPC2144/6/8) 10-bit A/D converters provide a total of 6/14analog inputs, with
conversion times as low as 2.44 us per channel.
6. Single 10-bit D/A converter provides variable analog output.
7. Two 32-bit timers/external event counters (with four capture and four compare channels each), PWM unit
(six outputs) and watchdog.
8. Low power real-time clock with independent power and dedicated 32 kHz clock input.
9. Multiple serial interfaces including two UARTs (16C550), two Fast I2C-bus (400 kbit/s), SPI and SSP with
buffering and variable data length capabilities.
10. Vectored interrupt controller with configurable priorities and vector addresses.
11. Up to 45 of 5 V tolerant fast general purpose I/O pins in a tiny LQFP64 package.
12. Up to nine edge or level sensitive external interrupt pins available.
13. On-chip integrated oscillator operates with an external crystal in range from 1 MHz to30 MHz and with
an external oscillator up to 50 MHz
14. Power saving modes include Idle and Power-down.
15. Individual enable/disable of peripheral functions as well as peripheral clock scaling for additional power
optimization.
16. Processor wake-up from Power-down mode via external interrupt, USB, Brown-Out Detect (BOD) or
Real-Time Clock (RTC).




9 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


First Step- Hardware Requirement:
Pin configuration of LPC 2148.

Hardware requirement of LPC2148:
1. LPC2148 need minimum below listed hardware to work properly
2. Power Supply
3. Crystal Oscillator
4. Reset Circuit
5. RTC crystal oscillator
6. UART
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Power Supply:
LPC2148 works on 3.3 V power supply. LM 117 can be used for generating 3.3 V supply. However,
basic peripherals like LCD, ULN 2003 (Motor Driver IC) etc. works on 5V. So AC mains supply is converted
into 5V using below mentioned circuit and after that LM 117 is used to convert 5V into 3.3V.
Block diagram of power Supply

Transformer: It is used to step down 230V AC to 9V AC supply and provides isolation between power grids
and circuit.
Rectifier: It is used to convert AC supply into DC.
Filter: It is used to reduce ripple factor of DC output available from rectifier end.
Regulator: It is used to regulate DC supply output.

11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Circuit Diagram:

Regulator IC 7805 is used to provide fix 5V dc supply.
LM 117 is used for generating 3.3V supply from 5V.

12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Calculations:

From the datasheet of LM117

Taking R 2= 240?, we get R 1=392?
Reset Circuit:
Reset button is essential in a system to avoid programming pitfalls and manually bring back the system
to the initialization mode. MCP 130T is a special IC used for providing stable RESET signal to LPC 2148.


13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Oscillator Circuit:

The value of capacitors C20 & C21 depends upon the frequency of crystal Y3. General circuit and
its equivalent circuit is as shown below.

14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Recommended values are as shown in table:

UART:
LPC 2148 has inbuilt ISP which means we can program it within the system using serial
communication on COM0. It has also COM1 for serial communication. MAX 232/233 IC must be used for
voltage logic conversion. Related connections are as given below.

Once the above listed circuit design is ready, we are ready to go further.



15 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Result:
ARM Evaluation system and the configuration of LPC2148 has been studied fully. The minimal setup
required for the functioning of the ARM processor is studied.
Outcomes:
1. Able to understand the ARM controller, its basic components inside and its features.
2. Able to know the components required for the working of ARM LPC2148

Applications:
ARM controller LPC2148 is used in no. of devices such as
1. Smart phones
2. Net books
3. E Readers
4. Digital TV
5. Home Gateways


1. What are the basic units of ARM 7?
2. What is the address system supported by ARM?
3. Define - RISC
4. What are the instructions used to access the memory in ARM?
5. What are the basic units of Microprocessor?
6. What is an Instruction?
7. What is clock cycle?
8. Define - Pipelining
9. What is cache miss?
10. What is meant by memory mapped I/O?
11. Define ? interrupt
12. What is meant by Exception?
13. What is meant by little ? endian mode?
14. What is meant by big ? endian mode?
15. What is the function of CPSR?
16. What is register - indirect addressing?
Viva-voce




16 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 2 ANALOG TO DIGITAL CONVERTOR
INTERFACING
Aim:
To write an embedded c program for interfacing an on chip ADC with LPC2148 ARM processor and
convert the given input voltage into corresponding decimal values.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. PC
Theory:
Analog to Digital converter (ADC) is a device that converts continuously varying analog signals from
instruments that monitor such conditions as movement, temperature, sound, etc., into binary code for the
computer. It may be either a single chip or can be one circuit within a chip. Analog to Digital conversion is
the process of changing continuously varying data, such as voltage, current, or shaft rotation, into discrete
digital quantities that represent the magnitude of the data compared to a standard or reference at the
moment the conversion is made. According to the method of conversion, ADCs can be classified into
Direct-Conversion ADCs, Successive Approximation ADCs, Integrating ADC and Sigma-Delta ADCs.
The LPC 2148 has 10-bit successive approximation analog to digital converter. Basic clocking for the
A/D converters is provided by the VPB clock. A programmable divider is included in each converter, to
scale this clock to the 4.5 MHz (max) clock needed by the successive approximation process. A fully
accurate conversion requires 11 of these clocks. The ADC cell can measure the voltage on any of the ADC
input signals. It is noted that these analog inputs are always connected to their pins, even if the Pin function
Select register assigns them to port pins. A simple self-test of the ADC can be done by driving these pins
as port outputs.



17 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Circuit diagram:




18 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus, an embedded c program for interfacing on-chip ADC with ARM processor is written and
executed. The decimal values of the converted voltage are seen in the WinXTalk screen.
Outcome:
Able to interface A/D convertors with ARM system and check its working by connecting an analog
quantity as input.
Applications:
1. ADC used in MODEM for converting analog signals to digital.
2. A fast video ADC in TV tuner cards
3. ADC used in digital storage oscilloscopes
4. Used in music reproduction technology.
5. Used in DSP if input is analog


1. What are the ADC operating modes in LPC2148?
2. What is meant by conversion time?
3. Why are internal ADCs preferred over external ADCs?
4. Why has 16-bit ADC more resolution than from 10-bit and 8-bit ADC?
5. What are ADC & its Resolution?
6. What is Burst conversion mode?
7. What is the function of A/D Control Register?
8. What is the function of A/D Global Data Register?
9. What is the function of A/D Status Register?
10. What is analog-to-digital (ADC) conversion error?
11. What is the function of Sample-and-hold circuits in analog-to digital converters?
12. What is the disadvantage of the flash analog-to digital converter?
Viva-voce




19 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 3 GENERATION OF RAMP AND SQUARE
WAVE USING ON-CHIP DAC
Aim:
To write and execute an embedded c program to generate ramp wave and square wave using on-chip
DAC of LPC2148 ARM controller.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
A digital-to-analog converter is a device for converting a digital signal into an analog signal (current or
voltage). Digital-to-Analog Converters are the interface between the abstract digital world and the analog
real world. Simple switches, a network of resistors, current sources or capacitors may be used to
implement this conversion. A DAC inputs a binary number and outputs an analog voltage or current signal.
The Microchip Technology Inc. MCP4921 is 2.7 ? 5.5V, low-power, 12-Bit Digital-to-Analog Converter
(DAC) with SPI interface. The MCP4921 DAC provides high accuracy and low noise performance for
industrial applications where calibration or compensation of signals is required. With an SPI connection
there is always one master device (usually a microcontroller) which controls the peripheral devices.
Typically there are three lines common to all the devices,
Master In Slave Out (MISO) ? The Slave line for sending data to the master,
Master Out Slave In (MOSI) ? The Master line for sending data to the peripherals,
Serial Clock (SCK) ? The clock pulses which synchronize data transmission generated by the
master and slave
Slave Select pin ? the pin on each device that the master can use to enable and disable specific
devices. When a device Slave Select pin is low, it communicates with the master. When it is high, it ignores
the master. In SPI, the clock signal is controlled by the master device LPC2148. All data is clocked in and
out using this pin. These lines need to be connected to the relevant pins on the LPC21xx processor. Any
unused GIO pin can be used for CS, instead pull this pin high. Conversion speed is the time it takes for the



20 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

DAC to provide an analog output when the digital input word is changed. The MCP4291 DAC ? SPI
connections with LPC21xx have four I/O lines (P0.4 ? P0.7) required. The analog output is generated by
using these four lines.
Circuit diagram:


Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the embedded c programs for generating ramp wave and square wave using ARM LPC2148 are
written and executed successfully and the waveforms are viewed in oscilloscope.
Outcome:
Able to program the DAC in-built inside the ARM controller and get the waveforms using it.




21 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications :
1. DAC used in Audio amplifier.
2. Video encoder
3. Display electronics
4. Data Acquistion systems
5. Motor control



1. What are the features of LPC2148 DAC?
2. What is the function of DAC register?
3. Which pin provides a voltage reference level for the D/A converter?
4. What are the applications of DAC in signal processing applications?
5. What is GIO?
6. What is the resolution of a digital-to-analog converter (DAC)?
7. What is the major advantage of the R/2R ladder digital-to-analog (DAC), as compared to a binary-
weighted digital-to-analog DAC converter?
8. What is the resolution of a 0?5 V 6-bit digital-to-analog converter (DAC) ?
9. What are DAC configurations?
10. What are the different types of DAC Circuits?
11. What are the Limitations of the Binary Weighted DAC?
12. What are the General DAC Characteristics?
13. Define reference voltage in DAC.
14. What is full scale voltage?
15. What is settling time?
VIVA-VOCE




22 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 4 LED DIMMING USING PWM

Aim:
To write an embedded c program for implementing PWM using ARM controller and verify the same by
dimming of LEDs.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
LPC2148 supports 2 types of PWM:
1) Single Edge PWM ? Pulse starts with new Period i.e pulse is always at the beginning
2) Double Edge PWM ? Pulse can be anywhere within the Period
A PWM block, like a Timer block , has a Timer Counter and an associated Pre-scale Register along
with Match Registers. These work exactly the same way as in the case of Timers. Match Registers 1 to 6
(except 0) are pinned on LPC214x i.e. the corresponding outputs are diverted to actual Pins on LPC214x
MCU. The PWM function must be selected for these Pins to get the PWM output.
The basic setup is to simply replace Servo by a LED and no external 5V source is needed. The
anode of LED is connected to P0.0 and cathode to ground. Pulse Widths corresponding to the switches
connected to P0.1/2/3/4 will be 2.5ms/5ms/7.5ms/10ms respectively. As the Pulse Width Increases LED
will keep on getting brighter and the reverse will happen if Pulse Width is decreased.



23 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus embedded c program for implementing Pulse Width Modulation is written and executed and
output has been verified in LED display.
Outcome:
Able to implement PWM using the ARM controller and verify the same in the form of dimming of
LEDS.



24 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Applications :
1. In Visual signals to covey a message
2. Illumination where light is reflected from objects
3. In Narrow band sensors



1. What factors determine the LED dimming performance?
2. What is meant by analog dimming?
3. What is flickering effect?
4. What is the factor determines dimming of the LED
5. Why Silicon is not suitable for fabrication of light-emitting diodes?
6. Why Silicon diode is less suited for low voltage rectifier operation?
7. What is the principle of zener diode?
8. What are the materials used to make LED?
9. What type of diodes is used in FM receivers?
10. Which diode suffers an avalanche breakdown?
11. What happens if the junction temperature of LED is increased?
12. How a transfer characteristic of a diode does is related?
13. What is the requirement of a clipping action of a diode?
14. What type of rectifier circuit requires four diodes?
15. Why are the pulse width modulated outputs required in most of the applications?
16. How do the variations in an average value get affected by PWM period?
17. Name the common formats available for LED display.
18. What are the types of seven segment display?
19. What is PWM?
20. What are the applications of PWM?

Viva-voce




25 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 5 INTERFACING REAL TIME CLOCK
AND SERIAL PORT
Aim:
To write and execute an embedded c program to interface DS1307 RTC using I2C protocol with ARM
controller
Apparatus Required:
1. LPC2148 ARM development board
2. Stepper motor
3. Interfacing cables
4. PC
Theory:
A clock, which is based on the interrupts at preset intervals, is Real Time Clock (RTC). An interrupt
service routine executes on each timeout (overflow) of this clock. This timing device once started never
resets or never reloaded with another value. Once it is set, it is not modified later. It is used in a system to
save the time and date.













26 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the program for interfacing real time clock with ARM controller is written and executed and the
date and time are verified on the screen.
Outcome:
Able to interface real time clock DS1307 with ARM controller and thereby display date and time
Applications :
1. I2C In ARM and PIC microcontrollers
2. Used as serial communication protocol with MASTER and SLAVE operation.

27 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
27 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00




1. What is I2C and how does it work?
2. What are the features of I2C in LPC2148 ARM7 microcontroller?
3. What is the function of I2C0CONSET register?
4. What is I2C0STAT?
5. What is the function of I2C0 Data Register?
6. What is RTC?
7. List the advantages of RTC
8. Through which port the date and time is displayed in RTC?
9. What is a serial port?
10. List the registers used to transfer data in serial port.
11. List the modes used for data transmission.
12. What is a simplex mode?
13. Which pin is used to transmit a character?
14. What is the baud rate of serial port?
15. What is the disadvantage of RS-232C?














Viva-voce




28 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 6 INTERFACING KEYPAD AND LCD

Aim:
To write an embedded c program to interface 4 x 4 matrix keypad with ARM processor and display the
pressed key in an LCD.
Apparatus Required:
1. LPC2148 ARM development board
2. Interfacing cables
3. PC
Theory:

In matrix keypad, keys are connected in rows and columns. When any switch is pressed, rows and
columns come into contact, which is that detected by controller to identify which key has been pressed. A
4?4 matrix keypad consists of 4 rows and 4 columns. There is a switch connecting each row and column.
So the combinations of rows and columns make up the 16 inputs.Initially all the switches are open (not
connected). When any one button is pressed, the switch is closed (connected),hence there is a connection
between the row and column. The first 4 pins are connected to the column as INPUT. The other 4 pins are
connected to the row as OUTPUT. Matrix keypad is a good substitution to normal push button.












29 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Circuit Diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus program for interfacing matrix keypad with ARM controller is written and executed and the key
pressed is seen in the LCD.



30 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Outcome:
Able to interface keypad with ARM controller and see the pressed key in the LCD display.
Applications :
1. Used in password based door locking system
2. Security system with user changeable
3. Used in laptops, computer games
4. Used in portable video games and cell phones



1. What is Matrix keypad?
2. What is the concept behind keypad interface?
3. What are the functions of pull- up resistors?
4. What is key de bouncing?
5. List the steps involved when the key in a 4 x 4 keyboard matrix is being pressed.
6. What is the value obtained if no key is pressed?
7. What kind of interrupt is generated if a key has to be operated in an interrupt mode?
8. How will you identify that the key is pressed?
9. What are the steps involved in Keyboard Interfacing?
10. List the registers used to store the keyboard, display modes and other operations programmed by
CPU.
11. Name the mode when a data is entered from the left side of the display unit.
12. How many rows and columns are present in a 16 x 2 alphanumeric LCD?
13. How many data lines are there in a 16 x 2 alphanumeric LCD?
14. Which pin of the LCD is used for adjusting its contrast?
15. Which command of an LCD is used to shift the entire display to the right?
16. Which command is used to select the 2 lines and 5 x 7 matrix of an LCD?
17. What changes are to be made to send data to an LCD?
18. For reading operation from an LCD what changes in the software are introduced?
19. Which instruction is used to select the first row first column of an LCD?
Viva-voce

31 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
31 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Expt. No. 7 INTERFACING EEPROM AND INTERRUPT

Aim:
To write a program to interface EEPROM using I2C protocol with ARM controller and retrieve the stored
messages inside EEPROM.
Apparatus Required:
1. LPC2148 ARM development board
2. Interfacing cables
3. PC
Theory:
I2C (Inter Integrated Circuit):
The I2C (Inter-IC) bus is a bi-directional two-wire serial bus that provides a communication link between
integrated circuits (ICs).I2C is a synchronous protocol that allows a master device to initiate communication
with a slave device. Data is exchanged between these devices.
EEPROM:
EEPROM (electrically erasable programmable read-only memory) is user-modifiable read-only
memory (ROM) that can be erased and reprogrammed (written to) repeatedly through the application of
higher than normal electrical voltage. It is a type of non-volatile memory used in computers and other
electronic devices to store small amounts of data that must be saved when power is removed, e.g.,
calibration tables or device configuration
Read, write and Erase EEPROM by using I2C in LPC2148 Primer Board. Wiring up an I2C based
EEPROM to the I2C port is relatively simple. The basic operation of the I2C based EEPROM's is to send a
command, such as WRITE, followed by an address and the data. In WRITE operation, the EEPROM is
used to store the data. In LPC2148 Primer Kit, 2 nos. of EEPROM lines are controlled by I2C Enabled
drivers. I2C Lines serial clock SCL (P0.2), serial data SDA (P0.3) connected to the I2C based serial
EEPROM IC. The EEPROM read & write operations are done in LPC2148 Primer Kit by using these SDA &
SCL I2C lines.
32 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
32 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To down load and run this program: Refer General procedure given in Page No: 60
Result:
Thus, the program for interfacing I2C based EEPROM with ARM processor has been written and
executed successfully and the memory content is verified on Win x talk terminal.
Outcome:
Able to interface memory ICs with ARM controller and perform the read and write operations.



33 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications:
1. ROM used in toys,automobiles to store data when power is off
2. In calculators and peripheral devices
3. In laser printers
4. And also in embedded systems where program need not to be changed.


1. How does I2C protocol work?
2. What is EEPROM?
3. What is meant by master slave mode?
4. What is meant by non-volatile memory?
5. What is an interrupt?
6. How does an interrupt request works?
7. What is a nested interrupt?
8. What are the registers used for enabling an interrupt?
9. What is PROM?
10. What is EPROM?
11. What is mask ROM?
12. Which memory allows simultaneous read and write operations?
13. Which memory has the shortest access times?
14. Which interrupt has the highest priority?
15. What is non maskable interrupt?
16. Which is the first level of memory access by the microprocessor?
17. List the types of cache memories.
18. What is the use of an interrupt?
19. What is the use of converting an interrupt to threads in a microprocessor?
20. What are the bits used to control an external interrupts?


Viva-voce




34 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00










CYCLE 2 - EXPERIMENTS




35 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 8 IMPLEMENTATION OF MAILBOX FUNCTION
USING LPC2148
Aim:
To create a mailbox in Micro C/OS ? II using LPC2148 ARM Controller
Apparatus Required:
1. LPC2148 ARM development board
2. Interfacing cables
3. PC
Theory:
System or the user code can send a message by the core services. A typical mail message, also
known as the exchange of information, refers to a task or an ISR using a pointer variable, through the core
services to put a message (that is, a pointer) into the mailbox. Similarly, one or more tasks can receive this
message by the core services. The tasks sending and receiving the message promise that the content that
the pointer points to is just that piece of message.
The mailbox of CooCox CoOS is a typical message mailbox which is composed of two parts: one is
the information which expressed by a pointer of void; the other is the waiting list which composed of the
tasks waiting for this mailbox. The waiting list supports two kinds of sorting: FIFO and preemptive priority.
The sorting mode is determined by the user when creating the mailbox.
Procedure:
To Edit / Compile / generate Hex file: Refer General procedure in Page No: 58
To down load and run this program: Refer General procedure in Page No: 60
Result:
Thus, the mailbox was created in Micro C/OS ?II and implemented using LPC2148.
Outcome:
Able to understand the concept of mail box in embedded systems and its significance in real time
systems





36 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications:
1. Used in Acorn RISC PC700
2. Used in ZIPIT wireless messenger
3. Used in Meizu M6 MINI player


1. What is IPC?
2. Define Queue.
3. What are the different types of mail box functions?
4. What is half duplex mode?
5. How many synchronous and asynchronous modes are there in serial port?
6. List the bits used to generate serial port interrupt
7. What is branch prediction?
8. Mention any two features of ?C/OS ? II.
9. Write the function for creating task in ?C/OS ? II.
10. Mention any two support devices for ?C/OS ? II.
11. How many user tasks can be handled by ?C/OS ? II?



















Viva-voce




37 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 9 INTERRUPT PERFORMANCE
CHARACTERISTICSOF ARM AND FPGA

Aim:
To study the interrupt performance characteristics of ARM and FPGA by using ARM controller kit and
FPGA kit separately.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
External Interrupts:
An interrupt caused by an external source such as the computer operator, external sensor or
monitoring device, or another computer. Interrupts are special events that require immediate attention.
Interfacing External Interrupts with LPC2148:
When an external interrupt signal occurs in LPC2148 Primer Board, the message "LOW" will be
displayed on PC. The interrupt signal occurs using switches. When the switch is pressed to LOW, then the
external interrupt occurs. The Vectored Interrupt Controller (VIC) takes 32 interrupt request inputs and
programmable assigns them into 3 categories, FIQ, vectored IRQ, and non-vectored IRQ. The ARM7
LPC2148 Primer board has two numbers of External Interrupts, connected with I/O Port lines (P0.14 &
P0.15) as switches.







38 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00



Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60


FirstRanker.com - FirstRanker's Choice
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00






?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING

VII SEMESTER - R 2013

EC6711 ? EMBEDDED LABORATORY






Name : _______________________________________
Register No : _______________________________________
Section : _______________________________________
LABORATORY MANUAL



2 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00




is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and
training.

? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different
levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on
heart and soul
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

To impart professional education integrated with human values to the younger generation, so as to
shape them as proficient and dedicated engineers, capable of providing comprehensive solutions to the
challenges in deploying technology for the service of humanity

? To educate the students with the state-of-art technologies to meet the growing challenges of the
electronics industry
? To carry out research through continuous interaction with research institutes and industry, on
advances in communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning,
innovation and ethical practices
VISION
VISION
MISSION
MISSION



3 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

PROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To provide students with a solid foundation in Mathematics, Science and fundamentals of
engineering, enabling them to apply, to find solutions for engineering problems and use this knowledge
to acquire higher education
2. Core Competence
To train the students in Electronics and Communication technologies so that they apply their
knowledge and training to compare, and to analyze various engineering industrial problems to find
solutions
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice which
enables them to find solutions for the real time problems in industry, and to design products
4. Professionalism
To inculcate professional and effective communication skills, leadership qualities and team spirit in
the students to make them multi-faceted personalities and develop their ability to relate engineering
issues to broader social context
5. Lifelong Learning/Ethics
To demonstrate and practice ethical and professional responsibilities in the industry and society in
the large, through commitment and lifelong learning needed for successful professional career


4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
PROGRAMME OUTCOMES (POs)
a) To demonstrate and apply knowledge of Mathematics, Science and engineering fundamentals in
Electronics and Communication Engineering field
b) To design a component, a system or a process to meet the specific needs within the realistic
constraints such as economics, environment, ethics, health, safety and manufacturability
c) To demonstrate the competency to use software tools for computation, simulation and testing of electronics
and communication engineering circuits
d) To identify, formulate and solve electronic and communication engineering problems
e) To demonstrate an ability to visualize and work on laboratory and multidisciplinary tasks
f) To function as a member or a leader in multidisciplinary activities
g) To communicate in verbal and written form with fellow engineers and society at large
h) To understand the impact of Electronics and Communication Engineering in the society and demonstrate
awareness of contemporary issues and commitment to give solutions exhibiting social responsibility
i) To demonstrate professional & ethical responsibilities
j) To exhibit confidence in self-education and ability for lifelong learning
k) To participate and succeed in competitive exams


5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
SYLLABUS

? Learn the working of ARM processor
? Understand the Building Blocks of Embedded Systems
? Learn the concept of memory map and memory interface
? Know the characteristics of Real Time Systems
? Write programs to interface memory, I/Os with processor
? Study the interrupt performance
LIST OF EXPERIMENTS:
1. Study of ARM evaluation system
2. Interfacing ADC and DAC
3. Interfacing LED and PWM
4. Interfacing real time clock and serial port
5. Interfacing keyboard and LCD
6. Interfacing EPROM and interrupt
7. Mailbox
8. Interrupt performance characteristics of ARM and FPGA
9. Flashing of LEDS
10. Interfacing stepper motor and temperature sensor
11. Implementing zigbee protocol with ARM



? Write programs in ARM for a specific Application
? Interface memory and Write programs related to memory operations
? Interface A/D and D/A convertors with ARM system
? Analyze the performance of interrupt
? Write programmes for interfacing keyboard, display, motor and sensor.
? Formulate a mini project using embedded system
COURSE OBJECTIVES
COURSE OUTCOMES
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
CONTENTS
Sl. No. Name of the Experiment Page No.
CYCLE 1 ? EXPERIMENTS
1
Study of ARM evaluation system 7
2
Analog to Digital Convertor interfacing 16
3
Generation of ramp and square wave using on-Chip DAC 19
4
LED dimming using PWM 22
5
Interfacing real time clock and serial port 25
6
Interfacing keypad and LCD 28
7
Interfacing EPROM and interrupt 31
CYCLE 2 ? EXPERIMENTS
8 Implementation of Mailbox Function using LPC 2148 35
9 Interrupt Performance Characteristics of Arm and FPGA 37
10 Flashing of LEDs 40
11 Stepper Motor Interface with ARM ? 7 LPC2148 43
12 LM35 Temperature Sensor Interface with ARM ? 7 LPC2148 47
13
Implementation of Wireless Communication Protocol using ZIGBEE Wireless
Module
50
ADDITIONAL EXPERIMENTS BEYOND THE SYYLABUS
14 Buzzer Interface with ARM ? 7 54
15 Relay interface with ARM? 7 57
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Expt. No. 1 STUDY OF ARM EVALUATION SYSTEM
Aim:
To study the building blocks of ARM7 system, its features, pin configuration and the components
required for functioning of ARM controller.
Architecture Overview:
A RISC-based computer design approach means ARM processors require significantly fewer transistors
than typical processors in average computers. This approach reduces cost, heat and power usage. These
are desirable traits for light, portable, battery-powered devices (smart phones, laptops, tablet and notepad
computers), and other embedded systems. A simpler design facilitates more efficient multi-core CPUs and
higher core counts at lower cost, providing higher processing power and improved energy efficiency for
servers and supercomputers.
In 2005, about 98% of all mobile phones sold used at least one ARM processor. The low power
consumption of ARM processors has made them very popular: 37 billion ARM processors have been
produced as of 2013, up from 10 billion in 2008. The ARM architecture (32-bit) is the most widely used
architecture in mobile devices, and most popular 32-bit one in embedded systems.
According to ARM Holdings, in 2010 alone, producers of chips based on ARM architectures
reported shipments of 6.1 billion ARM based processors, representing 95% of smart phones, 35% of digital
televisions and set-top boxes and 10% of mobile computers. It is the most widely used 32-bit instruction set
architecture in terms of quantity produced.
LPC 2148:
LPC2148 is the widely used IC from ARM-7 family. It is manufactured by Philips and it is pre-loaded
with many inbuilt peripherals making it more efficient and a reliable option for the beginners as well as high
end application developer.




8 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Features of LPC214x series controllers:
1. 8 to 40 kB of on-chip static RAM and 32 to 512 kB of on-chip flash program memory.128 bit wide
interface/accelerator enables high speed 60 MHz operation.
2. In-System/In-Application Programming (ISP/IAP) via on-chip boot-loader software. Single flash sector or
full chip erase in 400 ms and programming of 256 bytes in 1ms.
3. Embedded ICE RT and Embedded Trace interfaces offer real-time debugging with the on-chip Real
Monitor software and high speed tracing of instruction execution.
4. USB 2.0 Full Speed compliant Device Controller with 2 kB of endpoint RAM. In addition, the LPC2146/8
provides 8 kB of on-chip RAM accessible to USB by DMA.
5. One or two (LPC2141/2 vs. LPC2144/6/8) 10-bit A/D converters provide a total of 6/14analog inputs, with
conversion times as low as 2.44 us per channel.
6. Single 10-bit D/A converter provides variable analog output.
7. Two 32-bit timers/external event counters (with four capture and four compare channels each), PWM unit
(six outputs) and watchdog.
8. Low power real-time clock with independent power and dedicated 32 kHz clock input.
9. Multiple serial interfaces including two UARTs (16C550), two Fast I2C-bus (400 kbit/s), SPI and SSP with
buffering and variable data length capabilities.
10. Vectored interrupt controller with configurable priorities and vector addresses.
11. Up to 45 of 5 V tolerant fast general purpose I/O pins in a tiny LQFP64 package.
12. Up to nine edge or level sensitive external interrupt pins available.
13. On-chip integrated oscillator operates with an external crystal in range from 1 MHz to30 MHz and with
an external oscillator up to 50 MHz
14. Power saving modes include Idle and Power-down.
15. Individual enable/disable of peripheral functions as well as peripheral clock scaling for additional power
optimization.
16. Processor wake-up from Power-down mode via external interrupt, USB, Brown-Out Detect (BOD) or
Real-Time Clock (RTC).




9 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


First Step- Hardware Requirement:
Pin configuration of LPC 2148.

Hardware requirement of LPC2148:
1. LPC2148 need minimum below listed hardware to work properly
2. Power Supply
3. Crystal Oscillator
4. Reset Circuit
5. RTC crystal oscillator
6. UART
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Power Supply:
LPC2148 works on 3.3 V power supply. LM 117 can be used for generating 3.3 V supply. However,
basic peripherals like LCD, ULN 2003 (Motor Driver IC) etc. works on 5V. So AC mains supply is converted
into 5V using below mentioned circuit and after that LM 117 is used to convert 5V into 3.3V.
Block diagram of power Supply

Transformer: It is used to step down 230V AC to 9V AC supply and provides isolation between power grids
and circuit.
Rectifier: It is used to convert AC supply into DC.
Filter: It is used to reduce ripple factor of DC output available from rectifier end.
Regulator: It is used to regulate DC supply output.

11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Circuit Diagram:

Regulator IC 7805 is used to provide fix 5V dc supply.
LM 117 is used for generating 3.3V supply from 5V.

12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Calculations:

From the datasheet of LM117

Taking R 2= 240?, we get R 1=392?
Reset Circuit:
Reset button is essential in a system to avoid programming pitfalls and manually bring back the system
to the initialization mode. MCP 130T is a special IC used for providing stable RESET signal to LPC 2148.


13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Oscillator Circuit:

The value of capacitors C20 & C21 depends upon the frequency of crystal Y3. General circuit and
its equivalent circuit is as shown below.

14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Recommended values are as shown in table:

UART:
LPC 2148 has inbuilt ISP which means we can program it within the system using serial
communication on COM0. It has also COM1 for serial communication. MAX 232/233 IC must be used for
voltage logic conversion. Related connections are as given below.

Once the above listed circuit design is ready, we are ready to go further.



15 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Result:
ARM Evaluation system and the configuration of LPC2148 has been studied fully. The minimal setup
required for the functioning of the ARM processor is studied.
Outcomes:
1. Able to understand the ARM controller, its basic components inside and its features.
2. Able to know the components required for the working of ARM LPC2148

Applications:
ARM controller LPC2148 is used in no. of devices such as
1. Smart phones
2. Net books
3. E Readers
4. Digital TV
5. Home Gateways


1. What are the basic units of ARM 7?
2. What is the address system supported by ARM?
3. Define - RISC
4. What are the instructions used to access the memory in ARM?
5. What are the basic units of Microprocessor?
6. What is an Instruction?
7. What is clock cycle?
8. Define - Pipelining
9. What is cache miss?
10. What is meant by memory mapped I/O?
11. Define ? interrupt
12. What is meant by Exception?
13. What is meant by little ? endian mode?
14. What is meant by big ? endian mode?
15. What is the function of CPSR?
16. What is register - indirect addressing?
Viva-voce




16 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 2 ANALOG TO DIGITAL CONVERTOR
INTERFACING
Aim:
To write an embedded c program for interfacing an on chip ADC with LPC2148 ARM processor and
convert the given input voltage into corresponding decimal values.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. PC
Theory:
Analog to Digital converter (ADC) is a device that converts continuously varying analog signals from
instruments that monitor such conditions as movement, temperature, sound, etc., into binary code for the
computer. It may be either a single chip or can be one circuit within a chip. Analog to Digital conversion is
the process of changing continuously varying data, such as voltage, current, or shaft rotation, into discrete
digital quantities that represent the magnitude of the data compared to a standard or reference at the
moment the conversion is made. According to the method of conversion, ADCs can be classified into
Direct-Conversion ADCs, Successive Approximation ADCs, Integrating ADC and Sigma-Delta ADCs.
The LPC 2148 has 10-bit successive approximation analog to digital converter. Basic clocking for the
A/D converters is provided by the VPB clock. A programmable divider is included in each converter, to
scale this clock to the 4.5 MHz (max) clock needed by the successive approximation process. A fully
accurate conversion requires 11 of these clocks. The ADC cell can measure the voltage on any of the ADC
input signals. It is noted that these analog inputs are always connected to their pins, even if the Pin function
Select register assigns them to port pins. A simple self-test of the ADC can be done by driving these pins
as port outputs.



17 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Circuit diagram:




18 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus, an embedded c program for interfacing on-chip ADC with ARM processor is written and
executed. The decimal values of the converted voltage are seen in the WinXTalk screen.
Outcome:
Able to interface A/D convertors with ARM system and check its working by connecting an analog
quantity as input.
Applications:
1. ADC used in MODEM for converting analog signals to digital.
2. A fast video ADC in TV tuner cards
3. ADC used in digital storage oscilloscopes
4. Used in music reproduction technology.
5. Used in DSP if input is analog


1. What are the ADC operating modes in LPC2148?
2. What is meant by conversion time?
3. Why are internal ADCs preferred over external ADCs?
4. Why has 16-bit ADC more resolution than from 10-bit and 8-bit ADC?
5. What are ADC & its Resolution?
6. What is Burst conversion mode?
7. What is the function of A/D Control Register?
8. What is the function of A/D Global Data Register?
9. What is the function of A/D Status Register?
10. What is analog-to-digital (ADC) conversion error?
11. What is the function of Sample-and-hold circuits in analog-to digital converters?
12. What is the disadvantage of the flash analog-to digital converter?
Viva-voce




19 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 3 GENERATION OF RAMP AND SQUARE
WAVE USING ON-CHIP DAC
Aim:
To write and execute an embedded c program to generate ramp wave and square wave using on-chip
DAC of LPC2148 ARM controller.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
A digital-to-analog converter is a device for converting a digital signal into an analog signal (current or
voltage). Digital-to-Analog Converters are the interface between the abstract digital world and the analog
real world. Simple switches, a network of resistors, current sources or capacitors may be used to
implement this conversion. A DAC inputs a binary number and outputs an analog voltage or current signal.
The Microchip Technology Inc. MCP4921 is 2.7 ? 5.5V, low-power, 12-Bit Digital-to-Analog Converter
(DAC) with SPI interface. The MCP4921 DAC provides high accuracy and low noise performance for
industrial applications where calibration or compensation of signals is required. With an SPI connection
there is always one master device (usually a microcontroller) which controls the peripheral devices.
Typically there are three lines common to all the devices,
Master In Slave Out (MISO) ? The Slave line for sending data to the master,
Master Out Slave In (MOSI) ? The Master line for sending data to the peripherals,
Serial Clock (SCK) ? The clock pulses which synchronize data transmission generated by the
master and slave
Slave Select pin ? the pin on each device that the master can use to enable and disable specific
devices. When a device Slave Select pin is low, it communicates with the master. When it is high, it ignores
the master. In SPI, the clock signal is controlled by the master device LPC2148. All data is clocked in and
out using this pin. These lines need to be connected to the relevant pins on the LPC21xx processor. Any
unused GIO pin can be used for CS, instead pull this pin high. Conversion speed is the time it takes for the



20 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

DAC to provide an analog output when the digital input word is changed. The MCP4291 DAC ? SPI
connections with LPC21xx have four I/O lines (P0.4 ? P0.7) required. The analog output is generated by
using these four lines.
Circuit diagram:


Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the embedded c programs for generating ramp wave and square wave using ARM LPC2148 are
written and executed successfully and the waveforms are viewed in oscilloscope.
Outcome:
Able to program the DAC in-built inside the ARM controller and get the waveforms using it.




21 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications :
1. DAC used in Audio amplifier.
2. Video encoder
3. Display electronics
4. Data Acquistion systems
5. Motor control



1. What are the features of LPC2148 DAC?
2. What is the function of DAC register?
3. Which pin provides a voltage reference level for the D/A converter?
4. What are the applications of DAC in signal processing applications?
5. What is GIO?
6. What is the resolution of a digital-to-analog converter (DAC)?
7. What is the major advantage of the R/2R ladder digital-to-analog (DAC), as compared to a binary-
weighted digital-to-analog DAC converter?
8. What is the resolution of a 0?5 V 6-bit digital-to-analog converter (DAC) ?
9. What are DAC configurations?
10. What are the different types of DAC Circuits?
11. What are the Limitations of the Binary Weighted DAC?
12. What are the General DAC Characteristics?
13. Define reference voltage in DAC.
14. What is full scale voltage?
15. What is settling time?
VIVA-VOCE




22 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 4 LED DIMMING USING PWM

Aim:
To write an embedded c program for implementing PWM using ARM controller and verify the same by
dimming of LEDs.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
LPC2148 supports 2 types of PWM:
1) Single Edge PWM ? Pulse starts with new Period i.e pulse is always at the beginning
2) Double Edge PWM ? Pulse can be anywhere within the Period
A PWM block, like a Timer block , has a Timer Counter and an associated Pre-scale Register along
with Match Registers. These work exactly the same way as in the case of Timers. Match Registers 1 to 6
(except 0) are pinned on LPC214x i.e. the corresponding outputs are diverted to actual Pins on LPC214x
MCU. The PWM function must be selected for these Pins to get the PWM output.
The basic setup is to simply replace Servo by a LED and no external 5V source is needed. The
anode of LED is connected to P0.0 and cathode to ground. Pulse Widths corresponding to the switches
connected to P0.1/2/3/4 will be 2.5ms/5ms/7.5ms/10ms respectively. As the Pulse Width Increases LED
will keep on getting brighter and the reverse will happen if Pulse Width is decreased.



23 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus embedded c program for implementing Pulse Width Modulation is written and executed and
output has been verified in LED display.
Outcome:
Able to implement PWM using the ARM controller and verify the same in the form of dimming of
LEDS.



24 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Applications :
1. In Visual signals to covey a message
2. Illumination where light is reflected from objects
3. In Narrow band sensors



1. What factors determine the LED dimming performance?
2. What is meant by analog dimming?
3. What is flickering effect?
4. What is the factor determines dimming of the LED
5. Why Silicon is not suitable for fabrication of light-emitting diodes?
6. Why Silicon diode is less suited for low voltage rectifier operation?
7. What is the principle of zener diode?
8. What are the materials used to make LED?
9. What type of diodes is used in FM receivers?
10. Which diode suffers an avalanche breakdown?
11. What happens if the junction temperature of LED is increased?
12. How a transfer characteristic of a diode does is related?
13. What is the requirement of a clipping action of a diode?
14. What type of rectifier circuit requires four diodes?
15. Why are the pulse width modulated outputs required in most of the applications?
16. How do the variations in an average value get affected by PWM period?
17. Name the common formats available for LED display.
18. What are the types of seven segment display?
19. What is PWM?
20. What are the applications of PWM?

Viva-voce




25 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 5 INTERFACING REAL TIME CLOCK
AND SERIAL PORT
Aim:
To write and execute an embedded c program to interface DS1307 RTC using I2C protocol with ARM
controller
Apparatus Required:
1. LPC2148 ARM development board
2. Stepper motor
3. Interfacing cables
4. PC
Theory:
A clock, which is based on the interrupts at preset intervals, is Real Time Clock (RTC). An interrupt
service routine executes on each timeout (overflow) of this clock. This timing device once started never
resets or never reloaded with another value. Once it is set, it is not modified later. It is used in a system to
save the time and date.













26 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the program for interfacing real time clock with ARM controller is written and executed and the
date and time are verified on the screen.
Outcome:
Able to interface real time clock DS1307 with ARM controller and thereby display date and time
Applications :
1. I2C In ARM and PIC microcontrollers
2. Used as serial communication protocol with MASTER and SLAVE operation.

27 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
27 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00




1. What is I2C and how does it work?
2. What are the features of I2C in LPC2148 ARM7 microcontroller?
3. What is the function of I2C0CONSET register?
4. What is I2C0STAT?
5. What is the function of I2C0 Data Register?
6. What is RTC?
7. List the advantages of RTC
8. Through which port the date and time is displayed in RTC?
9. What is a serial port?
10. List the registers used to transfer data in serial port.
11. List the modes used for data transmission.
12. What is a simplex mode?
13. Which pin is used to transmit a character?
14. What is the baud rate of serial port?
15. What is the disadvantage of RS-232C?














Viva-voce




28 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 6 INTERFACING KEYPAD AND LCD

Aim:
To write an embedded c program to interface 4 x 4 matrix keypad with ARM processor and display the
pressed key in an LCD.
Apparatus Required:
1. LPC2148 ARM development board
2. Interfacing cables
3. PC
Theory:

In matrix keypad, keys are connected in rows and columns. When any switch is pressed, rows and
columns come into contact, which is that detected by controller to identify which key has been pressed. A
4?4 matrix keypad consists of 4 rows and 4 columns. There is a switch connecting each row and column.
So the combinations of rows and columns make up the 16 inputs.Initially all the switches are open (not
connected). When any one button is pressed, the switch is closed (connected),hence there is a connection
between the row and column. The first 4 pins are connected to the column as INPUT. The other 4 pins are
connected to the row as OUTPUT. Matrix keypad is a good substitution to normal push button.












29 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Circuit Diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus program for interfacing matrix keypad with ARM controller is written and executed and the key
pressed is seen in the LCD.



30 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Outcome:
Able to interface keypad with ARM controller and see the pressed key in the LCD display.
Applications :
1. Used in password based door locking system
2. Security system with user changeable
3. Used in laptops, computer games
4. Used in portable video games and cell phones



1. What is Matrix keypad?
2. What is the concept behind keypad interface?
3. What are the functions of pull- up resistors?
4. What is key de bouncing?
5. List the steps involved when the key in a 4 x 4 keyboard matrix is being pressed.
6. What is the value obtained if no key is pressed?
7. What kind of interrupt is generated if a key has to be operated in an interrupt mode?
8. How will you identify that the key is pressed?
9. What are the steps involved in Keyboard Interfacing?
10. List the registers used to store the keyboard, display modes and other operations programmed by
CPU.
11. Name the mode when a data is entered from the left side of the display unit.
12. How many rows and columns are present in a 16 x 2 alphanumeric LCD?
13. How many data lines are there in a 16 x 2 alphanumeric LCD?
14. Which pin of the LCD is used for adjusting its contrast?
15. Which command of an LCD is used to shift the entire display to the right?
16. Which command is used to select the 2 lines and 5 x 7 matrix of an LCD?
17. What changes are to be made to send data to an LCD?
18. For reading operation from an LCD what changes in the software are introduced?
19. Which instruction is used to select the first row first column of an LCD?
Viva-voce

31 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
31 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Expt. No. 7 INTERFACING EEPROM AND INTERRUPT

Aim:
To write a program to interface EEPROM using I2C protocol with ARM controller and retrieve the stored
messages inside EEPROM.
Apparatus Required:
1. LPC2148 ARM development board
2. Interfacing cables
3. PC
Theory:
I2C (Inter Integrated Circuit):
The I2C (Inter-IC) bus is a bi-directional two-wire serial bus that provides a communication link between
integrated circuits (ICs).I2C is a synchronous protocol that allows a master device to initiate communication
with a slave device. Data is exchanged between these devices.
EEPROM:
EEPROM (electrically erasable programmable read-only memory) is user-modifiable read-only
memory (ROM) that can be erased and reprogrammed (written to) repeatedly through the application of
higher than normal electrical voltage. It is a type of non-volatile memory used in computers and other
electronic devices to store small amounts of data that must be saved when power is removed, e.g.,
calibration tables or device configuration
Read, write and Erase EEPROM by using I2C in LPC2148 Primer Board. Wiring up an I2C based
EEPROM to the I2C port is relatively simple. The basic operation of the I2C based EEPROM's is to send a
command, such as WRITE, followed by an address and the data. In WRITE operation, the EEPROM is
used to store the data. In LPC2148 Primer Kit, 2 nos. of EEPROM lines are controlled by I2C Enabled
drivers. I2C Lines serial clock SCL (P0.2), serial data SDA (P0.3) connected to the I2C based serial
EEPROM IC. The EEPROM read & write operations are done in LPC2148 Primer Kit by using these SDA &
SCL I2C lines.
32 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
32 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To down load and run this program: Refer General procedure given in Page No: 60
Result:
Thus, the program for interfacing I2C based EEPROM with ARM processor has been written and
executed successfully and the memory content is verified on Win x talk terminal.
Outcome:
Able to interface memory ICs with ARM controller and perform the read and write operations.



33 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications:
1. ROM used in toys,automobiles to store data when power is off
2. In calculators and peripheral devices
3. In laser printers
4. And also in embedded systems where program need not to be changed.


1. How does I2C protocol work?
2. What is EEPROM?
3. What is meant by master slave mode?
4. What is meant by non-volatile memory?
5. What is an interrupt?
6. How does an interrupt request works?
7. What is a nested interrupt?
8. What are the registers used for enabling an interrupt?
9. What is PROM?
10. What is EPROM?
11. What is mask ROM?
12. Which memory allows simultaneous read and write operations?
13. Which memory has the shortest access times?
14. Which interrupt has the highest priority?
15. What is non maskable interrupt?
16. Which is the first level of memory access by the microprocessor?
17. List the types of cache memories.
18. What is the use of an interrupt?
19. What is the use of converting an interrupt to threads in a microprocessor?
20. What are the bits used to control an external interrupts?


Viva-voce




34 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00










CYCLE 2 - EXPERIMENTS




35 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 8 IMPLEMENTATION OF MAILBOX FUNCTION
USING LPC2148
Aim:
To create a mailbox in Micro C/OS ? II using LPC2148 ARM Controller
Apparatus Required:
1. LPC2148 ARM development board
2. Interfacing cables
3. PC
Theory:
System or the user code can send a message by the core services. A typical mail message, also
known as the exchange of information, refers to a task or an ISR using a pointer variable, through the core
services to put a message (that is, a pointer) into the mailbox. Similarly, one or more tasks can receive this
message by the core services. The tasks sending and receiving the message promise that the content that
the pointer points to is just that piece of message.
The mailbox of CooCox CoOS is a typical message mailbox which is composed of two parts: one is
the information which expressed by a pointer of void; the other is the waiting list which composed of the
tasks waiting for this mailbox. The waiting list supports two kinds of sorting: FIFO and preemptive priority.
The sorting mode is determined by the user when creating the mailbox.
Procedure:
To Edit / Compile / generate Hex file: Refer General procedure in Page No: 58
To down load and run this program: Refer General procedure in Page No: 60
Result:
Thus, the mailbox was created in Micro C/OS ?II and implemented using LPC2148.
Outcome:
Able to understand the concept of mail box in embedded systems and its significance in real time
systems





36 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications:
1. Used in Acorn RISC PC700
2. Used in ZIPIT wireless messenger
3. Used in Meizu M6 MINI player


1. What is IPC?
2. Define Queue.
3. What are the different types of mail box functions?
4. What is half duplex mode?
5. How many synchronous and asynchronous modes are there in serial port?
6. List the bits used to generate serial port interrupt
7. What is branch prediction?
8. Mention any two features of ?C/OS ? II.
9. Write the function for creating task in ?C/OS ? II.
10. Mention any two support devices for ?C/OS ? II.
11. How many user tasks can be handled by ?C/OS ? II?



















Viva-voce




37 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 9 INTERRUPT PERFORMANCE
CHARACTERISTICSOF ARM AND FPGA

Aim:
To study the interrupt performance characteristics of ARM and FPGA by using ARM controller kit and
FPGA kit separately.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
External Interrupts:
An interrupt caused by an external source such as the computer operator, external sensor or
monitoring device, or another computer. Interrupts are special events that require immediate attention.
Interfacing External Interrupts with LPC2148:
When an external interrupt signal occurs in LPC2148 Primer Board, the message "LOW" will be
displayed on PC. The interrupt signal occurs using switches. When the switch is pressed to LOW, then the
external interrupt occurs. The Vectored Interrupt Controller (VIC) takes 32 interrupt request inputs and
programmable assigns them into 3 categories, FIQ, vectored IRQ, and non-vectored IRQ. The ARM7
LPC2148 Primer board has two numbers of External Interrupts, connected with I/O Port lines (P0.14 &
P0.15) as switches.







38 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00



Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60


39 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
39 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Result:
Thus the interrupt performance characteristics of ARM and FPGA are studied. On comparison, ARM
counts at slow speed because it consumes more instruction cycle and FPGA is more efficient for servicing
and processing external interrupt pulses.
Outcome:
Able to understand the performance characteristics of ARM and FPGA while dealing with
interrrupts
Applications:
1. Used in random logic and SPLDs
2. Used in cryptography and filtering
3. In medical imaging
4. In bioinformatics and voice recognition



1. When is an Interrupt Request received?
2. What is ISR?
3. How do you initialize interrupt?
4. What is Vectored Interrupt Controller?
5. What are the kinds of protection available for SRAMS ?
6. What is interrupt pipelining?
7. What is pipeline shutdown?
8. What is branch prediction?
9. What is the use of Neon Floating point engine?
10. What is the use of ?vectorize option?
11. What is PTM?
12. What is ITM?
13. What is ETM?
14. What is I2S interface?
15. What is the use of ?SWI? in ARM assembly?

Viva-voce

FirstRanker.com - FirstRanker's Choice
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00






?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING

VII SEMESTER - R 2013

EC6711 ? EMBEDDED LABORATORY






Name : _______________________________________
Register No : _______________________________________
Section : _______________________________________
LABORATORY MANUAL



2 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00




is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and
training.

? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different
levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on
heart and soul
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

To impart professional education integrated with human values to the younger generation, so as to
shape them as proficient and dedicated engineers, capable of providing comprehensive solutions to the
challenges in deploying technology for the service of humanity

? To educate the students with the state-of-art technologies to meet the growing challenges of the
electronics industry
? To carry out research through continuous interaction with research institutes and industry, on
advances in communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning,
innovation and ethical practices
VISION
VISION
MISSION
MISSION



3 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

PROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To provide students with a solid foundation in Mathematics, Science and fundamentals of
engineering, enabling them to apply, to find solutions for engineering problems and use this knowledge
to acquire higher education
2. Core Competence
To train the students in Electronics and Communication technologies so that they apply their
knowledge and training to compare, and to analyze various engineering industrial problems to find
solutions
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice which
enables them to find solutions for the real time problems in industry, and to design products
4. Professionalism
To inculcate professional and effective communication skills, leadership qualities and team spirit in
the students to make them multi-faceted personalities and develop their ability to relate engineering
issues to broader social context
5. Lifelong Learning/Ethics
To demonstrate and practice ethical and professional responsibilities in the industry and society in
the large, through commitment and lifelong learning needed for successful professional career


4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
PROGRAMME OUTCOMES (POs)
a) To demonstrate and apply knowledge of Mathematics, Science and engineering fundamentals in
Electronics and Communication Engineering field
b) To design a component, a system or a process to meet the specific needs within the realistic
constraints such as economics, environment, ethics, health, safety and manufacturability
c) To demonstrate the competency to use software tools for computation, simulation and testing of electronics
and communication engineering circuits
d) To identify, formulate and solve electronic and communication engineering problems
e) To demonstrate an ability to visualize and work on laboratory and multidisciplinary tasks
f) To function as a member or a leader in multidisciplinary activities
g) To communicate in verbal and written form with fellow engineers and society at large
h) To understand the impact of Electronics and Communication Engineering in the society and demonstrate
awareness of contemporary issues and commitment to give solutions exhibiting social responsibility
i) To demonstrate professional & ethical responsibilities
j) To exhibit confidence in self-education and ability for lifelong learning
k) To participate and succeed in competitive exams


5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
SYLLABUS

? Learn the working of ARM processor
? Understand the Building Blocks of Embedded Systems
? Learn the concept of memory map and memory interface
? Know the characteristics of Real Time Systems
? Write programs to interface memory, I/Os with processor
? Study the interrupt performance
LIST OF EXPERIMENTS:
1. Study of ARM evaluation system
2. Interfacing ADC and DAC
3. Interfacing LED and PWM
4. Interfacing real time clock and serial port
5. Interfacing keyboard and LCD
6. Interfacing EPROM and interrupt
7. Mailbox
8. Interrupt performance characteristics of ARM and FPGA
9. Flashing of LEDS
10. Interfacing stepper motor and temperature sensor
11. Implementing zigbee protocol with ARM



? Write programs in ARM for a specific Application
? Interface memory and Write programs related to memory operations
? Interface A/D and D/A convertors with ARM system
? Analyze the performance of interrupt
? Write programmes for interfacing keyboard, display, motor and sensor.
? Formulate a mini project using embedded system
COURSE OBJECTIVES
COURSE OUTCOMES
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
CONTENTS
Sl. No. Name of the Experiment Page No.
CYCLE 1 ? EXPERIMENTS
1
Study of ARM evaluation system 7
2
Analog to Digital Convertor interfacing 16
3
Generation of ramp and square wave using on-Chip DAC 19
4
LED dimming using PWM 22
5
Interfacing real time clock and serial port 25
6
Interfacing keypad and LCD 28
7
Interfacing EPROM and interrupt 31
CYCLE 2 ? EXPERIMENTS
8 Implementation of Mailbox Function using LPC 2148 35
9 Interrupt Performance Characteristics of Arm and FPGA 37
10 Flashing of LEDs 40
11 Stepper Motor Interface with ARM ? 7 LPC2148 43
12 LM35 Temperature Sensor Interface with ARM ? 7 LPC2148 47
13
Implementation of Wireless Communication Protocol using ZIGBEE Wireless
Module
50
ADDITIONAL EXPERIMENTS BEYOND THE SYYLABUS
14 Buzzer Interface with ARM ? 7 54
15 Relay interface with ARM? 7 57
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Expt. No. 1 STUDY OF ARM EVALUATION SYSTEM
Aim:
To study the building blocks of ARM7 system, its features, pin configuration and the components
required for functioning of ARM controller.
Architecture Overview:
A RISC-based computer design approach means ARM processors require significantly fewer transistors
than typical processors in average computers. This approach reduces cost, heat and power usage. These
are desirable traits for light, portable, battery-powered devices (smart phones, laptops, tablet and notepad
computers), and other embedded systems. A simpler design facilitates more efficient multi-core CPUs and
higher core counts at lower cost, providing higher processing power and improved energy efficiency for
servers and supercomputers.
In 2005, about 98% of all mobile phones sold used at least one ARM processor. The low power
consumption of ARM processors has made them very popular: 37 billion ARM processors have been
produced as of 2013, up from 10 billion in 2008. The ARM architecture (32-bit) is the most widely used
architecture in mobile devices, and most popular 32-bit one in embedded systems.
According to ARM Holdings, in 2010 alone, producers of chips based on ARM architectures
reported shipments of 6.1 billion ARM based processors, representing 95% of smart phones, 35% of digital
televisions and set-top boxes and 10% of mobile computers. It is the most widely used 32-bit instruction set
architecture in terms of quantity produced.
LPC 2148:
LPC2148 is the widely used IC from ARM-7 family. It is manufactured by Philips and it is pre-loaded
with many inbuilt peripherals making it more efficient and a reliable option for the beginners as well as high
end application developer.




8 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Features of LPC214x series controllers:
1. 8 to 40 kB of on-chip static RAM and 32 to 512 kB of on-chip flash program memory.128 bit wide
interface/accelerator enables high speed 60 MHz operation.
2. In-System/In-Application Programming (ISP/IAP) via on-chip boot-loader software. Single flash sector or
full chip erase in 400 ms and programming of 256 bytes in 1ms.
3. Embedded ICE RT and Embedded Trace interfaces offer real-time debugging with the on-chip Real
Monitor software and high speed tracing of instruction execution.
4. USB 2.0 Full Speed compliant Device Controller with 2 kB of endpoint RAM. In addition, the LPC2146/8
provides 8 kB of on-chip RAM accessible to USB by DMA.
5. One or two (LPC2141/2 vs. LPC2144/6/8) 10-bit A/D converters provide a total of 6/14analog inputs, with
conversion times as low as 2.44 us per channel.
6. Single 10-bit D/A converter provides variable analog output.
7. Two 32-bit timers/external event counters (with four capture and four compare channels each), PWM unit
(six outputs) and watchdog.
8. Low power real-time clock with independent power and dedicated 32 kHz clock input.
9. Multiple serial interfaces including two UARTs (16C550), two Fast I2C-bus (400 kbit/s), SPI and SSP with
buffering and variable data length capabilities.
10. Vectored interrupt controller with configurable priorities and vector addresses.
11. Up to 45 of 5 V tolerant fast general purpose I/O pins in a tiny LQFP64 package.
12. Up to nine edge or level sensitive external interrupt pins available.
13. On-chip integrated oscillator operates with an external crystal in range from 1 MHz to30 MHz and with
an external oscillator up to 50 MHz
14. Power saving modes include Idle and Power-down.
15. Individual enable/disable of peripheral functions as well as peripheral clock scaling for additional power
optimization.
16. Processor wake-up from Power-down mode via external interrupt, USB, Brown-Out Detect (BOD) or
Real-Time Clock (RTC).




9 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


First Step- Hardware Requirement:
Pin configuration of LPC 2148.

Hardware requirement of LPC2148:
1. LPC2148 need minimum below listed hardware to work properly
2. Power Supply
3. Crystal Oscillator
4. Reset Circuit
5. RTC crystal oscillator
6. UART
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Power Supply:
LPC2148 works on 3.3 V power supply. LM 117 can be used for generating 3.3 V supply. However,
basic peripherals like LCD, ULN 2003 (Motor Driver IC) etc. works on 5V. So AC mains supply is converted
into 5V using below mentioned circuit and after that LM 117 is used to convert 5V into 3.3V.
Block diagram of power Supply

Transformer: It is used to step down 230V AC to 9V AC supply and provides isolation between power grids
and circuit.
Rectifier: It is used to convert AC supply into DC.
Filter: It is used to reduce ripple factor of DC output available from rectifier end.
Regulator: It is used to regulate DC supply output.

11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Circuit Diagram:

Regulator IC 7805 is used to provide fix 5V dc supply.
LM 117 is used for generating 3.3V supply from 5V.

12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Calculations:

From the datasheet of LM117

Taking R 2= 240?, we get R 1=392?
Reset Circuit:
Reset button is essential in a system to avoid programming pitfalls and manually bring back the system
to the initialization mode. MCP 130T is a special IC used for providing stable RESET signal to LPC 2148.


13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Oscillator Circuit:

The value of capacitors C20 & C21 depends upon the frequency of crystal Y3. General circuit and
its equivalent circuit is as shown below.

14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Recommended values are as shown in table:

UART:
LPC 2148 has inbuilt ISP which means we can program it within the system using serial
communication on COM0. It has also COM1 for serial communication. MAX 232/233 IC must be used for
voltage logic conversion. Related connections are as given below.

Once the above listed circuit design is ready, we are ready to go further.



15 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Result:
ARM Evaluation system and the configuration of LPC2148 has been studied fully. The minimal setup
required for the functioning of the ARM processor is studied.
Outcomes:
1. Able to understand the ARM controller, its basic components inside and its features.
2. Able to know the components required for the working of ARM LPC2148

Applications:
ARM controller LPC2148 is used in no. of devices such as
1. Smart phones
2. Net books
3. E Readers
4. Digital TV
5. Home Gateways


1. What are the basic units of ARM 7?
2. What is the address system supported by ARM?
3. Define - RISC
4. What are the instructions used to access the memory in ARM?
5. What are the basic units of Microprocessor?
6. What is an Instruction?
7. What is clock cycle?
8. Define - Pipelining
9. What is cache miss?
10. What is meant by memory mapped I/O?
11. Define ? interrupt
12. What is meant by Exception?
13. What is meant by little ? endian mode?
14. What is meant by big ? endian mode?
15. What is the function of CPSR?
16. What is register - indirect addressing?
Viva-voce




16 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 2 ANALOG TO DIGITAL CONVERTOR
INTERFACING
Aim:
To write an embedded c program for interfacing an on chip ADC with LPC2148 ARM processor and
convert the given input voltage into corresponding decimal values.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. PC
Theory:
Analog to Digital converter (ADC) is a device that converts continuously varying analog signals from
instruments that monitor such conditions as movement, temperature, sound, etc., into binary code for the
computer. It may be either a single chip or can be one circuit within a chip. Analog to Digital conversion is
the process of changing continuously varying data, such as voltage, current, or shaft rotation, into discrete
digital quantities that represent the magnitude of the data compared to a standard or reference at the
moment the conversion is made. According to the method of conversion, ADCs can be classified into
Direct-Conversion ADCs, Successive Approximation ADCs, Integrating ADC and Sigma-Delta ADCs.
The LPC 2148 has 10-bit successive approximation analog to digital converter. Basic clocking for the
A/D converters is provided by the VPB clock. A programmable divider is included in each converter, to
scale this clock to the 4.5 MHz (max) clock needed by the successive approximation process. A fully
accurate conversion requires 11 of these clocks. The ADC cell can measure the voltage on any of the ADC
input signals. It is noted that these analog inputs are always connected to their pins, even if the Pin function
Select register assigns them to port pins. A simple self-test of the ADC can be done by driving these pins
as port outputs.



17 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Circuit diagram:




18 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus, an embedded c program for interfacing on-chip ADC with ARM processor is written and
executed. The decimal values of the converted voltage are seen in the WinXTalk screen.
Outcome:
Able to interface A/D convertors with ARM system and check its working by connecting an analog
quantity as input.
Applications:
1. ADC used in MODEM for converting analog signals to digital.
2. A fast video ADC in TV tuner cards
3. ADC used in digital storage oscilloscopes
4. Used in music reproduction technology.
5. Used in DSP if input is analog


1. What are the ADC operating modes in LPC2148?
2. What is meant by conversion time?
3. Why are internal ADCs preferred over external ADCs?
4. Why has 16-bit ADC more resolution than from 10-bit and 8-bit ADC?
5. What are ADC & its Resolution?
6. What is Burst conversion mode?
7. What is the function of A/D Control Register?
8. What is the function of A/D Global Data Register?
9. What is the function of A/D Status Register?
10. What is analog-to-digital (ADC) conversion error?
11. What is the function of Sample-and-hold circuits in analog-to digital converters?
12. What is the disadvantage of the flash analog-to digital converter?
Viva-voce




19 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 3 GENERATION OF RAMP AND SQUARE
WAVE USING ON-CHIP DAC
Aim:
To write and execute an embedded c program to generate ramp wave and square wave using on-chip
DAC of LPC2148 ARM controller.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
A digital-to-analog converter is a device for converting a digital signal into an analog signal (current or
voltage). Digital-to-Analog Converters are the interface between the abstract digital world and the analog
real world. Simple switches, a network of resistors, current sources or capacitors may be used to
implement this conversion. A DAC inputs a binary number and outputs an analog voltage or current signal.
The Microchip Technology Inc. MCP4921 is 2.7 ? 5.5V, low-power, 12-Bit Digital-to-Analog Converter
(DAC) with SPI interface. The MCP4921 DAC provides high accuracy and low noise performance for
industrial applications where calibration or compensation of signals is required. With an SPI connection
there is always one master device (usually a microcontroller) which controls the peripheral devices.
Typically there are three lines common to all the devices,
Master In Slave Out (MISO) ? The Slave line for sending data to the master,
Master Out Slave In (MOSI) ? The Master line for sending data to the peripherals,
Serial Clock (SCK) ? The clock pulses which synchronize data transmission generated by the
master and slave
Slave Select pin ? the pin on each device that the master can use to enable and disable specific
devices. When a device Slave Select pin is low, it communicates with the master. When it is high, it ignores
the master. In SPI, the clock signal is controlled by the master device LPC2148. All data is clocked in and
out using this pin. These lines need to be connected to the relevant pins on the LPC21xx processor. Any
unused GIO pin can be used for CS, instead pull this pin high. Conversion speed is the time it takes for the



20 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

DAC to provide an analog output when the digital input word is changed. The MCP4291 DAC ? SPI
connections with LPC21xx have four I/O lines (P0.4 ? P0.7) required. The analog output is generated by
using these four lines.
Circuit diagram:


Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the embedded c programs for generating ramp wave and square wave using ARM LPC2148 are
written and executed successfully and the waveforms are viewed in oscilloscope.
Outcome:
Able to program the DAC in-built inside the ARM controller and get the waveforms using it.




21 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications :
1. DAC used in Audio amplifier.
2. Video encoder
3. Display electronics
4. Data Acquistion systems
5. Motor control



1. What are the features of LPC2148 DAC?
2. What is the function of DAC register?
3. Which pin provides a voltage reference level for the D/A converter?
4. What are the applications of DAC in signal processing applications?
5. What is GIO?
6. What is the resolution of a digital-to-analog converter (DAC)?
7. What is the major advantage of the R/2R ladder digital-to-analog (DAC), as compared to a binary-
weighted digital-to-analog DAC converter?
8. What is the resolution of a 0?5 V 6-bit digital-to-analog converter (DAC) ?
9. What are DAC configurations?
10. What are the different types of DAC Circuits?
11. What are the Limitations of the Binary Weighted DAC?
12. What are the General DAC Characteristics?
13. Define reference voltage in DAC.
14. What is full scale voltage?
15. What is settling time?
VIVA-VOCE




22 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 4 LED DIMMING USING PWM

Aim:
To write an embedded c program for implementing PWM using ARM controller and verify the same by
dimming of LEDs.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
LPC2148 supports 2 types of PWM:
1) Single Edge PWM ? Pulse starts with new Period i.e pulse is always at the beginning
2) Double Edge PWM ? Pulse can be anywhere within the Period
A PWM block, like a Timer block , has a Timer Counter and an associated Pre-scale Register along
with Match Registers. These work exactly the same way as in the case of Timers. Match Registers 1 to 6
(except 0) are pinned on LPC214x i.e. the corresponding outputs are diverted to actual Pins on LPC214x
MCU. The PWM function must be selected for these Pins to get the PWM output.
The basic setup is to simply replace Servo by a LED and no external 5V source is needed. The
anode of LED is connected to P0.0 and cathode to ground. Pulse Widths corresponding to the switches
connected to P0.1/2/3/4 will be 2.5ms/5ms/7.5ms/10ms respectively. As the Pulse Width Increases LED
will keep on getting brighter and the reverse will happen if Pulse Width is decreased.



23 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus embedded c program for implementing Pulse Width Modulation is written and executed and
output has been verified in LED display.
Outcome:
Able to implement PWM using the ARM controller and verify the same in the form of dimming of
LEDS.



24 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Applications :
1. In Visual signals to covey a message
2. Illumination where light is reflected from objects
3. In Narrow band sensors



1. What factors determine the LED dimming performance?
2. What is meant by analog dimming?
3. What is flickering effect?
4. What is the factor determines dimming of the LED
5. Why Silicon is not suitable for fabrication of light-emitting diodes?
6. Why Silicon diode is less suited for low voltage rectifier operation?
7. What is the principle of zener diode?
8. What are the materials used to make LED?
9. What type of diodes is used in FM receivers?
10. Which diode suffers an avalanche breakdown?
11. What happens if the junction temperature of LED is increased?
12. How a transfer characteristic of a diode does is related?
13. What is the requirement of a clipping action of a diode?
14. What type of rectifier circuit requires four diodes?
15. Why are the pulse width modulated outputs required in most of the applications?
16. How do the variations in an average value get affected by PWM period?
17. Name the common formats available for LED display.
18. What are the types of seven segment display?
19. What is PWM?
20. What are the applications of PWM?

Viva-voce




25 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 5 INTERFACING REAL TIME CLOCK
AND SERIAL PORT
Aim:
To write and execute an embedded c program to interface DS1307 RTC using I2C protocol with ARM
controller
Apparatus Required:
1. LPC2148 ARM development board
2. Stepper motor
3. Interfacing cables
4. PC
Theory:
A clock, which is based on the interrupts at preset intervals, is Real Time Clock (RTC). An interrupt
service routine executes on each timeout (overflow) of this clock. This timing device once started never
resets or never reloaded with another value. Once it is set, it is not modified later. It is used in a system to
save the time and date.













26 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the program for interfacing real time clock with ARM controller is written and executed and the
date and time are verified on the screen.
Outcome:
Able to interface real time clock DS1307 with ARM controller and thereby display date and time
Applications :
1. I2C In ARM and PIC microcontrollers
2. Used as serial communication protocol with MASTER and SLAVE operation.

27 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
27 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00




1. What is I2C and how does it work?
2. What are the features of I2C in LPC2148 ARM7 microcontroller?
3. What is the function of I2C0CONSET register?
4. What is I2C0STAT?
5. What is the function of I2C0 Data Register?
6. What is RTC?
7. List the advantages of RTC
8. Through which port the date and time is displayed in RTC?
9. What is a serial port?
10. List the registers used to transfer data in serial port.
11. List the modes used for data transmission.
12. What is a simplex mode?
13. Which pin is used to transmit a character?
14. What is the baud rate of serial port?
15. What is the disadvantage of RS-232C?














Viva-voce




28 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 6 INTERFACING KEYPAD AND LCD

Aim:
To write an embedded c program to interface 4 x 4 matrix keypad with ARM processor and display the
pressed key in an LCD.
Apparatus Required:
1. LPC2148 ARM development board
2. Interfacing cables
3. PC
Theory:

In matrix keypad, keys are connected in rows and columns. When any switch is pressed, rows and
columns come into contact, which is that detected by controller to identify which key has been pressed. A
4?4 matrix keypad consists of 4 rows and 4 columns. There is a switch connecting each row and column.
So the combinations of rows and columns make up the 16 inputs.Initially all the switches are open (not
connected). When any one button is pressed, the switch is closed (connected),hence there is a connection
between the row and column. The first 4 pins are connected to the column as INPUT. The other 4 pins are
connected to the row as OUTPUT. Matrix keypad is a good substitution to normal push button.












29 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Circuit Diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus program for interfacing matrix keypad with ARM controller is written and executed and the key
pressed is seen in the LCD.



30 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Outcome:
Able to interface keypad with ARM controller and see the pressed key in the LCD display.
Applications :
1. Used in password based door locking system
2. Security system with user changeable
3. Used in laptops, computer games
4. Used in portable video games and cell phones



1. What is Matrix keypad?
2. What is the concept behind keypad interface?
3. What are the functions of pull- up resistors?
4. What is key de bouncing?
5. List the steps involved when the key in a 4 x 4 keyboard matrix is being pressed.
6. What is the value obtained if no key is pressed?
7. What kind of interrupt is generated if a key has to be operated in an interrupt mode?
8. How will you identify that the key is pressed?
9. What are the steps involved in Keyboard Interfacing?
10. List the registers used to store the keyboard, display modes and other operations programmed by
CPU.
11. Name the mode when a data is entered from the left side of the display unit.
12. How many rows and columns are present in a 16 x 2 alphanumeric LCD?
13. How many data lines are there in a 16 x 2 alphanumeric LCD?
14. Which pin of the LCD is used for adjusting its contrast?
15. Which command of an LCD is used to shift the entire display to the right?
16. Which command is used to select the 2 lines and 5 x 7 matrix of an LCD?
17. What changes are to be made to send data to an LCD?
18. For reading operation from an LCD what changes in the software are introduced?
19. Which instruction is used to select the first row first column of an LCD?
Viva-voce

31 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
31 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Expt. No. 7 INTERFACING EEPROM AND INTERRUPT

Aim:
To write a program to interface EEPROM using I2C protocol with ARM controller and retrieve the stored
messages inside EEPROM.
Apparatus Required:
1. LPC2148 ARM development board
2. Interfacing cables
3. PC
Theory:
I2C (Inter Integrated Circuit):
The I2C (Inter-IC) bus is a bi-directional two-wire serial bus that provides a communication link between
integrated circuits (ICs).I2C is a synchronous protocol that allows a master device to initiate communication
with a slave device. Data is exchanged between these devices.
EEPROM:
EEPROM (electrically erasable programmable read-only memory) is user-modifiable read-only
memory (ROM) that can be erased and reprogrammed (written to) repeatedly through the application of
higher than normal electrical voltage. It is a type of non-volatile memory used in computers and other
electronic devices to store small amounts of data that must be saved when power is removed, e.g.,
calibration tables or device configuration
Read, write and Erase EEPROM by using I2C in LPC2148 Primer Board. Wiring up an I2C based
EEPROM to the I2C port is relatively simple. The basic operation of the I2C based EEPROM's is to send a
command, such as WRITE, followed by an address and the data. In WRITE operation, the EEPROM is
used to store the data. In LPC2148 Primer Kit, 2 nos. of EEPROM lines are controlled by I2C Enabled
drivers. I2C Lines serial clock SCL (P0.2), serial data SDA (P0.3) connected to the I2C based serial
EEPROM IC. The EEPROM read & write operations are done in LPC2148 Primer Kit by using these SDA &
SCL I2C lines.
32 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
32 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To down load and run this program: Refer General procedure given in Page No: 60
Result:
Thus, the program for interfacing I2C based EEPROM with ARM processor has been written and
executed successfully and the memory content is verified on Win x talk terminal.
Outcome:
Able to interface memory ICs with ARM controller and perform the read and write operations.



33 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications:
1. ROM used in toys,automobiles to store data when power is off
2. In calculators and peripheral devices
3. In laser printers
4. And also in embedded systems where program need not to be changed.


1. How does I2C protocol work?
2. What is EEPROM?
3. What is meant by master slave mode?
4. What is meant by non-volatile memory?
5. What is an interrupt?
6. How does an interrupt request works?
7. What is a nested interrupt?
8. What are the registers used for enabling an interrupt?
9. What is PROM?
10. What is EPROM?
11. What is mask ROM?
12. Which memory allows simultaneous read and write operations?
13. Which memory has the shortest access times?
14. Which interrupt has the highest priority?
15. What is non maskable interrupt?
16. Which is the first level of memory access by the microprocessor?
17. List the types of cache memories.
18. What is the use of an interrupt?
19. What is the use of converting an interrupt to threads in a microprocessor?
20. What are the bits used to control an external interrupts?


Viva-voce




34 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00










CYCLE 2 - EXPERIMENTS




35 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 8 IMPLEMENTATION OF MAILBOX FUNCTION
USING LPC2148
Aim:
To create a mailbox in Micro C/OS ? II using LPC2148 ARM Controller
Apparatus Required:
1. LPC2148 ARM development board
2. Interfacing cables
3. PC
Theory:
System or the user code can send a message by the core services. A typical mail message, also
known as the exchange of information, refers to a task or an ISR using a pointer variable, through the core
services to put a message (that is, a pointer) into the mailbox. Similarly, one or more tasks can receive this
message by the core services. The tasks sending and receiving the message promise that the content that
the pointer points to is just that piece of message.
The mailbox of CooCox CoOS is a typical message mailbox which is composed of two parts: one is
the information which expressed by a pointer of void; the other is the waiting list which composed of the
tasks waiting for this mailbox. The waiting list supports two kinds of sorting: FIFO and preemptive priority.
The sorting mode is determined by the user when creating the mailbox.
Procedure:
To Edit / Compile / generate Hex file: Refer General procedure in Page No: 58
To down load and run this program: Refer General procedure in Page No: 60
Result:
Thus, the mailbox was created in Micro C/OS ?II and implemented using LPC2148.
Outcome:
Able to understand the concept of mail box in embedded systems and its significance in real time
systems





36 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications:
1. Used in Acorn RISC PC700
2. Used in ZIPIT wireless messenger
3. Used in Meizu M6 MINI player


1. What is IPC?
2. Define Queue.
3. What are the different types of mail box functions?
4. What is half duplex mode?
5. How many synchronous and asynchronous modes are there in serial port?
6. List the bits used to generate serial port interrupt
7. What is branch prediction?
8. Mention any two features of ?C/OS ? II.
9. Write the function for creating task in ?C/OS ? II.
10. Mention any two support devices for ?C/OS ? II.
11. How many user tasks can be handled by ?C/OS ? II?



















Viva-voce




37 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 9 INTERRUPT PERFORMANCE
CHARACTERISTICSOF ARM AND FPGA

Aim:
To study the interrupt performance characteristics of ARM and FPGA by using ARM controller kit and
FPGA kit separately.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
External Interrupts:
An interrupt caused by an external source such as the computer operator, external sensor or
monitoring device, or another computer. Interrupts are special events that require immediate attention.
Interfacing External Interrupts with LPC2148:
When an external interrupt signal occurs in LPC2148 Primer Board, the message "LOW" will be
displayed on PC. The interrupt signal occurs using switches. When the switch is pressed to LOW, then the
external interrupt occurs. The Vectored Interrupt Controller (VIC) takes 32 interrupt request inputs and
programmable assigns them into 3 categories, FIQ, vectored IRQ, and non-vectored IRQ. The ARM7
LPC2148 Primer board has two numbers of External Interrupts, connected with I/O Port lines (P0.14 &
P0.15) as switches.







38 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00



Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60


39 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
39 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Result:
Thus the interrupt performance characteristics of ARM and FPGA are studied. On comparison, ARM
counts at slow speed because it consumes more instruction cycle and FPGA is more efficient for servicing
and processing external interrupt pulses.
Outcome:
Able to understand the performance characteristics of ARM and FPGA while dealing with
interrrupts
Applications:
1. Used in random logic and SPLDs
2. Used in cryptography and filtering
3. In medical imaging
4. In bioinformatics and voice recognition



1. When is an Interrupt Request received?
2. What is ISR?
3. How do you initialize interrupt?
4. What is Vectored Interrupt Controller?
5. What are the kinds of protection available for SRAMS ?
6. What is interrupt pipelining?
7. What is pipeline shutdown?
8. What is branch prediction?
9. What is the use of Neon Floating point engine?
10. What is the use of ?vectorize option?
11. What is PTM?
12. What is ITM?
13. What is ETM?
14. What is I2S interface?
15. What is the use of ?SWI? in ARM assembly?

Viva-voce




40 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 10 FLASHING OF LEDS
Aim:
To write and execute an embedded c program to display LEDs using LPC 2148 ARM controller
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
Theory:
LED (Light Emitting Diodes) is the most commonly used components, usually for displaying pins digital
states. Typical uses of LEDs include alarm devices, timers and confirmation of user input such as a mouse
click or keystroke. Interfacing LED with LPC2148 Flash a LED using LPC2148 Primer Board. It works by
turning ON a LED & then turning it OFF & then looping back to START. However the operating speed of
microcontroller is very high so the flashing frequency will also be very fast to be detected by human eye.
The ARM7 LPC2148 Primer board has eight numbers of point LEDs, connected with I/O Port lines (P1.16 ?
P1.23) to make port pins high.







FirstRanker.com - FirstRanker's Choice
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00






?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING

VII SEMESTER - R 2013

EC6711 ? EMBEDDED LABORATORY






Name : _______________________________________
Register No : _______________________________________
Section : _______________________________________
LABORATORY MANUAL



2 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00




is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and
training.

? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different
levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on
heart and soul
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

To impart professional education integrated with human values to the younger generation, so as to
shape them as proficient and dedicated engineers, capable of providing comprehensive solutions to the
challenges in deploying technology for the service of humanity

? To educate the students with the state-of-art technologies to meet the growing challenges of the
electronics industry
? To carry out research through continuous interaction with research institutes and industry, on
advances in communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning,
innovation and ethical practices
VISION
VISION
MISSION
MISSION



3 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

PROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To provide students with a solid foundation in Mathematics, Science and fundamentals of
engineering, enabling them to apply, to find solutions for engineering problems and use this knowledge
to acquire higher education
2. Core Competence
To train the students in Electronics and Communication technologies so that they apply their
knowledge and training to compare, and to analyze various engineering industrial problems to find
solutions
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice which
enables them to find solutions for the real time problems in industry, and to design products
4. Professionalism
To inculcate professional and effective communication skills, leadership qualities and team spirit in
the students to make them multi-faceted personalities and develop their ability to relate engineering
issues to broader social context
5. Lifelong Learning/Ethics
To demonstrate and practice ethical and professional responsibilities in the industry and society in
the large, through commitment and lifelong learning needed for successful professional career


4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
PROGRAMME OUTCOMES (POs)
a) To demonstrate and apply knowledge of Mathematics, Science and engineering fundamentals in
Electronics and Communication Engineering field
b) To design a component, a system or a process to meet the specific needs within the realistic
constraints such as economics, environment, ethics, health, safety and manufacturability
c) To demonstrate the competency to use software tools for computation, simulation and testing of electronics
and communication engineering circuits
d) To identify, formulate and solve electronic and communication engineering problems
e) To demonstrate an ability to visualize and work on laboratory and multidisciplinary tasks
f) To function as a member or a leader in multidisciplinary activities
g) To communicate in verbal and written form with fellow engineers and society at large
h) To understand the impact of Electronics and Communication Engineering in the society and demonstrate
awareness of contemporary issues and commitment to give solutions exhibiting social responsibility
i) To demonstrate professional & ethical responsibilities
j) To exhibit confidence in self-education and ability for lifelong learning
k) To participate and succeed in competitive exams


5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
SYLLABUS

? Learn the working of ARM processor
? Understand the Building Blocks of Embedded Systems
? Learn the concept of memory map and memory interface
? Know the characteristics of Real Time Systems
? Write programs to interface memory, I/Os with processor
? Study the interrupt performance
LIST OF EXPERIMENTS:
1. Study of ARM evaluation system
2. Interfacing ADC and DAC
3. Interfacing LED and PWM
4. Interfacing real time clock and serial port
5. Interfacing keyboard and LCD
6. Interfacing EPROM and interrupt
7. Mailbox
8. Interrupt performance characteristics of ARM and FPGA
9. Flashing of LEDS
10. Interfacing stepper motor and temperature sensor
11. Implementing zigbee protocol with ARM



? Write programs in ARM for a specific Application
? Interface memory and Write programs related to memory operations
? Interface A/D and D/A convertors with ARM system
? Analyze the performance of interrupt
? Write programmes for interfacing keyboard, display, motor and sensor.
? Formulate a mini project using embedded system
COURSE OBJECTIVES
COURSE OUTCOMES
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
CONTENTS
Sl. No. Name of the Experiment Page No.
CYCLE 1 ? EXPERIMENTS
1
Study of ARM evaluation system 7
2
Analog to Digital Convertor interfacing 16
3
Generation of ramp and square wave using on-Chip DAC 19
4
LED dimming using PWM 22
5
Interfacing real time clock and serial port 25
6
Interfacing keypad and LCD 28
7
Interfacing EPROM and interrupt 31
CYCLE 2 ? EXPERIMENTS
8 Implementation of Mailbox Function using LPC 2148 35
9 Interrupt Performance Characteristics of Arm and FPGA 37
10 Flashing of LEDs 40
11 Stepper Motor Interface with ARM ? 7 LPC2148 43
12 LM35 Temperature Sensor Interface with ARM ? 7 LPC2148 47
13
Implementation of Wireless Communication Protocol using ZIGBEE Wireless
Module
50
ADDITIONAL EXPERIMENTS BEYOND THE SYYLABUS
14 Buzzer Interface with ARM ? 7 54
15 Relay interface with ARM? 7 57
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Expt. No. 1 STUDY OF ARM EVALUATION SYSTEM
Aim:
To study the building blocks of ARM7 system, its features, pin configuration and the components
required for functioning of ARM controller.
Architecture Overview:
A RISC-based computer design approach means ARM processors require significantly fewer transistors
than typical processors in average computers. This approach reduces cost, heat and power usage. These
are desirable traits for light, portable, battery-powered devices (smart phones, laptops, tablet and notepad
computers), and other embedded systems. A simpler design facilitates more efficient multi-core CPUs and
higher core counts at lower cost, providing higher processing power and improved energy efficiency for
servers and supercomputers.
In 2005, about 98% of all mobile phones sold used at least one ARM processor. The low power
consumption of ARM processors has made them very popular: 37 billion ARM processors have been
produced as of 2013, up from 10 billion in 2008. The ARM architecture (32-bit) is the most widely used
architecture in mobile devices, and most popular 32-bit one in embedded systems.
According to ARM Holdings, in 2010 alone, producers of chips based on ARM architectures
reported shipments of 6.1 billion ARM based processors, representing 95% of smart phones, 35% of digital
televisions and set-top boxes and 10% of mobile computers. It is the most widely used 32-bit instruction set
architecture in terms of quantity produced.
LPC 2148:
LPC2148 is the widely used IC from ARM-7 family. It is manufactured by Philips and it is pre-loaded
with many inbuilt peripherals making it more efficient and a reliable option for the beginners as well as high
end application developer.




8 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Features of LPC214x series controllers:
1. 8 to 40 kB of on-chip static RAM and 32 to 512 kB of on-chip flash program memory.128 bit wide
interface/accelerator enables high speed 60 MHz operation.
2. In-System/In-Application Programming (ISP/IAP) via on-chip boot-loader software. Single flash sector or
full chip erase in 400 ms and programming of 256 bytes in 1ms.
3. Embedded ICE RT and Embedded Trace interfaces offer real-time debugging with the on-chip Real
Monitor software and high speed tracing of instruction execution.
4. USB 2.0 Full Speed compliant Device Controller with 2 kB of endpoint RAM. In addition, the LPC2146/8
provides 8 kB of on-chip RAM accessible to USB by DMA.
5. One or two (LPC2141/2 vs. LPC2144/6/8) 10-bit A/D converters provide a total of 6/14analog inputs, with
conversion times as low as 2.44 us per channel.
6. Single 10-bit D/A converter provides variable analog output.
7. Two 32-bit timers/external event counters (with four capture and four compare channels each), PWM unit
(six outputs) and watchdog.
8. Low power real-time clock with independent power and dedicated 32 kHz clock input.
9. Multiple serial interfaces including two UARTs (16C550), two Fast I2C-bus (400 kbit/s), SPI and SSP with
buffering and variable data length capabilities.
10. Vectored interrupt controller with configurable priorities and vector addresses.
11. Up to 45 of 5 V tolerant fast general purpose I/O pins in a tiny LQFP64 package.
12. Up to nine edge or level sensitive external interrupt pins available.
13. On-chip integrated oscillator operates with an external crystal in range from 1 MHz to30 MHz and with
an external oscillator up to 50 MHz
14. Power saving modes include Idle and Power-down.
15. Individual enable/disable of peripheral functions as well as peripheral clock scaling for additional power
optimization.
16. Processor wake-up from Power-down mode via external interrupt, USB, Brown-Out Detect (BOD) or
Real-Time Clock (RTC).




9 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


First Step- Hardware Requirement:
Pin configuration of LPC 2148.

Hardware requirement of LPC2148:
1. LPC2148 need minimum below listed hardware to work properly
2. Power Supply
3. Crystal Oscillator
4. Reset Circuit
5. RTC crystal oscillator
6. UART
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Power Supply:
LPC2148 works on 3.3 V power supply. LM 117 can be used for generating 3.3 V supply. However,
basic peripherals like LCD, ULN 2003 (Motor Driver IC) etc. works on 5V. So AC mains supply is converted
into 5V using below mentioned circuit and after that LM 117 is used to convert 5V into 3.3V.
Block diagram of power Supply

Transformer: It is used to step down 230V AC to 9V AC supply and provides isolation between power grids
and circuit.
Rectifier: It is used to convert AC supply into DC.
Filter: It is used to reduce ripple factor of DC output available from rectifier end.
Regulator: It is used to regulate DC supply output.

11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Circuit Diagram:

Regulator IC 7805 is used to provide fix 5V dc supply.
LM 117 is used for generating 3.3V supply from 5V.

12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Calculations:

From the datasheet of LM117

Taking R 2= 240?, we get R 1=392?
Reset Circuit:
Reset button is essential in a system to avoid programming pitfalls and manually bring back the system
to the initialization mode. MCP 130T is a special IC used for providing stable RESET signal to LPC 2148.


13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Oscillator Circuit:

The value of capacitors C20 & C21 depends upon the frequency of crystal Y3. General circuit and
its equivalent circuit is as shown below.

14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Recommended values are as shown in table:

UART:
LPC 2148 has inbuilt ISP which means we can program it within the system using serial
communication on COM0. It has also COM1 for serial communication. MAX 232/233 IC must be used for
voltage logic conversion. Related connections are as given below.

Once the above listed circuit design is ready, we are ready to go further.



15 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Result:
ARM Evaluation system and the configuration of LPC2148 has been studied fully. The minimal setup
required for the functioning of the ARM processor is studied.
Outcomes:
1. Able to understand the ARM controller, its basic components inside and its features.
2. Able to know the components required for the working of ARM LPC2148

Applications:
ARM controller LPC2148 is used in no. of devices such as
1. Smart phones
2. Net books
3. E Readers
4. Digital TV
5. Home Gateways


1. What are the basic units of ARM 7?
2. What is the address system supported by ARM?
3. Define - RISC
4. What are the instructions used to access the memory in ARM?
5. What are the basic units of Microprocessor?
6. What is an Instruction?
7. What is clock cycle?
8. Define - Pipelining
9. What is cache miss?
10. What is meant by memory mapped I/O?
11. Define ? interrupt
12. What is meant by Exception?
13. What is meant by little ? endian mode?
14. What is meant by big ? endian mode?
15. What is the function of CPSR?
16. What is register - indirect addressing?
Viva-voce




16 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 2 ANALOG TO DIGITAL CONVERTOR
INTERFACING
Aim:
To write an embedded c program for interfacing an on chip ADC with LPC2148 ARM processor and
convert the given input voltage into corresponding decimal values.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. PC
Theory:
Analog to Digital converter (ADC) is a device that converts continuously varying analog signals from
instruments that monitor such conditions as movement, temperature, sound, etc., into binary code for the
computer. It may be either a single chip or can be one circuit within a chip. Analog to Digital conversion is
the process of changing continuously varying data, such as voltage, current, or shaft rotation, into discrete
digital quantities that represent the magnitude of the data compared to a standard or reference at the
moment the conversion is made. According to the method of conversion, ADCs can be classified into
Direct-Conversion ADCs, Successive Approximation ADCs, Integrating ADC and Sigma-Delta ADCs.
The LPC 2148 has 10-bit successive approximation analog to digital converter. Basic clocking for the
A/D converters is provided by the VPB clock. A programmable divider is included in each converter, to
scale this clock to the 4.5 MHz (max) clock needed by the successive approximation process. A fully
accurate conversion requires 11 of these clocks. The ADC cell can measure the voltage on any of the ADC
input signals. It is noted that these analog inputs are always connected to their pins, even if the Pin function
Select register assigns them to port pins. A simple self-test of the ADC can be done by driving these pins
as port outputs.



17 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Circuit diagram:




18 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus, an embedded c program for interfacing on-chip ADC with ARM processor is written and
executed. The decimal values of the converted voltage are seen in the WinXTalk screen.
Outcome:
Able to interface A/D convertors with ARM system and check its working by connecting an analog
quantity as input.
Applications:
1. ADC used in MODEM for converting analog signals to digital.
2. A fast video ADC in TV tuner cards
3. ADC used in digital storage oscilloscopes
4. Used in music reproduction technology.
5. Used in DSP if input is analog


1. What are the ADC operating modes in LPC2148?
2. What is meant by conversion time?
3. Why are internal ADCs preferred over external ADCs?
4. Why has 16-bit ADC more resolution than from 10-bit and 8-bit ADC?
5. What are ADC & its Resolution?
6. What is Burst conversion mode?
7. What is the function of A/D Control Register?
8. What is the function of A/D Global Data Register?
9. What is the function of A/D Status Register?
10. What is analog-to-digital (ADC) conversion error?
11. What is the function of Sample-and-hold circuits in analog-to digital converters?
12. What is the disadvantage of the flash analog-to digital converter?
Viva-voce




19 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 3 GENERATION OF RAMP AND SQUARE
WAVE USING ON-CHIP DAC
Aim:
To write and execute an embedded c program to generate ramp wave and square wave using on-chip
DAC of LPC2148 ARM controller.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
A digital-to-analog converter is a device for converting a digital signal into an analog signal (current or
voltage). Digital-to-Analog Converters are the interface between the abstract digital world and the analog
real world. Simple switches, a network of resistors, current sources or capacitors may be used to
implement this conversion. A DAC inputs a binary number and outputs an analog voltage or current signal.
The Microchip Technology Inc. MCP4921 is 2.7 ? 5.5V, low-power, 12-Bit Digital-to-Analog Converter
(DAC) with SPI interface. The MCP4921 DAC provides high accuracy and low noise performance for
industrial applications where calibration or compensation of signals is required. With an SPI connection
there is always one master device (usually a microcontroller) which controls the peripheral devices.
Typically there are three lines common to all the devices,
Master In Slave Out (MISO) ? The Slave line for sending data to the master,
Master Out Slave In (MOSI) ? The Master line for sending data to the peripherals,
Serial Clock (SCK) ? The clock pulses which synchronize data transmission generated by the
master and slave
Slave Select pin ? the pin on each device that the master can use to enable and disable specific
devices. When a device Slave Select pin is low, it communicates with the master. When it is high, it ignores
the master. In SPI, the clock signal is controlled by the master device LPC2148. All data is clocked in and
out using this pin. These lines need to be connected to the relevant pins on the LPC21xx processor. Any
unused GIO pin can be used for CS, instead pull this pin high. Conversion speed is the time it takes for the



20 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

DAC to provide an analog output when the digital input word is changed. The MCP4291 DAC ? SPI
connections with LPC21xx have four I/O lines (P0.4 ? P0.7) required. The analog output is generated by
using these four lines.
Circuit diagram:


Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the embedded c programs for generating ramp wave and square wave using ARM LPC2148 are
written and executed successfully and the waveforms are viewed in oscilloscope.
Outcome:
Able to program the DAC in-built inside the ARM controller and get the waveforms using it.




21 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications :
1. DAC used in Audio amplifier.
2. Video encoder
3. Display electronics
4. Data Acquistion systems
5. Motor control



1. What are the features of LPC2148 DAC?
2. What is the function of DAC register?
3. Which pin provides a voltage reference level for the D/A converter?
4. What are the applications of DAC in signal processing applications?
5. What is GIO?
6. What is the resolution of a digital-to-analog converter (DAC)?
7. What is the major advantage of the R/2R ladder digital-to-analog (DAC), as compared to a binary-
weighted digital-to-analog DAC converter?
8. What is the resolution of a 0?5 V 6-bit digital-to-analog converter (DAC) ?
9. What are DAC configurations?
10. What are the different types of DAC Circuits?
11. What are the Limitations of the Binary Weighted DAC?
12. What are the General DAC Characteristics?
13. Define reference voltage in DAC.
14. What is full scale voltage?
15. What is settling time?
VIVA-VOCE




22 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 4 LED DIMMING USING PWM

Aim:
To write an embedded c program for implementing PWM using ARM controller and verify the same by
dimming of LEDs.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
LPC2148 supports 2 types of PWM:
1) Single Edge PWM ? Pulse starts with new Period i.e pulse is always at the beginning
2) Double Edge PWM ? Pulse can be anywhere within the Period
A PWM block, like a Timer block , has a Timer Counter and an associated Pre-scale Register along
with Match Registers. These work exactly the same way as in the case of Timers. Match Registers 1 to 6
(except 0) are pinned on LPC214x i.e. the corresponding outputs are diverted to actual Pins on LPC214x
MCU. The PWM function must be selected for these Pins to get the PWM output.
The basic setup is to simply replace Servo by a LED and no external 5V source is needed. The
anode of LED is connected to P0.0 and cathode to ground. Pulse Widths corresponding to the switches
connected to P0.1/2/3/4 will be 2.5ms/5ms/7.5ms/10ms respectively. As the Pulse Width Increases LED
will keep on getting brighter and the reverse will happen if Pulse Width is decreased.



23 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus embedded c program for implementing Pulse Width Modulation is written and executed and
output has been verified in LED display.
Outcome:
Able to implement PWM using the ARM controller and verify the same in the form of dimming of
LEDS.



24 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Applications :
1. In Visual signals to covey a message
2. Illumination where light is reflected from objects
3. In Narrow band sensors



1. What factors determine the LED dimming performance?
2. What is meant by analog dimming?
3. What is flickering effect?
4. What is the factor determines dimming of the LED
5. Why Silicon is not suitable for fabrication of light-emitting diodes?
6. Why Silicon diode is less suited for low voltage rectifier operation?
7. What is the principle of zener diode?
8. What are the materials used to make LED?
9. What type of diodes is used in FM receivers?
10. Which diode suffers an avalanche breakdown?
11. What happens if the junction temperature of LED is increased?
12. How a transfer characteristic of a diode does is related?
13. What is the requirement of a clipping action of a diode?
14. What type of rectifier circuit requires four diodes?
15. Why are the pulse width modulated outputs required in most of the applications?
16. How do the variations in an average value get affected by PWM period?
17. Name the common formats available for LED display.
18. What are the types of seven segment display?
19. What is PWM?
20. What are the applications of PWM?

Viva-voce




25 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 5 INTERFACING REAL TIME CLOCK
AND SERIAL PORT
Aim:
To write and execute an embedded c program to interface DS1307 RTC using I2C protocol with ARM
controller
Apparatus Required:
1. LPC2148 ARM development board
2. Stepper motor
3. Interfacing cables
4. PC
Theory:
A clock, which is based on the interrupts at preset intervals, is Real Time Clock (RTC). An interrupt
service routine executes on each timeout (overflow) of this clock. This timing device once started never
resets or never reloaded with another value. Once it is set, it is not modified later. It is used in a system to
save the time and date.













26 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the program for interfacing real time clock with ARM controller is written and executed and the
date and time are verified on the screen.
Outcome:
Able to interface real time clock DS1307 with ARM controller and thereby display date and time
Applications :
1. I2C In ARM and PIC microcontrollers
2. Used as serial communication protocol with MASTER and SLAVE operation.

27 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
27 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00




1. What is I2C and how does it work?
2. What are the features of I2C in LPC2148 ARM7 microcontroller?
3. What is the function of I2C0CONSET register?
4. What is I2C0STAT?
5. What is the function of I2C0 Data Register?
6. What is RTC?
7. List the advantages of RTC
8. Through which port the date and time is displayed in RTC?
9. What is a serial port?
10. List the registers used to transfer data in serial port.
11. List the modes used for data transmission.
12. What is a simplex mode?
13. Which pin is used to transmit a character?
14. What is the baud rate of serial port?
15. What is the disadvantage of RS-232C?














Viva-voce




28 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 6 INTERFACING KEYPAD AND LCD

Aim:
To write an embedded c program to interface 4 x 4 matrix keypad with ARM processor and display the
pressed key in an LCD.
Apparatus Required:
1. LPC2148 ARM development board
2. Interfacing cables
3. PC
Theory:

In matrix keypad, keys are connected in rows and columns. When any switch is pressed, rows and
columns come into contact, which is that detected by controller to identify which key has been pressed. A
4?4 matrix keypad consists of 4 rows and 4 columns. There is a switch connecting each row and column.
So the combinations of rows and columns make up the 16 inputs.Initially all the switches are open (not
connected). When any one button is pressed, the switch is closed (connected),hence there is a connection
between the row and column. The first 4 pins are connected to the column as INPUT. The other 4 pins are
connected to the row as OUTPUT. Matrix keypad is a good substitution to normal push button.












29 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Circuit Diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus program for interfacing matrix keypad with ARM controller is written and executed and the key
pressed is seen in the LCD.



30 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Outcome:
Able to interface keypad with ARM controller and see the pressed key in the LCD display.
Applications :
1. Used in password based door locking system
2. Security system with user changeable
3. Used in laptops, computer games
4. Used in portable video games and cell phones



1. What is Matrix keypad?
2. What is the concept behind keypad interface?
3. What are the functions of pull- up resistors?
4. What is key de bouncing?
5. List the steps involved when the key in a 4 x 4 keyboard matrix is being pressed.
6. What is the value obtained if no key is pressed?
7. What kind of interrupt is generated if a key has to be operated in an interrupt mode?
8. How will you identify that the key is pressed?
9. What are the steps involved in Keyboard Interfacing?
10. List the registers used to store the keyboard, display modes and other operations programmed by
CPU.
11. Name the mode when a data is entered from the left side of the display unit.
12. How many rows and columns are present in a 16 x 2 alphanumeric LCD?
13. How many data lines are there in a 16 x 2 alphanumeric LCD?
14. Which pin of the LCD is used for adjusting its contrast?
15. Which command of an LCD is used to shift the entire display to the right?
16. Which command is used to select the 2 lines and 5 x 7 matrix of an LCD?
17. What changes are to be made to send data to an LCD?
18. For reading operation from an LCD what changes in the software are introduced?
19. Which instruction is used to select the first row first column of an LCD?
Viva-voce

31 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
31 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Expt. No. 7 INTERFACING EEPROM AND INTERRUPT

Aim:
To write a program to interface EEPROM using I2C protocol with ARM controller and retrieve the stored
messages inside EEPROM.
Apparatus Required:
1. LPC2148 ARM development board
2. Interfacing cables
3. PC
Theory:
I2C (Inter Integrated Circuit):
The I2C (Inter-IC) bus is a bi-directional two-wire serial bus that provides a communication link between
integrated circuits (ICs).I2C is a synchronous protocol that allows a master device to initiate communication
with a slave device. Data is exchanged between these devices.
EEPROM:
EEPROM (electrically erasable programmable read-only memory) is user-modifiable read-only
memory (ROM) that can be erased and reprogrammed (written to) repeatedly through the application of
higher than normal electrical voltage. It is a type of non-volatile memory used in computers and other
electronic devices to store small amounts of data that must be saved when power is removed, e.g.,
calibration tables or device configuration
Read, write and Erase EEPROM by using I2C in LPC2148 Primer Board. Wiring up an I2C based
EEPROM to the I2C port is relatively simple. The basic operation of the I2C based EEPROM's is to send a
command, such as WRITE, followed by an address and the data. In WRITE operation, the EEPROM is
used to store the data. In LPC2148 Primer Kit, 2 nos. of EEPROM lines are controlled by I2C Enabled
drivers. I2C Lines serial clock SCL (P0.2), serial data SDA (P0.3) connected to the I2C based serial
EEPROM IC. The EEPROM read & write operations are done in LPC2148 Primer Kit by using these SDA &
SCL I2C lines.
32 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
32 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To down load and run this program: Refer General procedure given in Page No: 60
Result:
Thus, the program for interfacing I2C based EEPROM with ARM processor has been written and
executed successfully and the memory content is verified on Win x talk terminal.
Outcome:
Able to interface memory ICs with ARM controller and perform the read and write operations.



33 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications:
1. ROM used in toys,automobiles to store data when power is off
2. In calculators and peripheral devices
3. In laser printers
4. And also in embedded systems where program need not to be changed.


1. How does I2C protocol work?
2. What is EEPROM?
3. What is meant by master slave mode?
4. What is meant by non-volatile memory?
5. What is an interrupt?
6. How does an interrupt request works?
7. What is a nested interrupt?
8. What are the registers used for enabling an interrupt?
9. What is PROM?
10. What is EPROM?
11. What is mask ROM?
12. Which memory allows simultaneous read and write operations?
13. Which memory has the shortest access times?
14. Which interrupt has the highest priority?
15. What is non maskable interrupt?
16. Which is the first level of memory access by the microprocessor?
17. List the types of cache memories.
18. What is the use of an interrupt?
19. What is the use of converting an interrupt to threads in a microprocessor?
20. What are the bits used to control an external interrupts?


Viva-voce




34 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00










CYCLE 2 - EXPERIMENTS




35 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 8 IMPLEMENTATION OF MAILBOX FUNCTION
USING LPC2148
Aim:
To create a mailbox in Micro C/OS ? II using LPC2148 ARM Controller
Apparatus Required:
1. LPC2148 ARM development board
2. Interfacing cables
3. PC
Theory:
System or the user code can send a message by the core services. A typical mail message, also
known as the exchange of information, refers to a task or an ISR using a pointer variable, through the core
services to put a message (that is, a pointer) into the mailbox. Similarly, one or more tasks can receive this
message by the core services. The tasks sending and receiving the message promise that the content that
the pointer points to is just that piece of message.
The mailbox of CooCox CoOS is a typical message mailbox which is composed of two parts: one is
the information which expressed by a pointer of void; the other is the waiting list which composed of the
tasks waiting for this mailbox. The waiting list supports two kinds of sorting: FIFO and preemptive priority.
The sorting mode is determined by the user when creating the mailbox.
Procedure:
To Edit / Compile / generate Hex file: Refer General procedure in Page No: 58
To down load and run this program: Refer General procedure in Page No: 60
Result:
Thus, the mailbox was created in Micro C/OS ?II and implemented using LPC2148.
Outcome:
Able to understand the concept of mail box in embedded systems and its significance in real time
systems





36 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications:
1. Used in Acorn RISC PC700
2. Used in ZIPIT wireless messenger
3. Used in Meizu M6 MINI player


1. What is IPC?
2. Define Queue.
3. What are the different types of mail box functions?
4. What is half duplex mode?
5. How many synchronous and asynchronous modes are there in serial port?
6. List the bits used to generate serial port interrupt
7. What is branch prediction?
8. Mention any two features of ?C/OS ? II.
9. Write the function for creating task in ?C/OS ? II.
10. Mention any two support devices for ?C/OS ? II.
11. How many user tasks can be handled by ?C/OS ? II?



















Viva-voce




37 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 9 INTERRUPT PERFORMANCE
CHARACTERISTICSOF ARM AND FPGA

Aim:
To study the interrupt performance characteristics of ARM and FPGA by using ARM controller kit and
FPGA kit separately.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
External Interrupts:
An interrupt caused by an external source such as the computer operator, external sensor or
monitoring device, or another computer. Interrupts are special events that require immediate attention.
Interfacing External Interrupts with LPC2148:
When an external interrupt signal occurs in LPC2148 Primer Board, the message "LOW" will be
displayed on PC. The interrupt signal occurs using switches. When the switch is pressed to LOW, then the
external interrupt occurs. The Vectored Interrupt Controller (VIC) takes 32 interrupt request inputs and
programmable assigns them into 3 categories, FIQ, vectored IRQ, and non-vectored IRQ. The ARM7
LPC2148 Primer board has two numbers of External Interrupts, connected with I/O Port lines (P0.14 &
P0.15) as switches.







38 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00



Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60


39 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
39 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Result:
Thus the interrupt performance characteristics of ARM and FPGA are studied. On comparison, ARM
counts at slow speed because it consumes more instruction cycle and FPGA is more efficient for servicing
and processing external interrupt pulses.
Outcome:
Able to understand the performance characteristics of ARM and FPGA while dealing with
interrrupts
Applications:
1. Used in random logic and SPLDs
2. Used in cryptography and filtering
3. In medical imaging
4. In bioinformatics and voice recognition



1. When is an Interrupt Request received?
2. What is ISR?
3. How do you initialize interrupt?
4. What is Vectored Interrupt Controller?
5. What are the kinds of protection available for SRAMS ?
6. What is interrupt pipelining?
7. What is pipeline shutdown?
8. What is branch prediction?
9. What is the use of Neon Floating point engine?
10. What is the use of ?vectorize option?
11. What is PTM?
12. What is ITM?
13. What is ETM?
14. What is I2S interface?
15. What is the use of ?SWI? in ARM assembly?

Viva-voce




40 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 10 FLASHING OF LEDS
Aim:
To write and execute an embedded c program to display LEDs using LPC 2148 ARM controller
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
Theory:
LED (Light Emitting Diodes) is the most commonly used components, usually for displaying pins digital
states. Typical uses of LEDs include alarm devices, timers and confirmation of user input such as a mouse
click or keystroke. Interfacing LED with LPC2148 Flash a LED using LPC2148 Primer Board. It works by
turning ON a LED & then turning it OFF & then looping back to START. However the operating speed of
microcontroller is very high so the flashing frequency will also be very fast to be detected by human eye.
The ARM7 LPC2148 Primer board has eight numbers of point LEDs, connected with I/O Port lines (P1.16 ?
P1.23) to make port pins high.










41 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00



Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus program for flashing of LEDs is written and executed using ARM controller LPC2148.
FirstRanker.com - FirstRanker's Choice
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00






?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING

VII SEMESTER - R 2013

EC6711 ? EMBEDDED LABORATORY






Name : _______________________________________
Register No : _______________________________________
Section : _______________________________________
LABORATORY MANUAL



2 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00




is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and
training.

? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different
levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on
heart and soul
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

To impart professional education integrated with human values to the younger generation, so as to
shape them as proficient and dedicated engineers, capable of providing comprehensive solutions to the
challenges in deploying technology for the service of humanity

? To educate the students with the state-of-art technologies to meet the growing challenges of the
electronics industry
? To carry out research through continuous interaction with research institutes and industry, on
advances in communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning,
innovation and ethical practices
VISION
VISION
MISSION
MISSION



3 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

PROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To provide students with a solid foundation in Mathematics, Science and fundamentals of
engineering, enabling them to apply, to find solutions for engineering problems and use this knowledge
to acquire higher education
2. Core Competence
To train the students in Electronics and Communication technologies so that they apply their
knowledge and training to compare, and to analyze various engineering industrial problems to find
solutions
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice which
enables them to find solutions for the real time problems in industry, and to design products
4. Professionalism
To inculcate professional and effective communication skills, leadership qualities and team spirit in
the students to make them multi-faceted personalities and develop their ability to relate engineering
issues to broader social context
5. Lifelong Learning/Ethics
To demonstrate and practice ethical and professional responsibilities in the industry and society in
the large, through commitment and lifelong learning needed for successful professional career


4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
PROGRAMME OUTCOMES (POs)
a) To demonstrate and apply knowledge of Mathematics, Science and engineering fundamentals in
Electronics and Communication Engineering field
b) To design a component, a system or a process to meet the specific needs within the realistic
constraints such as economics, environment, ethics, health, safety and manufacturability
c) To demonstrate the competency to use software tools for computation, simulation and testing of electronics
and communication engineering circuits
d) To identify, formulate and solve electronic and communication engineering problems
e) To demonstrate an ability to visualize and work on laboratory and multidisciplinary tasks
f) To function as a member or a leader in multidisciplinary activities
g) To communicate in verbal and written form with fellow engineers and society at large
h) To understand the impact of Electronics and Communication Engineering in the society and demonstrate
awareness of contemporary issues and commitment to give solutions exhibiting social responsibility
i) To demonstrate professional & ethical responsibilities
j) To exhibit confidence in self-education and ability for lifelong learning
k) To participate and succeed in competitive exams


5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
SYLLABUS

? Learn the working of ARM processor
? Understand the Building Blocks of Embedded Systems
? Learn the concept of memory map and memory interface
? Know the characteristics of Real Time Systems
? Write programs to interface memory, I/Os with processor
? Study the interrupt performance
LIST OF EXPERIMENTS:
1. Study of ARM evaluation system
2. Interfacing ADC and DAC
3. Interfacing LED and PWM
4. Interfacing real time clock and serial port
5. Interfacing keyboard and LCD
6. Interfacing EPROM and interrupt
7. Mailbox
8. Interrupt performance characteristics of ARM and FPGA
9. Flashing of LEDS
10. Interfacing stepper motor and temperature sensor
11. Implementing zigbee protocol with ARM



? Write programs in ARM for a specific Application
? Interface memory and Write programs related to memory operations
? Interface A/D and D/A convertors with ARM system
? Analyze the performance of interrupt
? Write programmes for interfacing keyboard, display, motor and sensor.
? Formulate a mini project using embedded system
COURSE OBJECTIVES
COURSE OUTCOMES
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
CONTENTS
Sl. No. Name of the Experiment Page No.
CYCLE 1 ? EXPERIMENTS
1
Study of ARM evaluation system 7
2
Analog to Digital Convertor interfacing 16
3
Generation of ramp and square wave using on-Chip DAC 19
4
LED dimming using PWM 22
5
Interfacing real time clock and serial port 25
6
Interfacing keypad and LCD 28
7
Interfacing EPROM and interrupt 31
CYCLE 2 ? EXPERIMENTS
8 Implementation of Mailbox Function using LPC 2148 35
9 Interrupt Performance Characteristics of Arm and FPGA 37
10 Flashing of LEDs 40
11 Stepper Motor Interface with ARM ? 7 LPC2148 43
12 LM35 Temperature Sensor Interface with ARM ? 7 LPC2148 47
13
Implementation of Wireless Communication Protocol using ZIGBEE Wireless
Module
50
ADDITIONAL EXPERIMENTS BEYOND THE SYYLABUS
14 Buzzer Interface with ARM ? 7 54
15 Relay interface with ARM? 7 57
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Expt. No. 1 STUDY OF ARM EVALUATION SYSTEM
Aim:
To study the building blocks of ARM7 system, its features, pin configuration and the components
required for functioning of ARM controller.
Architecture Overview:
A RISC-based computer design approach means ARM processors require significantly fewer transistors
than typical processors in average computers. This approach reduces cost, heat and power usage. These
are desirable traits for light, portable, battery-powered devices (smart phones, laptops, tablet and notepad
computers), and other embedded systems. A simpler design facilitates more efficient multi-core CPUs and
higher core counts at lower cost, providing higher processing power and improved energy efficiency for
servers and supercomputers.
In 2005, about 98% of all mobile phones sold used at least one ARM processor. The low power
consumption of ARM processors has made them very popular: 37 billion ARM processors have been
produced as of 2013, up from 10 billion in 2008. The ARM architecture (32-bit) is the most widely used
architecture in mobile devices, and most popular 32-bit one in embedded systems.
According to ARM Holdings, in 2010 alone, producers of chips based on ARM architectures
reported shipments of 6.1 billion ARM based processors, representing 95% of smart phones, 35% of digital
televisions and set-top boxes and 10% of mobile computers. It is the most widely used 32-bit instruction set
architecture in terms of quantity produced.
LPC 2148:
LPC2148 is the widely used IC from ARM-7 family. It is manufactured by Philips and it is pre-loaded
with many inbuilt peripherals making it more efficient and a reliable option for the beginners as well as high
end application developer.




8 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Features of LPC214x series controllers:
1. 8 to 40 kB of on-chip static RAM and 32 to 512 kB of on-chip flash program memory.128 bit wide
interface/accelerator enables high speed 60 MHz operation.
2. In-System/In-Application Programming (ISP/IAP) via on-chip boot-loader software. Single flash sector or
full chip erase in 400 ms and programming of 256 bytes in 1ms.
3. Embedded ICE RT and Embedded Trace interfaces offer real-time debugging with the on-chip Real
Monitor software and high speed tracing of instruction execution.
4. USB 2.0 Full Speed compliant Device Controller with 2 kB of endpoint RAM. In addition, the LPC2146/8
provides 8 kB of on-chip RAM accessible to USB by DMA.
5. One or two (LPC2141/2 vs. LPC2144/6/8) 10-bit A/D converters provide a total of 6/14analog inputs, with
conversion times as low as 2.44 us per channel.
6. Single 10-bit D/A converter provides variable analog output.
7. Two 32-bit timers/external event counters (with four capture and four compare channels each), PWM unit
(six outputs) and watchdog.
8. Low power real-time clock with independent power and dedicated 32 kHz clock input.
9. Multiple serial interfaces including two UARTs (16C550), two Fast I2C-bus (400 kbit/s), SPI and SSP with
buffering and variable data length capabilities.
10. Vectored interrupt controller with configurable priorities and vector addresses.
11. Up to 45 of 5 V tolerant fast general purpose I/O pins in a tiny LQFP64 package.
12. Up to nine edge or level sensitive external interrupt pins available.
13. On-chip integrated oscillator operates with an external crystal in range from 1 MHz to30 MHz and with
an external oscillator up to 50 MHz
14. Power saving modes include Idle and Power-down.
15. Individual enable/disable of peripheral functions as well as peripheral clock scaling for additional power
optimization.
16. Processor wake-up from Power-down mode via external interrupt, USB, Brown-Out Detect (BOD) or
Real-Time Clock (RTC).




9 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


First Step- Hardware Requirement:
Pin configuration of LPC 2148.

Hardware requirement of LPC2148:
1. LPC2148 need minimum below listed hardware to work properly
2. Power Supply
3. Crystal Oscillator
4. Reset Circuit
5. RTC crystal oscillator
6. UART
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Power Supply:
LPC2148 works on 3.3 V power supply. LM 117 can be used for generating 3.3 V supply. However,
basic peripherals like LCD, ULN 2003 (Motor Driver IC) etc. works on 5V. So AC mains supply is converted
into 5V using below mentioned circuit and after that LM 117 is used to convert 5V into 3.3V.
Block diagram of power Supply

Transformer: It is used to step down 230V AC to 9V AC supply and provides isolation between power grids
and circuit.
Rectifier: It is used to convert AC supply into DC.
Filter: It is used to reduce ripple factor of DC output available from rectifier end.
Regulator: It is used to regulate DC supply output.

11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Circuit Diagram:

Regulator IC 7805 is used to provide fix 5V dc supply.
LM 117 is used for generating 3.3V supply from 5V.

12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Calculations:

From the datasheet of LM117

Taking R 2= 240?, we get R 1=392?
Reset Circuit:
Reset button is essential in a system to avoid programming pitfalls and manually bring back the system
to the initialization mode. MCP 130T is a special IC used for providing stable RESET signal to LPC 2148.


13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Oscillator Circuit:

The value of capacitors C20 & C21 depends upon the frequency of crystal Y3. General circuit and
its equivalent circuit is as shown below.

14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Recommended values are as shown in table:

UART:
LPC 2148 has inbuilt ISP which means we can program it within the system using serial
communication on COM0. It has also COM1 for serial communication. MAX 232/233 IC must be used for
voltage logic conversion. Related connections are as given below.

Once the above listed circuit design is ready, we are ready to go further.



15 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Result:
ARM Evaluation system and the configuration of LPC2148 has been studied fully. The minimal setup
required for the functioning of the ARM processor is studied.
Outcomes:
1. Able to understand the ARM controller, its basic components inside and its features.
2. Able to know the components required for the working of ARM LPC2148

Applications:
ARM controller LPC2148 is used in no. of devices such as
1. Smart phones
2. Net books
3. E Readers
4. Digital TV
5. Home Gateways


1. What are the basic units of ARM 7?
2. What is the address system supported by ARM?
3. Define - RISC
4. What are the instructions used to access the memory in ARM?
5. What are the basic units of Microprocessor?
6. What is an Instruction?
7. What is clock cycle?
8. Define - Pipelining
9. What is cache miss?
10. What is meant by memory mapped I/O?
11. Define ? interrupt
12. What is meant by Exception?
13. What is meant by little ? endian mode?
14. What is meant by big ? endian mode?
15. What is the function of CPSR?
16. What is register - indirect addressing?
Viva-voce




16 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 2 ANALOG TO DIGITAL CONVERTOR
INTERFACING
Aim:
To write an embedded c program for interfacing an on chip ADC with LPC2148 ARM processor and
convert the given input voltage into corresponding decimal values.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. PC
Theory:
Analog to Digital converter (ADC) is a device that converts continuously varying analog signals from
instruments that monitor such conditions as movement, temperature, sound, etc., into binary code for the
computer. It may be either a single chip or can be one circuit within a chip. Analog to Digital conversion is
the process of changing continuously varying data, such as voltage, current, or shaft rotation, into discrete
digital quantities that represent the magnitude of the data compared to a standard or reference at the
moment the conversion is made. According to the method of conversion, ADCs can be classified into
Direct-Conversion ADCs, Successive Approximation ADCs, Integrating ADC and Sigma-Delta ADCs.
The LPC 2148 has 10-bit successive approximation analog to digital converter. Basic clocking for the
A/D converters is provided by the VPB clock. A programmable divider is included in each converter, to
scale this clock to the 4.5 MHz (max) clock needed by the successive approximation process. A fully
accurate conversion requires 11 of these clocks. The ADC cell can measure the voltage on any of the ADC
input signals. It is noted that these analog inputs are always connected to their pins, even if the Pin function
Select register assigns them to port pins. A simple self-test of the ADC can be done by driving these pins
as port outputs.



17 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Circuit diagram:




18 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus, an embedded c program for interfacing on-chip ADC with ARM processor is written and
executed. The decimal values of the converted voltage are seen in the WinXTalk screen.
Outcome:
Able to interface A/D convertors with ARM system and check its working by connecting an analog
quantity as input.
Applications:
1. ADC used in MODEM for converting analog signals to digital.
2. A fast video ADC in TV tuner cards
3. ADC used in digital storage oscilloscopes
4. Used in music reproduction technology.
5. Used in DSP if input is analog


1. What are the ADC operating modes in LPC2148?
2. What is meant by conversion time?
3. Why are internal ADCs preferred over external ADCs?
4. Why has 16-bit ADC more resolution than from 10-bit and 8-bit ADC?
5. What are ADC & its Resolution?
6. What is Burst conversion mode?
7. What is the function of A/D Control Register?
8. What is the function of A/D Global Data Register?
9. What is the function of A/D Status Register?
10. What is analog-to-digital (ADC) conversion error?
11. What is the function of Sample-and-hold circuits in analog-to digital converters?
12. What is the disadvantage of the flash analog-to digital converter?
Viva-voce




19 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 3 GENERATION OF RAMP AND SQUARE
WAVE USING ON-CHIP DAC
Aim:
To write and execute an embedded c program to generate ramp wave and square wave using on-chip
DAC of LPC2148 ARM controller.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
A digital-to-analog converter is a device for converting a digital signal into an analog signal (current or
voltage). Digital-to-Analog Converters are the interface between the abstract digital world and the analog
real world. Simple switches, a network of resistors, current sources or capacitors may be used to
implement this conversion. A DAC inputs a binary number and outputs an analog voltage or current signal.
The Microchip Technology Inc. MCP4921 is 2.7 ? 5.5V, low-power, 12-Bit Digital-to-Analog Converter
(DAC) with SPI interface. The MCP4921 DAC provides high accuracy and low noise performance for
industrial applications where calibration or compensation of signals is required. With an SPI connection
there is always one master device (usually a microcontroller) which controls the peripheral devices.
Typically there are three lines common to all the devices,
Master In Slave Out (MISO) ? The Slave line for sending data to the master,
Master Out Slave In (MOSI) ? The Master line for sending data to the peripherals,
Serial Clock (SCK) ? The clock pulses which synchronize data transmission generated by the
master and slave
Slave Select pin ? the pin on each device that the master can use to enable and disable specific
devices. When a device Slave Select pin is low, it communicates with the master. When it is high, it ignores
the master. In SPI, the clock signal is controlled by the master device LPC2148. All data is clocked in and
out using this pin. These lines need to be connected to the relevant pins on the LPC21xx processor. Any
unused GIO pin can be used for CS, instead pull this pin high. Conversion speed is the time it takes for the



20 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

DAC to provide an analog output when the digital input word is changed. The MCP4291 DAC ? SPI
connections with LPC21xx have four I/O lines (P0.4 ? P0.7) required. The analog output is generated by
using these four lines.
Circuit diagram:


Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the embedded c programs for generating ramp wave and square wave using ARM LPC2148 are
written and executed successfully and the waveforms are viewed in oscilloscope.
Outcome:
Able to program the DAC in-built inside the ARM controller and get the waveforms using it.




21 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications :
1. DAC used in Audio amplifier.
2. Video encoder
3. Display electronics
4. Data Acquistion systems
5. Motor control



1. What are the features of LPC2148 DAC?
2. What is the function of DAC register?
3. Which pin provides a voltage reference level for the D/A converter?
4. What are the applications of DAC in signal processing applications?
5. What is GIO?
6. What is the resolution of a digital-to-analog converter (DAC)?
7. What is the major advantage of the R/2R ladder digital-to-analog (DAC), as compared to a binary-
weighted digital-to-analog DAC converter?
8. What is the resolution of a 0?5 V 6-bit digital-to-analog converter (DAC) ?
9. What are DAC configurations?
10. What are the different types of DAC Circuits?
11. What are the Limitations of the Binary Weighted DAC?
12. What are the General DAC Characteristics?
13. Define reference voltage in DAC.
14. What is full scale voltage?
15. What is settling time?
VIVA-VOCE




22 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 4 LED DIMMING USING PWM

Aim:
To write an embedded c program for implementing PWM using ARM controller and verify the same by
dimming of LEDs.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
LPC2148 supports 2 types of PWM:
1) Single Edge PWM ? Pulse starts with new Period i.e pulse is always at the beginning
2) Double Edge PWM ? Pulse can be anywhere within the Period
A PWM block, like a Timer block , has a Timer Counter and an associated Pre-scale Register along
with Match Registers. These work exactly the same way as in the case of Timers. Match Registers 1 to 6
(except 0) are pinned on LPC214x i.e. the corresponding outputs are diverted to actual Pins on LPC214x
MCU. The PWM function must be selected for these Pins to get the PWM output.
The basic setup is to simply replace Servo by a LED and no external 5V source is needed. The
anode of LED is connected to P0.0 and cathode to ground. Pulse Widths corresponding to the switches
connected to P0.1/2/3/4 will be 2.5ms/5ms/7.5ms/10ms respectively. As the Pulse Width Increases LED
will keep on getting brighter and the reverse will happen if Pulse Width is decreased.



23 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus embedded c program for implementing Pulse Width Modulation is written and executed and
output has been verified in LED display.
Outcome:
Able to implement PWM using the ARM controller and verify the same in the form of dimming of
LEDS.



24 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Applications :
1. In Visual signals to covey a message
2. Illumination where light is reflected from objects
3. In Narrow band sensors



1. What factors determine the LED dimming performance?
2. What is meant by analog dimming?
3. What is flickering effect?
4. What is the factor determines dimming of the LED
5. Why Silicon is not suitable for fabrication of light-emitting diodes?
6. Why Silicon diode is less suited for low voltage rectifier operation?
7. What is the principle of zener diode?
8. What are the materials used to make LED?
9. What type of diodes is used in FM receivers?
10. Which diode suffers an avalanche breakdown?
11. What happens if the junction temperature of LED is increased?
12. How a transfer characteristic of a diode does is related?
13. What is the requirement of a clipping action of a diode?
14. What type of rectifier circuit requires four diodes?
15. Why are the pulse width modulated outputs required in most of the applications?
16. How do the variations in an average value get affected by PWM period?
17. Name the common formats available for LED display.
18. What are the types of seven segment display?
19. What is PWM?
20. What are the applications of PWM?

Viva-voce




25 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 5 INTERFACING REAL TIME CLOCK
AND SERIAL PORT
Aim:
To write and execute an embedded c program to interface DS1307 RTC using I2C protocol with ARM
controller
Apparatus Required:
1. LPC2148 ARM development board
2. Stepper motor
3. Interfacing cables
4. PC
Theory:
A clock, which is based on the interrupts at preset intervals, is Real Time Clock (RTC). An interrupt
service routine executes on each timeout (overflow) of this clock. This timing device once started never
resets or never reloaded with another value. Once it is set, it is not modified later. It is used in a system to
save the time and date.













26 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the program for interfacing real time clock with ARM controller is written and executed and the
date and time are verified on the screen.
Outcome:
Able to interface real time clock DS1307 with ARM controller and thereby display date and time
Applications :
1. I2C In ARM and PIC microcontrollers
2. Used as serial communication protocol with MASTER and SLAVE operation.

27 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
27 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00




1. What is I2C and how does it work?
2. What are the features of I2C in LPC2148 ARM7 microcontroller?
3. What is the function of I2C0CONSET register?
4. What is I2C0STAT?
5. What is the function of I2C0 Data Register?
6. What is RTC?
7. List the advantages of RTC
8. Through which port the date and time is displayed in RTC?
9. What is a serial port?
10. List the registers used to transfer data in serial port.
11. List the modes used for data transmission.
12. What is a simplex mode?
13. Which pin is used to transmit a character?
14. What is the baud rate of serial port?
15. What is the disadvantage of RS-232C?














Viva-voce




28 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 6 INTERFACING KEYPAD AND LCD

Aim:
To write an embedded c program to interface 4 x 4 matrix keypad with ARM processor and display the
pressed key in an LCD.
Apparatus Required:
1. LPC2148 ARM development board
2. Interfacing cables
3. PC
Theory:

In matrix keypad, keys are connected in rows and columns. When any switch is pressed, rows and
columns come into contact, which is that detected by controller to identify which key has been pressed. A
4?4 matrix keypad consists of 4 rows and 4 columns. There is a switch connecting each row and column.
So the combinations of rows and columns make up the 16 inputs.Initially all the switches are open (not
connected). When any one button is pressed, the switch is closed (connected),hence there is a connection
between the row and column. The first 4 pins are connected to the column as INPUT. The other 4 pins are
connected to the row as OUTPUT. Matrix keypad is a good substitution to normal push button.












29 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Circuit Diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus program for interfacing matrix keypad with ARM controller is written and executed and the key
pressed is seen in the LCD.



30 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Outcome:
Able to interface keypad with ARM controller and see the pressed key in the LCD display.
Applications :
1. Used in password based door locking system
2. Security system with user changeable
3. Used in laptops, computer games
4. Used in portable video games and cell phones



1. What is Matrix keypad?
2. What is the concept behind keypad interface?
3. What are the functions of pull- up resistors?
4. What is key de bouncing?
5. List the steps involved when the key in a 4 x 4 keyboard matrix is being pressed.
6. What is the value obtained if no key is pressed?
7. What kind of interrupt is generated if a key has to be operated in an interrupt mode?
8. How will you identify that the key is pressed?
9. What are the steps involved in Keyboard Interfacing?
10. List the registers used to store the keyboard, display modes and other operations programmed by
CPU.
11. Name the mode when a data is entered from the left side of the display unit.
12. How many rows and columns are present in a 16 x 2 alphanumeric LCD?
13. How many data lines are there in a 16 x 2 alphanumeric LCD?
14. Which pin of the LCD is used for adjusting its contrast?
15. Which command of an LCD is used to shift the entire display to the right?
16. Which command is used to select the 2 lines and 5 x 7 matrix of an LCD?
17. What changes are to be made to send data to an LCD?
18. For reading operation from an LCD what changes in the software are introduced?
19. Which instruction is used to select the first row first column of an LCD?
Viva-voce

31 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
31 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Expt. No. 7 INTERFACING EEPROM AND INTERRUPT

Aim:
To write a program to interface EEPROM using I2C protocol with ARM controller and retrieve the stored
messages inside EEPROM.
Apparatus Required:
1. LPC2148 ARM development board
2. Interfacing cables
3. PC
Theory:
I2C (Inter Integrated Circuit):
The I2C (Inter-IC) bus is a bi-directional two-wire serial bus that provides a communication link between
integrated circuits (ICs).I2C is a synchronous protocol that allows a master device to initiate communication
with a slave device. Data is exchanged between these devices.
EEPROM:
EEPROM (electrically erasable programmable read-only memory) is user-modifiable read-only
memory (ROM) that can be erased and reprogrammed (written to) repeatedly through the application of
higher than normal electrical voltage. It is a type of non-volatile memory used in computers and other
electronic devices to store small amounts of data that must be saved when power is removed, e.g.,
calibration tables or device configuration
Read, write and Erase EEPROM by using I2C in LPC2148 Primer Board. Wiring up an I2C based
EEPROM to the I2C port is relatively simple. The basic operation of the I2C based EEPROM's is to send a
command, such as WRITE, followed by an address and the data. In WRITE operation, the EEPROM is
used to store the data. In LPC2148 Primer Kit, 2 nos. of EEPROM lines are controlled by I2C Enabled
drivers. I2C Lines serial clock SCL (P0.2), serial data SDA (P0.3) connected to the I2C based serial
EEPROM IC. The EEPROM read & write operations are done in LPC2148 Primer Kit by using these SDA &
SCL I2C lines.
32 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
32 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To down load and run this program: Refer General procedure given in Page No: 60
Result:
Thus, the program for interfacing I2C based EEPROM with ARM processor has been written and
executed successfully and the memory content is verified on Win x talk terminal.
Outcome:
Able to interface memory ICs with ARM controller and perform the read and write operations.



33 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications:
1. ROM used in toys,automobiles to store data when power is off
2. In calculators and peripheral devices
3. In laser printers
4. And also in embedded systems where program need not to be changed.


1. How does I2C protocol work?
2. What is EEPROM?
3. What is meant by master slave mode?
4. What is meant by non-volatile memory?
5. What is an interrupt?
6. How does an interrupt request works?
7. What is a nested interrupt?
8. What are the registers used for enabling an interrupt?
9. What is PROM?
10. What is EPROM?
11. What is mask ROM?
12. Which memory allows simultaneous read and write operations?
13. Which memory has the shortest access times?
14. Which interrupt has the highest priority?
15. What is non maskable interrupt?
16. Which is the first level of memory access by the microprocessor?
17. List the types of cache memories.
18. What is the use of an interrupt?
19. What is the use of converting an interrupt to threads in a microprocessor?
20. What are the bits used to control an external interrupts?


Viva-voce




34 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00










CYCLE 2 - EXPERIMENTS




35 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 8 IMPLEMENTATION OF MAILBOX FUNCTION
USING LPC2148
Aim:
To create a mailbox in Micro C/OS ? II using LPC2148 ARM Controller
Apparatus Required:
1. LPC2148 ARM development board
2. Interfacing cables
3. PC
Theory:
System or the user code can send a message by the core services. A typical mail message, also
known as the exchange of information, refers to a task or an ISR using a pointer variable, through the core
services to put a message (that is, a pointer) into the mailbox. Similarly, one or more tasks can receive this
message by the core services. The tasks sending and receiving the message promise that the content that
the pointer points to is just that piece of message.
The mailbox of CooCox CoOS is a typical message mailbox which is composed of two parts: one is
the information which expressed by a pointer of void; the other is the waiting list which composed of the
tasks waiting for this mailbox. The waiting list supports two kinds of sorting: FIFO and preemptive priority.
The sorting mode is determined by the user when creating the mailbox.
Procedure:
To Edit / Compile / generate Hex file: Refer General procedure in Page No: 58
To down load and run this program: Refer General procedure in Page No: 60
Result:
Thus, the mailbox was created in Micro C/OS ?II and implemented using LPC2148.
Outcome:
Able to understand the concept of mail box in embedded systems and its significance in real time
systems





36 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications:
1. Used in Acorn RISC PC700
2. Used in ZIPIT wireless messenger
3. Used in Meizu M6 MINI player


1. What is IPC?
2. Define Queue.
3. What are the different types of mail box functions?
4. What is half duplex mode?
5. How many synchronous and asynchronous modes are there in serial port?
6. List the bits used to generate serial port interrupt
7. What is branch prediction?
8. Mention any two features of ?C/OS ? II.
9. Write the function for creating task in ?C/OS ? II.
10. Mention any two support devices for ?C/OS ? II.
11. How many user tasks can be handled by ?C/OS ? II?



















Viva-voce




37 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 9 INTERRUPT PERFORMANCE
CHARACTERISTICSOF ARM AND FPGA

Aim:
To study the interrupt performance characteristics of ARM and FPGA by using ARM controller kit and
FPGA kit separately.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
External Interrupts:
An interrupt caused by an external source such as the computer operator, external sensor or
monitoring device, or another computer. Interrupts are special events that require immediate attention.
Interfacing External Interrupts with LPC2148:
When an external interrupt signal occurs in LPC2148 Primer Board, the message "LOW" will be
displayed on PC. The interrupt signal occurs using switches. When the switch is pressed to LOW, then the
external interrupt occurs. The Vectored Interrupt Controller (VIC) takes 32 interrupt request inputs and
programmable assigns them into 3 categories, FIQ, vectored IRQ, and non-vectored IRQ. The ARM7
LPC2148 Primer board has two numbers of External Interrupts, connected with I/O Port lines (P0.14 &
P0.15) as switches.







38 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00



Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60


39 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
39 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Result:
Thus the interrupt performance characteristics of ARM and FPGA are studied. On comparison, ARM
counts at slow speed because it consumes more instruction cycle and FPGA is more efficient for servicing
and processing external interrupt pulses.
Outcome:
Able to understand the performance characteristics of ARM and FPGA while dealing with
interrrupts
Applications:
1. Used in random logic and SPLDs
2. Used in cryptography and filtering
3. In medical imaging
4. In bioinformatics and voice recognition



1. When is an Interrupt Request received?
2. What is ISR?
3. How do you initialize interrupt?
4. What is Vectored Interrupt Controller?
5. What are the kinds of protection available for SRAMS ?
6. What is interrupt pipelining?
7. What is pipeline shutdown?
8. What is branch prediction?
9. What is the use of Neon Floating point engine?
10. What is the use of ?vectorize option?
11. What is PTM?
12. What is ITM?
13. What is ETM?
14. What is I2S interface?
15. What is the use of ?SWI? in ARM assembly?

Viva-voce




40 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 10 FLASHING OF LEDS
Aim:
To write and execute an embedded c program to display LEDs using LPC 2148 ARM controller
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
Theory:
LED (Light Emitting Diodes) is the most commonly used components, usually for displaying pins digital
states. Typical uses of LEDs include alarm devices, timers and confirmation of user input such as a mouse
click or keystroke. Interfacing LED with LPC2148 Flash a LED using LPC2148 Primer Board. It works by
turning ON a LED & then turning it OFF & then looping back to START. However the operating speed of
microcontroller is very high so the flashing frequency will also be very fast to be detected by human eye.
The ARM7 LPC2148 Primer board has eight numbers of point LEDs, connected with I/O Port lines (P1.16 ?
P1.23) to make port pins high.










41 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00



Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus program for flashing of LEDs is written and executed using ARM controller LPC2148.



42 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Outcome:
Able to interface LED lights via the input output port and control them
Applications:
1. In Illumination
2. As status indicators in equipments
3. Stadium displays and dynamic decorative displays



1. What is seven segment displays?
2. What are the different configurations of LED?
3. What is the function of GPIO?
4. What are the Pins which are used to connect LEDs?
5. How to identify 'Polarity' of LED?
6. Differentiate LED from LCD.
7. What is a use of Jumper?
8. How many numbers of LEDs present in Primer board?
9. Where LEDs are used?
10. What is the use of flash magic software?
11. Which port is used in ARM 7 processor kit?
12. Which diode suffers an avalanche breakdown?
13. What happens if the junction temperature of LED is increased?
14. What is an anti collision rate light?
15. What is fail-safe conditions






Viva-voce

FirstRanker.com - FirstRanker's Choice
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00






?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING

VII SEMESTER - R 2013

EC6711 ? EMBEDDED LABORATORY






Name : _______________________________________
Register No : _______________________________________
Section : _______________________________________
LABORATORY MANUAL



2 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00




is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and
training.

? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different
levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on
heart and soul
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

To impart professional education integrated with human values to the younger generation, so as to
shape them as proficient and dedicated engineers, capable of providing comprehensive solutions to the
challenges in deploying technology for the service of humanity

? To educate the students with the state-of-art technologies to meet the growing challenges of the
electronics industry
? To carry out research through continuous interaction with research institutes and industry, on
advances in communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning,
innovation and ethical practices
VISION
VISION
MISSION
MISSION



3 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

PROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To provide students with a solid foundation in Mathematics, Science and fundamentals of
engineering, enabling them to apply, to find solutions for engineering problems and use this knowledge
to acquire higher education
2. Core Competence
To train the students in Electronics and Communication technologies so that they apply their
knowledge and training to compare, and to analyze various engineering industrial problems to find
solutions
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice which
enables them to find solutions for the real time problems in industry, and to design products
4. Professionalism
To inculcate professional and effective communication skills, leadership qualities and team spirit in
the students to make them multi-faceted personalities and develop their ability to relate engineering
issues to broader social context
5. Lifelong Learning/Ethics
To demonstrate and practice ethical and professional responsibilities in the industry and society in
the large, through commitment and lifelong learning needed for successful professional career


4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
PROGRAMME OUTCOMES (POs)
a) To demonstrate and apply knowledge of Mathematics, Science and engineering fundamentals in
Electronics and Communication Engineering field
b) To design a component, a system or a process to meet the specific needs within the realistic
constraints such as economics, environment, ethics, health, safety and manufacturability
c) To demonstrate the competency to use software tools for computation, simulation and testing of electronics
and communication engineering circuits
d) To identify, formulate and solve electronic and communication engineering problems
e) To demonstrate an ability to visualize and work on laboratory and multidisciplinary tasks
f) To function as a member or a leader in multidisciplinary activities
g) To communicate in verbal and written form with fellow engineers and society at large
h) To understand the impact of Electronics and Communication Engineering in the society and demonstrate
awareness of contemporary issues and commitment to give solutions exhibiting social responsibility
i) To demonstrate professional & ethical responsibilities
j) To exhibit confidence in self-education and ability for lifelong learning
k) To participate and succeed in competitive exams


5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
SYLLABUS

? Learn the working of ARM processor
? Understand the Building Blocks of Embedded Systems
? Learn the concept of memory map and memory interface
? Know the characteristics of Real Time Systems
? Write programs to interface memory, I/Os with processor
? Study the interrupt performance
LIST OF EXPERIMENTS:
1. Study of ARM evaluation system
2. Interfacing ADC and DAC
3. Interfacing LED and PWM
4. Interfacing real time clock and serial port
5. Interfacing keyboard and LCD
6. Interfacing EPROM and interrupt
7. Mailbox
8. Interrupt performance characteristics of ARM and FPGA
9. Flashing of LEDS
10. Interfacing stepper motor and temperature sensor
11. Implementing zigbee protocol with ARM



? Write programs in ARM for a specific Application
? Interface memory and Write programs related to memory operations
? Interface A/D and D/A convertors with ARM system
? Analyze the performance of interrupt
? Write programmes for interfacing keyboard, display, motor and sensor.
? Formulate a mini project using embedded system
COURSE OBJECTIVES
COURSE OUTCOMES
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
CONTENTS
Sl. No. Name of the Experiment Page No.
CYCLE 1 ? EXPERIMENTS
1
Study of ARM evaluation system 7
2
Analog to Digital Convertor interfacing 16
3
Generation of ramp and square wave using on-Chip DAC 19
4
LED dimming using PWM 22
5
Interfacing real time clock and serial port 25
6
Interfacing keypad and LCD 28
7
Interfacing EPROM and interrupt 31
CYCLE 2 ? EXPERIMENTS
8 Implementation of Mailbox Function using LPC 2148 35
9 Interrupt Performance Characteristics of Arm and FPGA 37
10 Flashing of LEDs 40
11 Stepper Motor Interface with ARM ? 7 LPC2148 43
12 LM35 Temperature Sensor Interface with ARM ? 7 LPC2148 47
13
Implementation of Wireless Communication Protocol using ZIGBEE Wireless
Module
50
ADDITIONAL EXPERIMENTS BEYOND THE SYYLABUS
14 Buzzer Interface with ARM ? 7 54
15 Relay interface with ARM? 7 57
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Expt. No. 1 STUDY OF ARM EVALUATION SYSTEM
Aim:
To study the building blocks of ARM7 system, its features, pin configuration and the components
required for functioning of ARM controller.
Architecture Overview:
A RISC-based computer design approach means ARM processors require significantly fewer transistors
than typical processors in average computers. This approach reduces cost, heat and power usage. These
are desirable traits for light, portable, battery-powered devices (smart phones, laptops, tablet and notepad
computers), and other embedded systems. A simpler design facilitates more efficient multi-core CPUs and
higher core counts at lower cost, providing higher processing power and improved energy efficiency for
servers and supercomputers.
In 2005, about 98% of all mobile phones sold used at least one ARM processor. The low power
consumption of ARM processors has made them very popular: 37 billion ARM processors have been
produced as of 2013, up from 10 billion in 2008. The ARM architecture (32-bit) is the most widely used
architecture in mobile devices, and most popular 32-bit one in embedded systems.
According to ARM Holdings, in 2010 alone, producers of chips based on ARM architectures
reported shipments of 6.1 billion ARM based processors, representing 95% of smart phones, 35% of digital
televisions and set-top boxes and 10% of mobile computers. It is the most widely used 32-bit instruction set
architecture in terms of quantity produced.
LPC 2148:
LPC2148 is the widely used IC from ARM-7 family. It is manufactured by Philips and it is pre-loaded
with many inbuilt peripherals making it more efficient and a reliable option for the beginners as well as high
end application developer.




8 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Features of LPC214x series controllers:
1. 8 to 40 kB of on-chip static RAM and 32 to 512 kB of on-chip flash program memory.128 bit wide
interface/accelerator enables high speed 60 MHz operation.
2. In-System/In-Application Programming (ISP/IAP) via on-chip boot-loader software. Single flash sector or
full chip erase in 400 ms and programming of 256 bytes in 1ms.
3. Embedded ICE RT and Embedded Trace interfaces offer real-time debugging with the on-chip Real
Monitor software and high speed tracing of instruction execution.
4. USB 2.0 Full Speed compliant Device Controller with 2 kB of endpoint RAM. In addition, the LPC2146/8
provides 8 kB of on-chip RAM accessible to USB by DMA.
5. One or two (LPC2141/2 vs. LPC2144/6/8) 10-bit A/D converters provide a total of 6/14analog inputs, with
conversion times as low as 2.44 us per channel.
6. Single 10-bit D/A converter provides variable analog output.
7. Two 32-bit timers/external event counters (with four capture and four compare channels each), PWM unit
(six outputs) and watchdog.
8. Low power real-time clock with independent power and dedicated 32 kHz clock input.
9. Multiple serial interfaces including two UARTs (16C550), two Fast I2C-bus (400 kbit/s), SPI and SSP with
buffering and variable data length capabilities.
10. Vectored interrupt controller with configurable priorities and vector addresses.
11. Up to 45 of 5 V tolerant fast general purpose I/O pins in a tiny LQFP64 package.
12. Up to nine edge or level sensitive external interrupt pins available.
13. On-chip integrated oscillator operates with an external crystal in range from 1 MHz to30 MHz and with
an external oscillator up to 50 MHz
14. Power saving modes include Idle and Power-down.
15. Individual enable/disable of peripheral functions as well as peripheral clock scaling for additional power
optimization.
16. Processor wake-up from Power-down mode via external interrupt, USB, Brown-Out Detect (BOD) or
Real-Time Clock (RTC).




9 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


First Step- Hardware Requirement:
Pin configuration of LPC 2148.

Hardware requirement of LPC2148:
1. LPC2148 need minimum below listed hardware to work properly
2. Power Supply
3. Crystal Oscillator
4. Reset Circuit
5. RTC crystal oscillator
6. UART
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Power Supply:
LPC2148 works on 3.3 V power supply. LM 117 can be used for generating 3.3 V supply. However,
basic peripherals like LCD, ULN 2003 (Motor Driver IC) etc. works on 5V. So AC mains supply is converted
into 5V using below mentioned circuit and after that LM 117 is used to convert 5V into 3.3V.
Block diagram of power Supply

Transformer: It is used to step down 230V AC to 9V AC supply and provides isolation between power grids
and circuit.
Rectifier: It is used to convert AC supply into DC.
Filter: It is used to reduce ripple factor of DC output available from rectifier end.
Regulator: It is used to regulate DC supply output.

11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Circuit Diagram:

Regulator IC 7805 is used to provide fix 5V dc supply.
LM 117 is used for generating 3.3V supply from 5V.

12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Calculations:

From the datasheet of LM117

Taking R 2= 240?, we get R 1=392?
Reset Circuit:
Reset button is essential in a system to avoid programming pitfalls and manually bring back the system
to the initialization mode. MCP 130T is a special IC used for providing stable RESET signal to LPC 2148.


13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Oscillator Circuit:

The value of capacitors C20 & C21 depends upon the frequency of crystal Y3. General circuit and
its equivalent circuit is as shown below.

14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Recommended values are as shown in table:

UART:
LPC 2148 has inbuilt ISP which means we can program it within the system using serial
communication on COM0. It has also COM1 for serial communication. MAX 232/233 IC must be used for
voltage logic conversion. Related connections are as given below.

Once the above listed circuit design is ready, we are ready to go further.



15 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Result:
ARM Evaluation system and the configuration of LPC2148 has been studied fully. The minimal setup
required for the functioning of the ARM processor is studied.
Outcomes:
1. Able to understand the ARM controller, its basic components inside and its features.
2. Able to know the components required for the working of ARM LPC2148

Applications:
ARM controller LPC2148 is used in no. of devices such as
1. Smart phones
2. Net books
3. E Readers
4. Digital TV
5. Home Gateways


1. What are the basic units of ARM 7?
2. What is the address system supported by ARM?
3. Define - RISC
4. What are the instructions used to access the memory in ARM?
5. What are the basic units of Microprocessor?
6. What is an Instruction?
7. What is clock cycle?
8. Define - Pipelining
9. What is cache miss?
10. What is meant by memory mapped I/O?
11. Define ? interrupt
12. What is meant by Exception?
13. What is meant by little ? endian mode?
14. What is meant by big ? endian mode?
15. What is the function of CPSR?
16. What is register - indirect addressing?
Viva-voce




16 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 2 ANALOG TO DIGITAL CONVERTOR
INTERFACING
Aim:
To write an embedded c program for interfacing an on chip ADC with LPC2148 ARM processor and
convert the given input voltage into corresponding decimal values.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. PC
Theory:
Analog to Digital converter (ADC) is a device that converts continuously varying analog signals from
instruments that monitor such conditions as movement, temperature, sound, etc., into binary code for the
computer. It may be either a single chip or can be one circuit within a chip. Analog to Digital conversion is
the process of changing continuously varying data, such as voltage, current, or shaft rotation, into discrete
digital quantities that represent the magnitude of the data compared to a standard or reference at the
moment the conversion is made. According to the method of conversion, ADCs can be classified into
Direct-Conversion ADCs, Successive Approximation ADCs, Integrating ADC and Sigma-Delta ADCs.
The LPC 2148 has 10-bit successive approximation analog to digital converter. Basic clocking for the
A/D converters is provided by the VPB clock. A programmable divider is included in each converter, to
scale this clock to the 4.5 MHz (max) clock needed by the successive approximation process. A fully
accurate conversion requires 11 of these clocks. The ADC cell can measure the voltage on any of the ADC
input signals. It is noted that these analog inputs are always connected to their pins, even if the Pin function
Select register assigns them to port pins. A simple self-test of the ADC can be done by driving these pins
as port outputs.



17 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Circuit diagram:




18 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus, an embedded c program for interfacing on-chip ADC with ARM processor is written and
executed. The decimal values of the converted voltage are seen in the WinXTalk screen.
Outcome:
Able to interface A/D convertors with ARM system and check its working by connecting an analog
quantity as input.
Applications:
1. ADC used in MODEM for converting analog signals to digital.
2. A fast video ADC in TV tuner cards
3. ADC used in digital storage oscilloscopes
4. Used in music reproduction technology.
5. Used in DSP if input is analog


1. What are the ADC operating modes in LPC2148?
2. What is meant by conversion time?
3. Why are internal ADCs preferred over external ADCs?
4. Why has 16-bit ADC more resolution than from 10-bit and 8-bit ADC?
5. What are ADC & its Resolution?
6. What is Burst conversion mode?
7. What is the function of A/D Control Register?
8. What is the function of A/D Global Data Register?
9. What is the function of A/D Status Register?
10. What is analog-to-digital (ADC) conversion error?
11. What is the function of Sample-and-hold circuits in analog-to digital converters?
12. What is the disadvantage of the flash analog-to digital converter?
Viva-voce




19 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 3 GENERATION OF RAMP AND SQUARE
WAVE USING ON-CHIP DAC
Aim:
To write and execute an embedded c program to generate ramp wave and square wave using on-chip
DAC of LPC2148 ARM controller.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
A digital-to-analog converter is a device for converting a digital signal into an analog signal (current or
voltage). Digital-to-Analog Converters are the interface between the abstract digital world and the analog
real world. Simple switches, a network of resistors, current sources or capacitors may be used to
implement this conversion. A DAC inputs a binary number and outputs an analog voltage or current signal.
The Microchip Technology Inc. MCP4921 is 2.7 ? 5.5V, low-power, 12-Bit Digital-to-Analog Converter
(DAC) with SPI interface. The MCP4921 DAC provides high accuracy and low noise performance for
industrial applications where calibration or compensation of signals is required. With an SPI connection
there is always one master device (usually a microcontroller) which controls the peripheral devices.
Typically there are three lines common to all the devices,
Master In Slave Out (MISO) ? The Slave line for sending data to the master,
Master Out Slave In (MOSI) ? The Master line for sending data to the peripherals,
Serial Clock (SCK) ? The clock pulses which synchronize data transmission generated by the
master and slave
Slave Select pin ? the pin on each device that the master can use to enable and disable specific
devices. When a device Slave Select pin is low, it communicates with the master. When it is high, it ignores
the master. In SPI, the clock signal is controlled by the master device LPC2148. All data is clocked in and
out using this pin. These lines need to be connected to the relevant pins on the LPC21xx processor. Any
unused GIO pin can be used for CS, instead pull this pin high. Conversion speed is the time it takes for the



20 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

DAC to provide an analog output when the digital input word is changed. The MCP4291 DAC ? SPI
connections with LPC21xx have four I/O lines (P0.4 ? P0.7) required. The analog output is generated by
using these four lines.
Circuit diagram:


Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the embedded c programs for generating ramp wave and square wave using ARM LPC2148 are
written and executed successfully and the waveforms are viewed in oscilloscope.
Outcome:
Able to program the DAC in-built inside the ARM controller and get the waveforms using it.




21 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications :
1. DAC used in Audio amplifier.
2. Video encoder
3. Display electronics
4. Data Acquistion systems
5. Motor control



1. What are the features of LPC2148 DAC?
2. What is the function of DAC register?
3. Which pin provides a voltage reference level for the D/A converter?
4. What are the applications of DAC in signal processing applications?
5. What is GIO?
6. What is the resolution of a digital-to-analog converter (DAC)?
7. What is the major advantage of the R/2R ladder digital-to-analog (DAC), as compared to a binary-
weighted digital-to-analog DAC converter?
8. What is the resolution of a 0?5 V 6-bit digital-to-analog converter (DAC) ?
9. What are DAC configurations?
10. What are the different types of DAC Circuits?
11. What are the Limitations of the Binary Weighted DAC?
12. What are the General DAC Characteristics?
13. Define reference voltage in DAC.
14. What is full scale voltage?
15. What is settling time?
VIVA-VOCE




22 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 4 LED DIMMING USING PWM

Aim:
To write an embedded c program for implementing PWM using ARM controller and verify the same by
dimming of LEDs.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
LPC2148 supports 2 types of PWM:
1) Single Edge PWM ? Pulse starts with new Period i.e pulse is always at the beginning
2) Double Edge PWM ? Pulse can be anywhere within the Period
A PWM block, like a Timer block , has a Timer Counter and an associated Pre-scale Register along
with Match Registers. These work exactly the same way as in the case of Timers. Match Registers 1 to 6
(except 0) are pinned on LPC214x i.e. the corresponding outputs are diverted to actual Pins on LPC214x
MCU. The PWM function must be selected for these Pins to get the PWM output.
The basic setup is to simply replace Servo by a LED and no external 5V source is needed. The
anode of LED is connected to P0.0 and cathode to ground. Pulse Widths corresponding to the switches
connected to P0.1/2/3/4 will be 2.5ms/5ms/7.5ms/10ms respectively. As the Pulse Width Increases LED
will keep on getting brighter and the reverse will happen if Pulse Width is decreased.



23 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus embedded c program for implementing Pulse Width Modulation is written and executed and
output has been verified in LED display.
Outcome:
Able to implement PWM using the ARM controller and verify the same in the form of dimming of
LEDS.



24 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Applications :
1. In Visual signals to covey a message
2. Illumination where light is reflected from objects
3. In Narrow band sensors



1. What factors determine the LED dimming performance?
2. What is meant by analog dimming?
3. What is flickering effect?
4. What is the factor determines dimming of the LED
5. Why Silicon is not suitable for fabrication of light-emitting diodes?
6. Why Silicon diode is less suited for low voltage rectifier operation?
7. What is the principle of zener diode?
8. What are the materials used to make LED?
9. What type of diodes is used in FM receivers?
10. Which diode suffers an avalanche breakdown?
11. What happens if the junction temperature of LED is increased?
12. How a transfer characteristic of a diode does is related?
13. What is the requirement of a clipping action of a diode?
14. What type of rectifier circuit requires four diodes?
15. Why are the pulse width modulated outputs required in most of the applications?
16. How do the variations in an average value get affected by PWM period?
17. Name the common formats available for LED display.
18. What are the types of seven segment display?
19. What is PWM?
20. What are the applications of PWM?

Viva-voce




25 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 5 INTERFACING REAL TIME CLOCK
AND SERIAL PORT
Aim:
To write and execute an embedded c program to interface DS1307 RTC using I2C protocol with ARM
controller
Apparatus Required:
1. LPC2148 ARM development board
2. Stepper motor
3. Interfacing cables
4. PC
Theory:
A clock, which is based on the interrupts at preset intervals, is Real Time Clock (RTC). An interrupt
service routine executes on each timeout (overflow) of this clock. This timing device once started never
resets or never reloaded with another value. Once it is set, it is not modified later. It is used in a system to
save the time and date.













26 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the program for interfacing real time clock with ARM controller is written and executed and the
date and time are verified on the screen.
Outcome:
Able to interface real time clock DS1307 with ARM controller and thereby display date and time
Applications :
1. I2C In ARM and PIC microcontrollers
2. Used as serial communication protocol with MASTER and SLAVE operation.

27 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
27 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00




1. What is I2C and how does it work?
2. What are the features of I2C in LPC2148 ARM7 microcontroller?
3. What is the function of I2C0CONSET register?
4. What is I2C0STAT?
5. What is the function of I2C0 Data Register?
6. What is RTC?
7. List the advantages of RTC
8. Through which port the date and time is displayed in RTC?
9. What is a serial port?
10. List the registers used to transfer data in serial port.
11. List the modes used for data transmission.
12. What is a simplex mode?
13. Which pin is used to transmit a character?
14. What is the baud rate of serial port?
15. What is the disadvantage of RS-232C?














Viva-voce




28 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 6 INTERFACING KEYPAD AND LCD

Aim:
To write an embedded c program to interface 4 x 4 matrix keypad with ARM processor and display the
pressed key in an LCD.
Apparatus Required:
1. LPC2148 ARM development board
2. Interfacing cables
3. PC
Theory:

In matrix keypad, keys are connected in rows and columns. When any switch is pressed, rows and
columns come into contact, which is that detected by controller to identify which key has been pressed. A
4?4 matrix keypad consists of 4 rows and 4 columns. There is a switch connecting each row and column.
So the combinations of rows and columns make up the 16 inputs.Initially all the switches are open (not
connected). When any one button is pressed, the switch is closed (connected),hence there is a connection
between the row and column. The first 4 pins are connected to the column as INPUT. The other 4 pins are
connected to the row as OUTPUT. Matrix keypad is a good substitution to normal push button.












29 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Circuit Diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus program for interfacing matrix keypad with ARM controller is written and executed and the key
pressed is seen in the LCD.



30 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Outcome:
Able to interface keypad with ARM controller and see the pressed key in the LCD display.
Applications :
1. Used in password based door locking system
2. Security system with user changeable
3. Used in laptops, computer games
4. Used in portable video games and cell phones



1. What is Matrix keypad?
2. What is the concept behind keypad interface?
3. What are the functions of pull- up resistors?
4. What is key de bouncing?
5. List the steps involved when the key in a 4 x 4 keyboard matrix is being pressed.
6. What is the value obtained if no key is pressed?
7. What kind of interrupt is generated if a key has to be operated in an interrupt mode?
8. How will you identify that the key is pressed?
9. What are the steps involved in Keyboard Interfacing?
10. List the registers used to store the keyboard, display modes and other operations programmed by
CPU.
11. Name the mode when a data is entered from the left side of the display unit.
12. How many rows and columns are present in a 16 x 2 alphanumeric LCD?
13. How many data lines are there in a 16 x 2 alphanumeric LCD?
14. Which pin of the LCD is used for adjusting its contrast?
15. Which command of an LCD is used to shift the entire display to the right?
16. Which command is used to select the 2 lines and 5 x 7 matrix of an LCD?
17. What changes are to be made to send data to an LCD?
18. For reading operation from an LCD what changes in the software are introduced?
19. Which instruction is used to select the first row first column of an LCD?
Viva-voce

31 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
31 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Expt. No. 7 INTERFACING EEPROM AND INTERRUPT

Aim:
To write a program to interface EEPROM using I2C protocol with ARM controller and retrieve the stored
messages inside EEPROM.
Apparatus Required:
1. LPC2148 ARM development board
2. Interfacing cables
3. PC
Theory:
I2C (Inter Integrated Circuit):
The I2C (Inter-IC) bus is a bi-directional two-wire serial bus that provides a communication link between
integrated circuits (ICs).I2C is a synchronous protocol that allows a master device to initiate communication
with a slave device. Data is exchanged between these devices.
EEPROM:
EEPROM (electrically erasable programmable read-only memory) is user-modifiable read-only
memory (ROM) that can be erased and reprogrammed (written to) repeatedly through the application of
higher than normal electrical voltage. It is a type of non-volatile memory used in computers and other
electronic devices to store small amounts of data that must be saved when power is removed, e.g.,
calibration tables or device configuration
Read, write and Erase EEPROM by using I2C in LPC2148 Primer Board. Wiring up an I2C based
EEPROM to the I2C port is relatively simple. The basic operation of the I2C based EEPROM's is to send a
command, such as WRITE, followed by an address and the data. In WRITE operation, the EEPROM is
used to store the data. In LPC2148 Primer Kit, 2 nos. of EEPROM lines are controlled by I2C Enabled
drivers. I2C Lines serial clock SCL (P0.2), serial data SDA (P0.3) connected to the I2C based serial
EEPROM IC. The EEPROM read & write operations are done in LPC2148 Primer Kit by using these SDA &
SCL I2C lines.
32 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
32 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To down load and run this program: Refer General procedure given in Page No: 60
Result:
Thus, the program for interfacing I2C based EEPROM with ARM processor has been written and
executed successfully and the memory content is verified on Win x talk terminal.
Outcome:
Able to interface memory ICs with ARM controller and perform the read and write operations.



33 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications:
1. ROM used in toys,automobiles to store data when power is off
2. In calculators and peripheral devices
3. In laser printers
4. And also in embedded systems where program need not to be changed.


1. How does I2C protocol work?
2. What is EEPROM?
3. What is meant by master slave mode?
4. What is meant by non-volatile memory?
5. What is an interrupt?
6. How does an interrupt request works?
7. What is a nested interrupt?
8. What are the registers used for enabling an interrupt?
9. What is PROM?
10. What is EPROM?
11. What is mask ROM?
12. Which memory allows simultaneous read and write operations?
13. Which memory has the shortest access times?
14. Which interrupt has the highest priority?
15. What is non maskable interrupt?
16. Which is the first level of memory access by the microprocessor?
17. List the types of cache memories.
18. What is the use of an interrupt?
19. What is the use of converting an interrupt to threads in a microprocessor?
20. What are the bits used to control an external interrupts?


Viva-voce




34 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00










CYCLE 2 - EXPERIMENTS




35 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 8 IMPLEMENTATION OF MAILBOX FUNCTION
USING LPC2148
Aim:
To create a mailbox in Micro C/OS ? II using LPC2148 ARM Controller
Apparatus Required:
1. LPC2148 ARM development board
2. Interfacing cables
3. PC
Theory:
System or the user code can send a message by the core services. A typical mail message, also
known as the exchange of information, refers to a task or an ISR using a pointer variable, through the core
services to put a message (that is, a pointer) into the mailbox. Similarly, one or more tasks can receive this
message by the core services. The tasks sending and receiving the message promise that the content that
the pointer points to is just that piece of message.
The mailbox of CooCox CoOS is a typical message mailbox which is composed of two parts: one is
the information which expressed by a pointer of void; the other is the waiting list which composed of the
tasks waiting for this mailbox. The waiting list supports two kinds of sorting: FIFO and preemptive priority.
The sorting mode is determined by the user when creating the mailbox.
Procedure:
To Edit / Compile / generate Hex file: Refer General procedure in Page No: 58
To down load and run this program: Refer General procedure in Page No: 60
Result:
Thus, the mailbox was created in Micro C/OS ?II and implemented using LPC2148.
Outcome:
Able to understand the concept of mail box in embedded systems and its significance in real time
systems





36 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications:
1. Used in Acorn RISC PC700
2. Used in ZIPIT wireless messenger
3. Used in Meizu M6 MINI player


1. What is IPC?
2. Define Queue.
3. What are the different types of mail box functions?
4. What is half duplex mode?
5. How many synchronous and asynchronous modes are there in serial port?
6. List the bits used to generate serial port interrupt
7. What is branch prediction?
8. Mention any two features of ?C/OS ? II.
9. Write the function for creating task in ?C/OS ? II.
10. Mention any two support devices for ?C/OS ? II.
11. How many user tasks can be handled by ?C/OS ? II?



















Viva-voce




37 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 9 INTERRUPT PERFORMANCE
CHARACTERISTICSOF ARM AND FPGA

Aim:
To study the interrupt performance characteristics of ARM and FPGA by using ARM controller kit and
FPGA kit separately.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
External Interrupts:
An interrupt caused by an external source such as the computer operator, external sensor or
monitoring device, or another computer. Interrupts are special events that require immediate attention.
Interfacing External Interrupts with LPC2148:
When an external interrupt signal occurs in LPC2148 Primer Board, the message "LOW" will be
displayed on PC. The interrupt signal occurs using switches. When the switch is pressed to LOW, then the
external interrupt occurs. The Vectored Interrupt Controller (VIC) takes 32 interrupt request inputs and
programmable assigns them into 3 categories, FIQ, vectored IRQ, and non-vectored IRQ. The ARM7
LPC2148 Primer board has two numbers of External Interrupts, connected with I/O Port lines (P0.14 &
P0.15) as switches.







38 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00



Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60


39 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
39 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Result:
Thus the interrupt performance characteristics of ARM and FPGA are studied. On comparison, ARM
counts at slow speed because it consumes more instruction cycle and FPGA is more efficient for servicing
and processing external interrupt pulses.
Outcome:
Able to understand the performance characteristics of ARM and FPGA while dealing with
interrrupts
Applications:
1. Used in random logic and SPLDs
2. Used in cryptography and filtering
3. In medical imaging
4. In bioinformatics and voice recognition



1. When is an Interrupt Request received?
2. What is ISR?
3. How do you initialize interrupt?
4. What is Vectored Interrupt Controller?
5. What are the kinds of protection available for SRAMS ?
6. What is interrupt pipelining?
7. What is pipeline shutdown?
8. What is branch prediction?
9. What is the use of Neon Floating point engine?
10. What is the use of ?vectorize option?
11. What is PTM?
12. What is ITM?
13. What is ETM?
14. What is I2S interface?
15. What is the use of ?SWI? in ARM assembly?

Viva-voce




40 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 10 FLASHING OF LEDS
Aim:
To write and execute an embedded c program to display LEDs using LPC 2148 ARM controller
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
Theory:
LED (Light Emitting Diodes) is the most commonly used components, usually for displaying pins digital
states. Typical uses of LEDs include alarm devices, timers and confirmation of user input such as a mouse
click or keystroke. Interfacing LED with LPC2148 Flash a LED using LPC2148 Primer Board. It works by
turning ON a LED & then turning it OFF & then looping back to START. However the operating speed of
microcontroller is very high so the flashing frequency will also be very fast to be detected by human eye.
The ARM7 LPC2148 Primer board has eight numbers of point LEDs, connected with I/O Port lines (P1.16 ?
P1.23) to make port pins high.










41 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00



Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus program for flashing of LEDs is written and executed using ARM controller LPC2148.



42 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Outcome:
Able to interface LED lights via the input output port and control them
Applications:
1. In Illumination
2. As status indicators in equipments
3. Stadium displays and dynamic decorative displays



1. What is seven segment displays?
2. What are the different configurations of LED?
3. What is the function of GPIO?
4. What are the Pins which are used to connect LEDs?
5. How to identify 'Polarity' of LED?
6. Differentiate LED from LCD.
7. What is a use of Jumper?
8. How many numbers of LEDs present in Primer board?
9. Where LEDs are used?
10. What is the use of flash magic software?
11. Which port is used in ARM 7 processor kit?
12. Which diode suffers an avalanche breakdown?
13. What happens if the junction temperature of LED is increased?
14. What is an anti collision rate light?
15. What is fail-safe conditions






Viva-voce




43 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 11 STEPPER MOTOR INTERFACE WITH
ARM -7 LPC2148
Aim:
To write a program to interface stepper motor using ARM processor and control the movement of motor
in either directions.
Apparatus Required:
1. LPC2148 ARM development board
2. Stepper motor
3. Interfacing cables
4. PC
Theory:
A stepper motor can be viewed as a DC motor with number of poles (on both rotor and stator).
Additionally, soft magnetic material with many teeth on the rotor and stator cheaply multiplies the number of
poles (reluctance motor). Like an AC synchronous motor, it is ideally driven by sinusoidal current, allowing
a step less operation, but this puts some burden on the controller. When using an 8-bit digital controller,
256 micro steps per step are possible. As a digital-to-analog converter produces unwanted ohmic heat in
the controller, pulse-width modulation is used to regulate the mean current. Simpler models switch voltage
only for doing a step, thus needing an extra current limiter: for every step, they switch a single cable to the
motor.
The idea is to connect the output pins of the driver to 4 transistors. The transistor must be
grounded at the emitter and the driver pin must be connected to the base. Collector is connected to the coil
wire of the motor. Stepper motors are rated by the torque they produce. Synchronous electric motors using
soft magnetic materials (having a core) have the ability to provide position holding torque (called detent
torque, and sometimes included in the specifications) while not driven electrically. To achieve full rated
torque, the coils in a stepper motor must reach their full rated current during each step. The voltage rating
(if there is one) is almost meaningless. The motors also suffer from EMF, which means that once the coil is
turned off it starts to generate current because the motor is still rotating. There needs to be an explicit way
to handle this extra current in a circuit otherwise it can cause damage and affect performance of the motor.
FirstRanker.com - FirstRanker's Choice
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00






?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING

VII SEMESTER - R 2013

EC6711 ? EMBEDDED LABORATORY






Name : _______________________________________
Register No : _______________________________________
Section : _______________________________________
LABORATORY MANUAL



2 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00




is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and
training.

? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different
levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on
heart and soul
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

To impart professional education integrated with human values to the younger generation, so as to
shape them as proficient and dedicated engineers, capable of providing comprehensive solutions to the
challenges in deploying technology for the service of humanity

? To educate the students with the state-of-art technologies to meet the growing challenges of the
electronics industry
? To carry out research through continuous interaction with research institutes and industry, on
advances in communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning,
innovation and ethical practices
VISION
VISION
MISSION
MISSION



3 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

PROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To provide students with a solid foundation in Mathematics, Science and fundamentals of
engineering, enabling them to apply, to find solutions for engineering problems and use this knowledge
to acquire higher education
2. Core Competence
To train the students in Electronics and Communication technologies so that they apply their
knowledge and training to compare, and to analyze various engineering industrial problems to find
solutions
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice which
enables them to find solutions for the real time problems in industry, and to design products
4. Professionalism
To inculcate professional and effective communication skills, leadership qualities and team spirit in
the students to make them multi-faceted personalities and develop their ability to relate engineering
issues to broader social context
5. Lifelong Learning/Ethics
To demonstrate and practice ethical and professional responsibilities in the industry and society in
the large, through commitment and lifelong learning needed for successful professional career


4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
PROGRAMME OUTCOMES (POs)
a) To demonstrate and apply knowledge of Mathematics, Science and engineering fundamentals in
Electronics and Communication Engineering field
b) To design a component, a system or a process to meet the specific needs within the realistic
constraints such as economics, environment, ethics, health, safety and manufacturability
c) To demonstrate the competency to use software tools for computation, simulation and testing of electronics
and communication engineering circuits
d) To identify, formulate and solve electronic and communication engineering problems
e) To demonstrate an ability to visualize and work on laboratory and multidisciplinary tasks
f) To function as a member or a leader in multidisciplinary activities
g) To communicate in verbal and written form with fellow engineers and society at large
h) To understand the impact of Electronics and Communication Engineering in the society and demonstrate
awareness of contemporary issues and commitment to give solutions exhibiting social responsibility
i) To demonstrate professional & ethical responsibilities
j) To exhibit confidence in self-education and ability for lifelong learning
k) To participate and succeed in competitive exams


5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
SYLLABUS

? Learn the working of ARM processor
? Understand the Building Blocks of Embedded Systems
? Learn the concept of memory map and memory interface
? Know the characteristics of Real Time Systems
? Write programs to interface memory, I/Os with processor
? Study the interrupt performance
LIST OF EXPERIMENTS:
1. Study of ARM evaluation system
2. Interfacing ADC and DAC
3. Interfacing LED and PWM
4. Interfacing real time clock and serial port
5. Interfacing keyboard and LCD
6. Interfacing EPROM and interrupt
7. Mailbox
8. Interrupt performance characteristics of ARM and FPGA
9. Flashing of LEDS
10. Interfacing stepper motor and temperature sensor
11. Implementing zigbee protocol with ARM



? Write programs in ARM for a specific Application
? Interface memory and Write programs related to memory operations
? Interface A/D and D/A convertors with ARM system
? Analyze the performance of interrupt
? Write programmes for interfacing keyboard, display, motor and sensor.
? Formulate a mini project using embedded system
COURSE OBJECTIVES
COURSE OUTCOMES
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
CONTENTS
Sl. No. Name of the Experiment Page No.
CYCLE 1 ? EXPERIMENTS
1
Study of ARM evaluation system 7
2
Analog to Digital Convertor interfacing 16
3
Generation of ramp and square wave using on-Chip DAC 19
4
LED dimming using PWM 22
5
Interfacing real time clock and serial port 25
6
Interfacing keypad and LCD 28
7
Interfacing EPROM and interrupt 31
CYCLE 2 ? EXPERIMENTS
8 Implementation of Mailbox Function using LPC 2148 35
9 Interrupt Performance Characteristics of Arm and FPGA 37
10 Flashing of LEDs 40
11 Stepper Motor Interface with ARM ? 7 LPC2148 43
12 LM35 Temperature Sensor Interface with ARM ? 7 LPC2148 47
13
Implementation of Wireless Communication Protocol using ZIGBEE Wireless
Module
50
ADDITIONAL EXPERIMENTS BEYOND THE SYYLABUS
14 Buzzer Interface with ARM ? 7 54
15 Relay interface with ARM? 7 57
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Expt. No. 1 STUDY OF ARM EVALUATION SYSTEM
Aim:
To study the building blocks of ARM7 system, its features, pin configuration and the components
required for functioning of ARM controller.
Architecture Overview:
A RISC-based computer design approach means ARM processors require significantly fewer transistors
than typical processors in average computers. This approach reduces cost, heat and power usage. These
are desirable traits for light, portable, battery-powered devices (smart phones, laptops, tablet and notepad
computers), and other embedded systems. A simpler design facilitates more efficient multi-core CPUs and
higher core counts at lower cost, providing higher processing power and improved energy efficiency for
servers and supercomputers.
In 2005, about 98% of all mobile phones sold used at least one ARM processor. The low power
consumption of ARM processors has made them very popular: 37 billion ARM processors have been
produced as of 2013, up from 10 billion in 2008. The ARM architecture (32-bit) is the most widely used
architecture in mobile devices, and most popular 32-bit one in embedded systems.
According to ARM Holdings, in 2010 alone, producers of chips based on ARM architectures
reported shipments of 6.1 billion ARM based processors, representing 95% of smart phones, 35% of digital
televisions and set-top boxes and 10% of mobile computers. It is the most widely used 32-bit instruction set
architecture in terms of quantity produced.
LPC 2148:
LPC2148 is the widely used IC from ARM-7 family. It is manufactured by Philips and it is pre-loaded
with many inbuilt peripherals making it more efficient and a reliable option for the beginners as well as high
end application developer.




8 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Features of LPC214x series controllers:
1. 8 to 40 kB of on-chip static RAM and 32 to 512 kB of on-chip flash program memory.128 bit wide
interface/accelerator enables high speed 60 MHz operation.
2. In-System/In-Application Programming (ISP/IAP) via on-chip boot-loader software. Single flash sector or
full chip erase in 400 ms and programming of 256 bytes in 1ms.
3. Embedded ICE RT and Embedded Trace interfaces offer real-time debugging with the on-chip Real
Monitor software and high speed tracing of instruction execution.
4. USB 2.0 Full Speed compliant Device Controller with 2 kB of endpoint RAM. In addition, the LPC2146/8
provides 8 kB of on-chip RAM accessible to USB by DMA.
5. One or two (LPC2141/2 vs. LPC2144/6/8) 10-bit A/D converters provide a total of 6/14analog inputs, with
conversion times as low as 2.44 us per channel.
6. Single 10-bit D/A converter provides variable analog output.
7. Two 32-bit timers/external event counters (with four capture and four compare channels each), PWM unit
(six outputs) and watchdog.
8. Low power real-time clock with independent power and dedicated 32 kHz clock input.
9. Multiple serial interfaces including two UARTs (16C550), two Fast I2C-bus (400 kbit/s), SPI and SSP with
buffering and variable data length capabilities.
10. Vectored interrupt controller with configurable priorities and vector addresses.
11. Up to 45 of 5 V tolerant fast general purpose I/O pins in a tiny LQFP64 package.
12. Up to nine edge or level sensitive external interrupt pins available.
13. On-chip integrated oscillator operates with an external crystal in range from 1 MHz to30 MHz and with
an external oscillator up to 50 MHz
14. Power saving modes include Idle and Power-down.
15. Individual enable/disable of peripheral functions as well as peripheral clock scaling for additional power
optimization.
16. Processor wake-up from Power-down mode via external interrupt, USB, Brown-Out Detect (BOD) or
Real-Time Clock (RTC).




9 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


First Step- Hardware Requirement:
Pin configuration of LPC 2148.

Hardware requirement of LPC2148:
1. LPC2148 need minimum below listed hardware to work properly
2. Power Supply
3. Crystal Oscillator
4. Reset Circuit
5. RTC crystal oscillator
6. UART
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Power Supply:
LPC2148 works on 3.3 V power supply. LM 117 can be used for generating 3.3 V supply. However,
basic peripherals like LCD, ULN 2003 (Motor Driver IC) etc. works on 5V. So AC mains supply is converted
into 5V using below mentioned circuit and after that LM 117 is used to convert 5V into 3.3V.
Block diagram of power Supply

Transformer: It is used to step down 230V AC to 9V AC supply and provides isolation between power grids
and circuit.
Rectifier: It is used to convert AC supply into DC.
Filter: It is used to reduce ripple factor of DC output available from rectifier end.
Regulator: It is used to regulate DC supply output.

11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Circuit Diagram:

Regulator IC 7805 is used to provide fix 5V dc supply.
LM 117 is used for generating 3.3V supply from 5V.

12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Calculations:

From the datasheet of LM117

Taking R 2= 240?, we get R 1=392?
Reset Circuit:
Reset button is essential in a system to avoid programming pitfalls and manually bring back the system
to the initialization mode. MCP 130T is a special IC used for providing stable RESET signal to LPC 2148.


13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Oscillator Circuit:

The value of capacitors C20 & C21 depends upon the frequency of crystal Y3. General circuit and
its equivalent circuit is as shown below.

14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Recommended values are as shown in table:

UART:
LPC 2148 has inbuilt ISP which means we can program it within the system using serial
communication on COM0. It has also COM1 for serial communication. MAX 232/233 IC must be used for
voltage logic conversion. Related connections are as given below.

Once the above listed circuit design is ready, we are ready to go further.



15 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Result:
ARM Evaluation system and the configuration of LPC2148 has been studied fully. The minimal setup
required for the functioning of the ARM processor is studied.
Outcomes:
1. Able to understand the ARM controller, its basic components inside and its features.
2. Able to know the components required for the working of ARM LPC2148

Applications:
ARM controller LPC2148 is used in no. of devices such as
1. Smart phones
2. Net books
3. E Readers
4. Digital TV
5. Home Gateways


1. What are the basic units of ARM 7?
2. What is the address system supported by ARM?
3. Define - RISC
4. What are the instructions used to access the memory in ARM?
5. What are the basic units of Microprocessor?
6. What is an Instruction?
7. What is clock cycle?
8. Define - Pipelining
9. What is cache miss?
10. What is meant by memory mapped I/O?
11. Define ? interrupt
12. What is meant by Exception?
13. What is meant by little ? endian mode?
14. What is meant by big ? endian mode?
15. What is the function of CPSR?
16. What is register - indirect addressing?
Viva-voce




16 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 2 ANALOG TO DIGITAL CONVERTOR
INTERFACING
Aim:
To write an embedded c program for interfacing an on chip ADC with LPC2148 ARM processor and
convert the given input voltage into corresponding decimal values.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. PC
Theory:
Analog to Digital converter (ADC) is a device that converts continuously varying analog signals from
instruments that monitor such conditions as movement, temperature, sound, etc., into binary code for the
computer. It may be either a single chip or can be one circuit within a chip. Analog to Digital conversion is
the process of changing continuously varying data, such as voltage, current, or shaft rotation, into discrete
digital quantities that represent the magnitude of the data compared to a standard or reference at the
moment the conversion is made. According to the method of conversion, ADCs can be classified into
Direct-Conversion ADCs, Successive Approximation ADCs, Integrating ADC and Sigma-Delta ADCs.
The LPC 2148 has 10-bit successive approximation analog to digital converter. Basic clocking for the
A/D converters is provided by the VPB clock. A programmable divider is included in each converter, to
scale this clock to the 4.5 MHz (max) clock needed by the successive approximation process. A fully
accurate conversion requires 11 of these clocks. The ADC cell can measure the voltage on any of the ADC
input signals. It is noted that these analog inputs are always connected to their pins, even if the Pin function
Select register assigns them to port pins. A simple self-test of the ADC can be done by driving these pins
as port outputs.



17 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Circuit diagram:




18 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus, an embedded c program for interfacing on-chip ADC with ARM processor is written and
executed. The decimal values of the converted voltage are seen in the WinXTalk screen.
Outcome:
Able to interface A/D convertors with ARM system and check its working by connecting an analog
quantity as input.
Applications:
1. ADC used in MODEM for converting analog signals to digital.
2. A fast video ADC in TV tuner cards
3. ADC used in digital storage oscilloscopes
4. Used in music reproduction technology.
5. Used in DSP if input is analog


1. What are the ADC operating modes in LPC2148?
2. What is meant by conversion time?
3. Why are internal ADCs preferred over external ADCs?
4. Why has 16-bit ADC more resolution than from 10-bit and 8-bit ADC?
5. What are ADC & its Resolution?
6. What is Burst conversion mode?
7. What is the function of A/D Control Register?
8. What is the function of A/D Global Data Register?
9. What is the function of A/D Status Register?
10. What is analog-to-digital (ADC) conversion error?
11. What is the function of Sample-and-hold circuits in analog-to digital converters?
12. What is the disadvantage of the flash analog-to digital converter?
Viva-voce




19 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 3 GENERATION OF RAMP AND SQUARE
WAVE USING ON-CHIP DAC
Aim:
To write and execute an embedded c program to generate ramp wave and square wave using on-chip
DAC of LPC2148 ARM controller.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
A digital-to-analog converter is a device for converting a digital signal into an analog signal (current or
voltage). Digital-to-Analog Converters are the interface between the abstract digital world and the analog
real world. Simple switches, a network of resistors, current sources or capacitors may be used to
implement this conversion. A DAC inputs a binary number and outputs an analog voltage or current signal.
The Microchip Technology Inc. MCP4921 is 2.7 ? 5.5V, low-power, 12-Bit Digital-to-Analog Converter
(DAC) with SPI interface. The MCP4921 DAC provides high accuracy and low noise performance for
industrial applications where calibration or compensation of signals is required. With an SPI connection
there is always one master device (usually a microcontroller) which controls the peripheral devices.
Typically there are three lines common to all the devices,
Master In Slave Out (MISO) ? The Slave line for sending data to the master,
Master Out Slave In (MOSI) ? The Master line for sending data to the peripherals,
Serial Clock (SCK) ? The clock pulses which synchronize data transmission generated by the
master and slave
Slave Select pin ? the pin on each device that the master can use to enable and disable specific
devices. When a device Slave Select pin is low, it communicates with the master. When it is high, it ignores
the master. In SPI, the clock signal is controlled by the master device LPC2148. All data is clocked in and
out using this pin. These lines need to be connected to the relevant pins on the LPC21xx processor. Any
unused GIO pin can be used for CS, instead pull this pin high. Conversion speed is the time it takes for the



20 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

DAC to provide an analog output when the digital input word is changed. The MCP4291 DAC ? SPI
connections with LPC21xx have four I/O lines (P0.4 ? P0.7) required. The analog output is generated by
using these four lines.
Circuit diagram:


Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the embedded c programs for generating ramp wave and square wave using ARM LPC2148 are
written and executed successfully and the waveforms are viewed in oscilloscope.
Outcome:
Able to program the DAC in-built inside the ARM controller and get the waveforms using it.




21 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications :
1. DAC used in Audio amplifier.
2. Video encoder
3. Display electronics
4. Data Acquistion systems
5. Motor control



1. What are the features of LPC2148 DAC?
2. What is the function of DAC register?
3. Which pin provides a voltage reference level for the D/A converter?
4. What are the applications of DAC in signal processing applications?
5. What is GIO?
6. What is the resolution of a digital-to-analog converter (DAC)?
7. What is the major advantage of the R/2R ladder digital-to-analog (DAC), as compared to a binary-
weighted digital-to-analog DAC converter?
8. What is the resolution of a 0?5 V 6-bit digital-to-analog converter (DAC) ?
9. What are DAC configurations?
10. What are the different types of DAC Circuits?
11. What are the Limitations of the Binary Weighted DAC?
12. What are the General DAC Characteristics?
13. Define reference voltage in DAC.
14. What is full scale voltage?
15. What is settling time?
VIVA-VOCE




22 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 4 LED DIMMING USING PWM

Aim:
To write an embedded c program for implementing PWM using ARM controller and verify the same by
dimming of LEDs.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
LPC2148 supports 2 types of PWM:
1) Single Edge PWM ? Pulse starts with new Period i.e pulse is always at the beginning
2) Double Edge PWM ? Pulse can be anywhere within the Period
A PWM block, like a Timer block , has a Timer Counter and an associated Pre-scale Register along
with Match Registers. These work exactly the same way as in the case of Timers. Match Registers 1 to 6
(except 0) are pinned on LPC214x i.e. the corresponding outputs are diverted to actual Pins on LPC214x
MCU. The PWM function must be selected for these Pins to get the PWM output.
The basic setup is to simply replace Servo by a LED and no external 5V source is needed. The
anode of LED is connected to P0.0 and cathode to ground. Pulse Widths corresponding to the switches
connected to P0.1/2/3/4 will be 2.5ms/5ms/7.5ms/10ms respectively. As the Pulse Width Increases LED
will keep on getting brighter and the reverse will happen if Pulse Width is decreased.



23 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus embedded c program for implementing Pulse Width Modulation is written and executed and
output has been verified in LED display.
Outcome:
Able to implement PWM using the ARM controller and verify the same in the form of dimming of
LEDS.



24 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Applications :
1. In Visual signals to covey a message
2. Illumination where light is reflected from objects
3. In Narrow band sensors



1. What factors determine the LED dimming performance?
2. What is meant by analog dimming?
3. What is flickering effect?
4. What is the factor determines dimming of the LED
5. Why Silicon is not suitable for fabrication of light-emitting diodes?
6. Why Silicon diode is less suited for low voltage rectifier operation?
7. What is the principle of zener diode?
8. What are the materials used to make LED?
9. What type of diodes is used in FM receivers?
10. Which diode suffers an avalanche breakdown?
11. What happens if the junction temperature of LED is increased?
12. How a transfer characteristic of a diode does is related?
13. What is the requirement of a clipping action of a diode?
14. What type of rectifier circuit requires four diodes?
15. Why are the pulse width modulated outputs required in most of the applications?
16. How do the variations in an average value get affected by PWM period?
17. Name the common formats available for LED display.
18. What are the types of seven segment display?
19. What is PWM?
20. What are the applications of PWM?

Viva-voce




25 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 5 INTERFACING REAL TIME CLOCK
AND SERIAL PORT
Aim:
To write and execute an embedded c program to interface DS1307 RTC using I2C protocol with ARM
controller
Apparatus Required:
1. LPC2148 ARM development board
2. Stepper motor
3. Interfacing cables
4. PC
Theory:
A clock, which is based on the interrupts at preset intervals, is Real Time Clock (RTC). An interrupt
service routine executes on each timeout (overflow) of this clock. This timing device once started never
resets or never reloaded with another value. Once it is set, it is not modified later. It is used in a system to
save the time and date.













26 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the program for interfacing real time clock with ARM controller is written and executed and the
date and time are verified on the screen.
Outcome:
Able to interface real time clock DS1307 with ARM controller and thereby display date and time
Applications :
1. I2C In ARM and PIC microcontrollers
2. Used as serial communication protocol with MASTER and SLAVE operation.

27 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
27 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00




1. What is I2C and how does it work?
2. What are the features of I2C in LPC2148 ARM7 microcontroller?
3. What is the function of I2C0CONSET register?
4. What is I2C0STAT?
5. What is the function of I2C0 Data Register?
6. What is RTC?
7. List the advantages of RTC
8. Through which port the date and time is displayed in RTC?
9. What is a serial port?
10. List the registers used to transfer data in serial port.
11. List the modes used for data transmission.
12. What is a simplex mode?
13. Which pin is used to transmit a character?
14. What is the baud rate of serial port?
15. What is the disadvantage of RS-232C?














Viva-voce




28 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 6 INTERFACING KEYPAD AND LCD

Aim:
To write an embedded c program to interface 4 x 4 matrix keypad with ARM processor and display the
pressed key in an LCD.
Apparatus Required:
1. LPC2148 ARM development board
2. Interfacing cables
3. PC
Theory:

In matrix keypad, keys are connected in rows and columns. When any switch is pressed, rows and
columns come into contact, which is that detected by controller to identify which key has been pressed. A
4?4 matrix keypad consists of 4 rows and 4 columns. There is a switch connecting each row and column.
So the combinations of rows and columns make up the 16 inputs.Initially all the switches are open (not
connected). When any one button is pressed, the switch is closed (connected),hence there is a connection
between the row and column. The first 4 pins are connected to the column as INPUT. The other 4 pins are
connected to the row as OUTPUT. Matrix keypad is a good substitution to normal push button.












29 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Circuit Diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus program for interfacing matrix keypad with ARM controller is written and executed and the key
pressed is seen in the LCD.



30 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Outcome:
Able to interface keypad with ARM controller and see the pressed key in the LCD display.
Applications :
1. Used in password based door locking system
2. Security system with user changeable
3. Used in laptops, computer games
4. Used in portable video games and cell phones



1. What is Matrix keypad?
2. What is the concept behind keypad interface?
3. What are the functions of pull- up resistors?
4. What is key de bouncing?
5. List the steps involved when the key in a 4 x 4 keyboard matrix is being pressed.
6. What is the value obtained if no key is pressed?
7. What kind of interrupt is generated if a key has to be operated in an interrupt mode?
8. How will you identify that the key is pressed?
9. What are the steps involved in Keyboard Interfacing?
10. List the registers used to store the keyboard, display modes and other operations programmed by
CPU.
11. Name the mode when a data is entered from the left side of the display unit.
12. How many rows and columns are present in a 16 x 2 alphanumeric LCD?
13. How many data lines are there in a 16 x 2 alphanumeric LCD?
14. Which pin of the LCD is used for adjusting its contrast?
15. Which command of an LCD is used to shift the entire display to the right?
16. Which command is used to select the 2 lines and 5 x 7 matrix of an LCD?
17. What changes are to be made to send data to an LCD?
18. For reading operation from an LCD what changes in the software are introduced?
19. Which instruction is used to select the first row first column of an LCD?
Viva-voce

31 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
31 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Expt. No. 7 INTERFACING EEPROM AND INTERRUPT

Aim:
To write a program to interface EEPROM using I2C protocol with ARM controller and retrieve the stored
messages inside EEPROM.
Apparatus Required:
1. LPC2148 ARM development board
2. Interfacing cables
3. PC
Theory:
I2C (Inter Integrated Circuit):
The I2C (Inter-IC) bus is a bi-directional two-wire serial bus that provides a communication link between
integrated circuits (ICs).I2C is a synchronous protocol that allows a master device to initiate communication
with a slave device. Data is exchanged between these devices.
EEPROM:
EEPROM (electrically erasable programmable read-only memory) is user-modifiable read-only
memory (ROM) that can be erased and reprogrammed (written to) repeatedly through the application of
higher than normal electrical voltage. It is a type of non-volatile memory used in computers and other
electronic devices to store small amounts of data that must be saved when power is removed, e.g.,
calibration tables or device configuration
Read, write and Erase EEPROM by using I2C in LPC2148 Primer Board. Wiring up an I2C based
EEPROM to the I2C port is relatively simple. The basic operation of the I2C based EEPROM's is to send a
command, such as WRITE, followed by an address and the data. In WRITE operation, the EEPROM is
used to store the data. In LPC2148 Primer Kit, 2 nos. of EEPROM lines are controlled by I2C Enabled
drivers. I2C Lines serial clock SCL (P0.2), serial data SDA (P0.3) connected to the I2C based serial
EEPROM IC. The EEPROM read & write operations are done in LPC2148 Primer Kit by using these SDA &
SCL I2C lines.
32 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
32 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To down load and run this program: Refer General procedure given in Page No: 60
Result:
Thus, the program for interfacing I2C based EEPROM with ARM processor has been written and
executed successfully and the memory content is verified on Win x talk terminal.
Outcome:
Able to interface memory ICs with ARM controller and perform the read and write operations.



33 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications:
1. ROM used in toys,automobiles to store data when power is off
2. In calculators and peripheral devices
3. In laser printers
4. And also in embedded systems where program need not to be changed.


1. How does I2C protocol work?
2. What is EEPROM?
3. What is meant by master slave mode?
4. What is meant by non-volatile memory?
5. What is an interrupt?
6. How does an interrupt request works?
7. What is a nested interrupt?
8. What are the registers used for enabling an interrupt?
9. What is PROM?
10. What is EPROM?
11. What is mask ROM?
12. Which memory allows simultaneous read and write operations?
13. Which memory has the shortest access times?
14. Which interrupt has the highest priority?
15. What is non maskable interrupt?
16. Which is the first level of memory access by the microprocessor?
17. List the types of cache memories.
18. What is the use of an interrupt?
19. What is the use of converting an interrupt to threads in a microprocessor?
20. What are the bits used to control an external interrupts?


Viva-voce




34 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00










CYCLE 2 - EXPERIMENTS




35 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 8 IMPLEMENTATION OF MAILBOX FUNCTION
USING LPC2148
Aim:
To create a mailbox in Micro C/OS ? II using LPC2148 ARM Controller
Apparatus Required:
1. LPC2148 ARM development board
2. Interfacing cables
3. PC
Theory:
System or the user code can send a message by the core services. A typical mail message, also
known as the exchange of information, refers to a task or an ISR using a pointer variable, through the core
services to put a message (that is, a pointer) into the mailbox. Similarly, one or more tasks can receive this
message by the core services. The tasks sending and receiving the message promise that the content that
the pointer points to is just that piece of message.
The mailbox of CooCox CoOS is a typical message mailbox which is composed of two parts: one is
the information which expressed by a pointer of void; the other is the waiting list which composed of the
tasks waiting for this mailbox. The waiting list supports two kinds of sorting: FIFO and preemptive priority.
The sorting mode is determined by the user when creating the mailbox.
Procedure:
To Edit / Compile / generate Hex file: Refer General procedure in Page No: 58
To down load and run this program: Refer General procedure in Page No: 60
Result:
Thus, the mailbox was created in Micro C/OS ?II and implemented using LPC2148.
Outcome:
Able to understand the concept of mail box in embedded systems and its significance in real time
systems





36 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications:
1. Used in Acorn RISC PC700
2. Used in ZIPIT wireless messenger
3. Used in Meizu M6 MINI player


1. What is IPC?
2. Define Queue.
3. What are the different types of mail box functions?
4. What is half duplex mode?
5. How many synchronous and asynchronous modes are there in serial port?
6. List the bits used to generate serial port interrupt
7. What is branch prediction?
8. Mention any two features of ?C/OS ? II.
9. Write the function for creating task in ?C/OS ? II.
10. Mention any two support devices for ?C/OS ? II.
11. How many user tasks can be handled by ?C/OS ? II?



















Viva-voce




37 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 9 INTERRUPT PERFORMANCE
CHARACTERISTICSOF ARM AND FPGA

Aim:
To study the interrupt performance characteristics of ARM and FPGA by using ARM controller kit and
FPGA kit separately.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
External Interrupts:
An interrupt caused by an external source such as the computer operator, external sensor or
monitoring device, or another computer. Interrupts are special events that require immediate attention.
Interfacing External Interrupts with LPC2148:
When an external interrupt signal occurs in LPC2148 Primer Board, the message "LOW" will be
displayed on PC. The interrupt signal occurs using switches. When the switch is pressed to LOW, then the
external interrupt occurs. The Vectored Interrupt Controller (VIC) takes 32 interrupt request inputs and
programmable assigns them into 3 categories, FIQ, vectored IRQ, and non-vectored IRQ. The ARM7
LPC2148 Primer board has two numbers of External Interrupts, connected with I/O Port lines (P0.14 &
P0.15) as switches.







38 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00



Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60


39 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
39 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Result:
Thus the interrupt performance characteristics of ARM and FPGA are studied. On comparison, ARM
counts at slow speed because it consumes more instruction cycle and FPGA is more efficient for servicing
and processing external interrupt pulses.
Outcome:
Able to understand the performance characteristics of ARM and FPGA while dealing with
interrrupts
Applications:
1. Used in random logic and SPLDs
2. Used in cryptography and filtering
3. In medical imaging
4. In bioinformatics and voice recognition



1. When is an Interrupt Request received?
2. What is ISR?
3. How do you initialize interrupt?
4. What is Vectored Interrupt Controller?
5. What are the kinds of protection available for SRAMS ?
6. What is interrupt pipelining?
7. What is pipeline shutdown?
8. What is branch prediction?
9. What is the use of Neon Floating point engine?
10. What is the use of ?vectorize option?
11. What is PTM?
12. What is ITM?
13. What is ETM?
14. What is I2S interface?
15. What is the use of ?SWI? in ARM assembly?

Viva-voce




40 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 10 FLASHING OF LEDS
Aim:
To write and execute an embedded c program to display LEDs using LPC 2148 ARM controller
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
Theory:
LED (Light Emitting Diodes) is the most commonly used components, usually for displaying pins digital
states. Typical uses of LEDs include alarm devices, timers and confirmation of user input such as a mouse
click or keystroke. Interfacing LED with LPC2148 Flash a LED using LPC2148 Primer Board. It works by
turning ON a LED & then turning it OFF & then looping back to START. However the operating speed of
microcontroller is very high so the flashing frequency will also be very fast to be detected by human eye.
The ARM7 LPC2148 Primer board has eight numbers of point LEDs, connected with I/O Port lines (P1.16 ?
P1.23) to make port pins high.










41 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00



Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus program for flashing of LEDs is written and executed using ARM controller LPC2148.



42 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Outcome:
Able to interface LED lights via the input output port and control them
Applications:
1. In Illumination
2. As status indicators in equipments
3. Stadium displays and dynamic decorative displays



1. What is seven segment displays?
2. What are the different configurations of LED?
3. What is the function of GPIO?
4. What are the Pins which are used to connect LEDs?
5. How to identify 'Polarity' of LED?
6. Differentiate LED from LCD.
7. What is a use of Jumper?
8. How many numbers of LEDs present in Primer board?
9. Where LEDs are used?
10. What is the use of flash magic software?
11. Which port is used in ARM 7 processor kit?
12. Which diode suffers an avalanche breakdown?
13. What happens if the junction temperature of LED is increased?
14. What is an anti collision rate light?
15. What is fail-safe conditions






Viva-voce




43 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 11 STEPPER MOTOR INTERFACE WITH
ARM -7 LPC2148
Aim:
To write a program to interface stepper motor using ARM processor and control the movement of motor
in either directions.
Apparatus Required:
1. LPC2148 ARM development board
2. Stepper motor
3. Interfacing cables
4. PC
Theory:
A stepper motor can be viewed as a DC motor with number of poles (on both rotor and stator).
Additionally, soft magnetic material with many teeth on the rotor and stator cheaply multiplies the number of
poles (reluctance motor). Like an AC synchronous motor, it is ideally driven by sinusoidal current, allowing
a step less operation, but this puts some burden on the controller. When using an 8-bit digital controller,
256 micro steps per step are possible. As a digital-to-analog converter produces unwanted ohmic heat in
the controller, pulse-width modulation is used to regulate the mean current. Simpler models switch voltage
only for doing a step, thus needing an extra current limiter: for every step, they switch a single cable to the
motor.
The idea is to connect the output pins of the driver to 4 transistors. The transistor must be
grounded at the emitter and the driver pin must be connected to the base. Collector is connected to the coil
wire of the motor. Stepper motors are rated by the torque they produce. Synchronous electric motors using
soft magnetic materials (having a core) have the ability to provide position holding torque (called detent
torque, and sometimes included in the specifications) while not driven electrically. To achieve full rated
torque, the coils in a stepper motor must reach their full rated current during each step. The voltage rating
(if there is one) is almost meaningless. The motors also suffer from EMF, which means that once the coil is
turned off it starts to generate current because the motor is still rotating. There needs to be an explicit way
to handle this extra current in a circuit otherwise it can cause damage and affect performance of the motor.
44 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
44 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus stepper motor interface with ARM processor has been successfully implemented and the motor is
controlled in clockwise and anticlockwise direction.
Outcome:
Able to interface the stepper motor with ARM controller and thereby create some rotational
movements


FirstRanker.com - FirstRanker's Choice
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00






?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING

VII SEMESTER - R 2013

EC6711 ? EMBEDDED LABORATORY






Name : _______________________________________
Register No : _______________________________________
Section : _______________________________________
LABORATORY MANUAL



2 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00




is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and
training.

? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different
levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on
heart and soul
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

To impart professional education integrated with human values to the younger generation, so as to
shape them as proficient and dedicated engineers, capable of providing comprehensive solutions to the
challenges in deploying technology for the service of humanity

? To educate the students with the state-of-art technologies to meet the growing challenges of the
electronics industry
? To carry out research through continuous interaction with research institutes and industry, on
advances in communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning,
innovation and ethical practices
VISION
VISION
MISSION
MISSION



3 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

PROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To provide students with a solid foundation in Mathematics, Science and fundamentals of
engineering, enabling them to apply, to find solutions for engineering problems and use this knowledge
to acquire higher education
2. Core Competence
To train the students in Electronics and Communication technologies so that they apply their
knowledge and training to compare, and to analyze various engineering industrial problems to find
solutions
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice which
enables them to find solutions for the real time problems in industry, and to design products
4. Professionalism
To inculcate professional and effective communication skills, leadership qualities and team spirit in
the students to make them multi-faceted personalities and develop their ability to relate engineering
issues to broader social context
5. Lifelong Learning/Ethics
To demonstrate and practice ethical and professional responsibilities in the industry and society in
the large, through commitment and lifelong learning needed for successful professional career


4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
PROGRAMME OUTCOMES (POs)
a) To demonstrate and apply knowledge of Mathematics, Science and engineering fundamentals in
Electronics and Communication Engineering field
b) To design a component, a system or a process to meet the specific needs within the realistic
constraints such as economics, environment, ethics, health, safety and manufacturability
c) To demonstrate the competency to use software tools for computation, simulation and testing of electronics
and communication engineering circuits
d) To identify, formulate and solve electronic and communication engineering problems
e) To demonstrate an ability to visualize and work on laboratory and multidisciplinary tasks
f) To function as a member or a leader in multidisciplinary activities
g) To communicate in verbal and written form with fellow engineers and society at large
h) To understand the impact of Electronics and Communication Engineering in the society and demonstrate
awareness of contemporary issues and commitment to give solutions exhibiting social responsibility
i) To demonstrate professional & ethical responsibilities
j) To exhibit confidence in self-education and ability for lifelong learning
k) To participate and succeed in competitive exams


5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
SYLLABUS

? Learn the working of ARM processor
? Understand the Building Blocks of Embedded Systems
? Learn the concept of memory map and memory interface
? Know the characteristics of Real Time Systems
? Write programs to interface memory, I/Os with processor
? Study the interrupt performance
LIST OF EXPERIMENTS:
1. Study of ARM evaluation system
2. Interfacing ADC and DAC
3. Interfacing LED and PWM
4. Interfacing real time clock and serial port
5. Interfacing keyboard and LCD
6. Interfacing EPROM and interrupt
7. Mailbox
8. Interrupt performance characteristics of ARM and FPGA
9. Flashing of LEDS
10. Interfacing stepper motor and temperature sensor
11. Implementing zigbee protocol with ARM



? Write programs in ARM for a specific Application
? Interface memory and Write programs related to memory operations
? Interface A/D and D/A convertors with ARM system
? Analyze the performance of interrupt
? Write programmes for interfacing keyboard, display, motor and sensor.
? Formulate a mini project using embedded system
COURSE OBJECTIVES
COURSE OUTCOMES
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
CONTENTS
Sl. No. Name of the Experiment Page No.
CYCLE 1 ? EXPERIMENTS
1
Study of ARM evaluation system 7
2
Analog to Digital Convertor interfacing 16
3
Generation of ramp and square wave using on-Chip DAC 19
4
LED dimming using PWM 22
5
Interfacing real time clock and serial port 25
6
Interfacing keypad and LCD 28
7
Interfacing EPROM and interrupt 31
CYCLE 2 ? EXPERIMENTS
8 Implementation of Mailbox Function using LPC 2148 35
9 Interrupt Performance Characteristics of Arm and FPGA 37
10 Flashing of LEDs 40
11 Stepper Motor Interface with ARM ? 7 LPC2148 43
12 LM35 Temperature Sensor Interface with ARM ? 7 LPC2148 47
13
Implementation of Wireless Communication Protocol using ZIGBEE Wireless
Module
50
ADDITIONAL EXPERIMENTS BEYOND THE SYYLABUS
14 Buzzer Interface with ARM ? 7 54
15 Relay interface with ARM? 7 57
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Expt. No. 1 STUDY OF ARM EVALUATION SYSTEM
Aim:
To study the building blocks of ARM7 system, its features, pin configuration and the components
required for functioning of ARM controller.
Architecture Overview:
A RISC-based computer design approach means ARM processors require significantly fewer transistors
than typical processors in average computers. This approach reduces cost, heat and power usage. These
are desirable traits for light, portable, battery-powered devices (smart phones, laptops, tablet and notepad
computers), and other embedded systems. A simpler design facilitates more efficient multi-core CPUs and
higher core counts at lower cost, providing higher processing power and improved energy efficiency for
servers and supercomputers.
In 2005, about 98% of all mobile phones sold used at least one ARM processor. The low power
consumption of ARM processors has made them very popular: 37 billion ARM processors have been
produced as of 2013, up from 10 billion in 2008. The ARM architecture (32-bit) is the most widely used
architecture in mobile devices, and most popular 32-bit one in embedded systems.
According to ARM Holdings, in 2010 alone, producers of chips based on ARM architectures
reported shipments of 6.1 billion ARM based processors, representing 95% of smart phones, 35% of digital
televisions and set-top boxes and 10% of mobile computers. It is the most widely used 32-bit instruction set
architecture in terms of quantity produced.
LPC 2148:
LPC2148 is the widely used IC from ARM-7 family. It is manufactured by Philips and it is pre-loaded
with many inbuilt peripherals making it more efficient and a reliable option for the beginners as well as high
end application developer.




8 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Features of LPC214x series controllers:
1. 8 to 40 kB of on-chip static RAM and 32 to 512 kB of on-chip flash program memory.128 bit wide
interface/accelerator enables high speed 60 MHz operation.
2. In-System/In-Application Programming (ISP/IAP) via on-chip boot-loader software. Single flash sector or
full chip erase in 400 ms and programming of 256 bytes in 1ms.
3. Embedded ICE RT and Embedded Trace interfaces offer real-time debugging with the on-chip Real
Monitor software and high speed tracing of instruction execution.
4. USB 2.0 Full Speed compliant Device Controller with 2 kB of endpoint RAM. In addition, the LPC2146/8
provides 8 kB of on-chip RAM accessible to USB by DMA.
5. One or two (LPC2141/2 vs. LPC2144/6/8) 10-bit A/D converters provide a total of 6/14analog inputs, with
conversion times as low as 2.44 us per channel.
6. Single 10-bit D/A converter provides variable analog output.
7. Two 32-bit timers/external event counters (with four capture and four compare channels each), PWM unit
(six outputs) and watchdog.
8. Low power real-time clock with independent power and dedicated 32 kHz clock input.
9. Multiple serial interfaces including two UARTs (16C550), two Fast I2C-bus (400 kbit/s), SPI and SSP with
buffering and variable data length capabilities.
10. Vectored interrupt controller with configurable priorities and vector addresses.
11. Up to 45 of 5 V tolerant fast general purpose I/O pins in a tiny LQFP64 package.
12. Up to nine edge or level sensitive external interrupt pins available.
13. On-chip integrated oscillator operates with an external crystal in range from 1 MHz to30 MHz and with
an external oscillator up to 50 MHz
14. Power saving modes include Idle and Power-down.
15. Individual enable/disable of peripheral functions as well as peripheral clock scaling for additional power
optimization.
16. Processor wake-up from Power-down mode via external interrupt, USB, Brown-Out Detect (BOD) or
Real-Time Clock (RTC).




9 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


First Step- Hardware Requirement:
Pin configuration of LPC 2148.

Hardware requirement of LPC2148:
1. LPC2148 need minimum below listed hardware to work properly
2. Power Supply
3. Crystal Oscillator
4. Reset Circuit
5. RTC crystal oscillator
6. UART
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Power Supply:
LPC2148 works on 3.3 V power supply. LM 117 can be used for generating 3.3 V supply. However,
basic peripherals like LCD, ULN 2003 (Motor Driver IC) etc. works on 5V. So AC mains supply is converted
into 5V using below mentioned circuit and after that LM 117 is used to convert 5V into 3.3V.
Block diagram of power Supply

Transformer: It is used to step down 230V AC to 9V AC supply and provides isolation between power grids
and circuit.
Rectifier: It is used to convert AC supply into DC.
Filter: It is used to reduce ripple factor of DC output available from rectifier end.
Regulator: It is used to regulate DC supply output.

11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Circuit Diagram:

Regulator IC 7805 is used to provide fix 5V dc supply.
LM 117 is used for generating 3.3V supply from 5V.

12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Calculations:

From the datasheet of LM117

Taking R 2= 240?, we get R 1=392?
Reset Circuit:
Reset button is essential in a system to avoid programming pitfalls and manually bring back the system
to the initialization mode. MCP 130T is a special IC used for providing stable RESET signal to LPC 2148.


13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Oscillator Circuit:

The value of capacitors C20 & C21 depends upon the frequency of crystal Y3. General circuit and
its equivalent circuit is as shown below.

14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Recommended values are as shown in table:

UART:
LPC 2148 has inbuilt ISP which means we can program it within the system using serial
communication on COM0. It has also COM1 for serial communication. MAX 232/233 IC must be used for
voltage logic conversion. Related connections are as given below.

Once the above listed circuit design is ready, we are ready to go further.



15 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Result:
ARM Evaluation system and the configuration of LPC2148 has been studied fully. The minimal setup
required for the functioning of the ARM processor is studied.
Outcomes:
1. Able to understand the ARM controller, its basic components inside and its features.
2. Able to know the components required for the working of ARM LPC2148

Applications:
ARM controller LPC2148 is used in no. of devices such as
1. Smart phones
2. Net books
3. E Readers
4. Digital TV
5. Home Gateways


1. What are the basic units of ARM 7?
2. What is the address system supported by ARM?
3. Define - RISC
4. What are the instructions used to access the memory in ARM?
5. What are the basic units of Microprocessor?
6. What is an Instruction?
7. What is clock cycle?
8. Define - Pipelining
9. What is cache miss?
10. What is meant by memory mapped I/O?
11. Define ? interrupt
12. What is meant by Exception?
13. What is meant by little ? endian mode?
14. What is meant by big ? endian mode?
15. What is the function of CPSR?
16. What is register - indirect addressing?
Viva-voce




16 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 2 ANALOG TO DIGITAL CONVERTOR
INTERFACING
Aim:
To write an embedded c program for interfacing an on chip ADC with LPC2148 ARM processor and
convert the given input voltage into corresponding decimal values.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. PC
Theory:
Analog to Digital converter (ADC) is a device that converts continuously varying analog signals from
instruments that monitor such conditions as movement, temperature, sound, etc., into binary code for the
computer. It may be either a single chip or can be one circuit within a chip. Analog to Digital conversion is
the process of changing continuously varying data, such as voltage, current, or shaft rotation, into discrete
digital quantities that represent the magnitude of the data compared to a standard or reference at the
moment the conversion is made. According to the method of conversion, ADCs can be classified into
Direct-Conversion ADCs, Successive Approximation ADCs, Integrating ADC and Sigma-Delta ADCs.
The LPC 2148 has 10-bit successive approximation analog to digital converter. Basic clocking for the
A/D converters is provided by the VPB clock. A programmable divider is included in each converter, to
scale this clock to the 4.5 MHz (max) clock needed by the successive approximation process. A fully
accurate conversion requires 11 of these clocks. The ADC cell can measure the voltage on any of the ADC
input signals. It is noted that these analog inputs are always connected to their pins, even if the Pin function
Select register assigns them to port pins. A simple self-test of the ADC can be done by driving these pins
as port outputs.



17 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Circuit diagram:




18 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus, an embedded c program for interfacing on-chip ADC with ARM processor is written and
executed. The decimal values of the converted voltage are seen in the WinXTalk screen.
Outcome:
Able to interface A/D convertors with ARM system and check its working by connecting an analog
quantity as input.
Applications:
1. ADC used in MODEM for converting analog signals to digital.
2. A fast video ADC in TV tuner cards
3. ADC used in digital storage oscilloscopes
4. Used in music reproduction technology.
5. Used in DSP if input is analog


1. What are the ADC operating modes in LPC2148?
2. What is meant by conversion time?
3. Why are internal ADCs preferred over external ADCs?
4. Why has 16-bit ADC more resolution than from 10-bit and 8-bit ADC?
5. What are ADC & its Resolution?
6. What is Burst conversion mode?
7. What is the function of A/D Control Register?
8. What is the function of A/D Global Data Register?
9. What is the function of A/D Status Register?
10. What is analog-to-digital (ADC) conversion error?
11. What is the function of Sample-and-hold circuits in analog-to digital converters?
12. What is the disadvantage of the flash analog-to digital converter?
Viva-voce




19 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 3 GENERATION OF RAMP AND SQUARE
WAVE USING ON-CHIP DAC
Aim:
To write and execute an embedded c program to generate ramp wave and square wave using on-chip
DAC of LPC2148 ARM controller.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
A digital-to-analog converter is a device for converting a digital signal into an analog signal (current or
voltage). Digital-to-Analog Converters are the interface between the abstract digital world and the analog
real world. Simple switches, a network of resistors, current sources or capacitors may be used to
implement this conversion. A DAC inputs a binary number and outputs an analog voltage or current signal.
The Microchip Technology Inc. MCP4921 is 2.7 ? 5.5V, low-power, 12-Bit Digital-to-Analog Converter
(DAC) with SPI interface. The MCP4921 DAC provides high accuracy and low noise performance for
industrial applications where calibration or compensation of signals is required. With an SPI connection
there is always one master device (usually a microcontroller) which controls the peripheral devices.
Typically there are three lines common to all the devices,
Master In Slave Out (MISO) ? The Slave line for sending data to the master,
Master Out Slave In (MOSI) ? The Master line for sending data to the peripherals,
Serial Clock (SCK) ? The clock pulses which synchronize data transmission generated by the
master and slave
Slave Select pin ? the pin on each device that the master can use to enable and disable specific
devices. When a device Slave Select pin is low, it communicates with the master. When it is high, it ignores
the master. In SPI, the clock signal is controlled by the master device LPC2148. All data is clocked in and
out using this pin. These lines need to be connected to the relevant pins on the LPC21xx processor. Any
unused GIO pin can be used for CS, instead pull this pin high. Conversion speed is the time it takes for the



20 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

DAC to provide an analog output when the digital input word is changed. The MCP4291 DAC ? SPI
connections with LPC21xx have four I/O lines (P0.4 ? P0.7) required. The analog output is generated by
using these four lines.
Circuit diagram:


Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the embedded c programs for generating ramp wave and square wave using ARM LPC2148 are
written and executed successfully and the waveforms are viewed in oscilloscope.
Outcome:
Able to program the DAC in-built inside the ARM controller and get the waveforms using it.




21 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications :
1. DAC used in Audio amplifier.
2. Video encoder
3. Display electronics
4. Data Acquistion systems
5. Motor control



1. What are the features of LPC2148 DAC?
2. What is the function of DAC register?
3. Which pin provides a voltage reference level for the D/A converter?
4. What are the applications of DAC in signal processing applications?
5. What is GIO?
6. What is the resolution of a digital-to-analog converter (DAC)?
7. What is the major advantage of the R/2R ladder digital-to-analog (DAC), as compared to a binary-
weighted digital-to-analog DAC converter?
8. What is the resolution of a 0?5 V 6-bit digital-to-analog converter (DAC) ?
9. What are DAC configurations?
10. What are the different types of DAC Circuits?
11. What are the Limitations of the Binary Weighted DAC?
12. What are the General DAC Characteristics?
13. Define reference voltage in DAC.
14. What is full scale voltage?
15. What is settling time?
VIVA-VOCE




22 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 4 LED DIMMING USING PWM

Aim:
To write an embedded c program for implementing PWM using ARM controller and verify the same by
dimming of LEDs.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
LPC2148 supports 2 types of PWM:
1) Single Edge PWM ? Pulse starts with new Period i.e pulse is always at the beginning
2) Double Edge PWM ? Pulse can be anywhere within the Period
A PWM block, like a Timer block , has a Timer Counter and an associated Pre-scale Register along
with Match Registers. These work exactly the same way as in the case of Timers. Match Registers 1 to 6
(except 0) are pinned on LPC214x i.e. the corresponding outputs are diverted to actual Pins on LPC214x
MCU. The PWM function must be selected for these Pins to get the PWM output.
The basic setup is to simply replace Servo by a LED and no external 5V source is needed. The
anode of LED is connected to P0.0 and cathode to ground. Pulse Widths corresponding to the switches
connected to P0.1/2/3/4 will be 2.5ms/5ms/7.5ms/10ms respectively. As the Pulse Width Increases LED
will keep on getting brighter and the reverse will happen if Pulse Width is decreased.



23 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus embedded c program for implementing Pulse Width Modulation is written and executed and
output has been verified in LED display.
Outcome:
Able to implement PWM using the ARM controller and verify the same in the form of dimming of
LEDS.



24 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Applications :
1. In Visual signals to covey a message
2. Illumination where light is reflected from objects
3. In Narrow band sensors



1. What factors determine the LED dimming performance?
2. What is meant by analog dimming?
3. What is flickering effect?
4. What is the factor determines dimming of the LED
5. Why Silicon is not suitable for fabrication of light-emitting diodes?
6. Why Silicon diode is less suited for low voltage rectifier operation?
7. What is the principle of zener diode?
8. What are the materials used to make LED?
9. What type of diodes is used in FM receivers?
10. Which diode suffers an avalanche breakdown?
11. What happens if the junction temperature of LED is increased?
12. How a transfer characteristic of a diode does is related?
13. What is the requirement of a clipping action of a diode?
14. What type of rectifier circuit requires four diodes?
15. Why are the pulse width modulated outputs required in most of the applications?
16. How do the variations in an average value get affected by PWM period?
17. Name the common formats available for LED display.
18. What are the types of seven segment display?
19. What is PWM?
20. What are the applications of PWM?

Viva-voce




25 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 5 INTERFACING REAL TIME CLOCK
AND SERIAL PORT
Aim:
To write and execute an embedded c program to interface DS1307 RTC using I2C protocol with ARM
controller
Apparatus Required:
1. LPC2148 ARM development board
2. Stepper motor
3. Interfacing cables
4. PC
Theory:
A clock, which is based on the interrupts at preset intervals, is Real Time Clock (RTC). An interrupt
service routine executes on each timeout (overflow) of this clock. This timing device once started never
resets or never reloaded with another value. Once it is set, it is not modified later. It is used in a system to
save the time and date.













26 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the program for interfacing real time clock with ARM controller is written and executed and the
date and time are verified on the screen.
Outcome:
Able to interface real time clock DS1307 with ARM controller and thereby display date and time
Applications :
1. I2C In ARM and PIC microcontrollers
2. Used as serial communication protocol with MASTER and SLAVE operation.

27 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
27 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00




1. What is I2C and how does it work?
2. What are the features of I2C in LPC2148 ARM7 microcontroller?
3. What is the function of I2C0CONSET register?
4. What is I2C0STAT?
5. What is the function of I2C0 Data Register?
6. What is RTC?
7. List the advantages of RTC
8. Through which port the date and time is displayed in RTC?
9. What is a serial port?
10. List the registers used to transfer data in serial port.
11. List the modes used for data transmission.
12. What is a simplex mode?
13. Which pin is used to transmit a character?
14. What is the baud rate of serial port?
15. What is the disadvantage of RS-232C?














Viva-voce




28 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 6 INTERFACING KEYPAD AND LCD

Aim:
To write an embedded c program to interface 4 x 4 matrix keypad with ARM processor and display the
pressed key in an LCD.
Apparatus Required:
1. LPC2148 ARM development board
2. Interfacing cables
3. PC
Theory:

In matrix keypad, keys are connected in rows and columns. When any switch is pressed, rows and
columns come into contact, which is that detected by controller to identify which key has been pressed. A
4?4 matrix keypad consists of 4 rows and 4 columns. There is a switch connecting each row and column.
So the combinations of rows and columns make up the 16 inputs.Initially all the switches are open (not
connected). When any one button is pressed, the switch is closed (connected),hence there is a connection
between the row and column. The first 4 pins are connected to the column as INPUT. The other 4 pins are
connected to the row as OUTPUT. Matrix keypad is a good substitution to normal push button.












29 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Circuit Diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus program for interfacing matrix keypad with ARM controller is written and executed and the key
pressed is seen in the LCD.



30 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Outcome:
Able to interface keypad with ARM controller and see the pressed key in the LCD display.
Applications :
1. Used in password based door locking system
2. Security system with user changeable
3. Used in laptops, computer games
4. Used in portable video games and cell phones



1. What is Matrix keypad?
2. What is the concept behind keypad interface?
3. What are the functions of pull- up resistors?
4. What is key de bouncing?
5. List the steps involved when the key in a 4 x 4 keyboard matrix is being pressed.
6. What is the value obtained if no key is pressed?
7. What kind of interrupt is generated if a key has to be operated in an interrupt mode?
8. How will you identify that the key is pressed?
9. What are the steps involved in Keyboard Interfacing?
10. List the registers used to store the keyboard, display modes and other operations programmed by
CPU.
11. Name the mode when a data is entered from the left side of the display unit.
12. How many rows and columns are present in a 16 x 2 alphanumeric LCD?
13. How many data lines are there in a 16 x 2 alphanumeric LCD?
14. Which pin of the LCD is used for adjusting its contrast?
15. Which command of an LCD is used to shift the entire display to the right?
16. Which command is used to select the 2 lines and 5 x 7 matrix of an LCD?
17. What changes are to be made to send data to an LCD?
18. For reading operation from an LCD what changes in the software are introduced?
19. Which instruction is used to select the first row first column of an LCD?
Viva-voce

31 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
31 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Expt. No. 7 INTERFACING EEPROM AND INTERRUPT

Aim:
To write a program to interface EEPROM using I2C protocol with ARM controller and retrieve the stored
messages inside EEPROM.
Apparatus Required:
1. LPC2148 ARM development board
2. Interfacing cables
3. PC
Theory:
I2C (Inter Integrated Circuit):
The I2C (Inter-IC) bus is a bi-directional two-wire serial bus that provides a communication link between
integrated circuits (ICs).I2C is a synchronous protocol that allows a master device to initiate communication
with a slave device. Data is exchanged between these devices.
EEPROM:
EEPROM (electrically erasable programmable read-only memory) is user-modifiable read-only
memory (ROM) that can be erased and reprogrammed (written to) repeatedly through the application of
higher than normal electrical voltage. It is a type of non-volatile memory used in computers and other
electronic devices to store small amounts of data that must be saved when power is removed, e.g.,
calibration tables or device configuration
Read, write and Erase EEPROM by using I2C in LPC2148 Primer Board. Wiring up an I2C based
EEPROM to the I2C port is relatively simple. The basic operation of the I2C based EEPROM's is to send a
command, such as WRITE, followed by an address and the data. In WRITE operation, the EEPROM is
used to store the data. In LPC2148 Primer Kit, 2 nos. of EEPROM lines are controlled by I2C Enabled
drivers. I2C Lines serial clock SCL (P0.2), serial data SDA (P0.3) connected to the I2C based serial
EEPROM IC. The EEPROM read & write operations are done in LPC2148 Primer Kit by using these SDA &
SCL I2C lines.
32 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
32 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To down load and run this program: Refer General procedure given in Page No: 60
Result:
Thus, the program for interfacing I2C based EEPROM with ARM processor has been written and
executed successfully and the memory content is verified on Win x talk terminal.
Outcome:
Able to interface memory ICs with ARM controller and perform the read and write operations.



33 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications:
1. ROM used in toys,automobiles to store data when power is off
2. In calculators and peripheral devices
3. In laser printers
4. And also in embedded systems where program need not to be changed.


1. How does I2C protocol work?
2. What is EEPROM?
3. What is meant by master slave mode?
4. What is meant by non-volatile memory?
5. What is an interrupt?
6. How does an interrupt request works?
7. What is a nested interrupt?
8. What are the registers used for enabling an interrupt?
9. What is PROM?
10. What is EPROM?
11. What is mask ROM?
12. Which memory allows simultaneous read and write operations?
13. Which memory has the shortest access times?
14. Which interrupt has the highest priority?
15. What is non maskable interrupt?
16. Which is the first level of memory access by the microprocessor?
17. List the types of cache memories.
18. What is the use of an interrupt?
19. What is the use of converting an interrupt to threads in a microprocessor?
20. What are the bits used to control an external interrupts?


Viva-voce




34 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00










CYCLE 2 - EXPERIMENTS




35 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 8 IMPLEMENTATION OF MAILBOX FUNCTION
USING LPC2148
Aim:
To create a mailbox in Micro C/OS ? II using LPC2148 ARM Controller
Apparatus Required:
1. LPC2148 ARM development board
2. Interfacing cables
3. PC
Theory:
System or the user code can send a message by the core services. A typical mail message, also
known as the exchange of information, refers to a task or an ISR using a pointer variable, through the core
services to put a message (that is, a pointer) into the mailbox. Similarly, one or more tasks can receive this
message by the core services. The tasks sending and receiving the message promise that the content that
the pointer points to is just that piece of message.
The mailbox of CooCox CoOS is a typical message mailbox which is composed of two parts: one is
the information which expressed by a pointer of void; the other is the waiting list which composed of the
tasks waiting for this mailbox. The waiting list supports two kinds of sorting: FIFO and preemptive priority.
The sorting mode is determined by the user when creating the mailbox.
Procedure:
To Edit / Compile / generate Hex file: Refer General procedure in Page No: 58
To down load and run this program: Refer General procedure in Page No: 60
Result:
Thus, the mailbox was created in Micro C/OS ?II and implemented using LPC2148.
Outcome:
Able to understand the concept of mail box in embedded systems and its significance in real time
systems





36 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications:
1. Used in Acorn RISC PC700
2. Used in ZIPIT wireless messenger
3. Used in Meizu M6 MINI player


1. What is IPC?
2. Define Queue.
3. What are the different types of mail box functions?
4. What is half duplex mode?
5. How many synchronous and asynchronous modes are there in serial port?
6. List the bits used to generate serial port interrupt
7. What is branch prediction?
8. Mention any two features of ?C/OS ? II.
9. Write the function for creating task in ?C/OS ? II.
10. Mention any two support devices for ?C/OS ? II.
11. How many user tasks can be handled by ?C/OS ? II?



















Viva-voce




37 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 9 INTERRUPT PERFORMANCE
CHARACTERISTICSOF ARM AND FPGA

Aim:
To study the interrupt performance characteristics of ARM and FPGA by using ARM controller kit and
FPGA kit separately.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
External Interrupts:
An interrupt caused by an external source such as the computer operator, external sensor or
monitoring device, or another computer. Interrupts are special events that require immediate attention.
Interfacing External Interrupts with LPC2148:
When an external interrupt signal occurs in LPC2148 Primer Board, the message "LOW" will be
displayed on PC. The interrupt signal occurs using switches. When the switch is pressed to LOW, then the
external interrupt occurs. The Vectored Interrupt Controller (VIC) takes 32 interrupt request inputs and
programmable assigns them into 3 categories, FIQ, vectored IRQ, and non-vectored IRQ. The ARM7
LPC2148 Primer board has two numbers of External Interrupts, connected with I/O Port lines (P0.14 &
P0.15) as switches.







38 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00



Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60


39 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
39 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Result:
Thus the interrupt performance characteristics of ARM and FPGA are studied. On comparison, ARM
counts at slow speed because it consumes more instruction cycle and FPGA is more efficient for servicing
and processing external interrupt pulses.
Outcome:
Able to understand the performance characteristics of ARM and FPGA while dealing with
interrrupts
Applications:
1. Used in random logic and SPLDs
2. Used in cryptography and filtering
3. In medical imaging
4. In bioinformatics and voice recognition



1. When is an Interrupt Request received?
2. What is ISR?
3. How do you initialize interrupt?
4. What is Vectored Interrupt Controller?
5. What are the kinds of protection available for SRAMS ?
6. What is interrupt pipelining?
7. What is pipeline shutdown?
8. What is branch prediction?
9. What is the use of Neon Floating point engine?
10. What is the use of ?vectorize option?
11. What is PTM?
12. What is ITM?
13. What is ETM?
14. What is I2S interface?
15. What is the use of ?SWI? in ARM assembly?

Viva-voce




40 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 10 FLASHING OF LEDS
Aim:
To write and execute an embedded c program to display LEDs using LPC 2148 ARM controller
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
Theory:
LED (Light Emitting Diodes) is the most commonly used components, usually for displaying pins digital
states. Typical uses of LEDs include alarm devices, timers and confirmation of user input such as a mouse
click or keystroke. Interfacing LED with LPC2148 Flash a LED using LPC2148 Primer Board. It works by
turning ON a LED & then turning it OFF & then looping back to START. However the operating speed of
microcontroller is very high so the flashing frequency will also be very fast to be detected by human eye.
The ARM7 LPC2148 Primer board has eight numbers of point LEDs, connected with I/O Port lines (P1.16 ?
P1.23) to make port pins high.










41 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00



Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus program for flashing of LEDs is written and executed using ARM controller LPC2148.



42 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Outcome:
Able to interface LED lights via the input output port and control them
Applications:
1. In Illumination
2. As status indicators in equipments
3. Stadium displays and dynamic decorative displays



1. What is seven segment displays?
2. What are the different configurations of LED?
3. What is the function of GPIO?
4. What are the Pins which are used to connect LEDs?
5. How to identify 'Polarity' of LED?
6. Differentiate LED from LCD.
7. What is a use of Jumper?
8. How many numbers of LEDs present in Primer board?
9. Where LEDs are used?
10. What is the use of flash magic software?
11. Which port is used in ARM 7 processor kit?
12. Which diode suffers an avalanche breakdown?
13. What happens if the junction temperature of LED is increased?
14. What is an anti collision rate light?
15. What is fail-safe conditions






Viva-voce




43 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 11 STEPPER MOTOR INTERFACE WITH
ARM -7 LPC2148
Aim:
To write a program to interface stepper motor using ARM processor and control the movement of motor
in either directions.
Apparatus Required:
1. LPC2148 ARM development board
2. Stepper motor
3. Interfacing cables
4. PC
Theory:
A stepper motor can be viewed as a DC motor with number of poles (on both rotor and stator).
Additionally, soft magnetic material with many teeth on the rotor and stator cheaply multiplies the number of
poles (reluctance motor). Like an AC synchronous motor, it is ideally driven by sinusoidal current, allowing
a step less operation, but this puts some burden on the controller. When using an 8-bit digital controller,
256 micro steps per step are possible. As a digital-to-analog converter produces unwanted ohmic heat in
the controller, pulse-width modulation is used to regulate the mean current. Simpler models switch voltage
only for doing a step, thus needing an extra current limiter: for every step, they switch a single cable to the
motor.
The idea is to connect the output pins of the driver to 4 transistors. The transistor must be
grounded at the emitter and the driver pin must be connected to the base. Collector is connected to the coil
wire of the motor. Stepper motors are rated by the torque they produce. Synchronous electric motors using
soft magnetic materials (having a core) have the ability to provide position holding torque (called detent
torque, and sometimes included in the specifications) while not driven electrically. To achieve full rated
torque, the coils in a stepper motor must reach their full rated current during each step. The voltage rating
(if there is one) is almost meaningless. The motors also suffer from EMF, which means that once the coil is
turned off it starts to generate current because the motor is still rotating. There needs to be an explicit way
to handle this extra current in a circuit otherwise it can cause damage and affect performance of the motor.
44 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
44 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus stepper motor interface with ARM processor has been successfully implemented and the motor is
controlled in clockwise and anticlockwise direction.
Outcome:
Able to interface the stepper motor with ARM controller and thereby create some rotational
movements





45 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Applications:
3. Used for precise positioning with a motor
4. Used in hard disk drives, robotics
5. Used in telescopes and toys







1. Define GPIO.
2. What is the function of ULN2803?
3. How LPC2148 control stepper motor?
4. Which I/O port lines used to rotate stepper motor?
5. How stepper motor reacts for each pulse it receives?
6. What is serial communication?
7. What is parallel communication?
8. What is stepper motor & why it is named so?
9. How can be step angle is calculated?
10. What are the advantages and disadvantages of parallel communication?
11. What does instruction-pipelining mean?
12. What is the power supply required for ARM processor?
13. What is a unit for torque?
14. What is RPM rating for a DC motor?
15. What device that is used to obtain an accurate position control of rotating shafts in terms of steps?
Viva-voce

FirstRanker.com - FirstRanker's Choice
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00






?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING

VII SEMESTER - R 2013

EC6711 ? EMBEDDED LABORATORY






Name : _______________________________________
Register No : _______________________________________
Section : _______________________________________
LABORATORY MANUAL



2 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00




is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and
training.

? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different
levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on
heart and soul
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

To impart professional education integrated with human values to the younger generation, so as to
shape them as proficient and dedicated engineers, capable of providing comprehensive solutions to the
challenges in deploying technology for the service of humanity

? To educate the students with the state-of-art technologies to meet the growing challenges of the
electronics industry
? To carry out research through continuous interaction with research institutes and industry, on
advances in communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning,
innovation and ethical practices
VISION
VISION
MISSION
MISSION



3 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

PROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To provide students with a solid foundation in Mathematics, Science and fundamentals of
engineering, enabling them to apply, to find solutions for engineering problems and use this knowledge
to acquire higher education
2. Core Competence
To train the students in Electronics and Communication technologies so that they apply their
knowledge and training to compare, and to analyze various engineering industrial problems to find
solutions
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice which
enables them to find solutions for the real time problems in industry, and to design products
4. Professionalism
To inculcate professional and effective communication skills, leadership qualities and team spirit in
the students to make them multi-faceted personalities and develop their ability to relate engineering
issues to broader social context
5. Lifelong Learning/Ethics
To demonstrate and practice ethical and professional responsibilities in the industry and society in
the large, through commitment and lifelong learning needed for successful professional career


4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
PROGRAMME OUTCOMES (POs)
a) To demonstrate and apply knowledge of Mathematics, Science and engineering fundamentals in
Electronics and Communication Engineering field
b) To design a component, a system or a process to meet the specific needs within the realistic
constraints such as economics, environment, ethics, health, safety and manufacturability
c) To demonstrate the competency to use software tools for computation, simulation and testing of electronics
and communication engineering circuits
d) To identify, formulate and solve electronic and communication engineering problems
e) To demonstrate an ability to visualize and work on laboratory and multidisciplinary tasks
f) To function as a member or a leader in multidisciplinary activities
g) To communicate in verbal and written form with fellow engineers and society at large
h) To understand the impact of Electronics and Communication Engineering in the society and demonstrate
awareness of contemporary issues and commitment to give solutions exhibiting social responsibility
i) To demonstrate professional & ethical responsibilities
j) To exhibit confidence in self-education and ability for lifelong learning
k) To participate and succeed in competitive exams


5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
SYLLABUS

? Learn the working of ARM processor
? Understand the Building Blocks of Embedded Systems
? Learn the concept of memory map and memory interface
? Know the characteristics of Real Time Systems
? Write programs to interface memory, I/Os with processor
? Study the interrupt performance
LIST OF EXPERIMENTS:
1. Study of ARM evaluation system
2. Interfacing ADC and DAC
3. Interfacing LED and PWM
4. Interfacing real time clock and serial port
5. Interfacing keyboard and LCD
6. Interfacing EPROM and interrupt
7. Mailbox
8. Interrupt performance characteristics of ARM and FPGA
9. Flashing of LEDS
10. Interfacing stepper motor and temperature sensor
11. Implementing zigbee protocol with ARM



? Write programs in ARM for a specific Application
? Interface memory and Write programs related to memory operations
? Interface A/D and D/A convertors with ARM system
? Analyze the performance of interrupt
? Write programmes for interfacing keyboard, display, motor and sensor.
? Formulate a mini project using embedded system
COURSE OBJECTIVES
COURSE OUTCOMES
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
CONTENTS
Sl. No. Name of the Experiment Page No.
CYCLE 1 ? EXPERIMENTS
1
Study of ARM evaluation system 7
2
Analog to Digital Convertor interfacing 16
3
Generation of ramp and square wave using on-Chip DAC 19
4
LED dimming using PWM 22
5
Interfacing real time clock and serial port 25
6
Interfacing keypad and LCD 28
7
Interfacing EPROM and interrupt 31
CYCLE 2 ? EXPERIMENTS
8 Implementation of Mailbox Function using LPC 2148 35
9 Interrupt Performance Characteristics of Arm and FPGA 37
10 Flashing of LEDs 40
11 Stepper Motor Interface with ARM ? 7 LPC2148 43
12 LM35 Temperature Sensor Interface with ARM ? 7 LPC2148 47
13
Implementation of Wireless Communication Protocol using ZIGBEE Wireless
Module
50
ADDITIONAL EXPERIMENTS BEYOND THE SYYLABUS
14 Buzzer Interface with ARM ? 7 54
15 Relay interface with ARM? 7 57
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Expt. No. 1 STUDY OF ARM EVALUATION SYSTEM
Aim:
To study the building blocks of ARM7 system, its features, pin configuration and the components
required for functioning of ARM controller.
Architecture Overview:
A RISC-based computer design approach means ARM processors require significantly fewer transistors
than typical processors in average computers. This approach reduces cost, heat and power usage. These
are desirable traits for light, portable, battery-powered devices (smart phones, laptops, tablet and notepad
computers), and other embedded systems. A simpler design facilitates more efficient multi-core CPUs and
higher core counts at lower cost, providing higher processing power and improved energy efficiency for
servers and supercomputers.
In 2005, about 98% of all mobile phones sold used at least one ARM processor. The low power
consumption of ARM processors has made them very popular: 37 billion ARM processors have been
produced as of 2013, up from 10 billion in 2008. The ARM architecture (32-bit) is the most widely used
architecture in mobile devices, and most popular 32-bit one in embedded systems.
According to ARM Holdings, in 2010 alone, producers of chips based on ARM architectures
reported shipments of 6.1 billion ARM based processors, representing 95% of smart phones, 35% of digital
televisions and set-top boxes and 10% of mobile computers. It is the most widely used 32-bit instruction set
architecture in terms of quantity produced.
LPC 2148:
LPC2148 is the widely used IC from ARM-7 family. It is manufactured by Philips and it is pre-loaded
with many inbuilt peripherals making it more efficient and a reliable option for the beginners as well as high
end application developer.




8 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Features of LPC214x series controllers:
1. 8 to 40 kB of on-chip static RAM and 32 to 512 kB of on-chip flash program memory.128 bit wide
interface/accelerator enables high speed 60 MHz operation.
2. In-System/In-Application Programming (ISP/IAP) via on-chip boot-loader software. Single flash sector or
full chip erase in 400 ms and programming of 256 bytes in 1ms.
3. Embedded ICE RT and Embedded Trace interfaces offer real-time debugging with the on-chip Real
Monitor software and high speed tracing of instruction execution.
4. USB 2.0 Full Speed compliant Device Controller with 2 kB of endpoint RAM. In addition, the LPC2146/8
provides 8 kB of on-chip RAM accessible to USB by DMA.
5. One or two (LPC2141/2 vs. LPC2144/6/8) 10-bit A/D converters provide a total of 6/14analog inputs, with
conversion times as low as 2.44 us per channel.
6. Single 10-bit D/A converter provides variable analog output.
7. Two 32-bit timers/external event counters (with four capture and four compare channels each), PWM unit
(six outputs) and watchdog.
8. Low power real-time clock with independent power and dedicated 32 kHz clock input.
9. Multiple serial interfaces including two UARTs (16C550), two Fast I2C-bus (400 kbit/s), SPI and SSP with
buffering and variable data length capabilities.
10. Vectored interrupt controller with configurable priorities and vector addresses.
11. Up to 45 of 5 V tolerant fast general purpose I/O pins in a tiny LQFP64 package.
12. Up to nine edge or level sensitive external interrupt pins available.
13. On-chip integrated oscillator operates with an external crystal in range from 1 MHz to30 MHz and with
an external oscillator up to 50 MHz
14. Power saving modes include Idle and Power-down.
15. Individual enable/disable of peripheral functions as well as peripheral clock scaling for additional power
optimization.
16. Processor wake-up from Power-down mode via external interrupt, USB, Brown-Out Detect (BOD) or
Real-Time Clock (RTC).




9 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


First Step- Hardware Requirement:
Pin configuration of LPC 2148.

Hardware requirement of LPC2148:
1. LPC2148 need minimum below listed hardware to work properly
2. Power Supply
3. Crystal Oscillator
4. Reset Circuit
5. RTC crystal oscillator
6. UART
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Power Supply:
LPC2148 works on 3.3 V power supply. LM 117 can be used for generating 3.3 V supply. However,
basic peripherals like LCD, ULN 2003 (Motor Driver IC) etc. works on 5V. So AC mains supply is converted
into 5V using below mentioned circuit and after that LM 117 is used to convert 5V into 3.3V.
Block diagram of power Supply

Transformer: It is used to step down 230V AC to 9V AC supply and provides isolation between power grids
and circuit.
Rectifier: It is used to convert AC supply into DC.
Filter: It is used to reduce ripple factor of DC output available from rectifier end.
Regulator: It is used to regulate DC supply output.

11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Circuit Diagram:

Regulator IC 7805 is used to provide fix 5V dc supply.
LM 117 is used for generating 3.3V supply from 5V.

12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Calculations:

From the datasheet of LM117

Taking R 2= 240?, we get R 1=392?
Reset Circuit:
Reset button is essential in a system to avoid programming pitfalls and manually bring back the system
to the initialization mode. MCP 130T is a special IC used for providing stable RESET signal to LPC 2148.


13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Oscillator Circuit:

The value of capacitors C20 & C21 depends upon the frequency of crystal Y3. General circuit and
its equivalent circuit is as shown below.

14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Recommended values are as shown in table:

UART:
LPC 2148 has inbuilt ISP which means we can program it within the system using serial
communication on COM0. It has also COM1 for serial communication. MAX 232/233 IC must be used for
voltage logic conversion. Related connections are as given below.

Once the above listed circuit design is ready, we are ready to go further.



15 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Result:
ARM Evaluation system and the configuration of LPC2148 has been studied fully. The minimal setup
required for the functioning of the ARM processor is studied.
Outcomes:
1. Able to understand the ARM controller, its basic components inside and its features.
2. Able to know the components required for the working of ARM LPC2148

Applications:
ARM controller LPC2148 is used in no. of devices such as
1. Smart phones
2. Net books
3. E Readers
4. Digital TV
5. Home Gateways


1. What are the basic units of ARM 7?
2. What is the address system supported by ARM?
3. Define - RISC
4. What are the instructions used to access the memory in ARM?
5. What are the basic units of Microprocessor?
6. What is an Instruction?
7. What is clock cycle?
8. Define - Pipelining
9. What is cache miss?
10. What is meant by memory mapped I/O?
11. Define ? interrupt
12. What is meant by Exception?
13. What is meant by little ? endian mode?
14. What is meant by big ? endian mode?
15. What is the function of CPSR?
16. What is register - indirect addressing?
Viva-voce




16 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 2 ANALOG TO DIGITAL CONVERTOR
INTERFACING
Aim:
To write an embedded c program for interfacing an on chip ADC with LPC2148 ARM processor and
convert the given input voltage into corresponding decimal values.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. PC
Theory:
Analog to Digital converter (ADC) is a device that converts continuously varying analog signals from
instruments that monitor such conditions as movement, temperature, sound, etc., into binary code for the
computer. It may be either a single chip or can be one circuit within a chip. Analog to Digital conversion is
the process of changing continuously varying data, such as voltage, current, or shaft rotation, into discrete
digital quantities that represent the magnitude of the data compared to a standard or reference at the
moment the conversion is made. According to the method of conversion, ADCs can be classified into
Direct-Conversion ADCs, Successive Approximation ADCs, Integrating ADC and Sigma-Delta ADCs.
The LPC 2148 has 10-bit successive approximation analog to digital converter. Basic clocking for the
A/D converters is provided by the VPB clock. A programmable divider is included in each converter, to
scale this clock to the 4.5 MHz (max) clock needed by the successive approximation process. A fully
accurate conversion requires 11 of these clocks. The ADC cell can measure the voltage on any of the ADC
input signals. It is noted that these analog inputs are always connected to their pins, even if the Pin function
Select register assigns them to port pins. A simple self-test of the ADC can be done by driving these pins
as port outputs.



17 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Circuit diagram:




18 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus, an embedded c program for interfacing on-chip ADC with ARM processor is written and
executed. The decimal values of the converted voltage are seen in the WinXTalk screen.
Outcome:
Able to interface A/D convertors with ARM system and check its working by connecting an analog
quantity as input.
Applications:
1. ADC used in MODEM for converting analog signals to digital.
2. A fast video ADC in TV tuner cards
3. ADC used in digital storage oscilloscopes
4. Used in music reproduction technology.
5. Used in DSP if input is analog


1. What are the ADC operating modes in LPC2148?
2. What is meant by conversion time?
3. Why are internal ADCs preferred over external ADCs?
4. Why has 16-bit ADC more resolution than from 10-bit and 8-bit ADC?
5. What are ADC & its Resolution?
6. What is Burst conversion mode?
7. What is the function of A/D Control Register?
8. What is the function of A/D Global Data Register?
9. What is the function of A/D Status Register?
10. What is analog-to-digital (ADC) conversion error?
11. What is the function of Sample-and-hold circuits in analog-to digital converters?
12. What is the disadvantage of the flash analog-to digital converter?
Viva-voce




19 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 3 GENERATION OF RAMP AND SQUARE
WAVE USING ON-CHIP DAC
Aim:
To write and execute an embedded c program to generate ramp wave and square wave using on-chip
DAC of LPC2148 ARM controller.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
A digital-to-analog converter is a device for converting a digital signal into an analog signal (current or
voltage). Digital-to-Analog Converters are the interface between the abstract digital world and the analog
real world. Simple switches, a network of resistors, current sources or capacitors may be used to
implement this conversion. A DAC inputs a binary number and outputs an analog voltage or current signal.
The Microchip Technology Inc. MCP4921 is 2.7 ? 5.5V, low-power, 12-Bit Digital-to-Analog Converter
(DAC) with SPI interface. The MCP4921 DAC provides high accuracy and low noise performance for
industrial applications where calibration or compensation of signals is required. With an SPI connection
there is always one master device (usually a microcontroller) which controls the peripheral devices.
Typically there are three lines common to all the devices,
Master In Slave Out (MISO) ? The Slave line for sending data to the master,
Master Out Slave In (MOSI) ? The Master line for sending data to the peripherals,
Serial Clock (SCK) ? The clock pulses which synchronize data transmission generated by the
master and slave
Slave Select pin ? the pin on each device that the master can use to enable and disable specific
devices. When a device Slave Select pin is low, it communicates with the master. When it is high, it ignores
the master. In SPI, the clock signal is controlled by the master device LPC2148. All data is clocked in and
out using this pin. These lines need to be connected to the relevant pins on the LPC21xx processor. Any
unused GIO pin can be used for CS, instead pull this pin high. Conversion speed is the time it takes for the



20 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

DAC to provide an analog output when the digital input word is changed. The MCP4291 DAC ? SPI
connections with LPC21xx have four I/O lines (P0.4 ? P0.7) required. The analog output is generated by
using these four lines.
Circuit diagram:


Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the embedded c programs for generating ramp wave and square wave using ARM LPC2148 are
written and executed successfully and the waveforms are viewed in oscilloscope.
Outcome:
Able to program the DAC in-built inside the ARM controller and get the waveforms using it.




21 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications :
1. DAC used in Audio amplifier.
2. Video encoder
3. Display electronics
4. Data Acquistion systems
5. Motor control



1. What are the features of LPC2148 DAC?
2. What is the function of DAC register?
3. Which pin provides a voltage reference level for the D/A converter?
4. What are the applications of DAC in signal processing applications?
5. What is GIO?
6. What is the resolution of a digital-to-analog converter (DAC)?
7. What is the major advantage of the R/2R ladder digital-to-analog (DAC), as compared to a binary-
weighted digital-to-analog DAC converter?
8. What is the resolution of a 0?5 V 6-bit digital-to-analog converter (DAC) ?
9. What are DAC configurations?
10. What are the different types of DAC Circuits?
11. What are the Limitations of the Binary Weighted DAC?
12. What are the General DAC Characteristics?
13. Define reference voltage in DAC.
14. What is full scale voltage?
15. What is settling time?
VIVA-VOCE




22 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 4 LED DIMMING USING PWM

Aim:
To write an embedded c program for implementing PWM using ARM controller and verify the same by
dimming of LEDs.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
LPC2148 supports 2 types of PWM:
1) Single Edge PWM ? Pulse starts with new Period i.e pulse is always at the beginning
2) Double Edge PWM ? Pulse can be anywhere within the Period
A PWM block, like a Timer block , has a Timer Counter and an associated Pre-scale Register along
with Match Registers. These work exactly the same way as in the case of Timers. Match Registers 1 to 6
(except 0) are pinned on LPC214x i.e. the corresponding outputs are diverted to actual Pins on LPC214x
MCU. The PWM function must be selected for these Pins to get the PWM output.
The basic setup is to simply replace Servo by a LED and no external 5V source is needed. The
anode of LED is connected to P0.0 and cathode to ground. Pulse Widths corresponding to the switches
connected to P0.1/2/3/4 will be 2.5ms/5ms/7.5ms/10ms respectively. As the Pulse Width Increases LED
will keep on getting brighter and the reverse will happen if Pulse Width is decreased.



23 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus embedded c program for implementing Pulse Width Modulation is written and executed and
output has been verified in LED display.
Outcome:
Able to implement PWM using the ARM controller and verify the same in the form of dimming of
LEDS.



24 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Applications :
1. In Visual signals to covey a message
2. Illumination where light is reflected from objects
3. In Narrow band sensors



1. What factors determine the LED dimming performance?
2. What is meant by analog dimming?
3. What is flickering effect?
4. What is the factor determines dimming of the LED
5. Why Silicon is not suitable for fabrication of light-emitting diodes?
6. Why Silicon diode is less suited for low voltage rectifier operation?
7. What is the principle of zener diode?
8. What are the materials used to make LED?
9. What type of diodes is used in FM receivers?
10. Which diode suffers an avalanche breakdown?
11. What happens if the junction temperature of LED is increased?
12. How a transfer characteristic of a diode does is related?
13. What is the requirement of a clipping action of a diode?
14. What type of rectifier circuit requires four diodes?
15. Why are the pulse width modulated outputs required in most of the applications?
16. How do the variations in an average value get affected by PWM period?
17. Name the common formats available for LED display.
18. What are the types of seven segment display?
19. What is PWM?
20. What are the applications of PWM?

Viva-voce




25 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 5 INTERFACING REAL TIME CLOCK
AND SERIAL PORT
Aim:
To write and execute an embedded c program to interface DS1307 RTC using I2C protocol with ARM
controller
Apparatus Required:
1. LPC2148 ARM development board
2. Stepper motor
3. Interfacing cables
4. PC
Theory:
A clock, which is based on the interrupts at preset intervals, is Real Time Clock (RTC). An interrupt
service routine executes on each timeout (overflow) of this clock. This timing device once started never
resets or never reloaded with another value. Once it is set, it is not modified later. It is used in a system to
save the time and date.













26 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the program for interfacing real time clock with ARM controller is written and executed and the
date and time are verified on the screen.
Outcome:
Able to interface real time clock DS1307 with ARM controller and thereby display date and time
Applications :
1. I2C In ARM and PIC microcontrollers
2. Used as serial communication protocol with MASTER and SLAVE operation.

27 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
27 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00




1. What is I2C and how does it work?
2. What are the features of I2C in LPC2148 ARM7 microcontroller?
3. What is the function of I2C0CONSET register?
4. What is I2C0STAT?
5. What is the function of I2C0 Data Register?
6. What is RTC?
7. List the advantages of RTC
8. Through which port the date and time is displayed in RTC?
9. What is a serial port?
10. List the registers used to transfer data in serial port.
11. List the modes used for data transmission.
12. What is a simplex mode?
13. Which pin is used to transmit a character?
14. What is the baud rate of serial port?
15. What is the disadvantage of RS-232C?














Viva-voce




28 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 6 INTERFACING KEYPAD AND LCD

Aim:
To write an embedded c program to interface 4 x 4 matrix keypad with ARM processor and display the
pressed key in an LCD.
Apparatus Required:
1. LPC2148 ARM development board
2. Interfacing cables
3. PC
Theory:

In matrix keypad, keys are connected in rows and columns. When any switch is pressed, rows and
columns come into contact, which is that detected by controller to identify which key has been pressed. A
4?4 matrix keypad consists of 4 rows and 4 columns. There is a switch connecting each row and column.
So the combinations of rows and columns make up the 16 inputs.Initially all the switches are open (not
connected). When any one button is pressed, the switch is closed (connected),hence there is a connection
between the row and column. The first 4 pins are connected to the column as INPUT. The other 4 pins are
connected to the row as OUTPUT. Matrix keypad is a good substitution to normal push button.












29 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Circuit Diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus program for interfacing matrix keypad with ARM controller is written and executed and the key
pressed is seen in the LCD.



30 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Outcome:
Able to interface keypad with ARM controller and see the pressed key in the LCD display.
Applications :
1. Used in password based door locking system
2. Security system with user changeable
3. Used in laptops, computer games
4. Used in portable video games and cell phones



1. What is Matrix keypad?
2. What is the concept behind keypad interface?
3. What are the functions of pull- up resistors?
4. What is key de bouncing?
5. List the steps involved when the key in a 4 x 4 keyboard matrix is being pressed.
6. What is the value obtained if no key is pressed?
7. What kind of interrupt is generated if a key has to be operated in an interrupt mode?
8. How will you identify that the key is pressed?
9. What are the steps involved in Keyboard Interfacing?
10. List the registers used to store the keyboard, display modes and other operations programmed by
CPU.
11. Name the mode when a data is entered from the left side of the display unit.
12. How many rows and columns are present in a 16 x 2 alphanumeric LCD?
13. How many data lines are there in a 16 x 2 alphanumeric LCD?
14. Which pin of the LCD is used for adjusting its contrast?
15. Which command of an LCD is used to shift the entire display to the right?
16. Which command is used to select the 2 lines and 5 x 7 matrix of an LCD?
17. What changes are to be made to send data to an LCD?
18. For reading operation from an LCD what changes in the software are introduced?
19. Which instruction is used to select the first row first column of an LCD?
Viva-voce

31 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
31 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Expt. No. 7 INTERFACING EEPROM AND INTERRUPT

Aim:
To write a program to interface EEPROM using I2C protocol with ARM controller and retrieve the stored
messages inside EEPROM.
Apparatus Required:
1. LPC2148 ARM development board
2. Interfacing cables
3. PC
Theory:
I2C (Inter Integrated Circuit):
The I2C (Inter-IC) bus is a bi-directional two-wire serial bus that provides a communication link between
integrated circuits (ICs).I2C is a synchronous protocol that allows a master device to initiate communication
with a slave device. Data is exchanged between these devices.
EEPROM:
EEPROM (electrically erasable programmable read-only memory) is user-modifiable read-only
memory (ROM) that can be erased and reprogrammed (written to) repeatedly through the application of
higher than normal electrical voltage. It is a type of non-volatile memory used in computers and other
electronic devices to store small amounts of data that must be saved when power is removed, e.g.,
calibration tables or device configuration
Read, write and Erase EEPROM by using I2C in LPC2148 Primer Board. Wiring up an I2C based
EEPROM to the I2C port is relatively simple. The basic operation of the I2C based EEPROM's is to send a
command, such as WRITE, followed by an address and the data. In WRITE operation, the EEPROM is
used to store the data. In LPC2148 Primer Kit, 2 nos. of EEPROM lines are controlled by I2C Enabled
drivers. I2C Lines serial clock SCL (P0.2), serial data SDA (P0.3) connected to the I2C based serial
EEPROM IC. The EEPROM read & write operations are done in LPC2148 Primer Kit by using these SDA &
SCL I2C lines.
32 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
32 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To down load and run this program: Refer General procedure given in Page No: 60
Result:
Thus, the program for interfacing I2C based EEPROM with ARM processor has been written and
executed successfully and the memory content is verified on Win x talk terminal.
Outcome:
Able to interface memory ICs with ARM controller and perform the read and write operations.



33 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications:
1. ROM used in toys,automobiles to store data when power is off
2. In calculators and peripheral devices
3. In laser printers
4. And also in embedded systems where program need not to be changed.


1. How does I2C protocol work?
2. What is EEPROM?
3. What is meant by master slave mode?
4. What is meant by non-volatile memory?
5. What is an interrupt?
6. How does an interrupt request works?
7. What is a nested interrupt?
8. What are the registers used for enabling an interrupt?
9. What is PROM?
10. What is EPROM?
11. What is mask ROM?
12. Which memory allows simultaneous read and write operations?
13. Which memory has the shortest access times?
14. Which interrupt has the highest priority?
15. What is non maskable interrupt?
16. Which is the first level of memory access by the microprocessor?
17. List the types of cache memories.
18. What is the use of an interrupt?
19. What is the use of converting an interrupt to threads in a microprocessor?
20. What are the bits used to control an external interrupts?


Viva-voce




34 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00










CYCLE 2 - EXPERIMENTS




35 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 8 IMPLEMENTATION OF MAILBOX FUNCTION
USING LPC2148
Aim:
To create a mailbox in Micro C/OS ? II using LPC2148 ARM Controller
Apparatus Required:
1. LPC2148 ARM development board
2. Interfacing cables
3. PC
Theory:
System or the user code can send a message by the core services. A typical mail message, also
known as the exchange of information, refers to a task or an ISR using a pointer variable, through the core
services to put a message (that is, a pointer) into the mailbox. Similarly, one or more tasks can receive this
message by the core services. The tasks sending and receiving the message promise that the content that
the pointer points to is just that piece of message.
The mailbox of CooCox CoOS is a typical message mailbox which is composed of two parts: one is
the information which expressed by a pointer of void; the other is the waiting list which composed of the
tasks waiting for this mailbox. The waiting list supports two kinds of sorting: FIFO and preemptive priority.
The sorting mode is determined by the user when creating the mailbox.
Procedure:
To Edit / Compile / generate Hex file: Refer General procedure in Page No: 58
To down load and run this program: Refer General procedure in Page No: 60
Result:
Thus, the mailbox was created in Micro C/OS ?II and implemented using LPC2148.
Outcome:
Able to understand the concept of mail box in embedded systems and its significance in real time
systems





36 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications:
1. Used in Acorn RISC PC700
2. Used in ZIPIT wireless messenger
3. Used in Meizu M6 MINI player


1. What is IPC?
2. Define Queue.
3. What are the different types of mail box functions?
4. What is half duplex mode?
5. How many synchronous and asynchronous modes are there in serial port?
6. List the bits used to generate serial port interrupt
7. What is branch prediction?
8. Mention any two features of ?C/OS ? II.
9. Write the function for creating task in ?C/OS ? II.
10. Mention any two support devices for ?C/OS ? II.
11. How many user tasks can be handled by ?C/OS ? II?



















Viva-voce




37 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 9 INTERRUPT PERFORMANCE
CHARACTERISTICSOF ARM AND FPGA

Aim:
To study the interrupt performance characteristics of ARM and FPGA by using ARM controller kit and
FPGA kit separately.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
External Interrupts:
An interrupt caused by an external source such as the computer operator, external sensor or
monitoring device, or another computer. Interrupts are special events that require immediate attention.
Interfacing External Interrupts with LPC2148:
When an external interrupt signal occurs in LPC2148 Primer Board, the message "LOW" will be
displayed on PC. The interrupt signal occurs using switches. When the switch is pressed to LOW, then the
external interrupt occurs. The Vectored Interrupt Controller (VIC) takes 32 interrupt request inputs and
programmable assigns them into 3 categories, FIQ, vectored IRQ, and non-vectored IRQ. The ARM7
LPC2148 Primer board has two numbers of External Interrupts, connected with I/O Port lines (P0.14 &
P0.15) as switches.







38 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00



Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60


39 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
39 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Result:
Thus the interrupt performance characteristics of ARM and FPGA are studied. On comparison, ARM
counts at slow speed because it consumes more instruction cycle and FPGA is more efficient for servicing
and processing external interrupt pulses.
Outcome:
Able to understand the performance characteristics of ARM and FPGA while dealing with
interrrupts
Applications:
1. Used in random logic and SPLDs
2. Used in cryptography and filtering
3. In medical imaging
4. In bioinformatics and voice recognition



1. When is an Interrupt Request received?
2. What is ISR?
3. How do you initialize interrupt?
4. What is Vectored Interrupt Controller?
5. What are the kinds of protection available for SRAMS ?
6. What is interrupt pipelining?
7. What is pipeline shutdown?
8. What is branch prediction?
9. What is the use of Neon Floating point engine?
10. What is the use of ?vectorize option?
11. What is PTM?
12. What is ITM?
13. What is ETM?
14. What is I2S interface?
15. What is the use of ?SWI? in ARM assembly?

Viva-voce




40 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 10 FLASHING OF LEDS
Aim:
To write and execute an embedded c program to display LEDs using LPC 2148 ARM controller
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
Theory:
LED (Light Emitting Diodes) is the most commonly used components, usually for displaying pins digital
states. Typical uses of LEDs include alarm devices, timers and confirmation of user input such as a mouse
click or keystroke. Interfacing LED with LPC2148 Flash a LED using LPC2148 Primer Board. It works by
turning ON a LED & then turning it OFF & then looping back to START. However the operating speed of
microcontroller is very high so the flashing frequency will also be very fast to be detected by human eye.
The ARM7 LPC2148 Primer board has eight numbers of point LEDs, connected with I/O Port lines (P1.16 ?
P1.23) to make port pins high.










41 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00



Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus program for flashing of LEDs is written and executed using ARM controller LPC2148.



42 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Outcome:
Able to interface LED lights via the input output port and control them
Applications:
1. In Illumination
2. As status indicators in equipments
3. Stadium displays and dynamic decorative displays



1. What is seven segment displays?
2. What are the different configurations of LED?
3. What is the function of GPIO?
4. What are the Pins which are used to connect LEDs?
5. How to identify 'Polarity' of LED?
6. Differentiate LED from LCD.
7. What is a use of Jumper?
8. How many numbers of LEDs present in Primer board?
9. Where LEDs are used?
10. What is the use of flash magic software?
11. Which port is used in ARM 7 processor kit?
12. Which diode suffers an avalanche breakdown?
13. What happens if the junction temperature of LED is increased?
14. What is an anti collision rate light?
15. What is fail-safe conditions






Viva-voce




43 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 11 STEPPER MOTOR INTERFACE WITH
ARM -7 LPC2148
Aim:
To write a program to interface stepper motor using ARM processor and control the movement of motor
in either directions.
Apparatus Required:
1. LPC2148 ARM development board
2. Stepper motor
3. Interfacing cables
4. PC
Theory:
A stepper motor can be viewed as a DC motor with number of poles (on both rotor and stator).
Additionally, soft magnetic material with many teeth on the rotor and stator cheaply multiplies the number of
poles (reluctance motor). Like an AC synchronous motor, it is ideally driven by sinusoidal current, allowing
a step less operation, but this puts some burden on the controller. When using an 8-bit digital controller,
256 micro steps per step are possible. As a digital-to-analog converter produces unwanted ohmic heat in
the controller, pulse-width modulation is used to regulate the mean current. Simpler models switch voltage
only for doing a step, thus needing an extra current limiter: for every step, they switch a single cable to the
motor.
The idea is to connect the output pins of the driver to 4 transistors. The transistor must be
grounded at the emitter and the driver pin must be connected to the base. Collector is connected to the coil
wire of the motor. Stepper motors are rated by the torque they produce. Synchronous electric motors using
soft magnetic materials (having a core) have the ability to provide position holding torque (called detent
torque, and sometimes included in the specifications) while not driven electrically. To achieve full rated
torque, the coils in a stepper motor must reach their full rated current during each step. The voltage rating
(if there is one) is almost meaningless. The motors also suffer from EMF, which means that once the coil is
turned off it starts to generate current because the motor is still rotating. There needs to be an explicit way
to handle this extra current in a circuit otherwise it can cause damage and affect performance of the motor.
44 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
44 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus stepper motor interface with ARM processor has been successfully implemented and the motor is
controlled in clockwise and anticlockwise direction.
Outcome:
Able to interface the stepper motor with ARM controller and thereby create some rotational
movements





45 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Applications:
3. Used for precise positioning with a motor
4. Used in hard disk drives, robotics
5. Used in telescopes and toys







1. Define GPIO.
2. What is the function of ULN2803?
3. How LPC2148 control stepper motor?
4. Which I/O port lines used to rotate stepper motor?
5. How stepper motor reacts for each pulse it receives?
6. What is serial communication?
7. What is parallel communication?
8. What is stepper motor & why it is named so?
9. How can be step angle is calculated?
10. What are the advantages and disadvantages of parallel communication?
11. What does instruction-pipelining mean?
12. What is the power supply required for ARM processor?
13. What is a unit for torque?
14. What is RPM rating for a DC motor?
15. What device that is used to obtain an accurate position control of rotating shafts in terms of steps?
Viva-voce

46 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
46 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Expt. No. 12 LM35 TEMPERATURE SENSOR INTERFACE
WITH ARM-7 LPC2148
Aim:
To write a program to interface of LM35 temperature sensor to on-chip ADC of ARM controller and
display the room temperature value on the screen.
Apparatus Required:
1. LPC2148 ARM development board
2. Temperature sensor
3. Interfacing cables
4. PC
Theory:
Temperature Sensor:
The LM35 series are precision integrated-circuit temperature sensors, whose output voltage is linearly
proportional to the Celsius (Centigrade) temperature. The output of the sensor is converted to digital output
that is easy to connect with microcontroller. Temperature sensor has three terminals and required
Maximum of 5.5 V supply. This type of sensor consists of a material that performs the operation according
to temperature to vary the resistance. This change of resistance is sensed by circuit and it calculates
temperature. When the voltage increases then the temperature also rises. We can see this operation by
using a diode.







FirstRanker.com - FirstRanker's Choice
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00






?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING

VII SEMESTER - R 2013

EC6711 ? EMBEDDED LABORATORY






Name : _______________________________________
Register No : _______________________________________
Section : _______________________________________
LABORATORY MANUAL



2 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00




is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and
training.

? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different
levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on
heart and soul
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

To impart professional education integrated with human values to the younger generation, so as to
shape them as proficient and dedicated engineers, capable of providing comprehensive solutions to the
challenges in deploying technology for the service of humanity

? To educate the students with the state-of-art technologies to meet the growing challenges of the
electronics industry
? To carry out research through continuous interaction with research institutes and industry, on
advances in communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning,
innovation and ethical practices
VISION
VISION
MISSION
MISSION



3 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

PROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To provide students with a solid foundation in Mathematics, Science and fundamentals of
engineering, enabling them to apply, to find solutions for engineering problems and use this knowledge
to acquire higher education
2. Core Competence
To train the students in Electronics and Communication technologies so that they apply their
knowledge and training to compare, and to analyze various engineering industrial problems to find
solutions
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice which
enables them to find solutions for the real time problems in industry, and to design products
4. Professionalism
To inculcate professional and effective communication skills, leadership qualities and team spirit in
the students to make them multi-faceted personalities and develop their ability to relate engineering
issues to broader social context
5. Lifelong Learning/Ethics
To demonstrate and practice ethical and professional responsibilities in the industry and society in
the large, through commitment and lifelong learning needed for successful professional career


4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
PROGRAMME OUTCOMES (POs)
a) To demonstrate and apply knowledge of Mathematics, Science and engineering fundamentals in
Electronics and Communication Engineering field
b) To design a component, a system or a process to meet the specific needs within the realistic
constraints such as economics, environment, ethics, health, safety and manufacturability
c) To demonstrate the competency to use software tools for computation, simulation and testing of electronics
and communication engineering circuits
d) To identify, formulate and solve electronic and communication engineering problems
e) To demonstrate an ability to visualize and work on laboratory and multidisciplinary tasks
f) To function as a member or a leader in multidisciplinary activities
g) To communicate in verbal and written form with fellow engineers and society at large
h) To understand the impact of Electronics and Communication Engineering in the society and demonstrate
awareness of contemporary issues and commitment to give solutions exhibiting social responsibility
i) To demonstrate professional & ethical responsibilities
j) To exhibit confidence in self-education and ability for lifelong learning
k) To participate and succeed in competitive exams


5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
SYLLABUS

? Learn the working of ARM processor
? Understand the Building Blocks of Embedded Systems
? Learn the concept of memory map and memory interface
? Know the characteristics of Real Time Systems
? Write programs to interface memory, I/Os with processor
? Study the interrupt performance
LIST OF EXPERIMENTS:
1. Study of ARM evaluation system
2. Interfacing ADC and DAC
3. Interfacing LED and PWM
4. Interfacing real time clock and serial port
5. Interfacing keyboard and LCD
6. Interfacing EPROM and interrupt
7. Mailbox
8. Interrupt performance characteristics of ARM and FPGA
9. Flashing of LEDS
10. Interfacing stepper motor and temperature sensor
11. Implementing zigbee protocol with ARM



? Write programs in ARM for a specific Application
? Interface memory and Write programs related to memory operations
? Interface A/D and D/A convertors with ARM system
? Analyze the performance of interrupt
? Write programmes for interfacing keyboard, display, motor and sensor.
? Formulate a mini project using embedded system
COURSE OBJECTIVES
COURSE OUTCOMES
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
CONTENTS
Sl. No. Name of the Experiment Page No.
CYCLE 1 ? EXPERIMENTS
1
Study of ARM evaluation system 7
2
Analog to Digital Convertor interfacing 16
3
Generation of ramp and square wave using on-Chip DAC 19
4
LED dimming using PWM 22
5
Interfacing real time clock and serial port 25
6
Interfacing keypad and LCD 28
7
Interfacing EPROM and interrupt 31
CYCLE 2 ? EXPERIMENTS
8 Implementation of Mailbox Function using LPC 2148 35
9 Interrupt Performance Characteristics of Arm and FPGA 37
10 Flashing of LEDs 40
11 Stepper Motor Interface with ARM ? 7 LPC2148 43
12 LM35 Temperature Sensor Interface with ARM ? 7 LPC2148 47
13
Implementation of Wireless Communication Protocol using ZIGBEE Wireless
Module
50
ADDITIONAL EXPERIMENTS BEYOND THE SYYLABUS
14 Buzzer Interface with ARM ? 7 54
15 Relay interface with ARM? 7 57
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Expt. No. 1 STUDY OF ARM EVALUATION SYSTEM
Aim:
To study the building blocks of ARM7 system, its features, pin configuration and the components
required for functioning of ARM controller.
Architecture Overview:
A RISC-based computer design approach means ARM processors require significantly fewer transistors
than typical processors in average computers. This approach reduces cost, heat and power usage. These
are desirable traits for light, portable, battery-powered devices (smart phones, laptops, tablet and notepad
computers), and other embedded systems. A simpler design facilitates more efficient multi-core CPUs and
higher core counts at lower cost, providing higher processing power and improved energy efficiency for
servers and supercomputers.
In 2005, about 98% of all mobile phones sold used at least one ARM processor. The low power
consumption of ARM processors has made them very popular: 37 billion ARM processors have been
produced as of 2013, up from 10 billion in 2008. The ARM architecture (32-bit) is the most widely used
architecture in mobile devices, and most popular 32-bit one in embedded systems.
According to ARM Holdings, in 2010 alone, producers of chips based on ARM architectures
reported shipments of 6.1 billion ARM based processors, representing 95% of smart phones, 35% of digital
televisions and set-top boxes and 10% of mobile computers. It is the most widely used 32-bit instruction set
architecture in terms of quantity produced.
LPC 2148:
LPC2148 is the widely used IC from ARM-7 family. It is manufactured by Philips and it is pre-loaded
with many inbuilt peripherals making it more efficient and a reliable option for the beginners as well as high
end application developer.




8 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Features of LPC214x series controllers:
1. 8 to 40 kB of on-chip static RAM and 32 to 512 kB of on-chip flash program memory.128 bit wide
interface/accelerator enables high speed 60 MHz operation.
2. In-System/In-Application Programming (ISP/IAP) via on-chip boot-loader software. Single flash sector or
full chip erase in 400 ms and programming of 256 bytes in 1ms.
3. Embedded ICE RT and Embedded Trace interfaces offer real-time debugging with the on-chip Real
Monitor software and high speed tracing of instruction execution.
4. USB 2.0 Full Speed compliant Device Controller with 2 kB of endpoint RAM. In addition, the LPC2146/8
provides 8 kB of on-chip RAM accessible to USB by DMA.
5. One or two (LPC2141/2 vs. LPC2144/6/8) 10-bit A/D converters provide a total of 6/14analog inputs, with
conversion times as low as 2.44 us per channel.
6. Single 10-bit D/A converter provides variable analog output.
7. Two 32-bit timers/external event counters (with four capture and four compare channels each), PWM unit
(six outputs) and watchdog.
8. Low power real-time clock with independent power and dedicated 32 kHz clock input.
9. Multiple serial interfaces including two UARTs (16C550), two Fast I2C-bus (400 kbit/s), SPI and SSP with
buffering and variable data length capabilities.
10. Vectored interrupt controller with configurable priorities and vector addresses.
11. Up to 45 of 5 V tolerant fast general purpose I/O pins in a tiny LQFP64 package.
12. Up to nine edge or level sensitive external interrupt pins available.
13. On-chip integrated oscillator operates with an external crystal in range from 1 MHz to30 MHz and with
an external oscillator up to 50 MHz
14. Power saving modes include Idle and Power-down.
15. Individual enable/disable of peripheral functions as well as peripheral clock scaling for additional power
optimization.
16. Processor wake-up from Power-down mode via external interrupt, USB, Brown-Out Detect (BOD) or
Real-Time Clock (RTC).




9 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


First Step- Hardware Requirement:
Pin configuration of LPC 2148.

Hardware requirement of LPC2148:
1. LPC2148 need minimum below listed hardware to work properly
2. Power Supply
3. Crystal Oscillator
4. Reset Circuit
5. RTC crystal oscillator
6. UART
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Power Supply:
LPC2148 works on 3.3 V power supply. LM 117 can be used for generating 3.3 V supply. However,
basic peripherals like LCD, ULN 2003 (Motor Driver IC) etc. works on 5V. So AC mains supply is converted
into 5V using below mentioned circuit and after that LM 117 is used to convert 5V into 3.3V.
Block diagram of power Supply

Transformer: It is used to step down 230V AC to 9V AC supply and provides isolation between power grids
and circuit.
Rectifier: It is used to convert AC supply into DC.
Filter: It is used to reduce ripple factor of DC output available from rectifier end.
Regulator: It is used to regulate DC supply output.

11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Circuit Diagram:

Regulator IC 7805 is used to provide fix 5V dc supply.
LM 117 is used for generating 3.3V supply from 5V.

12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Calculations:

From the datasheet of LM117

Taking R 2= 240?, we get R 1=392?
Reset Circuit:
Reset button is essential in a system to avoid programming pitfalls and manually bring back the system
to the initialization mode. MCP 130T is a special IC used for providing stable RESET signal to LPC 2148.


13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Oscillator Circuit:

The value of capacitors C20 & C21 depends upon the frequency of crystal Y3. General circuit and
its equivalent circuit is as shown below.

14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Recommended values are as shown in table:

UART:
LPC 2148 has inbuilt ISP which means we can program it within the system using serial
communication on COM0. It has also COM1 for serial communication. MAX 232/233 IC must be used for
voltage logic conversion. Related connections are as given below.

Once the above listed circuit design is ready, we are ready to go further.



15 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Result:
ARM Evaluation system and the configuration of LPC2148 has been studied fully. The minimal setup
required for the functioning of the ARM processor is studied.
Outcomes:
1. Able to understand the ARM controller, its basic components inside and its features.
2. Able to know the components required for the working of ARM LPC2148

Applications:
ARM controller LPC2148 is used in no. of devices such as
1. Smart phones
2. Net books
3. E Readers
4. Digital TV
5. Home Gateways


1. What are the basic units of ARM 7?
2. What is the address system supported by ARM?
3. Define - RISC
4. What are the instructions used to access the memory in ARM?
5. What are the basic units of Microprocessor?
6. What is an Instruction?
7. What is clock cycle?
8. Define - Pipelining
9. What is cache miss?
10. What is meant by memory mapped I/O?
11. Define ? interrupt
12. What is meant by Exception?
13. What is meant by little ? endian mode?
14. What is meant by big ? endian mode?
15. What is the function of CPSR?
16. What is register - indirect addressing?
Viva-voce




16 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 2 ANALOG TO DIGITAL CONVERTOR
INTERFACING
Aim:
To write an embedded c program for interfacing an on chip ADC with LPC2148 ARM processor and
convert the given input voltage into corresponding decimal values.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. PC
Theory:
Analog to Digital converter (ADC) is a device that converts continuously varying analog signals from
instruments that monitor such conditions as movement, temperature, sound, etc., into binary code for the
computer. It may be either a single chip or can be one circuit within a chip. Analog to Digital conversion is
the process of changing continuously varying data, such as voltage, current, or shaft rotation, into discrete
digital quantities that represent the magnitude of the data compared to a standard or reference at the
moment the conversion is made. According to the method of conversion, ADCs can be classified into
Direct-Conversion ADCs, Successive Approximation ADCs, Integrating ADC and Sigma-Delta ADCs.
The LPC 2148 has 10-bit successive approximation analog to digital converter. Basic clocking for the
A/D converters is provided by the VPB clock. A programmable divider is included in each converter, to
scale this clock to the 4.5 MHz (max) clock needed by the successive approximation process. A fully
accurate conversion requires 11 of these clocks. The ADC cell can measure the voltage on any of the ADC
input signals. It is noted that these analog inputs are always connected to their pins, even if the Pin function
Select register assigns them to port pins. A simple self-test of the ADC can be done by driving these pins
as port outputs.



17 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Circuit diagram:




18 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus, an embedded c program for interfacing on-chip ADC with ARM processor is written and
executed. The decimal values of the converted voltage are seen in the WinXTalk screen.
Outcome:
Able to interface A/D convertors with ARM system and check its working by connecting an analog
quantity as input.
Applications:
1. ADC used in MODEM for converting analog signals to digital.
2. A fast video ADC in TV tuner cards
3. ADC used in digital storage oscilloscopes
4. Used in music reproduction technology.
5. Used in DSP if input is analog


1. What are the ADC operating modes in LPC2148?
2. What is meant by conversion time?
3. Why are internal ADCs preferred over external ADCs?
4. Why has 16-bit ADC more resolution than from 10-bit and 8-bit ADC?
5. What are ADC & its Resolution?
6. What is Burst conversion mode?
7. What is the function of A/D Control Register?
8. What is the function of A/D Global Data Register?
9. What is the function of A/D Status Register?
10. What is analog-to-digital (ADC) conversion error?
11. What is the function of Sample-and-hold circuits in analog-to digital converters?
12. What is the disadvantage of the flash analog-to digital converter?
Viva-voce




19 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 3 GENERATION OF RAMP AND SQUARE
WAVE USING ON-CHIP DAC
Aim:
To write and execute an embedded c program to generate ramp wave and square wave using on-chip
DAC of LPC2148 ARM controller.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
A digital-to-analog converter is a device for converting a digital signal into an analog signal (current or
voltage). Digital-to-Analog Converters are the interface between the abstract digital world and the analog
real world. Simple switches, a network of resistors, current sources or capacitors may be used to
implement this conversion. A DAC inputs a binary number and outputs an analog voltage or current signal.
The Microchip Technology Inc. MCP4921 is 2.7 ? 5.5V, low-power, 12-Bit Digital-to-Analog Converter
(DAC) with SPI interface. The MCP4921 DAC provides high accuracy and low noise performance for
industrial applications where calibration or compensation of signals is required. With an SPI connection
there is always one master device (usually a microcontroller) which controls the peripheral devices.
Typically there are three lines common to all the devices,
Master In Slave Out (MISO) ? The Slave line for sending data to the master,
Master Out Slave In (MOSI) ? The Master line for sending data to the peripherals,
Serial Clock (SCK) ? The clock pulses which synchronize data transmission generated by the
master and slave
Slave Select pin ? the pin on each device that the master can use to enable and disable specific
devices. When a device Slave Select pin is low, it communicates with the master. When it is high, it ignores
the master. In SPI, the clock signal is controlled by the master device LPC2148. All data is clocked in and
out using this pin. These lines need to be connected to the relevant pins on the LPC21xx processor. Any
unused GIO pin can be used for CS, instead pull this pin high. Conversion speed is the time it takes for the



20 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

DAC to provide an analog output when the digital input word is changed. The MCP4291 DAC ? SPI
connections with LPC21xx have four I/O lines (P0.4 ? P0.7) required. The analog output is generated by
using these four lines.
Circuit diagram:


Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the embedded c programs for generating ramp wave and square wave using ARM LPC2148 are
written and executed successfully and the waveforms are viewed in oscilloscope.
Outcome:
Able to program the DAC in-built inside the ARM controller and get the waveforms using it.




21 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications :
1. DAC used in Audio amplifier.
2. Video encoder
3. Display electronics
4. Data Acquistion systems
5. Motor control



1. What are the features of LPC2148 DAC?
2. What is the function of DAC register?
3. Which pin provides a voltage reference level for the D/A converter?
4. What are the applications of DAC in signal processing applications?
5. What is GIO?
6. What is the resolution of a digital-to-analog converter (DAC)?
7. What is the major advantage of the R/2R ladder digital-to-analog (DAC), as compared to a binary-
weighted digital-to-analog DAC converter?
8. What is the resolution of a 0?5 V 6-bit digital-to-analog converter (DAC) ?
9. What are DAC configurations?
10. What are the different types of DAC Circuits?
11. What are the Limitations of the Binary Weighted DAC?
12. What are the General DAC Characteristics?
13. Define reference voltage in DAC.
14. What is full scale voltage?
15. What is settling time?
VIVA-VOCE




22 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 4 LED DIMMING USING PWM

Aim:
To write an embedded c program for implementing PWM using ARM controller and verify the same by
dimming of LEDs.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
LPC2148 supports 2 types of PWM:
1) Single Edge PWM ? Pulse starts with new Period i.e pulse is always at the beginning
2) Double Edge PWM ? Pulse can be anywhere within the Period
A PWM block, like a Timer block , has a Timer Counter and an associated Pre-scale Register along
with Match Registers. These work exactly the same way as in the case of Timers. Match Registers 1 to 6
(except 0) are pinned on LPC214x i.e. the corresponding outputs are diverted to actual Pins on LPC214x
MCU. The PWM function must be selected for these Pins to get the PWM output.
The basic setup is to simply replace Servo by a LED and no external 5V source is needed. The
anode of LED is connected to P0.0 and cathode to ground. Pulse Widths corresponding to the switches
connected to P0.1/2/3/4 will be 2.5ms/5ms/7.5ms/10ms respectively. As the Pulse Width Increases LED
will keep on getting brighter and the reverse will happen if Pulse Width is decreased.



23 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus embedded c program for implementing Pulse Width Modulation is written and executed and
output has been verified in LED display.
Outcome:
Able to implement PWM using the ARM controller and verify the same in the form of dimming of
LEDS.



24 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Applications :
1. In Visual signals to covey a message
2. Illumination where light is reflected from objects
3. In Narrow band sensors



1. What factors determine the LED dimming performance?
2. What is meant by analog dimming?
3. What is flickering effect?
4. What is the factor determines dimming of the LED
5. Why Silicon is not suitable for fabrication of light-emitting diodes?
6. Why Silicon diode is less suited for low voltage rectifier operation?
7. What is the principle of zener diode?
8. What are the materials used to make LED?
9. What type of diodes is used in FM receivers?
10. Which diode suffers an avalanche breakdown?
11. What happens if the junction temperature of LED is increased?
12. How a transfer characteristic of a diode does is related?
13. What is the requirement of a clipping action of a diode?
14. What type of rectifier circuit requires four diodes?
15. Why are the pulse width modulated outputs required in most of the applications?
16. How do the variations in an average value get affected by PWM period?
17. Name the common formats available for LED display.
18. What are the types of seven segment display?
19. What is PWM?
20. What are the applications of PWM?

Viva-voce




25 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 5 INTERFACING REAL TIME CLOCK
AND SERIAL PORT
Aim:
To write and execute an embedded c program to interface DS1307 RTC using I2C protocol with ARM
controller
Apparatus Required:
1. LPC2148 ARM development board
2. Stepper motor
3. Interfacing cables
4. PC
Theory:
A clock, which is based on the interrupts at preset intervals, is Real Time Clock (RTC). An interrupt
service routine executes on each timeout (overflow) of this clock. This timing device once started never
resets or never reloaded with another value. Once it is set, it is not modified later. It is used in a system to
save the time and date.













26 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the program for interfacing real time clock with ARM controller is written and executed and the
date and time are verified on the screen.
Outcome:
Able to interface real time clock DS1307 with ARM controller and thereby display date and time
Applications :
1. I2C In ARM and PIC microcontrollers
2. Used as serial communication protocol with MASTER and SLAVE operation.

27 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
27 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00




1. What is I2C and how does it work?
2. What are the features of I2C in LPC2148 ARM7 microcontroller?
3. What is the function of I2C0CONSET register?
4. What is I2C0STAT?
5. What is the function of I2C0 Data Register?
6. What is RTC?
7. List the advantages of RTC
8. Through which port the date and time is displayed in RTC?
9. What is a serial port?
10. List the registers used to transfer data in serial port.
11. List the modes used for data transmission.
12. What is a simplex mode?
13. Which pin is used to transmit a character?
14. What is the baud rate of serial port?
15. What is the disadvantage of RS-232C?














Viva-voce




28 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 6 INTERFACING KEYPAD AND LCD

Aim:
To write an embedded c program to interface 4 x 4 matrix keypad with ARM processor and display the
pressed key in an LCD.
Apparatus Required:
1. LPC2148 ARM development board
2. Interfacing cables
3. PC
Theory:

In matrix keypad, keys are connected in rows and columns. When any switch is pressed, rows and
columns come into contact, which is that detected by controller to identify which key has been pressed. A
4?4 matrix keypad consists of 4 rows and 4 columns. There is a switch connecting each row and column.
So the combinations of rows and columns make up the 16 inputs.Initially all the switches are open (not
connected). When any one button is pressed, the switch is closed (connected),hence there is a connection
between the row and column. The first 4 pins are connected to the column as INPUT. The other 4 pins are
connected to the row as OUTPUT. Matrix keypad is a good substitution to normal push button.












29 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Circuit Diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus program for interfacing matrix keypad with ARM controller is written and executed and the key
pressed is seen in the LCD.



30 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Outcome:
Able to interface keypad with ARM controller and see the pressed key in the LCD display.
Applications :
1. Used in password based door locking system
2. Security system with user changeable
3. Used in laptops, computer games
4. Used in portable video games and cell phones



1. What is Matrix keypad?
2. What is the concept behind keypad interface?
3. What are the functions of pull- up resistors?
4. What is key de bouncing?
5. List the steps involved when the key in a 4 x 4 keyboard matrix is being pressed.
6. What is the value obtained if no key is pressed?
7. What kind of interrupt is generated if a key has to be operated in an interrupt mode?
8. How will you identify that the key is pressed?
9. What are the steps involved in Keyboard Interfacing?
10. List the registers used to store the keyboard, display modes and other operations programmed by
CPU.
11. Name the mode when a data is entered from the left side of the display unit.
12. How many rows and columns are present in a 16 x 2 alphanumeric LCD?
13. How many data lines are there in a 16 x 2 alphanumeric LCD?
14. Which pin of the LCD is used for adjusting its contrast?
15. Which command of an LCD is used to shift the entire display to the right?
16. Which command is used to select the 2 lines and 5 x 7 matrix of an LCD?
17. What changes are to be made to send data to an LCD?
18. For reading operation from an LCD what changes in the software are introduced?
19. Which instruction is used to select the first row first column of an LCD?
Viva-voce

31 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
31 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Expt. No. 7 INTERFACING EEPROM AND INTERRUPT

Aim:
To write a program to interface EEPROM using I2C protocol with ARM controller and retrieve the stored
messages inside EEPROM.
Apparatus Required:
1. LPC2148 ARM development board
2. Interfacing cables
3. PC
Theory:
I2C (Inter Integrated Circuit):
The I2C (Inter-IC) bus is a bi-directional two-wire serial bus that provides a communication link between
integrated circuits (ICs).I2C is a synchronous protocol that allows a master device to initiate communication
with a slave device. Data is exchanged between these devices.
EEPROM:
EEPROM (electrically erasable programmable read-only memory) is user-modifiable read-only
memory (ROM) that can be erased and reprogrammed (written to) repeatedly through the application of
higher than normal electrical voltage. It is a type of non-volatile memory used in computers and other
electronic devices to store small amounts of data that must be saved when power is removed, e.g.,
calibration tables or device configuration
Read, write and Erase EEPROM by using I2C in LPC2148 Primer Board. Wiring up an I2C based
EEPROM to the I2C port is relatively simple. The basic operation of the I2C based EEPROM's is to send a
command, such as WRITE, followed by an address and the data. In WRITE operation, the EEPROM is
used to store the data. In LPC2148 Primer Kit, 2 nos. of EEPROM lines are controlled by I2C Enabled
drivers. I2C Lines serial clock SCL (P0.2), serial data SDA (P0.3) connected to the I2C based serial
EEPROM IC. The EEPROM read & write operations are done in LPC2148 Primer Kit by using these SDA &
SCL I2C lines.
32 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
32 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To down load and run this program: Refer General procedure given in Page No: 60
Result:
Thus, the program for interfacing I2C based EEPROM with ARM processor has been written and
executed successfully and the memory content is verified on Win x talk terminal.
Outcome:
Able to interface memory ICs with ARM controller and perform the read and write operations.



33 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications:
1. ROM used in toys,automobiles to store data when power is off
2. In calculators and peripheral devices
3. In laser printers
4. And also in embedded systems where program need not to be changed.


1. How does I2C protocol work?
2. What is EEPROM?
3. What is meant by master slave mode?
4. What is meant by non-volatile memory?
5. What is an interrupt?
6. How does an interrupt request works?
7. What is a nested interrupt?
8. What are the registers used for enabling an interrupt?
9. What is PROM?
10. What is EPROM?
11. What is mask ROM?
12. Which memory allows simultaneous read and write operations?
13. Which memory has the shortest access times?
14. Which interrupt has the highest priority?
15. What is non maskable interrupt?
16. Which is the first level of memory access by the microprocessor?
17. List the types of cache memories.
18. What is the use of an interrupt?
19. What is the use of converting an interrupt to threads in a microprocessor?
20. What are the bits used to control an external interrupts?


Viva-voce




34 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00










CYCLE 2 - EXPERIMENTS




35 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 8 IMPLEMENTATION OF MAILBOX FUNCTION
USING LPC2148
Aim:
To create a mailbox in Micro C/OS ? II using LPC2148 ARM Controller
Apparatus Required:
1. LPC2148 ARM development board
2. Interfacing cables
3. PC
Theory:
System or the user code can send a message by the core services. A typical mail message, also
known as the exchange of information, refers to a task or an ISR using a pointer variable, through the core
services to put a message (that is, a pointer) into the mailbox. Similarly, one or more tasks can receive this
message by the core services. The tasks sending and receiving the message promise that the content that
the pointer points to is just that piece of message.
The mailbox of CooCox CoOS is a typical message mailbox which is composed of two parts: one is
the information which expressed by a pointer of void; the other is the waiting list which composed of the
tasks waiting for this mailbox. The waiting list supports two kinds of sorting: FIFO and preemptive priority.
The sorting mode is determined by the user when creating the mailbox.
Procedure:
To Edit / Compile / generate Hex file: Refer General procedure in Page No: 58
To down load and run this program: Refer General procedure in Page No: 60
Result:
Thus, the mailbox was created in Micro C/OS ?II and implemented using LPC2148.
Outcome:
Able to understand the concept of mail box in embedded systems and its significance in real time
systems





36 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications:
1. Used in Acorn RISC PC700
2. Used in ZIPIT wireless messenger
3. Used in Meizu M6 MINI player


1. What is IPC?
2. Define Queue.
3. What are the different types of mail box functions?
4. What is half duplex mode?
5. How many synchronous and asynchronous modes are there in serial port?
6. List the bits used to generate serial port interrupt
7. What is branch prediction?
8. Mention any two features of ?C/OS ? II.
9. Write the function for creating task in ?C/OS ? II.
10. Mention any two support devices for ?C/OS ? II.
11. How many user tasks can be handled by ?C/OS ? II?



















Viva-voce




37 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 9 INTERRUPT PERFORMANCE
CHARACTERISTICSOF ARM AND FPGA

Aim:
To study the interrupt performance characteristics of ARM and FPGA by using ARM controller kit and
FPGA kit separately.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
External Interrupts:
An interrupt caused by an external source such as the computer operator, external sensor or
monitoring device, or another computer. Interrupts are special events that require immediate attention.
Interfacing External Interrupts with LPC2148:
When an external interrupt signal occurs in LPC2148 Primer Board, the message "LOW" will be
displayed on PC. The interrupt signal occurs using switches. When the switch is pressed to LOW, then the
external interrupt occurs. The Vectored Interrupt Controller (VIC) takes 32 interrupt request inputs and
programmable assigns them into 3 categories, FIQ, vectored IRQ, and non-vectored IRQ. The ARM7
LPC2148 Primer board has two numbers of External Interrupts, connected with I/O Port lines (P0.14 &
P0.15) as switches.







38 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00



Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60


39 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
39 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Result:
Thus the interrupt performance characteristics of ARM and FPGA are studied. On comparison, ARM
counts at slow speed because it consumes more instruction cycle and FPGA is more efficient for servicing
and processing external interrupt pulses.
Outcome:
Able to understand the performance characteristics of ARM and FPGA while dealing with
interrrupts
Applications:
1. Used in random logic and SPLDs
2. Used in cryptography and filtering
3. In medical imaging
4. In bioinformatics and voice recognition



1. When is an Interrupt Request received?
2. What is ISR?
3. How do you initialize interrupt?
4. What is Vectored Interrupt Controller?
5. What are the kinds of protection available for SRAMS ?
6. What is interrupt pipelining?
7. What is pipeline shutdown?
8. What is branch prediction?
9. What is the use of Neon Floating point engine?
10. What is the use of ?vectorize option?
11. What is PTM?
12. What is ITM?
13. What is ETM?
14. What is I2S interface?
15. What is the use of ?SWI? in ARM assembly?

Viva-voce




40 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 10 FLASHING OF LEDS
Aim:
To write and execute an embedded c program to display LEDs using LPC 2148 ARM controller
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
Theory:
LED (Light Emitting Diodes) is the most commonly used components, usually for displaying pins digital
states. Typical uses of LEDs include alarm devices, timers and confirmation of user input such as a mouse
click or keystroke. Interfacing LED with LPC2148 Flash a LED using LPC2148 Primer Board. It works by
turning ON a LED & then turning it OFF & then looping back to START. However the operating speed of
microcontroller is very high so the flashing frequency will also be very fast to be detected by human eye.
The ARM7 LPC2148 Primer board has eight numbers of point LEDs, connected with I/O Port lines (P1.16 ?
P1.23) to make port pins high.










41 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00



Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus program for flashing of LEDs is written and executed using ARM controller LPC2148.



42 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Outcome:
Able to interface LED lights via the input output port and control them
Applications:
1. In Illumination
2. As status indicators in equipments
3. Stadium displays and dynamic decorative displays



1. What is seven segment displays?
2. What are the different configurations of LED?
3. What is the function of GPIO?
4. What are the Pins which are used to connect LEDs?
5. How to identify 'Polarity' of LED?
6. Differentiate LED from LCD.
7. What is a use of Jumper?
8. How many numbers of LEDs present in Primer board?
9. Where LEDs are used?
10. What is the use of flash magic software?
11. Which port is used in ARM 7 processor kit?
12. Which diode suffers an avalanche breakdown?
13. What happens if the junction temperature of LED is increased?
14. What is an anti collision rate light?
15. What is fail-safe conditions






Viva-voce




43 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 11 STEPPER MOTOR INTERFACE WITH
ARM -7 LPC2148
Aim:
To write a program to interface stepper motor using ARM processor and control the movement of motor
in either directions.
Apparatus Required:
1. LPC2148 ARM development board
2. Stepper motor
3. Interfacing cables
4. PC
Theory:
A stepper motor can be viewed as a DC motor with number of poles (on both rotor and stator).
Additionally, soft magnetic material with many teeth on the rotor and stator cheaply multiplies the number of
poles (reluctance motor). Like an AC synchronous motor, it is ideally driven by sinusoidal current, allowing
a step less operation, but this puts some burden on the controller. When using an 8-bit digital controller,
256 micro steps per step are possible. As a digital-to-analog converter produces unwanted ohmic heat in
the controller, pulse-width modulation is used to regulate the mean current. Simpler models switch voltage
only for doing a step, thus needing an extra current limiter: for every step, they switch a single cable to the
motor.
The idea is to connect the output pins of the driver to 4 transistors. The transistor must be
grounded at the emitter and the driver pin must be connected to the base. Collector is connected to the coil
wire of the motor. Stepper motors are rated by the torque they produce. Synchronous electric motors using
soft magnetic materials (having a core) have the ability to provide position holding torque (called detent
torque, and sometimes included in the specifications) while not driven electrically. To achieve full rated
torque, the coils in a stepper motor must reach their full rated current during each step. The voltage rating
(if there is one) is almost meaningless. The motors also suffer from EMF, which means that once the coil is
turned off it starts to generate current because the motor is still rotating. There needs to be an explicit way
to handle this extra current in a circuit otherwise it can cause damage and affect performance of the motor.
44 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
44 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus stepper motor interface with ARM processor has been successfully implemented and the motor is
controlled in clockwise and anticlockwise direction.
Outcome:
Able to interface the stepper motor with ARM controller and thereby create some rotational
movements





45 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Applications:
3. Used for precise positioning with a motor
4. Used in hard disk drives, robotics
5. Used in telescopes and toys







1. Define GPIO.
2. What is the function of ULN2803?
3. How LPC2148 control stepper motor?
4. Which I/O port lines used to rotate stepper motor?
5. How stepper motor reacts for each pulse it receives?
6. What is serial communication?
7. What is parallel communication?
8. What is stepper motor & why it is named so?
9. How can be step angle is calculated?
10. What are the advantages and disadvantages of parallel communication?
11. What does instruction-pipelining mean?
12. What is the power supply required for ARM processor?
13. What is a unit for torque?
14. What is RPM rating for a DC motor?
15. What device that is used to obtain an accurate position control of rotating shafts in terms of steps?
Viva-voce

46 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
46 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Expt. No. 12 LM35 TEMPERATURE SENSOR INTERFACE
WITH ARM-7 LPC2148
Aim:
To write a program to interface of LM35 temperature sensor to on-chip ADC of ARM controller and
display the room temperature value on the screen.
Apparatus Required:
1. LPC2148 ARM development board
2. Temperature sensor
3. Interfacing cables
4. PC
Theory:
Temperature Sensor:
The LM35 series are precision integrated-circuit temperature sensors, whose output voltage is linearly
proportional to the Celsius (Centigrade) temperature. The output of the sensor is converted to digital output
that is easy to connect with microcontroller. Temperature sensor has three terminals and required
Maximum of 5.5 V supply. This type of sensor consists of a material that performs the operation according
to temperature to vary the resistance. This change of resistance is sensed by circuit and it calculates
temperature. When the voltage increases then the temperature also rises. We can see this operation by
using a diode.







47 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
47 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00


Circuit diagram:

FirstRanker.com - FirstRanker's Choice
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00






?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING

VII SEMESTER - R 2013

EC6711 ? EMBEDDED LABORATORY






Name : _______________________________________
Register No : _______________________________________
Section : _______________________________________
LABORATORY MANUAL



2 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00




is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and
training.

? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different
levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on
heart and soul
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

To impart professional education integrated with human values to the younger generation, so as to
shape them as proficient and dedicated engineers, capable of providing comprehensive solutions to the
challenges in deploying technology for the service of humanity

? To educate the students with the state-of-art technologies to meet the growing challenges of the
electronics industry
? To carry out research through continuous interaction with research institutes and industry, on
advances in communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning,
innovation and ethical practices
VISION
VISION
MISSION
MISSION



3 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

PROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To provide students with a solid foundation in Mathematics, Science and fundamentals of
engineering, enabling them to apply, to find solutions for engineering problems and use this knowledge
to acquire higher education
2. Core Competence
To train the students in Electronics and Communication technologies so that they apply their
knowledge and training to compare, and to analyze various engineering industrial problems to find
solutions
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice which
enables them to find solutions for the real time problems in industry, and to design products
4. Professionalism
To inculcate professional and effective communication skills, leadership qualities and team spirit in
the students to make them multi-faceted personalities and develop their ability to relate engineering
issues to broader social context
5. Lifelong Learning/Ethics
To demonstrate and practice ethical and professional responsibilities in the industry and society in
the large, through commitment and lifelong learning needed for successful professional career


4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
PROGRAMME OUTCOMES (POs)
a) To demonstrate and apply knowledge of Mathematics, Science and engineering fundamentals in
Electronics and Communication Engineering field
b) To design a component, a system or a process to meet the specific needs within the realistic
constraints such as economics, environment, ethics, health, safety and manufacturability
c) To demonstrate the competency to use software tools for computation, simulation and testing of electronics
and communication engineering circuits
d) To identify, formulate and solve electronic and communication engineering problems
e) To demonstrate an ability to visualize and work on laboratory and multidisciplinary tasks
f) To function as a member or a leader in multidisciplinary activities
g) To communicate in verbal and written form with fellow engineers and society at large
h) To understand the impact of Electronics and Communication Engineering in the society and demonstrate
awareness of contemporary issues and commitment to give solutions exhibiting social responsibility
i) To demonstrate professional & ethical responsibilities
j) To exhibit confidence in self-education and ability for lifelong learning
k) To participate and succeed in competitive exams


5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
SYLLABUS

? Learn the working of ARM processor
? Understand the Building Blocks of Embedded Systems
? Learn the concept of memory map and memory interface
? Know the characteristics of Real Time Systems
? Write programs to interface memory, I/Os with processor
? Study the interrupt performance
LIST OF EXPERIMENTS:
1. Study of ARM evaluation system
2. Interfacing ADC and DAC
3. Interfacing LED and PWM
4. Interfacing real time clock and serial port
5. Interfacing keyboard and LCD
6. Interfacing EPROM and interrupt
7. Mailbox
8. Interrupt performance characteristics of ARM and FPGA
9. Flashing of LEDS
10. Interfacing stepper motor and temperature sensor
11. Implementing zigbee protocol with ARM



? Write programs in ARM for a specific Application
? Interface memory and Write programs related to memory operations
? Interface A/D and D/A convertors with ARM system
? Analyze the performance of interrupt
? Write programmes for interfacing keyboard, display, motor and sensor.
? Formulate a mini project using embedded system
COURSE OBJECTIVES
COURSE OUTCOMES
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
CONTENTS
Sl. No. Name of the Experiment Page No.
CYCLE 1 ? EXPERIMENTS
1
Study of ARM evaluation system 7
2
Analog to Digital Convertor interfacing 16
3
Generation of ramp and square wave using on-Chip DAC 19
4
LED dimming using PWM 22
5
Interfacing real time clock and serial port 25
6
Interfacing keypad and LCD 28
7
Interfacing EPROM and interrupt 31
CYCLE 2 ? EXPERIMENTS
8 Implementation of Mailbox Function using LPC 2148 35
9 Interrupt Performance Characteristics of Arm and FPGA 37
10 Flashing of LEDs 40
11 Stepper Motor Interface with ARM ? 7 LPC2148 43
12 LM35 Temperature Sensor Interface with ARM ? 7 LPC2148 47
13
Implementation of Wireless Communication Protocol using ZIGBEE Wireless
Module
50
ADDITIONAL EXPERIMENTS BEYOND THE SYYLABUS
14 Buzzer Interface with ARM ? 7 54
15 Relay interface with ARM? 7 57
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Expt. No. 1 STUDY OF ARM EVALUATION SYSTEM
Aim:
To study the building blocks of ARM7 system, its features, pin configuration and the components
required for functioning of ARM controller.
Architecture Overview:
A RISC-based computer design approach means ARM processors require significantly fewer transistors
than typical processors in average computers. This approach reduces cost, heat and power usage. These
are desirable traits for light, portable, battery-powered devices (smart phones, laptops, tablet and notepad
computers), and other embedded systems. A simpler design facilitates more efficient multi-core CPUs and
higher core counts at lower cost, providing higher processing power and improved energy efficiency for
servers and supercomputers.
In 2005, about 98% of all mobile phones sold used at least one ARM processor. The low power
consumption of ARM processors has made them very popular: 37 billion ARM processors have been
produced as of 2013, up from 10 billion in 2008. The ARM architecture (32-bit) is the most widely used
architecture in mobile devices, and most popular 32-bit one in embedded systems.
According to ARM Holdings, in 2010 alone, producers of chips based on ARM architectures
reported shipments of 6.1 billion ARM based processors, representing 95% of smart phones, 35% of digital
televisions and set-top boxes and 10% of mobile computers. It is the most widely used 32-bit instruction set
architecture in terms of quantity produced.
LPC 2148:
LPC2148 is the widely used IC from ARM-7 family. It is manufactured by Philips and it is pre-loaded
with many inbuilt peripherals making it more efficient and a reliable option for the beginners as well as high
end application developer.




8 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Features of LPC214x series controllers:
1. 8 to 40 kB of on-chip static RAM and 32 to 512 kB of on-chip flash program memory.128 bit wide
interface/accelerator enables high speed 60 MHz operation.
2. In-System/In-Application Programming (ISP/IAP) via on-chip boot-loader software. Single flash sector or
full chip erase in 400 ms and programming of 256 bytes in 1ms.
3. Embedded ICE RT and Embedded Trace interfaces offer real-time debugging with the on-chip Real
Monitor software and high speed tracing of instruction execution.
4. USB 2.0 Full Speed compliant Device Controller with 2 kB of endpoint RAM. In addition, the LPC2146/8
provides 8 kB of on-chip RAM accessible to USB by DMA.
5. One or two (LPC2141/2 vs. LPC2144/6/8) 10-bit A/D converters provide a total of 6/14analog inputs, with
conversion times as low as 2.44 us per channel.
6. Single 10-bit D/A converter provides variable analog output.
7. Two 32-bit timers/external event counters (with four capture and four compare channels each), PWM unit
(six outputs) and watchdog.
8. Low power real-time clock with independent power and dedicated 32 kHz clock input.
9. Multiple serial interfaces including two UARTs (16C550), two Fast I2C-bus (400 kbit/s), SPI and SSP with
buffering and variable data length capabilities.
10. Vectored interrupt controller with configurable priorities and vector addresses.
11. Up to 45 of 5 V tolerant fast general purpose I/O pins in a tiny LQFP64 package.
12. Up to nine edge or level sensitive external interrupt pins available.
13. On-chip integrated oscillator operates with an external crystal in range from 1 MHz to30 MHz and with
an external oscillator up to 50 MHz
14. Power saving modes include Idle and Power-down.
15. Individual enable/disable of peripheral functions as well as peripheral clock scaling for additional power
optimization.
16. Processor wake-up from Power-down mode via external interrupt, USB, Brown-Out Detect (BOD) or
Real-Time Clock (RTC).




9 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


First Step- Hardware Requirement:
Pin configuration of LPC 2148.

Hardware requirement of LPC2148:
1. LPC2148 need minimum below listed hardware to work properly
2. Power Supply
3. Crystal Oscillator
4. Reset Circuit
5. RTC crystal oscillator
6. UART
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Power Supply:
LPC2148 works on 3.3 V power supply. LM 117 can be used for generating 3.3 V supply. However,
basic peripherals like LCD, ULN 2003 (Motor Driver IC) etc. works on 5V. So AC mains supply is converted
into 5V using below mentioned circuit and after that LM 117 is used to convert 5V into 3.3V.
Block diagram of power Supply

Transformer: It is used to step down 230V AC to 9V AC supply and provides isolation between power grids
and circuit.
Rectifier: It is used to convert AC supply into DC.
Filter: It is used to reduce ripple factor of DC output available from rectifier end.
Regulator: It is used to regulate DC supply output.

11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Circuit Diagram:

Regulator IC 7805 is used to provide fix 5V dc supply.
LM 117 is used for generating 3.3V supply from 5V.

12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Calculations:

From the datasheet of LM117

Taking R 2= 240?, we get R 1=392?
Reset Circuit:
Reset button is essential in a system to avoid programming pitfalls and manually bring back the system
to the initialization mode. MCP 130T is a special IC used for providing stable RESET signal to LPC 2148.


13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Oscillator Circuit:

The value of capacitors C20 & C21 depends upon the frequency of crystal Y3. General circuit and
its equivalent circuit is as shown below.

14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Recommended values are as shown in table:

UART:
LPC 2148 has inbuilt ISP which means we can program it within the system using serial
communication on COM0. It has also COM1 for serial communication. MAX 232/233 IC must be used for
voltage logic conversion. Related connections are as given below.

Once the above listed circuit design is ready, we are ready to go further.



15 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Result:
ARM Evaluation system and the configuration of LPC2148 has been studied fully. The minimal setup
required for the functioning of the ARM processor is studied.
Outcomes:
1. Able to understand the ARM controller, its basic components inside and its features.
2. Able to know the components required for the working of ARM LPC2148

Applications:
ARM controller LPC2148 is used in no. of devices such as
1. Smart phones
2. Net books
3. E Readers
4. Digital TV
5. Home Gateways


1. What are the basic units of ARM 7?
2. What is the address system supported by ARM?
3. Define - RISC
4. What are the instructions used to access the memory in ARM?
5. What are the basic units of Microprocessor?
6. What is an Instruction?
7. What is clock cycle?
8. Define - Pipelining
9. What is cache miss?
10. What is meant by memory mapped I/O?
11. Define ? interrupt
12. What is meant by Exception?
13. What is meant by little ? endian mode?
14. What is meant by big ? endian mode?
15. What is the function of CPSR?
16. What is register - indirect addressing?
Viva-voce




16 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 2 ANALOG TO DIGITAL CONVERTOR
INTERFACING
Aim:
To write an embedded c program for interfacing an on chip ADC with LPC2148 ARM processor and
convert the given input voltage into corresponding decimal values.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. PC
Theory:
Analog to Digital converter (ADC) is a device that converts continuously varying analog signals from
instruments that monitor such conditions as movement, temperature, sound, etc., into binary code for the
computer. It may be either a single chip or can be one circuit within a chip. Analog to Digital conversion is
the process of changing continuously varying data, such as voltage, current, or shaft rotation, into discrete
digital quantities that represent the magnitude of the data compared to a standard or reference at the
moment the conversion is made. According to the method of conversion, ADCs can be classified into
Direct-Conversion ADCs, Successive Approximation ADCs, Integrating ADC and Sigma-Delta ADCs.
The LPC 2148 has 10-bit successive approximation analog to digital converter. Basic clocking for the
A/D converters is provided by the VPB clock. A programmable divider is included in each converter, to
scale this clock to the 4.5 MHz (max) clock needed by the successive approximation process. A fully
accurate conversion requires 11 of these clocks. The ADC cell can measure the voltage on any of the ADC
input signals. It is noted that these analog inputs are always connected to their pins, even if the Pin function
Select register assigns them to port pins. A simple self-test of the ADC can be done by driving these pins
as port outputs.



17 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Circuit diagram:




18 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus, an embedded c program for interfacing on-chip ADC with ARM processor is written and
executed. The decimal values of the converted voltage are seen in the WinXTalk screen.
Outcome:
Able to interface A/D convertors with ARM system and check its working by connecting an analog
quantity as input.
Applications:
1. ADC used in MODEM for converting analog signals to digital.
2. A fast video ADC in TV tuner cards
3. ADC used in digital storage oscilloscopes
4. Used in music reproduction technology.
5. Used in DSP if input is analog


1. What are the ADC operating modes in LPC2148?
2. What is meant by conversion time?
3. Why are internal ADCs preferred over external ADCs?
4. Why has 16-bit ADC more resolution than from 10-bit and 8-bit ADC?
5. What are ADC & its Resolution?
6. What is Burst conversion mode?
7. What is the function of A/D Control Register?
8. What is the function of A/D Global Data Register?
9. What is the function of A/D Status Register?
10. What is analog-to-digital (ADC) conversion error?
11. What is the function of Sample-and-hold circuits in analog-to digital converters?
12. What is the disadvantage of the flash analog-to digital converter?
Viva-voce




19 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 3 GENERATION OF RAMP AND SQUARE
WAVE USING ON-CHIP DAC
Aim:
To write and execute an embedded c program to generate ramp wave and square wave using on-chip
DAC of LPC2148 ARM controller.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
A digital-to-analog converter is a device for converting a digital signal into an analog signal (current or
voltage). Digital-to-Analog Converters are the interface between the abstract digital world and the analog
real world. Simple switches, a network of resistors, current sources or capacitors may be used to
implement this conversion. A DAC inputs a binary number and outputs an analog voltage or current signal.
The Microchip Technology Inc. MCP4921 is 2.7 ? 5.5V, low-power, 12-Bit Digital-to-Analog Converter
(DAC) with SPI interface. The MCP4921 DAC provides high accuracy and low noise performance for
industrial applications where calibration or compensation of signals is required. With an SPI connection
there is always one master device (usually a microcontroller) which controls the peripheral devices.
Typically there are three lines common to all the devices,
Master In Slave Out (MISO) ? The Slave line for sending data to the master,
Master Out Slave In (MOSI) ? The Master line for sending data to the peripherals,
Serial Clock (SCK) ? The clock pulses which synchronize data transmission generated by the
master and slave
Slave Select pin ? the pin on each device that the master can use to enable and disable specific
devices. When a device Slave Select pin is low, it communicates with the master. When it is high, it ignores
the master. In SPI, the clock signal is controlled by the master device LPC2148. All data is clocked in and
out using this pin. These lines need to be connected to the relevant pins on the LPC21xx processor. Any
unused GIO pin can be used for CS, instead pull this pin high. Conversion speed is the time it takes for the



20 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

DAC to provide an analog output when the digital input word is changed. The MCP4291 DAC ? SPI
connections with LPC21xx have four I/O lines (P0.4 ? P0.7) required. The analog output is generated by
using these four lines.
Circuit diagram:


Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the embedded c programs for generating ramp wave and square wave using ARM LPC2148 are
written and executed successfully and the waveforms are viewed in oscilloscope.
Outcome:
Able to program the DAC in-built inside the ARM controller and get the waveforms using it.




21 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications :
1. DAC used in Audio amplifier.
2. Video encoder
3. Display electronics
4. Data Acquistion systems
5. Motor control



1. What are the features of LPC2148 DAC?
2. What is the function of DAC register?
3. Which pin provides a voltage reference level for the D/A converter?
4. What are the applications of DAC in signal processing applications?
5. What is GIO?
6. What is the resolution of a digital-to-analog converter (DAC)?
7. What is the major advantage of the R/2R ladder digital-to-analog (DAC), as compared to a binary-
weighted digital-to-analog DAC converter?
8. What is the resolution of a 0?5 V 6-bit digital-to-analog converter (DAC) ?
9. What are DAC configurations?
10. What are the different types of DAC Circuits?
11. What are the Limitations of the Binary Weighted DAC?
12. What are the General DAC Characteristics?
13. Define reference voltage in DAC.
14. What is full scale voltage?
15. What is settling time?
VIVA-VOCE




22 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 4 LED DIMMING USING PWM

Aim:
To write an embedded c program for implementing PWM using ARM controller and verify the same by
dimming of LEDs.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
LPC2148 supports 2 types of PWM:
1) Single Edge PWM ? Pulse starts with new Period i.e pulse is always at the beginning
2) Double Edge PWM ? Pulse can be anywhere within the Period
A PWM block, like a Timer block , has a Timer Counter and an associated Pre-scale Register along
with Match Registers. These work exactly the same way as in the case of Timers. Match Registers 1 to 6
(except 0) are pinned on LPC214x i.e. the corresponding outputs are diverted to actual Pins on LPC214x
MCU. The PWM function must be selected for these Pins to get the PWM output.
The basic setup is to simply replace Servo by a LED and no external 5V source is needed. The
anode of LED is connected to P0.0 and cathode to ground. Pulse Widths corresponding to the switches
connected to P0.1/2/3/4 will be 2.5ms/5ms/7.5ms/10ms respectively. As the Pulse Width Increases LED
will keep on getting brighter and the reverse will happen if Pulse Width is decreased.



23 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus embedded c program for implementing Pulse Width Modulation is written and executed and
output has been verified in LED display.
Outcome:
Able to implement PWM using the ARM controller and verify the same in the form of dimming of
LEDS.



24 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Applications :
1. In Visual signals to covey a message
2. Illumination where light is reflected from objects
3. In Narrow band sensors



1. What factors determine the LED dimming performance?
2. What is meant by analog dimming?
3. What is flickering effect?
4. What is the factor determines dimming of the LED
5. Why Silicon is not suitable for fabrication of light-emitting diodes?
6. Why Silicon diode is less suited for low voltage rectifier operation?
7. What is the principle of zener diode?
8. What are the materials used to make LED?
9. What type of diodes is used in FM receivers?
10. Which diode suffers an avalanche breakdown?
11. What happens if the junction temperature of LED is increased?
12. How a transfer characteristic of a diode does is related?
13. What is the requirement of a clipping action of a diode?
14. What type of rectifier circuit requires four diodes?
15. Why are the pulse width modulated outputs required in most of the applications?
16. How do the variations in an average value get affected by PWM period?
17. Name the common formats available for LED display.
18. What are the types of seven segment display?
19. What is PWM?
20. What are the applications of PWM?

Viva-voce




25 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 5 INTERFACING REAL TIME CLOCK
AND SERIAL PORT
Aim:
To write and execute an embedded c program to interface DS1307 RTC using I2C protocol with ARM
controller
Apparatus Required:
1. LPC2148 ARM development board
2. Stepper motor
3. Interfacing cables
4. PC
Theory:
A clock, which is based on the interrupts at preset intervals, is Real Time Clock (RTC). An interrupt
service routine executes on each timeout (overflow) of this clock. This timing device once started never
resets or never reloaded with another value. Once it is set, it is not modified later. It is used in a system to
save the time and date.













26 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the program for interfacing real time clock with ARM controller is written and executed and the
date and time are verified on the screen.
Outcome:
Able to interface real time clock DS1307 with ARM controller and thereby display date and time
Applications :
1. I2C In ARM and PIC microcontrollers
2. Used as serial communication protocol with MASTER and SLAVE operation.

27 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
27 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00




1. What is I2C and how does it work?
2. What are the features of I2C in LPC2148 ARM7 microcontroller?
3. What is the function of I2C0CONSET register?
4. What is I2C0STAT?
5. What is the function of I2C0 Data Register?
6. What is RTC?
7. List the advantages of RTC
8. Through which port the date and time is displayed in RTC?
9. What is a serial port?
10. List the registers used to transfer data in serial port.
11. List the modes used for data transmission.
12. What is a simplex mode?
13. Which pin is used to transmit a character?
14. What is the baud rate of serial port?
15. What is the disadvantage of RS-232C?














Viva-voce




28 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 6 INTERFACING KEYPAD AND LCD

Aim:
To write an embedded c program to interface 4 x 4 matrix keypad with ARM processor and display the
pressed key in an LCD.
Apparatus Required:
1. LPC2148 ARM development board
2. Interfacing cables
3. PC
Theory:

In matrix keypad, keys are connected in rows and columns. When any switch is pressed, rows and
columns come into contact, which is that detected by controller to identify which key has been pressed. A
4?4 matrix keypad consists of 4 rows and 4 columns. There is a switch connecting each row and column.
So the combinations of rows and columns make up the 16 inputs.Initially all the switches are open (not
connected). When any one button is pressed, the switch is closed (connected),hence there is a connection
between the row and column. The first 4 pins are connected to the column as INPUT. The other 4 pins are
connected to the row as OUTPUT. Matrix keypad is a good substitution to normal push button.












29 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Circuit Diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus program for interfacing matrix keypad with ARM controller is written and executed and the key
pressed is seen in the LCD.



30 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Outcome:
Able to interface keypad with ARM controller and see the pressed key in the LCD display.
Applications :
1. Used in password based door locking system
2. Security system with user changeable
3. Used in laptops, computer games
4. Used in portable video games and cell phones



1. What is Matrix keypad?
2. What is the concept behind keypad interface?
3. What are the functions of pull- up resistors?
4. What is key de bouncing?
5. List the steps involved when the key in a 4 x 4 keyboard matrix is being pressed.
6. What is the value obtained if no key is pressed?
7. What kind of interrupt is generated if a key has to be operated in an interrupt mode?
8. How will you identify that the key is pressed?
9. What are the steps involved in Keyboard Interfacing?
10. List the registers used to store the keyboard, display modes and other operations programmed by
CPU.
11. Name the mode when a data is entered from the left side of the display unit.
12. How many rows and columns are present in a 16 x 2 alphanumeric LCD?
13. How many data lines are there in a 16 x 2 alphanumeric LCD?
14. Which pin of the LCD is used for adjusting its contrast?
15. Which command of an LCD is used to shift the entire display to the right?
16. Which command is used to select the 2 lines and 5 x 7 matrix of an LCD?
17. What changes are to be made to send data to an LCD?
18. For reading operation from an LCD what changes in the software are introduced?
19. Which instruction is used to select the first row first column of an LCD?
Viva-voce

31 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
31 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Expt. No. 7 INTERFACING EEPROM AND INTERRUPT

Aim:
To write a program to interface EEPROM using I2C protocol with ARM controller and retrieve the stored
messages inside EEPROM.
Apparatus Required:
1. LPC2148 ARM development board
2. Interfacing cables
3. PC
Theory:
I2C (Inter Integrated Circuit):
The I2C (Inter-IC) bus is a bi-directional two-wire serial bus that provides a communication link between
integrated circuits (ICs).I2C is a synchronous protocol that allows a master device to initiate communication
with a slave device. Data is exchanged between these devices.
EEPROM:
EEPROM (electrically erasable programmable read-only memory) is user-modifiable read-only
memory (ROM) that can be erased and reprogrammed (written to) repeatedly through the application of
higher than normal electrical voltage. It is a type of non-volatile memory used in computers and other
electronic devices to store small amounts of data that must be saved when power is removed, e.g.,
calibration tables or device configuration
Read, write and Erase EEPROM by using I2C in LPC2148 Primer Board. Wiring up an I2C based
EEPROM to the I2C port is relatively simple. The basic operation of the I2C based EEPROM's is to send a
command, such as WRITE, followed by an address and the data. In WRITE operation, the EEPROM is
used to store the data. In LPC2148 Primer Kit, 2 nos. of EEPROM lines are controlled by I2C Enabled
drivers. I2C Lines serial clock SCL (P0.2), serial data SDA (P0.3) connected to the I2C based serial
EEPROM IC. The EEPROM read & write operations are done in LPC2148 Primer Kit by using these SDA &
SCL I2C lines.
32 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
32 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To down load and run this program: Refer General procedure given in Page No: 60
Result:
Thus, the program for interfacing I2C based EEPROM with ARM processor has been written and
executed successfully and the memory content is verified on Win x talk terminal.
Outcome:
Able to interface memory ICs with ARM controller and perform the read and write operations.



33 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications:
1. ROM used in toys,automobiles to store data when power is off
2. In calculators and peripheral devices
3. In laser printers
4. And also in embedded systems where program need not to be changed.


1. How does I2C protocol work?
2. What is EEPROM?
3. What is meant by master slave mode?
4. What is meant by non-volatile memory?
5. What is an interrupt?
6. How does an interrupt request works?
7. What is a nested interrupt?
8. What are the registers used for enabling an interrupt?
9. What is PROM?
10. What is EPROM?
11. What is mask ROM?
12. Which memory allows simultaneous read and write operations?
13. Which memory has the shortest access times?
14. Which interrupt has the highest priority?
15. What is non maskable interrupt?
16. Which is the first level of memory access by the microprocessor?
17. List the types of cache memories.
18. What is the use of an interrupt?
19. What is the use of converting an interrupt to threads in a microprocessor?
20. What are the bits used to control an external interrupts?


Viva-voce




34 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00










CYCLE 2 - EXPERIMENTS




35 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 8 IMPLEMENTATION OF MAILBOX FUNCTION
USING LPC2148
Aim:
To create a mailbox in Micro C/OS ? II using LPC2148 ARM Controller
Apparatus Required:
1. LPC2148 ARM development board
2. Interfacing cables
3. PC
Theory:
System or the user code can send a message by the core services. A typical mail message, also
known as the exchange of information, refers to a task or an ISR using a pointer variable, through the core
services to put a message (that is, a pointer) into the mailbox. Similarly, one or more tasks can receive this
message by the core services. The tasks sending and receiving the message promise that the content that
the pointer points to is just that piece of message.
The mailbox of CooCox CoOS is a typical message mailbox which is composed of two parts: one is
the information which expressed by a pointer of void; the other is the waiting list which composed of the
tasks waiting for this mailbox. The waiting list supports two kinds of sorting: FIFO and preemptive priority.
The sorting mode is determined by the user when creating the mailbox.
Procedure:
To Edit / Compile / generate Hex file: Refer General procedure in Page No: 58
To down load and run this program: Refer General procedure in Page No: 60
Result:
Thus, the mailbox was created in Micro C/OS ?II and implemented using LPC2148.
Outcome:
Able to understand the concept of mail box in embedded systems and its significance in real time
systems





36 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications:
1. Used in Acorn RISC PC700
2. Used in ZIPIT wireless messenger
3. Used in Meizu M6 MINI player


1. What is IPC?
2. Define Queue.
3. What are the different types of mail box functions?
4. What is half duplex mode?
5. How many synchronous and asynchronous modes are there in serial port?
6. List the bits used to generate serial port interrupt
7. What is branch prediction?
8. Mention any two features of ?C/OS ? II.
9. Write the function for creating task in ?C/OS ? II.
10. Mention any two support devices for ?C/OS ? II.
11. How many user tasks can be handled by ?C/OS ? II?



















Viva-voce




37 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 9 INTERRUPT PERFORMANCE
CHARACTERISTICSOF ARM AND FPGA

Aim:
To study the interrupt performance characteristics of ARM and FPGA by using ARM controller kit and
FPGA kit separately.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
External Interrupts:
An interrupt caused by an external source such as the computer operator, external sensor or
monitoring device, or another computer. Interrupts are special events that require immediate attention.
Interfacing External Interrupts with LPC2148:
When an external interrupt signal occurs in LPC2148 Primer Board, the message "LOW" will be
displayed on PC. The interrupt signal occurs using switches. When the switch is pressed to LOW, then the
external interrupt occurs. The Vectored Interrupt Controller (VIC) takes 32 interrupt request inputs and
programmable assigns them into 3 categories, FIQ, vectored IRQ, and non-vectored IRQ. The ARM7
LPC2148 Primer board has two numbers of External Interrupts, connected with I/O Port lines (P0.14 &
P0.15) as switches.







38 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00



Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60


39 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
39 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Result:
Thus the interrupt performance characteristics of ARM and FPGA are studied. On comparison, ARM
counts at slow speed because it consumes more instruction cycle and FPGA is more efficient for servicing
and processing external interrupt pulses.
Outcome:
Able to understand the performance characteristics of ARM and FPGA while dealing with
interrrupts
Applications:
1. Used in random logic and SPLDs
2. Used in cryptography and filtering
3. In medical imaging
4. In bioinformatics and voice recognition



1. When is an Interrupt Request received?
2. What is ISR?
3. How do you initialize interrupt?
4. What is Vectored Interrupt Controller?
5. What are the kinds of protection available for SRAMS ?
6. What is interrupt pipelining?
7. What is pipeline shutdown?
8. What is branch prediction?
9. What is the use of Neon Floating point engine?
10. What is the use of ?vectorize option?
11. What is PTM?
12. What is ITM?
13. What is ETM?
14. What is I2S interface?
15. What is the use of ?SWI? in ARM assembly?

Viva-voce




40 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 10 FLASHING OF LEDS
Aim:
To write and execute an embedded c program to display LEDs using LPC 2148 ARM controller
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
Theory:
LED (Light Emitting Diodes) is the most commonly used components, usually for displaying pins digital
states. Typical uses of LEDs include alarm devices, timers and confirmation of user input such as a mouse
click or keystroke. Interfacing LED with LPC2148 Flash a LED using LPC2148 Primer Board. It works by
turning ON a LED & then turning it OFF & then looping back to START. However the operating speed of
microcontroller is very high so the flashing frequency will also be very fast to be detected by human eye.
The ARM7 LPC2148 Primer board has eight numbers of point LEDs, connected with I/O Port lines (P1.16 ?
P1.23) to make port pins high.










41 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00



Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus program for flashing of LEDs is written and executed using ARM controller LPC2148.



42 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Outcome:
Able to interface LED lights via the input output port and control them
Applications:
1. In Illumination
2. As status indicators in equipments
3. Stadium displays and dynamic decorative displays



1. What is seven segment displays?
2. What are the different configurations of LED?
3. What is the function of GPIO?
4. What are the Pins which are used to connect LEDs?
5. How to identify 'Polarity' of LED?
6. Differentiate LED from LCD.
7. What is a use of Jumper?
8. How many numbers of LEDs present in Primer board?
9. Where LEDs are used?
10. What is the use of flash magic software?
11. Which port is used in ARM 7 processor kit?
12. Which diode suffers an avalanche breakdown?
13. What happens if the junction temperature of LED is increased?
14. What is an anti collision rate light?
15. What is fail-safe conditions






Viva-voce




43 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 11 STEPPER MOTOR INTERFACE WITH
ARM -7 LPC2148
Aim:
To write a program to interface stepper motor using ARM processor and control the movement of motor
in either directions.
Apparatus Required:
1. LPC2148 ARM development board
2. Stepper motor
3. Interfacing cables
4. PC
Theory:
A stepper motor can be viewed as a DC motor with number of poles (on both rotor and stator).
Additionally, soft magnetic material with many teeth on the rotor and stator cheaply multiplies the number of
poles (reluctance motor). Like an AC synchronous motor, it is ideally driven by sinusoidal current, allowing
a step less operation, but this puts some burden on the controller. When using an 8-bit digital controller,
256 micro steps per step are possible. As a digital-to-analog converter produces unwanted ohmic heat in
the controller, pulse-width modulation is used to regulate the mean current. Simpler models switch voltage
only for doing a step, thus needing an extra current limiter: for every step, they switch a single cable to the
motor.
The idea is to connect the output pins of the driver to 4 transistors. The transistor must be
grounded at the emitter and the driver pin must be connected to the base. Collector is connected to the coil
wire of the motor. Stepper motors are rated by the torque they produce. Synchronous electric motors using
soft magnetic materials (having a core) have the ability to provide position holding torque (called detent
torque, and sometimes included in the specifications) while not driven electrically. To achieve full rated
torque, the coils in a stepper motor must reach their full rated current during each step. The voltage rating
(if there is one) is almost meaningless. The motors also suffer from EMF, which means that once the coil is
turned off it starts to generate current because the motor is still rotating. There needs to be an explicit way
to handle this extra current in a circuit otherwise it can cause damage and affect performance of the motor.
44 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
44 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus stepper motor interface with ARM processor has been successfully implemented and the motor is
controlled in clockwise and anticlockwise direction.
Outcome:
Able to interface the stepper motor with ARM controller and thereby create some rotational
movements





45 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Applications:
3. Used for precise positioning with a motor
4. Used in hard disk drives, robotics
5. Used in telescopes and toys







1. Define GPIO.
2. What is the function of ULN2803?
3. How LPC2148 control stepper motor?
4. Which I/O port lines used to rotate stepper motor?
5. How stepper motor reacts for each pulse it receives?
6. What is serial communication?
7. What is parallel communication?
8. What is stepper motor & why it is named so?
9. How can be step angle is calculated?
10. What are the advantages and disadvantages of parallel communication?
11. What does instruction-pipelining mean?
12. What is the power supply required for ARM processor?
13. What is a unit for torque?
14. What is RPM rating for a DC motor?
15. What device that is used to obtain an accurate position control of rotating shafts in terms of steps?
Viva-voce

46 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
46 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Expt. No. 12 LM35 TEMPERATURE SENSOR INTERFACE
WITH ARM-7 LPC2148
Aim:
To write a program to interface of LM35 temperature sensor to on-chip ADC of ARM controller and
display the room temperature value on the screen.
Apparatus Required:
1. LPC2148 ARM development board
2. Temperature sensor
3. Interfacing cables
4. PC
Theory:
Temperature Sensor:
The LM35 series are precision integrated-circuit temperature sensors, whose output voltage is linearly
proportional to the Celsius (Centigrade) temperature. The output of the sensor is converted to digital output
that is easy to connect with microcontroller. Temperature sensor has three terminals and required
Maximum of 5.5 V supply. This type of sensor consists of a material that performs the operation according
to temperature to vary the resistance. This change of resistance is sensed by circuit and it calculates
temperature. When the voltage increases then the temperature also rises. We can see this operation by
using a diode.







47 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
47 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00


Circuit diagram:

48 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
48 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the program for interfacing temperature sensor with ARM controller is written and executed and
the temperature reading is seen on the monitor.
Outcome:
Able to interface different sensors with in-built ADC of the ARM processor and access the data
produced from them
Applications:
1. Used in Ovens, refrigerators
2. In HVAC environmental control
3. coolant or cylinder head temperatures
4. in the automotive industry to monitor air intake



1. What is LM35?
2. Define ISP.
3. How many Analog-to-Digital Converters available as an inner peripheral in LPC2148?
4. What is the main function of analog pin in LPC 2148?
5. What is the output voltage produced by LM35 for one degree temperature?
6. What is the difference between LM 34 and LM 35 sensors?
7. How many pins are available in LM35?
8. Why Vref is set of ADC0848 to 2.56 V if analog input is connected to the LM35?
9. What is operating the operating temperature range in LM35?
10. Why LM35 is used to Measure Temperature?
11. List the devices used to sense temperature.
12. What is the purpose of a thermocouple?
13. What is the output voltage of a thermocouple?
Viva-voce

FirstRanker.com - FirstRanker's Choice
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00






?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING

VII SEMESTER - R 2013

EC6711 ? EMBEDDED LABORATORY






Name : _______________________________________
Register No : _______________________________________
Section : _______________________________________
LABORATORY MANUAL



2 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00




is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and
training.

? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different
levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on
heart and soul
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

To impart professional education integrated with human values to the younger generation, so as to
shape them as proficient and dedicated engineers, capable of providing comprehensive solutions to the
challenges in deploying technology for the service of humanity

? To educate the students with the state-of-art technologies to meet the growing challenges of the
electronics industry
? To carry out research through continuous interaction with research institutes and industry, on
advances in communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning,
innovation and ethical practices
VISION
VISION
MISSION
MISSION



3 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

PROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To provide students with a solid foundation in Mathematics, Science and fundamentals of
engineering, enabling them to apply, to find solutions for engineering problems and use this knowledge
to acquire higher education
2. Core Competence
To train the students in Electronics and Communication technologies so that they apply their
knowledge and training to compare, and to analyze various engineering industrial problems to find
solutions
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice which
enables them to find solutions for the real time problems in industry, and to design products
4. Professionalism
To inculcate professional and effective communication skills, leadership qualities and team spirit in
the students to make them multi-faceted personalities and develop their ability to relate engineering
issues to broader social context
5. Lifelong Learning/Ethics
To demonstrate and practice ethical and professional responsibilities in the industry and society in
the large, through commitment and lifelong learning needed for successful professional career


4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
PROGRAMME OUTCOMES (POs)
a) To demonstrate and apply knowledge of Mathematics, Science and engineering fundamentals in
Electronics and Communication Engineering field
b) To design a component, a system or a process to meet the specific needs within the realistic
constraints such as economics, environment, ethics, health, safety and manufacturability
c) To demonstrate the competency to use software tools for computation, simulation and testing of electronics
and communication engineering circuits
d) To identify, formulate and solve electronic and communication engineering problems
e) To demonstrate an ability to visualize and work on laboratory and multidisciplinary tasks
f) To function as a member or a leader in multidisciplinary activities
g) To communicate in verbal and written form with fellow engineers and society at large
h) To understand the impact of Electronics and Communication Engineering in the society and demonstrate
awareness of contemporary issues and commitment to give solutions exhibiting social responsibility
i) To demonstrate professional & ethical responsibilities
j) To exhibit confidence in self-education and ability for lifelong learning
k) To participate and succeed in competitive exams


5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
SYLLABUS

? Learn the working of ARM processor
? Understand the Building Blocks of Embedded Systems
? Learn the concept of memory map and memory interface
? Know the characteristics of Real Time Systems
? Write programs to interface memory, I/Os with processor
? Study the interrupt performance
LIST OF EXPERIMENTS:
1. Study of ARM evaluation system
2. Interfacing ADC and DAC
3. Interfacing LED and PWM
4. Interfacing real time clock and serial port
5. Interfacing keyboard and LCD
6. Interfacing EPROM and interrupt
7. Mailbox
8. Interrupt performance characteristics of ARM and FPGA
9. Flashing of LEDS
10. Interfacing stepper motor and temperature sensor
11. Implementing zigbee protocol with ARM



? Write programs in ARM for a specific Application
? Interface memory and Write programs related to memory operations
? Interface A/D and D/A convertors with ARM system
? Analyze the performance of interrupt
? Write programmes for interfacing keyboard, display, motor and sensor.
? Formulate a mini project using embedded system
COURSE OBJECTIVES
COURSE OUTCOMES
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
CONTENTS
Sl. No. Name of the Experiment Page No.
CYCLE 1 ? EXPERIMENTS
1
Study of ARM evaluation system 7
2
Analog to Digital Convertor interfacing 16
3
Generation of ramp and square wave using on-Chip DAC 19
4
LED dimming using PWM 22
5
Interfacing real time clock and serial port 25
6
Interfacing keypad and LCD 28
7
Interfacing EPROM and interrupt 31
CYCLE 2 ? EXPERIMENTS
8 Implementation of Mailbox Function using LPC 2148 35
9 Interrupt Performance Characteristics of Arm and FPGA 37
10 Flashing of LEDs 40
11 Stepper Motor Interface with ARM ? 7 LPC2148 43
12 LM35 Temperature Sensor Interface with ARM ? 7 LPC2148 47
13
Implementation of Wireless Communication Protocol using ZIGBEE Wireless
Module
50
ADDITIONAL EXPERIMENTS BEYOND THE SYYLABUS
14 Buzzer Interface with ARM ? 7 54
15 Relay interface with ARM? 7 57
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Expt. No. 1 STUDY OF ARM EVALUATION SYSTEM
Aim:
To study the building blocks of ARM7 system, its features, pin configuration and the components
required for functioning of ARM controller.
Architecture Overview:
A RISC-based computer design approach means ARM processors require significantly fewer transistors
than typical processors in average computers. This approach reduces cost, heat and power usage. These
are desirable traits for light, portable, battery-powered devices (smart phones, laptops, tablet and notepad
computers), and other embedded systems. A simpler design facilitates more efficient multi-core CPUs and
higher core counts at lower cost, providing higher processing power and improved energy efficiency for
servers and supercomputers.
In 2005, about 98% of all mobile phones sold used at least one ARM processor. The low power
consumption of ARM processors has made them very popular: 37 billion ARM processors have been
produced as of 2013, up from 10 billion in 2008. The ARM architecture (32-bit) is the most widely used
architecture in mobile devices, and most popular 32-bit one in embedded systems.
According to ARM Holdings, in 2010 alone, producers of chips based on ARM architectures
reported shipments of 6.1 billion ARM based processors, representing 95% of smart phones, 35% of digital
televisions and set-top boxes and 10% of mobile computers. It is the most widely used 32-bit instruction set
architecture in terms of quantity produced.
LPC 2148:
LPC2148 is the widely used IC from ARM-7 family. It is manufactured by Philips and it is pre-loaded
with many inbuilt peripherals making it more efficient and a reliable option for the beginners as well as high
end application developer.




8 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Features of LPC214x series controllers:
1. 8 to 40 kB of on-chip static RAM and 32 to 512 kB of on-chip flash program memory.128 bit wide
interface/accelerator enables high speed 60 MHz operation.
2. In-System/In-Application Programming (ISP/IAP) via on-chip boot-loader software. Single flash sector or
full chip erase in 400 ms and programming of 256 bytes in 1ms.
3. Embedded ICE RT and Embedded Trace interfaces offer real-time debugging with the on-chip Real
Monitor software and high speed tracing of instruction execution.
4. USB 2.0 Full Speed compliant Device Controller with 2 kB of endpoint RAM. In addition, the LPC2146/8
provides 8 kB of on-chip RAM accessible to USB by DMA.
5. One or two (LPC2141/2 vs. LPC2144/6/8) 10-bit A/D converters provide a total of 6/14analog inputs, with
conversion times as low as 2.44 us per channel.
6. Single 10-bit D/A converter provides variable analog output.
7. Two 32-bit timers/external event counters (with four capture and four compare channels each), PWM unit
(six outputs) and watchdog.
8. Low power real-time clock with independent power and dedicated 32 kHz clock input.
9. Multiple serial interfaces including two UARTs (16C550), two Fast I2C-bus (400 kbit/s), SPI and SSP with
buffering and variable data length capabilities.
10. Vectored interrupt controller with configurable priorities and vector addresses.
11. Up to 45 of 5 V tolerant fast general purpose I/O pins in a tiny LQFP64 package.
12. Up to nine edge or level sensitive external interrupt pins available.
13. On-chip integrated oscillator operates with an external crystal in range from 1 MHz to30 MHz and with
an external oscillator up to 50 MHz
14. Power saving modes include Idle and Power-down.
15. Individual enable/disable of peripheral functions as well as peripheral clock scaling for additional power
optimization.
16. Processor wake-up from Power-down mode via external interrupt, USB, Brown-Out Detect (BOD) or
Real-Time Clock (RTC).




9 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


First Step- Hardware Requirement:
Pin configuration of LPC 2148.

Hardware requirement of LPC2148:
1. LPC2148 need minimum below listed hardware to work properly
2. Power Supply
3. Crystal Oscillator
4. Reset Circuit
5. RTC crystal oscillator
6. UART
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Power Supply:
LPC2148 works on 3.3 V power supply. LM 117 can be used for generating 3.3 V supply. However,
basic peripherals like LCD, ULN 2003 (Motor Driver IC) etc. works on 5V. So AC mains supply is converted
into 5V using below mentioned circuit and after that LM 117 is used to convert 5V into 3.3V.
Block diagram of power Supply

Transformer: It is used to step down 230V AC to 9V AC supply and provides isolation between power grids
and circuit.
Rectifier: It is used to convert AC supply into DC.
Filter: It is used to reduce ripple factor of DC output available from rectifier end.
Regulator: It is used to regulate DC supply output.

11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Circuit Diagram:

Regulator IC 7805 is used to provide fix 5V dc supply.
LM 117 is used for generating 3.3V supply from 5V.

12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Calculations:

From the datasheet of LM117

Taking R 2= 240?, we get R 1=392?
Reset Circuit:
Reset button is essential in a system to avoid programming pitfalls and manually bring back the system
to the initialization mode. MCP 130T is a special IC used for providing stable RESET signal to LPC 2148.


13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Oscillator Circuit:

The value of capacitors C20 & C21 depends upon the frequency of crystal Y3. General circuit and
its equivalent circuit is as shown below.

14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Recommended values are as shown in table:

UART:
LPC 2148 has inbuilt ISP which means we can program it within the system using serial
communication on COM0. It has also COM1 for serial communication. MAX 232/233 IC must be used for
voltage logic conversion. Related connections are as given below.

Once the above listed circuit design is ready, we are ready to go further.



15 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Result:
ARM Evaluation system and the configuration of LPC2148 has been studied fully. The minimal setup
required for the functioning of the ARM processor is studied.
Outcomes:
1. Able to understand the ARM controller, its basic components inside and its features.
2. Able to know the components required for the working of ARM LPC2148

Applications:
ARM controller LPC2148 is used in no. of devices such as
1. Smart phones
2. Net books
3. E Readers
4. Digital TV
5. Home Gateways


1. What are the basic units of ARM 7?
2. What is the address system supported by ARM?
3. Define - RISC
4. What are the instructions used to access the memory in ARM?
5. What are the basic units of Microprocessor?
6. What is an Instruction?
7. What is clock cycle?
8. Define - Pipelining
9. What is cache miss?
10. What is meant by memory mapped I/O?
11. Define ? interrupt
12. What is meant by Exception?
13. What is meant by little ? endian mode?
14. What is meant by big ? endian mode?
15. What is the function of CPSR?
16. What is register - indirect addressing?
Viva-voce




16 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 2 ANALOG TO DIGITAL CONVERTOR
INTERFACING
Aim:
To write an embedded c program for interfacing an on chip ADC with LPC2148 ARM processor and
convert the given input voltage into corresponding decimal values.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. PC
Theory:
Analog to Digital converter (ADC) is a device that converts continuously varying analog signals from
instruments that monitor such conditions as movement, temperature, sound, etc., into binary code for the
computer. It may be either a single chip or can be one circuit within a chip. Analog to Digital conversion is
the process of changing continuously varying data, such as voltage, current, or shaft rotation, into discrete
digital quantities that represent the magnitude of the data compared to a standard or reference at the
moment the conversion is made. According to the method of conversion, ADCs can be classified into
Direct-Conversion ADCs, Successive Approximation ADCs, Integrating ADC and Sigma-Delta ADCs.
The LPC 2148 has 10-bit successive approximation analog to digital converter. Basic clocking for the
A/D converters is provided by the VPB clock. A programmable divider is included in each converter, to
scale this clock to the 4.5 MHz (max) clock needed by the successive approximation process. A fully
accurate conversion requires 11 of these clocks. The ADC cell can measure the voltage on any of the ADC
input signals. It is noted that these analog inputs are always connected to their pins, even if the Pin function
Select register assigns them to port pins. A simple self-test of the ADC can be done by driving these pins
as port outputs.



17 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Circuit diagram:




18 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus, an embedded c program for interfacing on-chip ADC with ARM processor is written and
executed. The decimal values of the converted voltage are seen in the WinXTalk screen.
Outcome:
Able to interface A/D convertors with ARM system and check its working by connecting an analog
quantity as input.
Applications:
1. ADC used in MODEM for converting analog signals to digital.
2. A fast video ADC in TV tuner cards
3. ADC used in digital storage oscilloscopes
4. Used in music reproduction technology.
5. Used in DSP if input is analog


1. What are the ADC operating modes in LPC2148?
2. What is meant by conversion time?
3. Why are internal ADCs preferred over external ADCs?
4. Why has 16-bit ADC more resolution than from 10-bit and 8-bit ADC?
5. What are ADC & its Resolution?
6. What is Burst conversion mode?
7. What is the function of A/D Control Register?
8. What is the function of A/D Global Data Register?
9. What is the function of A/D Status Register?
10. What is analog-to-digital (ADC) conversion error?
11. What is the function of Sample-and-hold circuits in analog-to digital converters?
12. What is the disadvantage of the flash analog-to digital converter?
Viva-voce




19 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 3 GENERATION OF RAMP AND SQUARE
WAVE USING ON-CHIP DAC
Aim:
To write and execute an embedded c program to generate ramp wave and square wave using on-chip
DAC of LPC2148 ARM controller.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
A digital-to-analog converter is a device for converting a digital signal into an analog signal (current or
voltage). Digital-to-Analog Converters are the interface between the abstract digital world and the analog
real world. Simple switches, a network of resistors, current sources or capacitors may be used to
implement this conversion. A DAC inputs a binary number and outputs an analog voltage or current signal.
The Microchip Technology Inc. MCP4921 is 2.7 ? 5.5V, low-power, 12-Bit Digital-to-Analog Converter
(DAC) with SPI interface. The MCP4921 DAC provides high accuracy and low noise performance for
industrial applications where calibration or compensation of signals is required. With an SPI connection
there is always one master device (usually a microcontroller) which controls the peripheral devices.
Typically there are three lines common to all the devices,
Master In Slave Out (MISO) ? The Slave line for sending data to the master,
Master Out Slave In (MOSI) ? The Master line for sending data to the peripherals,
Serial Clock (SCK) ? The clock pulses which synchronize data transmission generated by the
master and slave
Slave Select pin ? the pin on each device that the master can use to enable and disable specific
devices. When a device Slave Select pin is low, it communicates with the master. When it is high, it ignores
the master. In SPI, the clock signal is controlled by the master device LPC2148. All data is clocked in and
out using this pin. These lines need to be connected to the relevant pins on the LPC21xx processor. Any
unused GIO pin can be used for CS, instead pull this pin high. Conversion speed is the time it takes for the



20 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

DAC to provide an analog output when the digital input word is changed. The MCP4291 DAC ? SPI
connections with LPC21xx have four I/O lines (P0.4 ? P0.7) required. The analog output is generated by
using these four lines.
Circuit diagram:


Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the embedded c programs for generating ramp wave and square wave using ARM LPC2148 are
written and executed successfully and the waveforms are viewed in oscilloscope.
Outcome:
Able to program the DAC in-built inside the ARM controller and get the waveforms using it.




21 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications :
1. DAC used in Audio amplifier.
2. Video encoder
3. Display electronics
4. Data Acquistion systems
5. Motor control



1. What are the features of LPC2148 DAC?
2. What is the function of DAC register?
3. Which pin provides a voltage reference level for the D/A converter?
4. What are the applications of DAC in signal processing applications?
5. What is GIO?
6. What is the resolution of a digital-to-analog converter (DAC)?
7. What is the major advantage of the R/2R ladder digital-to-analog (DAC), as compared to a binary-
weighted digital-to-analog DAC converter?
8. What is the resolution of a 0?5 V 6-bit digital-to-analog converter (DAC) ?
9. What are DAC configurations?
10. What are the different types of DAC Circuits?
11. What are the Limitations of the Binary Weighted DAC?
12. What are the General DAC Characteristics?
13. Define reference voltage in DAC.
14. What is full scale voltage?
15. What is settling time?
VIVA-VOCE




22 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 4 LED DIMMING USING PWM

Aim:
To write an embedded c program for implementing PWM using ARM controller and verify the same by
dimming of LEDs.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
LPC2148 supports 2 types of PWM:
1) Single Edge PWM ? Pulse starts with new Period i.e pulse is always at the beginning
2) Double Edge PWM ? Pulse can be anywhere within the Period
A PWM block, like a Timer block , has a Timer Counter and an associated Pre-scale Register along
with Match Registers. These work exactly the same way as in the case of Timers. Match Registers 1 to 6
(except 0) are pinned on LPC214x i.e. the corresponding outputs are diverted to actual Pins on LPC214x
MCU. The PWM function must be selected for these Pins to get the PWM output.
The basic setup is to simply replace Servo by a LED and no external 5V source is needed. The
anode of LED is connected to P0.0 and cathode to ground. Pulse Widths corresponding to the switches
connected to P0.1/2/3/4 will be 2.5ms/5ms/7.5ms/10ms respectively. As the Pulse Width Increases LED
will keep on getting brighter and the reverse will happen if Pulse Width is decreased.



23 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus embedded c program for implementing Pulse Width Modulation is written and executed and
output has been verified in LED display.
Outcome:
Able to implement PWM using the ARM controller and verify the same in the form of dimming of
LEDS.



24 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Applications :
1. In Visual signals to covey a message
2. Illumination where light is reflected from objects
3. In Narrow band sensors



1. What factors determine the LED dimming performance?
2. What is meant by analog dimming?
3. What is flickering effect?
4. What is the factor determines dimming of the LED
5. Why Silicon is not suitable for fabrication of light-emitting diodes?
6. Why Silicon diode is less suited for low voltage rectifier operation?
7. What is the principle of zener diode?
8. What are the materials used to make LED?
9. What type of diodes is used in FM receivers?
10. Which diode suffers an avalanche breakdown?
11. What happens if the junction temperature of LED is increased?
12. How a transfer characteristic of a diode does is related?
13. What is the requirement of a clipping action of a diode?
14. What type of rectifier circuit requires four diodes?
15. Why are the pulse width modulated outputs required in most of the applications?
16. How do the variations in an average value get affected by PWM period?
17. Name the common formats available for LED display.
18. What are the types of seven segment display?
19. What is PWM?
20. What are the applications of PWM?

Viva-voce




25 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 5 INTERFACING REAL TIME CLOCK
AND SERIAL PORT
Aim:
To write and execute an embedded c program to interface DS1307 RTC using I2C protocol with ARM
controller
Apparatus Required:
1. LPC2148 ARM development board
2. Stepper motor
3. Interfacing cables
4. PC
Theory:
A clock, which is based on the interrupts at preset intervals, is Real Time Clock (RTC). An interrupt
service routine executes on each timeout (overflow) of this clock. This timing device once started never
resets or never reloaded with another value. Once it is set, it is not modified later. It is used in a system to
save the time and date.













26 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the program for interfacing real time clock with ARM controller is written and executed and the
date and time are verified on the screen.
Outcome:
Able to interface real time clock DS1307 with ARM controller and thereby display date and time
Applications :
1. I2C In ARM and PIC microcontrollers
2. Used as serial communication protocol with MASTER and SLAVE operation.

27 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
27 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00




1. What is I2C and how does it work?
2. What are the features of I2C in LPC2148 ARM7 microcontroller?
3. What is the function of I2C0CONSET register?
4. What is I2C0STAT?
5. What is the function of I2C0 Data Register?
6. What is RTC?
7. List the advantages of RTC
8. Through which port the date and time is displayed in RTC?
9. What is a serial port?
10. List the registers used to transfer data in serial port.
11. List the modes used for data transmission.
12. What is a simplex mode?
13. Which pin is used to transmit a character?
14. What is the baud rate of serial port?
15. What is the disadvantage of RS-232C?














Viva-voce




28 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 6 INTERFACING KEYPAD AND LCD

Aim:
To write an embedded c program to interface 4 x 4 matrix keypad with ARM processor and display the
pressed key in an LCD.
Apparatus Required:
1. LPC2148 ARM development board
2. Interfacing cables
3. PC
Theory:

In matrix keypad, keys are connected in rows and columns. When any switch is pressed, rows and
columns come into contact, which is that detected by controller to identify which key has been pressed. A
4?4 matrix keypad consists of 4 rows and 4 columns. There is a switch connecting each row and column.
So the combinations of rows and columns make up the 16 inputs.Initially all the switches are open (not
connected). When any one button is pressed, the switch is closed (connected),hence there is a connection
between the row and column. The first 4 pins are connected to the column as INPUT. The other 4 pins are
connected to the row as OUTPUT. Matrix keypad is a good substitution to normal push button.












29 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Circuit Diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus program for interfacing matrix keypad with ARM controller is written and executed and the key
pressed is seen in the LCD.



30 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Outcome:
Able to interface keypad with ARM controller and see the pressed key in the LCD display.
Applications :
1. Used in password based door locking system
2. Security system with user changeable
3. Used in laptops, computer games
4. Used in portable video games and cell phones



1. What is Matrix keypad?
2. What is the concept behind keypad interface?
3. What are the functions of pull- up resistors?
4. What is key de bouncing?
5. List the steps involved when the key in a 4 x 4 keyboard matrix is being pressed.
6. What is the value obtained if no key is pressed?
7. What kind of interrupt is generated if a key has to be operated in an interrupt mode?
8. How will you identify that the key is pressed?
9. What are the steps involved in Keyboard Interfacing?
10. List the registers used to store the keyboard, display modes and other operations programmed by
CPU.
11. Name the mode when a data is entered from the left side of the display unit.
12. How many rows and columns are present in a 16 x 2 alphanumeric LCD?
13. How many data lines are there in a 16 x 2 alphanumeric LCD?
14. Which pin of the LCD is used for adjusting its contrast?
15. Which command of an LCD is used to shift the entire display to the right?
16. Which command is used to select the 2 lines and 5 x 7 matrix of an LCD?
17. What changes are to be made to send data to an LCD?
18. For reading operation from an LCD what changes in the software are introduced?
19. Which instruction is used to select the first row first column of an LCD?
Viva-voce

31 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
31 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Expt. No. 7 INTERFACING EEPROM AND INTERRUPT

Aim:
To write a program to interface EEPROM using I2C protocol with ARM controller and retrieve the stored
messages inside EEPROM.
Apparatus Required:
1. LPC2148 ARM development board
2. Interfacing cables
3. PC
Theory:
I2C (Inter Integrated Circuit):
The I2C (Inter-IC) bus is a bi-directional two-wire serial bus that provides a communication link between
integrated circuits (ICs).I2C is a synchronous protocol that allows a master device to initiate communication
with a slave device. Data is exchanged between these devices.
EEPROM:
EEPROM (electrically erasable programmable read-only memory) is user-modifiable read-only
memory (ROM) that can be erased and reprogrammed (written to) repeatedly through the application of
higher than normal electrical voltage. It is a type of non-volatile memory used in computers and other
electronic devices to store small amounts of data that must be saved when power is removed, e.g.,
calibration tables or device configuration
Read, write and Erase EEPROM by using I2C in LPC2148 Primer Board. Wiring up an I2C based
EEPROM to the I2C port is relatively simple. The basic operation of the I2C based EEPROM's is to send a
command, such as WRITE, followed by an address and the data. In WRITE operation, the EEPROM is
used to store the data. In LPC2148 Primer Kit, 2 nos. of EEPROM lines are controlled by I2C Enabled
drivers. I2C Lines serial clock SCL (P0.2), serial data SDA (P0.3) connected to the I2C based serial
EEPROM IC. The EEPROM read & write operations are done in LPC2148 Primer Kit by using these SDA &
SCL I2C lines.
32 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
32 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To down load and run this program: Refer General procedure given in Page No: 60
Result:
Thus, the program for interfacing I2C based EEPROM with ARM processor has been written and
executed successfully and the memory content is verified on Win x talk terminal.
Outcome:
Able to interface memory ICs with ARM controller and perform the read and write operations.



33 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications:
1. ROM used in toys,automobiles to store data when power is off
2. In calculators and peripheral devices
3. In laser printers
4. And also in embedded systems where program need not to be changed.


1. How does I2C protocol work?
2. What is EEPROM?
3. What is meant by master slave mode?
4. What is meant by non-volatile memory?
5. What is an interrupt?
6. How does an interrupt request works?
7. What is a nested interrupt?
8. What are the registers used for enabling an interrupt?
9. What is PROM?
10. What is EPROM?
11. What is mask ROM?
12. Which memory allows simultaneous read and write operations?
13. Which memory has the shortest access times?
14. Which interrupt has the highest priority?
15. What is non maskable interrupt?
16. Which is the first level of memory access by the microprocessor?
17. List the types of cache memories.
18. What is the use of an interrupt?
19. What is the use of converting an interrupt to threads in a microprocessor?
20. What are the bits used to control an external interrupts?


Viva-voce




34 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00










CYCLE 2 - EXPERIMENTS




35 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 8 IMPLEMENTATION OF MAILBOX FUNCTION
USING LPC2148
Aim:
To create a mailbox in Micro C/OS ? II using LPC2148 ARM Controller
Apparatus Required:
1. LPC2148 ARM development board
2. Interfacing cables
3. PC
Theory:
System or the user code can send a message by the core services. A typical mail message, also
known as the exchange of information, refers to a task or an ISR using a pointer variable, through the core
services to put a message (that is, a pointer) into the mailbox. Similarly, one or more tasks can receive this
message by the core services. The tasks sending and receiving the message promise that the content that
the pointer points to is just that piece of message.
The mailbox of CooCox CoOS is a typical message mailbox which is composed of two parts: one is
the information which expressed by a pointer of void; the other is the waiting list which composed of the
tasks waiting for this mailbox. The waiting list supports two kinds of sorting: FIFO and preemptive priority.
The sorting mode is determined by the user when creating the mailbox.
Procedure:
To Edit / Compile / generate Hex file: Refer General procedure in Page No: 58
To down load and run this program: Refer General procedure in Page No: 60
Result:
Thus, the mailbox was created in Micro C/OS ?II and implemented using LPC2148.
Outcome:
Able to understand the concept of mail box in embedded systems and its significance in real time
systems





36 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications:
1. Used in Acorn RISC PC700
2. Used in ZIPIT wireless messenger
3. Used in Meizu M6 MINI player


1. What is IPC?
2. Define Queue.
3. What are the different types of mail box functions?
4. What is half duplex mode?
5. How many synchronous and asynchronous modes are there in serial port?
6. List the bits used to generate serial port interrupt
7. What is branch prediction?
8. Mention any two features of ?C/OS ? II.
9. Write the function for creating task in ?C/OS ? II.
10. Mention any two support devices for ?C/OS ? II.
11. How many user tasks can be handled by ?C/OS ? II?



















Viva-voce




37 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 9 INTERRUPT PERFORMANCE
CHARACTERISTICSOF ARM AND FPGA

Aim:
To study the interrupt performance characteristics of ARM and FPGA by using ARM controller kit and
FPGA kit separately.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
External Interrupts:
An interrupt caused by an external source such as the computer operator, external sensor or
monitoring device, or another computer. Interrupts are special events that require immediate attention.
Interfacing External Interrupts with LPC2148:
When an external interrupt signal occurs in LPC2148 Primer Board, the message "LOW" will be
displayed on PC. The interrupt signal occurs using switches. When the switch is pressed to LOW, then the
external interrupt occurs. The Vectored Interrupt Controller (VIC) takes 32 interrupt request inputs and
programmable assigns them into 3 categories, FIQ, vectored IRQ, and non-vectored IRQ. The ARM7
LPC2148 Primer board has two numbers of External Interrupts, connected with I/O Port lines (P0.14 &
P0.15) as switches.







38 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00



Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60


39 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
39 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Result:
Thus the interrupt performance characteristics of ARM and FPGA are studied. On comparison, ARM
counts at slow speed because it consumes more instruction cycle and FPGA is more efficient for servicing
and processing external interrupt pulses.
Outcome:
Able to understand the performance characteristics of ARM and FPGA while dealing with
interrrupts
Applications:
1. Used in random logic and SPLDs
2. Used in cryptography and filtering
3. In medical imaging
4. In bioinformatics and voice recognition



1. When is an Interrupt Request received?
2. What is ISR?
3. How do you initialize interrupt?
4. What is Vectored Interrupt Controller?
5. What are the kinds of protection available for SRAMS ?
6. What is interrupt pipelining?
7. What is pipeline shutdown?
8. What is branch prediction?
9. What is the use of Neon Floating point engine?
10. What is the use of ?vectorize option?
11. What is PTM?
12. What is ITM?
13. What is ETM?
14. What is I2S interface?
15. What is the use of ?SWI? in ARM assembly?

Viva-voce




40 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 10 FLASHING OF LEDS
Aim:
To write and execute an embedded c program to display LEDs using LPC 2148 ARM controller
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
Theory:
LED (Light Emitting Diodes) is the most commonly used components, usually for displaying pins digital
states. Typical uses of LEDs include alarm devices, timers and confirmation of user input such as a mouse
click or keystroke. Interfacing LED with LPC2148 Flash a LED using LPC2148 Primer Board. It works by
turning ON a LED & then turning it OFF & then looping back to START. However the operating speed of
microcontroller is very high so the flashing frequency will also be very fast to be detected by human eye.
The ARM7 LPC2148 Primer board has eight numbers of point LEDs, connected with I/O Port lines (P1.16 ?
P1.23) to make port pins high.










41 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00



Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus program for flashing of LEDs is written and executed using ARM controller LPC2148.



42 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Outcome:
Able to interface LED lights via the input output port and control them
Applications:
1. In Illumination
2. As status indicators in equipments
3. Stadium displays and dynamic decorative displays



1. What is seven segment displays?
2. What are the different configurations of LED?
3. What is the function of GPIO?
4. What are the Pins which are used to connect LEDs?
5. How to identify 'Polarity' of LED?
6. Differentiate LED from LCD.
7. What is a use of Jumper?
8. How many numbers of LEDs present in Primer board?
9. Where LEDs are used?
10. What is the use of flash magic software?
11. Which port is used in ARM 7 processor kit?
12. Which diode suffers an avalanche breakdown?
13. What happens if the junction temperature of LED is increased?
14. What is an anti collision rate light?
15. What is fail-safe conditions






Viva-voce




43 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 11 STEPPER MOTOR INTERFACE WITH
ARM -7 LPC2148
Aim:
To write a program to interface stepper motor using ARM processor and control the movement of motor
in either directions.
Apparatus Required:
1. LPC2148 ARM development board
2. Stepper motor
3. Interfacing cables
4. PC
Theory:
A stepper motor can be viewed as a DC motor with number of poles (on both rotor and stator).
Additionally, soft magnetic material with many teeth on the rotor and stator cheaply multiplies the number of
poles (reluctance motor). Like an AC synchronous motor, it is ideally driven by sinusoidal current, allowing
a step less operation, but this puts some burden on the controller. When using an 8-bit digital controller,
256 micro steps per step are possible. As a digital-to-analog converter produces unwanted ohmic heat in
the controller, pulse-width modulation is used to regulate the mean current. Simpler models switch voltage
only for doing a step, thus needing an extra current limiter: for every step, they switch a single cable to the
motor.
The idea is to connect the output pins of the driver to 4 transistors. The transistor must be
grounded at the emitter and the driver pin must be connected to the base. Collector is connected to the coil
wire of the motor. Stepper motors are rated by the torque they produce. Synchronous electric motors using
soft magnetic materials (having a core) have the ability to provide position holding torque (called detent
torque, and sometimes included in the specifications) while not driven electrically. To achieve full rated
torque, the coils in a stepper motor must reach their full rated current during each step. The voltage rating
(if there is one) is almost meaningless. The motors also suffer from EMF, which means that once the coil is
turned off it starts to generate current because the motor is still rotating. There needs to be an explicit way
to handle this extra current in a circuit otherwise it can cause damage and affect performance of the motor.
44 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
44 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus stepper motor interface with ARM processor has been successfully implemented and the motor is
controlled in clockwise and anticlockwise direction.
Outcome:
Able to interface the stepper motor with ARM controller and thereby create some rotational
movements





45 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Applications:
3. Used for precise positioning with a motor
4. Used in hard disk drives, robotics
5. Used in telescopes and toys







1. Define GPIO.
2. What is the function of ULN2803?
3. How LPC2148 control stepper motor?
4. Which I/O port lines used to rotate stepper motor?
5. How stepper motor reacts for each pulse it receives?
6. What is serial communication?
7. What is parallel communication?
8. What is stepper motor & why it is named so?
9. How can be step angle is calculated?
10. What are the advantages and disadvantages of parallel communication?
11. What does instruction-pipelining mean?
12. What is the power supply required for ARM processor?
13. What is a unit for torque?
14. What is RPM rating for a DC motor?
15. What device that is used to obtain an accurate position control of rotating shafts in terms of steps?
Viva-voce

46 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
46 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Expt. No. 12 LM35 TEMPERATURE SENSOR INTERFACE
WITH ARM-7 LPC2148
Aim:
To write a program to interface of LM35 temperature sensor to on-chip ADC of ARM controller and
display the room temperature value on the screen.
Apparatus Required:
1. LPC2148 ARM development board
2. Temperature sensor
3. Interfacing cables
4. PC
Theory:
Temperature Sensor:
The LM35 series are precision integrated-circuit temperature sensors, whose output voltage is linearly
proportional to the Celsius (Centigrade) temperature. The output of the sensor is converted to digital output
that is easy to connect with microcontroller. Temperature sensor has three terminals and required
Maximum of 5.5 V supply. This type of sensor consists of a material that performs the operation according
to temperature to vary the resistance. This change of resistance is sensed by circuit and it calculates
temperature. When the voltage increases then the temperature also rises. We can see this operation by
using a diode.







47 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
47 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00


Circuit diagram:

48 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
48 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the program for interfacing temperature sensor with ARM controller is written and executed and
the temperature reading is seen on the monitor.
Outcome:
Able to interface different sensors with in-built ADC of the ARM processor and access the data
produced from them
Applications:
1. Used in Ovens, refrigerators
2. In HVAC environmental control
3. coolant or cylinder head temperatures
4. in the automotive industry to monitor air intake



1. What is LM35?
2. Define ISP.
3. How many Analog-to-Digital Converters available as an inner peripheral in LPC2148?
4. What is the main function of analog pin in LPC 2148?
5. What is the output voltage produced by LM35 for one degree temperature?
6. What is the difference between LM 34 and LM 35 sensors?
7. How many pins are available in LM35?
8. Why Vref is set of ADC0848 to 2.56 V if analog input is connected to the LM35?
9. What is operating the operating temperature range in LM35?
10. Why LM35 is used to Measure Temperature?
11. List the devices used to sense temperature.
12. What is the purpose of a thermocouple?
13. What is the output voltage of a thermocouple?
Viva-voce




49 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 13 IMPLEMENTATION OF WIRELESS
COMMUNICATION PROTOCOL
USING ZIGBEE WIRELESS MODULE
Aim:
To implement wireless communication protocol using zigbee wireless module with the help of ARM
processor
Apparatus required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. Zigbee module
5. PC
Theory:
ZigBee is a specification to suite high level communication protocols using small, low-power digital
radios based on an IEEE 802 standard for personal area networks. The ZigBee is the name of a wireless
protocol maintained by the IEEE 802.15 standard. This is a protocol specified for wireless Personal Area
Network (PAN) using low powered wireless transceivers. There are already wireless transmitter and
receiver modules which can do point to point communication. The Xbee is the brand name a wireless
transceiver device introduced by the Digi international which works on the ZigBee protocol and can form
PAN networks. They have an approximate range of 10 to 100 meters and are used in industries, scientific
fields, medical fields etc
Digi ZigBee:
The Digi Xbee 802.15.4 modules are the easiest to use, most reliable and cost-effective RF devices.
The 802.15.4 Xbee modules provide two friendly modes of communication - a simple serial method to
transmit/receive or a framed mode providing advanced features. These modules can communicate point to
point, from one point to a PC, or in a mesh network.



FirstRanker.com - FirstRanker's Choice
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00






?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING

VII SEMESTER - R 2013

EC6711 ? EMBEDDED LABORATORY






Name : _______________________________________
Register No : _______________________________________
Section : _______________________________________
LABORATORY MANUAL



2 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00




is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and
training.

? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different
levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on
heart and soul
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

To impart professional education integrated with human values to the younger generation, so as to
shape them as proficient and dedicated engineers, capable of providing comprehensive solutions to the
challenges in deploying technology for the service of humanity

? To educate the students with the state-of-art technologies to meet the growing challenges of the
electronics industry
? To carry out research through continuous interaction with research institutes and industry, on
advances in communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning,
innovation and ethical practices
VISION
VISION
MISSION
MISSION



3 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

PROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To provide students with a solid foundation in Mathematics, Science and fundamentals of
engineering, enabling them to apply, to find solutions for engineering problems and use this knowledge
to acquire higher education
2. Core Competence
To train the students in Electronics and Communication technologies so that they apply their
knowledge and training to compare, and to analyze various engineering industrial problems to find
solutions
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice which
enables them to find solutions for the real time problems in industry, and to design products
4. Professionalism
To inculcate professional and effective communication skills, leadership qualities and team spirit in
the students to make them multi-faceted personalities and develop their ability to relate engineering
issues to broader social context
5. Lifelong Learning/Ethics
To demonstrate and practice ethical and professional responsibilities in the industry and society in
the large, through commitment and lifelong learning needed for successful professional career


4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
PROGRAMME OUTCOMES (POs)
a) To demonstrate and apply knowledge of Mathematics, Science and engineering fundamentals in
Electronics and Communication Engineering field
b) To design a component, a system or a process to meet the specific needs within the realistic
constraints such as economics, environment, ethics, health, safety and manufacturability
c) To demonstrate the competency to use software tools for computation, simulation and testing of electronics
and communication engineering circuits
d) To identify, formulate and solve electronic and communication engineering problems
e) To demonstrate an ability to visualize and work on laboratory and multidisciplinary tasks
f) To function as a member or a leader in multidisciplinary activities
g) To communicate in verbal and written form with fellow engineers and society at large
h) To understand the impact of Electronics and Communication Engineering in the society and demonstrate
awareness of contemporary issues and commitment to give solutions exhibiting social responsibility
i) To demonstrate professional & ethical responsibilities
j) To exhibit confidence in self-education and ability for lifelong learning
k) To participate and succeed in competitive exams


5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
SYLLABUS

? Learn the working of ARM processor
? Understand the Building Blocks of Embedded Systems
? Learn the concept of memory map and memory interface
? Know the characteristics of Real Time Systems
? Write programs to interface memory, I/Os with processor
? Study the interrupt performance
LIST OF EXPERIMENTS:
1. Study of ARM evaluation system
2. Interfacing ADC and DAC
3. Interfacing LED and PWM
4. Interfacing real time clock and serial port
5. Interfacing keyboard and LCD
6. Interfacing EPROM and interrupt
7. Mailbox
8. Interrupt performance characteristics of ARM and FPGA
9. Flashing of LEDS
10. Interfacing stepper motor and temperature sensor
11. Implementing zigbee protocol with ARM



? Write programs in ARM for a specific Application
? Interface memory and Write programs related to memory operations
? Interface A/D and D/A convertors with ARM system
? Analyze the performance of interrupt
? Write programmes for interfacing keyboard, display, motor and sensor.
? Formulate a mini project using embedded system
COURSE OBJECTIVES
COURSE OUTCOMES
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
CONTENTS
Sl. No. Name of the Experiment Page No.
CYCLE 1 ? EXPERIMENTS
1
Study of ARM evaluation system 7
2
Analog to Digital Convertor interfacing 16
3
Generation of ramp and square wave using on-Chip DAC 19
4
LED dimming using PWM 22
5
Interfacing real time clock and serial port 25
6
Interfacing keypad and LCD 28
7
Interfacing EPROM and interrupt 31
CYCLE 2 ? EXPERIMENTS
8 Implementation of Mailbox Function using LPC 2148 35
9 Interrupt Performance Characteristics of Arm and FPGA 37
10 Flashing of LEDs 40
11 Stepper Motor Interface with ARM ? 7 LPC2148 43
12 LM35 Temperature Sensor Interface with ARM ? 7 LPC2148 47
13
Implementation of Wireless Communication Protocol using ZIGBEE Wireless
Module
50
ADDITIONAL EXPERIMENTS BEYOND THE SYYLABUS
14 Buzzer Interface with ARM ? 7 54
15 Relay interface with ARM? 7 57
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Expt. No. 1 STUDY OF ARM EVALUATION SYSTEM
Aim:
To study the building blocks of ARM7 system, its features, pin configuration and the components
required for functioning of ARM controller.
Architecture Overview:
A RISC-based computer design approach means ARM processors require significantly fewer transistors
than typical processors in average computers. This approach reduces cost, heat and power usage. These
are desirable traits for light, portable, battery-powered devices (smart phones, laptops, tablet and notepad
computers), and other embedded systems. A simpler design facilitates more efficient multi-core CPUs and
higher core counts at lower cost, providing higher processing power and improved energy efficiency for
servers and supercomputers.
In 2005, about 98% of all mobile phones sold used at least one ARM processor. The low power
consumption of ARM processors has made them very popular: 37 billion ARM processors have been
produced as of 2013, up from 10 billion in 2008. The ARM architecture (32-bit) is the most widely used
architecture in mobile devices, and most popular 32-bit one in embedded systems.
According to ARM Holdings, in 2010 alone, producers of chips based on ARM architectures
reported shipments of 6.1 billion ARM based processors, representing 95% of smart phones, 35% of digital
televisions and set-top boxes and 10% of mobile computers. It is the most widely used 32-bit instruction set
architecture in terms of quantity produced.
LPC 2148:
LPC2148 is the widely used IC from ARM-7 family. It is manufactured by Philips and it is pre-loaded
with many inbuilt peripherals making it more efficient and a reliable option for the beginners as well as high
end application developer.




8 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Features of LPC214x series controllers:
1. 8 to 40 kB of on-chip static RAM and 32 to 512 kB of on-chip flash program memory.128 bit wide
interface/accelerator enables high speed 60 MHz operation.
2. In-System/In-Application Programming (ISP/IAP) via on-chip boot-loader software. Single flash sector or
full chip erase in 400 ms and programming of 256 bytes in 1ms.
3. Embedded ICE RT and Embedded Trace interfaces offer real-time debugging with the on-chip Real
Monitor software and high speed tracing of instruction execution.
4. USB 2.0 Full Speed compliant Device Controller with 2 kB of endpoint RAM. In addition, the LPC2146/8
provides 8 kB of on-chip RAM accessible to USB by DMA.
5. One or two (LPC2141/2 vs. LPC2144/6/8) 10-bit A/D converters provide a total of 6/14analog inputs, with
conversion times as low as 2.44 us per channel.
6. Single 10-bit D/A converter provides variable analog output.
7. Two 32-bit timers/external event counters (with four capture and four compare channels each), PWM unit
(six outputs) and watchdog.
8. Low power real-time clock with independent power and dedicated 32 kHz clock input.
9. Multiple serial interfaces including two UARTs (16C550), two Fast I2C-bus (400 kbit/s), SPI and SSP with
buffering and variable data length capabilities.
10. Vectored interrupt controller with configurable priorities and vector addresses.
11. Up to 45 of 5 V tolerant fast general purpose I/O pins in a tiny LQFP64 package.
12. Up to nine edge or level sensitive external interrupt pins available.
13. On-chip integrated oscillator operates with an external crystal in range from 1 MHz to30 MHz and with
an external oscillator up to 50 MHz
14. Power saving modes include Idle and Power-down.
15. Individual enable/disable of peripheral functions as well as peripheral clock scaling for additional power
optimization.
16. Processor wake-up from Power-down mode via external interrupt, USB, Brown-Out Detect (BOD) or
Real-Time Clock (RTC).




9 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


First Step- Hardware Requirement:
Pin configuration of LPC 2148.

Hardware requirement of LPC2148:
1. LPC2148 need minimum below listed hardware to work properly
2. Power Supply
3. Crystal Oscillator
4. Reset Circuit
5. RTC crystal oscillator
6. UART
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Power Supply:
LPC2148 works on 3.3 V power supply. LM 117 can be used for generating 3.3 V supply. However,
basic peripherals like LCD, ULN 2003 (Motor Driver IC) etc. works on 5V. So AC mains supply is converted
into 5V using below mentioned circuit and after that LM 117 is used to convert 5V into 3.3V.
Block diagram of power Supply

Transformer: It is used to step down 230V AC to 9V AC supply and provides isolation between power grids
and circuit.
Rectifier: It is used to convert AC supply into DC.
Filter: It is used to reduce ripple factor of DC output available from rectifier end.
Regulator: It is used to regulate DC supply output.

11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Circuit Diagram:

Regulator IC 7805 is used to provide fix 5V dc supply.
LM 117 is used for generating 3.3V supply from 5V.

12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Calculations:

From the datasheet of LM117

Taking R 2= 240?, we get R 1=392?
Reset Circuit:
Reset button is essential in a system to avoid programming pitfalls and manually bring back the system
to the initialization mode. MCP 130T is a special IC used for providing stable RESET signal to LPC 2148.


13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Oscillator Circuit:

The value of capacitors C20 & C21 depends upon the frequency of crystal Y3. General circuit and
its equivalent circuit is as shown below.

14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Recommended values are as shown in table:

UART:
LPC 2148 has inbuilt ISP which means we can program it within the system using serial
communication on COM0. It has also COM1 for serial communication. MAX 232/233 IC must be used for
voltage logic conversion. Related connections are as given below.

Once the above listed circuit design is ready, we are ready to go further.



15 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Result:
ARM Evaluation system and the configuration of LPC2148 has been studied fully. The minimal setup
required for the functioning of the ARM processor is studied.
Outcomes:
1. Able to understand the ARM controller, its basic components inside and its features.
2. Able to know the components required for the working of ARM LPC2148

Applications:
ARM controller LPC2148 is used in no. of devices such as
1. Smart phones
2. Net books
3. E Readers
4. Digital TV
5. Home Gateways


1. What are the basic units of ARM 7?
2. What is the address system supported by ARM?
3. Define - RISC
4. What are the instructions used to access the memory in ARM?
5. What are the basic units of Microprocessor?
6. What is an Instruction?
7. What is clock cycle?
8. Define - Pipelining
9. What is cache miss?
10. What is meant by memory mapped I/O?
11. Define ? interrupt
12. What is meant by Exception?
13. What is meant by little ? endian mode?
14. What is meant by big ? endian mode?
15. What is the function of CPSR?
16. What is register - indirect addressing?
Viva-voce




16 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 2 ANALOG TO DIGITAL CONVERTOR
INTERFACING
Aim:
To write an embedded c program for interfacing an on chip ADC with LPC2148 ARM processor and
convert the given input voltage into corresponding decimal values.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. PC
Theory:
Analog to Digital converter (ADC) is a device that converts continuously varying analog signals from
instruments that monitor such conditions as movement, temperature, sound, etc., into binary code for the
computer. It may be either a single chip or can be one circuit within a chip. Analog to Digital conversion is
the process of changing continuously varying data, such as voltage, current, or shaft rotation, into discrete
digital quantities that represent the magnitude of the data compared to a standard or reference at the
moment the conversion is made. According to the method of conversion, ADCs can be classified into
Direct-Conversion ADCs, Successive Approximation ADCs, Integrating ADC and Sigma-Delta ADCs.
The LPC 2148 has 10-bit successive approximation analog to digital converter. Basic clocking for the
A/D converters is provided by the VPB clock. A programmable divider is included in each converter, to
scale this clock to the 4.5 MHz (max) clock needed by the successive approximation process. A fully
accurate conversion requires 11 of these clocks. The ADC cell can measure the voltage on any of the ADC
input signals. It is noted that these analog inputs are always connected to their pins, even if the Pin function
Select register assigns them to port pins. A simple self-test of the ADC can be done by driving these pins
as port outputs.



17 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Circuit diagram:




18 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus, an embedded c program for interfacing on-chip ADC with ARM processor is written and
executed. The decimal values of the converted voltage are seen in the WinXTalk screen.
Outcome:
Able to interface A/D convertors with ARM system and check its working by connecting an analog
quantity as input.
Applications:
1. ADC used in MODEM for converting analog signals to digital.
2. A fast video ADC in TV tuner cards
3. ADC used in digital storage oscilloscopes
4. Used in music reproduction technology.
5. Used in DSP if input is analog


1. What are the ADC operating modes in LPC2148?
2. What is meant by conversion time?
3. Why are internal ADCs preferred over external ADCs?
4. Why has 16-bit ADC more resolution than from 10-bit and 8-bit ADC?
5. What are ADC & its Resolution?
6. What is Burst conversion mode?
7. What is the function of A/D Control Register?
8. What is the function of A/D Global Data Register?
9. What is the function of A/D Status Register?
10. What is analog-to-digital (ADC) conversion error?
11. What is the function of Sample-and-hold circuits in analog-to digital converters?
12. What is the disadvantage of the flash analog-to digital converter?
Viva-voce




19 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 3 GENERATION OF RAMP AND SQUARE
WAVE USING ON-CHIP DAC
Aim:
To write and execute an embedded c program to generate ramp wave and square wave using on-chip
DAC of LPC2148 ARM controller.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
A digital-to-analog converter is a device for converting a digital signal into an analog signal (current or
voltage). Digital-to-Analog Converters are the interface between the abstract digital world and the analog
real world. Simple switches, a network of resistors, current sources or capacitors may be used to
implement this conversion. A DAC inputs a binary number and outputs an analog voltage or current signal.
The Microchip Technology Inc. MCP4921 is 2.7 ? 5.5V, low-power, 12-Bit Digital-to-Analog Converter
(DAC) with SPI interface. The MCP4921 DAC provides high accuracy and low noise performance for
industrial applications where calibration or compensation of signals is required. With an SPI connection
there is always one master device (usually a microcontroller) which controls the peripheral devices.
Typically there are three lines common to all the devices,
Master In Slave Out (MISO) ? The Slave line for sending data to the master,
Master Out Slave In (MOSI) ? The Master line for sending data to the peripherals,
Serial Clock (SCK) ? The clock pulses which synchronize data transmission generated by the
master and slave
Slave Select pin ? the pin on each device that the master can use to enable and disable specific
devices. When a device Slave Select pin is low, it communicates with the master. When it is high, it ignores
the master. In SPI, the clock signal is controlled by the master device LPC2148. All data is clocked in and
out using this pin. These lines need to be connected to the relevant pins on the LPC21xx processor. Any
unused GIO pin can be used for CS, instead pull this pin high. Conversion speed is the time it takes for the



20 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

DAC to provide an analog output when the digital input word is changed. The MCP4291 DAC ? SPI
connections with LPC21xx have four I/O lines (P0.4 ? P0.7) required. The analog output is generated by
using these four lines.
Circuit diagram:


Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the embedded c programs for generating ramp wave and square wave using ARM LPC2148 are
written and executed successfully and the waveforms are viewed in oscilloscope.
Outcome:
Able to program the DAC in-built inside the ARM controller and get the waveforms using it.




21 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications :
1. DAC used in Audio amplifier.
2. Video encoder
3. Display electronics
4. Data Acquistion systems
5. Motor control



1. What are the features of LPC2148 DAC?
2. What is the function of DAC register?
3. Which pin provides a voltage reference level for the D/A converter?
4. What are the applications of DAC in signal processing applications?
5. What is GIO?
6. What is the resolution of a digital-to-analog converter (DAC)?
7. What is the major advantage of the R/2R ladder digital-to-analog (DAC), as compared to a binary-
weighted digital-to-analog DAC converter?
8. What is the resolution of a 0?5 V 6-bit digital-to-analog converter (DAC) ?
9. What are DAC configurations?
10. What are the different types of DAC Circuits?
11. What are the Limitations of the Binary Weighted DAC?
12. What are the General DAC Characteristics?
13. Define reference voltage in DAC.
14. What is full scale voltage?
15. What is settling time?
VIVA-VOCE




22 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 4 LED DIMMING USING PWM

Aim:
To write an embedded c program for implementing PWM using ARM controller and verify the same by
dimming of LEDs.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
LPC2148 supports 2 types of PWM:
1) Single Edge PWM ? Pulse starts with new Period i.e pulse is always at the beginning
2) Double Edge PWM ? Pulse can be anywhere within the Period
A PWM block, like a Timer block , has a Timer Counter and an associated Pre-scale Register along
with Match Registers. These work exactly the same way as in the case of Timers. Match Registers 1 to 6
(except 0) are pinned on LPC214x i.e. the corresponding outputs are diverted to actual Pins on LPC214x
MCU. The PWM function must be selected for these Pins to get the PWM output.
The basic setup is to simply replace Servo by a LED and no external 5V source is needed. The
anode of LED is connected to P0.0 and cathode to ground. Pulse Widths corresponding to the switches
connected to P0.1/2/3/4 will be 2.5ms/5ms/7.5ms/10ms respectively. As the Pulse Width Increases LED
will keep on getting brighter and the reverse will happen if Pulse Width is decreased.



23 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus embedded c program for implementing Pulse Width Modulation is written and executed and
output has been verified in LED display.
Outcome:
Able to implement PWM using the ARM controller and verify the same in the form of dimming of
LEDS.



24 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Applications :
1. In Visual signals to covey a message
2. Illumination where light is reflected from objects
3. In Narrow band sensors



1. What factors determine the LED dimming performance?
2. What is meant by analog dimming?
3. What is flickering effect?
4. What is the factor determines dimming of the LED
5. Why Silicon is not suitable for fabrication of light-emitting diodes?
6. Why Silicon diode is less suited for low voltage rectifier operation?
7. What is the principle of zener diode?
8. What are the materials used to make LED?
9. What type of diodes is used in FM receivers?
10. Which diode suffers an avalanche breakdown?
11. What happens if the junction temperature of LED is increased?
12. How a transfer characteristic of a diode does is related?
13. What is the requirement of a clipping action of a diode?
14. What type of rectifier circuit requires four diodes?
15. Why are the pulse width modulated outputs required in most of the applications?
16. How do the variations in an average value get affected by PWM period?
17. Name the common formats available for LED display.
18. What are the types of seven segment display?
19. What is PWM?
20. What are the applications of PWM?

Viva-voce




25 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 5 INTERFACING REAL TIME CLOCK
AND SERIAL PORT
Aim:
To write and execute an embedded c program to interface DS1307 RTC using I2C protocol with ARM
controller
Apparatus Required:
1. LPC2148 ARM development board
2. Stepper motor
3. Interfacing cables
4. PC
Theory:
A clock, which is based on the interrupts at preset intervals, is Real Time Clock (RTC). An interrupt
service routine executes on each timeout (overflow) of this clock. This timing device once started never
resets or never reloaded with another value. Once it is set, it is not modified later. It is used in a system to
save the time and date.













26 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the program for interfacing real time clock with ARM controller is written and executed and the
date and time are verified on the screen.
Outcome:
Able to interface real time clock DS1307 with ARM controller and thereby display date and time
Applications :
1. I2C In ARM and PIC microcontrollers
2. Used as serial communication protocol with MASTER and SLAVE operation.

27 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
27 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00




1. What is I2C and how does it work?
2. What are the features of I2C in LPC2148 ARM7 microcontroller?
3. What is the function of I2C0CONSET register?
4. What is I2C0STAT?
5. What is the function of I2C0 Data Register?
6. What is RTC?
7. List the advantages of RTC
8. Through which port the date and time is displayed in RTC?
9. What is a serial port?
10. List the registers used to transfer data in serial port.
11. List the modes used for data transmission.
12. What is a simplex mode?
13. Which pin is used to transmit a character?
14. What is the baud rate of serial port?
15. What is the disadvantage of RS-232C?














Viva-voce




28 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 6 INTERFACING KEYPAD AND LCD

Aim:
To write an embedded c program to interface 4 x 4 matrix keypad with ARM processor and display the
pressed key in an LCD.
Apparatus Required:
1. LPC2148 ARM development board
2. Interfacing cables
3. PC
Theory:

In matrix keypad, keys are connected in rows and columns. When any switch is pressed, rows and
columns come into contact, which is that detected by controller to identify which key has been pressed. A
4?4 matrix keypad consists of 4 rows and 4 columns. There is a switch connecting each row and column.
So the combinations of rows and columns make up the 16 inputs.Initially all the switches are open (not
connected). When any one button is pressed, the switch is closed (connected),hence there is a connection
between the row and column. The first 4 pins are connected to the column as INPUT. The other 4 pins are
connected to the row as OUTPUT. Matrix keypad is a good substitution to normal push button.












29 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Circuit Diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus program for interfacing matrix keypad with ARM controller is written and executed and the key
pressed is seen in the LCD.



30 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Outcome:
Able to interface keypad with ARM controller and see the pressed key in the LCD display.
Applications :
1. Used in password based door locking system
2. Security system with user changeable
3. Used in laptops, computer games
4. Used in portable video games and cell phones



1. What is Matrix keypad?
2. What is the concept behind keypad interface?
3. What are the functions of pull- up resistors?
4. What is key de bouncing?
5. List the steps involved when the key in a 4 x 4 keyboard matrix is being pressed.
6. What is the value obtained if no key is pressed?
7. What kind of interrupt is generated if a key has to be operated in an interrupt mode?
8. How will you identify that the key is pressed?
9. What are the steps involved in Keyboard Interfacing?
10. List the registers used to store the keyboard, display modes and other operations programmed by
CPU.
11. Name the mode when a data is entered from the left side of the display unit.
12. How many rows and columns are present in a 16 x 2 alphanumeric LCD?
13. How many data lines are there in a 16 x 2 alphanumeric LCD?
14. Which pin of the LCD is used for adjusting its contrast?
15. Which command of an LCD is used to shift the entire display to the right?
16. Which command is used to select the 2 lines and 5 x 7 matrix of an LCD?
17. What changes are to be made to send data to an LCD?
18. For reading operation from an LCD what changes in the software are introduced?
19. Which instruction is used to select the first row first column of an LCD?
Viva-voce

31 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
31 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Expt. No. 7 INTERFACING EEPROM AND INTERRUPT

Aim:
To write a program to interface EEPROM using I2C protocol with ARM controller and retrieve the stored
messages inside EEPROM.
Apparatus Required:
1. LPC2148 ARM development board
2. Interfacing cables
3. PC
Theory:
I2C (Inter Integrated Circuit):
The I2C (Inter-IC) bus is a bi-directional two-wire serial bus that provides a communication link between
integrated circuits (ICs).I2C is a synchronous protocol that allows a master device to initiate communication
with a slave device. Data is exchanged between these devices.
EEPROM:
EEPROM (electrically erasable programmable read-only memory) is user-modifiable read-only
memory (ROM) that can be erased and reprogrammed (written to) repeatedly through the application of
higher than normal electrical voltage. It is a type of non-volatile memory used in computers and other
electronic devices to store small amounts of data that must be saved when power is removed, e.g.,
calibration tables or device configuration
Read, write and Erase EEPROM by using I2C in LPC2148 Primer Board. Wiring up an I2C based
EEPROM to the I2C port is relatively simple. The basic operation of the I2C based EEPROM's is to send a
command, such as WRITE, followed by an address and the data. In WRITE operation, the EEPROM is
used to store the data. In LPC2148 Primer Kit, 2 nos. of EEPROM lines are controlled by I2C Enabled
drivers. I2C Lines serial clock SCL (P0.2), serial data SDA (P0.3) connected to the I2C based serial
EEPROM IC. The EEPROM read & write operations are done in LPC2148 Primer Kit by using these SDA &
SCL I2C lines.
32 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
32 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To down load and run this program: Refer General procedure given in Page No: 60
Result:
Thus, the program for interfacing I2C based EEPROM with ARM processor has been written and
executed successfully and the memory content is verified on Win x talk terminal.
Outcome:
Able to interface memory ICs with ARM controller and perform the read and write operations.



33 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications:
1. ROM used in toys,automobiles to store data when power is off
2. In calculators and peripheral devices
3. In laser printers
4. And also in embedded systems where program need not to be changed.


1. How does I2C protocol work?
2. What is EEPROM?
3. What is meant by master slave mode?
4. What is meant by non-volatile memory?
5. What is an interrupt?
6. How does an interrupt request works?
7. What is a nested interrupt?
8. What are the registers used for enabling an interrupt?
9. What is PROM?
10. What is EPROM?
11. What is mask ROM?
12. Which memory allows simultaneous read and write operations?
13. Which memory has the shortest access times?
14. Which interrupt has the highest priority?
15. What is non maskable interrupt?
16. Which is the first level of memory access by the microprocessor?
17. List the types of cache memories.
18. What is the use of an interrupt?
19. What is the use of converting an interrupt to threads in a microprocessor?
20. What are the bits used to control an external interrupts?


Viva-voce




34 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00










CYCLE 2 - EXPERIMENTS




35 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 8 IMPLEMENTATION OF MAILBOX FUNCTION
USING LPC2148
Aim:
To create a mailbox in Micro C/OS ? II using LPC2148 ARM Controller
Apparatus Required:
1. LPC2148 ARM development board
2. Interfacing cables
3. PC
Theory:
System or the user code can send a message by the core services. A typical mail message, also
known as the exchange of information, refers to a task or an ISR using a pointer variable, through the core
services to put a message (that is, a pointer) into the mailbox. Similarly, one or more tasks can receive this
message by the core services. The tasks sending and receiving the message promise that the content that
the pointer points to is just that piece of message.
The mailbox of CooCox CoOS is a typical message mailbox which is composed of two parts: one is
the information which expressed by a pointer of void; the other is the waiting list which composed of the
tasks waiting for this mailbox. The waiting list supports two kinds of sorting: FIFO and preemptive priority.
The sorting mode is determined by the user when creating the mailbox.
Procedure:
To Edit / Compile / generate Hex file: Refer General procedure in Page No: 58
To down load and run this program: Refer General procedure in Page No: 60
Result:
Thus, the mailbox was created in Micro C/OS ?II and implemented using LPC2148.
Outcome:
Able to understand the concept of mail box in embedded systems and its significance in real time
systems





36 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications:
1. Used in Acorn RISC PC700
2. Used in ZIPIT wireless messenger
3. Used in Meizu M6 MINI player


1. What is IPC?
2. Define Queue.
3. What are the different types of mail box functions?
4. What is half duplex mode?
5. How many synchronous and asynchronous modes are there in serial port?
6. List the bits used to generate serial port interrupt
7. What is branch prediction?
8. Mention any two features of ?C/OS ? II.
9. Write the function for creating task in ?C/OS ? II.
10. Mention any two support devices for ?C/OS ? II.
11. How many user tasks can be handled by ?C/OS ? II?



















Viva-voce




37 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 9 INTERRUPT PERFORMANCE
CHARACTERISTICSOF ARM AND FPGA

Aim:
To study the interrupt performance characteristics of ARM and FPGA by using ARM controller kit and
FPGA kit separately.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
External Interrupts:
An interrupt caused by an external source such as the computer operator, external sensor or
monitoring device, or another computer. Interrupts are special events that require immediate attention.
Interfacing External Interrupts with LPC2148:
When an external interrupt signal occurs in LPC2148 Primer Board, the message "LOW" will be
displayed on PC. The interrupt signal occurs using switches. When the switch is pressed to LOW, then the
external interrupt occurs. The Vectored Interrupt Controller (VIC) takes 32 interrupt request inputs and
programmable assigns them into 3 categories, FIQ, vectored IRQ, and non-vectored IRQ. The ARM7
LPC2148 Primer board has two numbers of External Interrupts, connected with I/O Port lines (P0.14 &
P0.15) as switches.







38 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00



Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60


39 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
39 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Result:
Thus the interrupt performance characteristics of ARM and FPGA are studied. On comparison, ARM
counts at slow speed because it consumes more instruction cycle and FPGA is more efficient for servicing
and processing external interrupt pulses.
Outcome:
Able to understand the performance characteristics of ARM and FPGA while dealing with
interrrupts
Applications:
1. Used in random logic and SPLDs
2. Used in cryptography and filtering
3. In medical imaging
4. In bioinformatics and voice recognition



1. When is an Interrupt Request received?
2. What is ISR?
3. How do you initialize interrupt?
4. What is Vectored Interrupt Controller?
5. What are the kinds of protection available for SRAMS ?
6. What is interrupt pipelining?
7. What is pipeline shutdown?
8. What is branch prediction?
9. What is the use of Neon Floating point engine?
10. What is the use of ?vectorize option?
11. What is PTM?
12. What is ITM?
13. What is ETM?
14. What is I2S interface?
15. What is the use of ?SWI? in ARM assembly?

Viva-voce




40 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 10 FLASHING OF LEDS
Aim:
To write and execute an embedded c program to display LEDs using LPC 2148 ARM controller
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
Theory:
LED (Light Emitting Diodes) is the most commonly used components, usually for displaying pins digital
states. Typical uses of LEDs include alarm devices, timers and confirmation of user input such as a mouse
click or keystroke. Interfacing LED with LPC2148 Flash a LED using LPC2148 Primer Board. It works by
turning ON a LED & then turning it OFF & then looping back to START. However the operating speed of
microcontroller is very high so the flashing frequency will also be very fast to be detected by human eye.
The ARM7 LPC2148 Primer board has eight numbers of point LEDs, connected with I/O Port lines (P1.16 ?
P1.23) to make port pins high.










41 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00



Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus program for flashing of LEDs is written and executed using ARM controller LPC2148.



42 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Outcome:
Able to interface LED lights via the input output port and control them
Applications:
1. In Illumination
2. As status indicators in equipments
3. Stadium displays and dynamic decorative displays



1. What is seven segment displays?
2. What are the different configurations of LED?
3. What is the function of GPIO?
4. What are the Pins which are used to connect LEDs?
5. How to identify 'Polarity' of LED?
6. Differentiate LED from LCD.
7. What is a use of Jumper?
8. How many numbers of LEDs present in Primer board?
9. Where LEDs are used?
10. What is the use of flash magic software?
11. Which port is used in ARM 7 processor kit?
12. Which diode suffers an avalanche breakdown?
13. What happens if the junction temperature of LED is increased?
14. What is an anti collision rate light?
15. What is fail-safe conditions






Viva-voce




43 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 11 STEPPER MOTOR INTERFACE WITH
ARM -7 LPC2148
Aim:
To write a program to interface stepper motor using ARM processor and control the movement of motor
in either directions.
Apparatus Required:
1. LPC2148 ARM development board
2. Stepper motor
3. Interfacing cables
4. PC
Theory:
A stepper motor can be viewed as a DC motor with number of poles (on both rotor and stator).
Additionally, soft magnetic material with many teeth on the rotor and stator cheaply multiplies the number of
poles (reluctance motor). Like an AC synchronous motor, it is ideally driven by sinusoidal current, allowing
a step less operation, but this puts some burden on the controller. When using an 8-bit digital controller,
256 micro steps per step are possible. As a digital-to-analog converter produces unwanted ohmic heat in
the controller, pulse-width modulation is used to regulate the mean current. Simpler models switch voltage
only for doing a step, thus needing an extra current limiter: for every step, they switch a single cable to the
motor.
The idea is to connect the output pins of the driver to 4 transistors. The transistor must be
grounded at the emitter and the driver pin must be connected to the base. Collector is connected to the coil
wire of the motor. Stepper motors are rated by the torque they produce. Synchronous electric motors using
soft magnetic materials (having a core) have the ability to provide position holding torque (called detent
torque, and sometimes included in the specifications) while not driven electrically. To achieve full rated
torque, the coils in a stepper motor must reach their full rated current during each step. The voltage rating
(if there is one) is almost meaningless. The motors also suffer from EMF, which means that once the coil is
turned off it starts to generate current because the motor is still rotating. There needs to be an explicit way
to handle this extra current in a circuit otherwise it can cause damage and affect performance of the motor.
44 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
44 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus stepper motor interface with ARM processor has been successfully implemented and the motor is
controlled in clockwise and anticlockwise direction.
Outcome:
Able to interface the stepper motor with ARM controller and thereby create some rotational
movements





45 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Applications:
3. Used for precise positioning with a motor
4. Used in hard disk drives, robotics
5. Used in telescopes and toys







1. Define GPIO.
2. What is the function of ULN2803?
3. How LPC2148 control stepper motor?
4. Which I/O port lines used to rotate stepper motor?
5. How stepper motor reacts for each pulse it receives?
6. What is serial communication?
7. What is parallel communication?
8. What is stepper motor & why it is named so?
9. How can be step angle is calculated?
10. What are the advantages and disadvantages of parallel communication?
11. What does instruction-pipelining mean?
12. What is the power supply required for ARM processor?
13. What is a unit for torque?
14. What is RPM rating for a DC motor?
15. What device that is used to obtain an accurate position control of rotating shafts in terms of steps?
Viva-voce

46 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
46 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Expt. No. 12 LM35 TEMPERATURE SENSOR INTERFACE
WITH ARM-7 LPC2148
Aim:
To write a program to interface of LM35 temperature sensor to on-chip ADC of ARM controller and
display the room temperature value on the screen.
Apparatus Required:
1. LPC2148 ARM development board
2. Temperature sensor
3. Interfacing cables
4. PC
Theory:
Temperature Sensor:
The LM35 series are precision integrated-circuit temperature sensors, whose output voltage is linearly
proportional to the Celsius (Centigrade) temperature. The output of the sensor is converted to digital output
that is easy to connect with microcontroller. Temperature sensor has three terminals and required
Maximum of 5.5 V supply. This type of sensor consists of a material that performs the operation according
to temperature to vary the resistance. This change of resistance is sensed by circuit and it calculates
temperature. When the voltage increases then the temperature also rises. We can see this operation by
using a diode.







47 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
47 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00


Circuit diagram:

48 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
48 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the program for interfacing temperature sensor with ARM controller is written and executed and
the temperature reading is seen on the monitor.
Outcome:
Able to interface different sensors with in-built ADC of the ARM processor and access the data
produced from them
Applications:
1. Used in Ovens, refrigerators
2. In HVAC environmental control
3. coolant or cylinder head temperatures
4. in the automotive industry to monitor air intake



1. What is LM35?
2. Define ISP.
3. How many Analog-to-Digital Converters available as an inner peripheral in LPC2148?
4. What is the main function of analog pin in LPC 2148?
5. What is the output voltage produced by LM35 for one degree temperature?
6. What is the difference between LM 34 and LM 35 sensors?
7. How many pins are available in LM35?
8. Why Vref is set of ADC0848 to 2.56 V if analog input is connected to the LM35?
9. What is operating the operating temperature range in LM35?
10. Why LM35 is used to Measure Temperature?
11. List the devices used to sense temperature.
12. What is the purpose of a thermocouple?
13. What is the output voltage of a thermocouple?
Viva-voce




49 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 13 IMPLEMENTATION OF WIRELESS
COMMUNICATION PROTOCOL
USING ZIGBEE WIRELESS MODULE
Aim:
To implement wireless communication protocol using zigbee wireless module with the help of ARM
processor
Apparatus required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. Zigbee module
5. PC
Theory:
ZigBee is a specification to suite high level communication protocols using small, low-power digital
radios based on an IEEE 802 standard for personal area networks. The ZigBee is the name of a wireless
protocol maintained by the IEEE 802.15 standard. This is a protocol specified for wireless Personal Area
Network (PAN) using low powered wireless transceivers. There are already wireless transmitter and
receiver modules which can do point to point communication. The Xbee is the brand name a wireless
transceiver device introduced by the Digi international which works on the ZigBee protocol and can form
PAN networks. They have an approximate range of 10 to 100 meters and are used in industries, scientific
fields, medical fields etc
Digi ZigBee:
The Digi Xbee 802.15.4 modules are the easiest to use, most reliable and cost-effective RF devices.
The 802.15.4 Xbee modules provide two friendly modes of communication - a simple serial method to
transmit/receive or a framed mode providing advanced features. These modules can communicate point to
point, from one point to a PC, or in a mesh network.



50 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
50 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Circuit diagram:


Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the wireless communication protocol using Zigbee wireless module is implemented using
LPC2148.
Outcome:
Able to form a wireless network using zigbee module and ARM controller

FirstRanker.com - FirstRanker's Choice
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00






?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING

VII SEMESTER - R 2013

EC6711 ? EMBEDDED LABORATORY






Name : _______________________________________
Register No : _______________________________________
Section : _______________________________________
LABORATORY MANUAL



2 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00




is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and
training.

? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different
levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on
heart and soul
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

To impart professional education integrated with human values to the younger generation, so as to
shape them as proficient and dedicated engineers, capable of providing comprehensive solutions to the
challenges in deploying technology for the service of humanity

? To educate the students with the state-of-art technologies to meet the growing challenges of the
electronics industry
? To carry out research through continuous interaction with research institutes and industry, on
advances in communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning,
innovation and ethical practices
VISION
VISION
MISSION
MISSION



3 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

PROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To provide students with a solid foundation in Mathematics, Science and fundamentals of
engineering, enabling them to apply, to find solutions for engineering problems and use this knowledge
to acquire higher education
2. Core Competence
To train the students in Electronics and Communication technologies so that they apply their
knowledge and training to compare, and to analyze various engineering industrial problems to find
solutions
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice which
enables them to find solutions for the real time problems in industry, and to design products
4. Professionalism
To inculcate professional and effective communication skills, leadership qualities and team spirit in
the students to make them multi-faceted personalities and develop their ability to relate engineering
issues to broader social context
5. Lifelong Learning/Ethics
To demonstrate and practice ethical and professional responsibilities in the industry and society in
the large, through commitment and lifelong learning needed for successful professional career


4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
PROGRAMME OUTCOMES (POs)
a) To demonstrate and apply knowledge of Mathematics, Science and engineering fundamentals in
Electronics and Communication Engineering field
b) To design a component, a system or a process to meet the specific needs within the realistic
constraints such as economics, environment, ethics, health, safety and manufacturability
c) To demonstrate the competency to use software tools for computation, simulation and testing of electronics
and communication engineering circuits
d) To identify, formulate and solve electronic and communication engineering problems
e) To demonstrate an ability to visualize and work on laboratory and multidisciplinary tasks
f) To function as a member or a leader in multidisciplinary activities
g) To communicate in verbal and written form with fellow engineers and society at large
h) To understand the impact of Electronics and Communication Engineering in the society and demonstrate
awareness of contemporary issues and commitment to give solutions exhibiting social responsibility
i) To demonstrate professional & ethical responsibilities
j) To exhibit confidence in self-education and ability for lifelong learning
k) To participate and succeed in competitive exams


5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
SYLLABUS

? Learn the working of ARM processor
? Understand the Building Blocks of Embedded Systems
? Learn the concept of memory map and memory interface
? Know the characteristics of Real Time Systems
? Write programs to interface memory, I/Os with processor
? Study the interrupt performance
LIST OF EXPERIMENTS:
1. Study of ARM evaluation system
2. Interfacing ADC and DAC
3. Interfacing LED and PWM
4. Interfacing real time clock and serial port
5. Interfacing keyboard and LCD
6. Interfacing EPROM and interrupt
7. Mailbox
8. Interrupt performance characteristics of ARM and FPGA
9. Flashing of LEDS
10. Interfacing stepper motor and temperature sensor
11. Implementing zigbee protocol with ARM



? Write programs in ARM for a specific Application
? Interface memory and Write programs related to memory operations
? Interface A/D and D/A convertors with ARM system
? Analyze the performance of interrupt
? Write programmes for interfacing keyboard, display, motor and sensor.
? Formulate a mini project using embedded system
COURSE OBJECTIVES
COURSE OUTCOMES
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
CONTENTS
Sl. No. Name of the Experiment Page No.
CYCLE 1 ? EXPERIMENTS
1
Study of ARM evaluation system 7
2
Analog to Digital Convertor interfacing 16
3
Generation of ramp and square wave using on-Chip DAC 19
4
LED dimming using PWM 22
5
Interfacing real time clock and serial port 25
6
Interfacing keypad and LCD 28
7
Interfacing EPROM and interrupt 31
CYCLE 2 ? EXPERIMENTS
8 Implementation of Mailbox Function using LPC 2148 35
9 Interrupt Performance Characteristics of Arm and FPGA 37
10 Flashing of LEDs 40
11 Stepper Motor Interface with ARM ? 7 LPC2148 43
12 LM35 Temperature Sensor Interface with ARM ? 7 LPC2148 47
13
Implementation of Wireless Communication Protocol using ZIGBEE Wireless
Module
50
ADDITIONAL EXPERIMENTS BEYOND THE SYYLABUS
14 Buzzer Interface with ARM ? 7 54
15 Relay interface with ARM? 7 57
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Expt. No. 1 STUDY OF ARM EVALUATION SYSTEM
Aim:
To study the building blocks of ARM7 system, its features, pin configuration and the components
required for functioning of ARM controller.
Architecture Overview:
A RISC-based computer design approach means ARM processors require significantly fewer transistors
than typical processors in average computers. This approach reduces cost, heat and power usage. These
are desirable traits for light, portable, battery-powered devices (smart phones, laptops, tablet and notepad
computers), and other embedded systems. A simpler design facilitates more efficient multi-core CPUs and
higher core counts at lower cost, providing higher processing power and improved energy efficiency for
servers and supercomputers.
In 2005, about 98% of all mobile phones sold used at least one ARM processor. The low power
consumption of ARM processors has made them very popular: 37 billion ARM processors have been
produced as of 2013, up from 10 billion in 2008. The ARM architecture (32-bit) is the most widely used
architecture in mobile devices, and most popular 32-bit one in embedded systems.
According to ARM Holdings, in 2010 alone, producers of chips based on ARM architectures
reported shipments of 6.1 billion ARM based processors, representing 95% of smart phones, 35% of digital
televisions and set-top boxes and 10% of mobile computers. It is the most widely used 32-bit instruction set
architecture in terms of quantity produced.
LPC 2148:
LPC2148 is the widely used IC from ARM-7 family. It is manufactured by Philips and it is pre-loaded
with many inbuilt peripherals making it more efficient and a reliable option for the beginners as well as high
end application developer.




8 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Features of LPC214x series controllers:
1. 8 to 40 kB of on-chip static RAM and 32 to 512 kB of on-chip flash program memory.128 bit wide
interface/accelerator enables high speed 60 MHz operation.
2. In-System/In-Application Programming (ISP/IAP) via on-chip boot-loader software. Single flash sector or
full chip erase in 400 ms and programming of 256 bytes in 1ms.
3. Embedded ICE RT and Embedded Trace interfaces offer real-time debugging with the on-chip Real
Monitor software and high speed tracing of instruction execution.
4. USB 2.0 Full Speed compliant Device Controller with 2 kB of endpoint RAM. In addition, the LPC2146/8
provides 8 kB of on-chip RAM accessible to USB by DMA.
5. One or two (LPC2141/2 vs. LPC2144/6/8) 10-bit A/D converters provide a total of 6/14analog inputs, with
conversion times as low as 2.44 us per channel.
6. Single 10-bit D/A converter provides variable analog output.
7. Two 32-bit timers/external event counters (with four capture and four compare channels each), PWM unit
(six outputs) and watchdog.
8. Low power real-time clock with independent power and dedicated 32 kHz clock input.
9. Multiple serial interfaces including two UARTs (16C550), two Fast I2C-bus (400 kbit/s), SPI and SSP with
buffering and variable data length capabilities.
10. Vectored interrupt controller with configurable priorities and vector addresses.
11. Up to 45 of 5 V tolerant fast general purpose I/O pins in a tiny LQFP64 package.
12. Up to nine edge or level sensitive external interrupt pins available.
13. On-chip integrated oscillator operates with an external crystal in range from 1 MHz to30 MHz and with
an external oscillator up to 50 MHz
14. Power saving modes include Idle and Power-down.
15. Individual enable/disable of peripheral functions as well as peripheral clock scaling for additional power
optimization.
16. Processor wake-up from Power-down mode via external interrupt, USB, Brown-Out Detect (BOD) or
Real-Time Clock (RTC).




9 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


First Step- Hardware Requirement:
Pin configuration of LPC 2148.

Hardware requirement of LPC2148:
1. LPC2148 need minimum below listed hardware to work properly
2. Power Supply
3. Crystal Oscillator
4. Reset Circuit
5. RTC crystal oscillator
6. UART
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Power Supply:
LPC2148 works on 3.3 V power supply. LM 117 can be used for generating 3.3 V supply. However,
basic peripherals like LCD, ULN 2003 (Motor Driver IC) etc. works on 5V. So AC mains supply is converted
into 5V using below mentioned circuit and after that LM 117 is used to convert 5V into 3.3V.
Block diagram of power Supply

Transformer: It is used to step down 230V AC to 9V AC supply and provides isolation between power grids
and circuit.
Rectifier: It is used to convert AC supply into DC.
Filter: It is used to reduce ripple factor of DC output available from rectifier end.
Regulator: It is used to regulate DC supply output.

11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Circuit Diagram:

Regulator IC 7805 is used to provide fix 5V dc supply.
LM 117 is used for generating 3.3V supply from 5V.

12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Calculations:

From the datasheet of LM117

Taking R 2= 240?, we get R 1=392?
Reset Circuit:
Reset button is essential in a system to avoid programming pitfalls and manually bring back the system
to the initialization mode. MCP 130T is a special IC used for providing stable RESET signal to LPC 2148.


13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Oscillator Circuit:

The value of capacitors C20 & C21 depends upon the frequency of crystal Y3. General circuit and
its equivalent circuit is as shown below.

14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Recommended values are as shown in table:

UART:
LPC 2148 has inbuilt ISP which means we can program it within the system using serial
communication on COM0. It has also COM1 for serial communication. MAX 232/233 IC must be used for
voltage logic conversion. Related connections are as given below.

Once the above listed circuit design is ready, we are ready to go further.



15 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Result:
ARM Evaluation system and the configuration of LPC2148 has been studied fully. The minimal setup
required for the functioning of the ARM processor is studied.
Outcomes:
1. Able to understand the ARM controller, its basic components inside and its features.
2. Able to know the components required for the working of ARM LPC2148

Applications:
ARM controller LPC2148 is used in no. of devices such as
1. Smart phones
2. Net books
3. E Readers
4. Digital TV
5. Home Gateways


1. What are the basic units of ARM 7?
2. What is the address system supported by ARM?
3. Define - RISC
4. What are the instructions used to access the memory in ARM?
5. What are the basic units of Microprocessor?
6. What is an Instruction?
7. What is clock cycle?
8. Define - Pipelining
9. What is cache miss?
10. What is meant by memory mapped I/O?
11. Define ? interrupt
12. What is meant by Exception?
13. What is meant by little ? endian mode?
14. What is meant by big ? endian mode?
15. What is the function of CPSR?
16. What is register - indirect addressing?
Viva-voce




16 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 2 ANALOG TO DIGITAL CONVERTOR
INTERFACING
Aim:
To write an embedded c program for interfacing an on chip ADC with LPC2148 ARM processor and
convert the given input voltage into corresponding decimal values.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. PC
Theory:
Analog to Digital converter (ADC) is a device that converts continuously varying analog signals from
instruments that monitor such conditions as movement, temperature, sound, etc., into binary code for the
computer. It may be either a single chip or can be one circuit within a chip. Analog to Digital conversion is
the process of changing continuously varying data, such as voltage, current, or shaft rotation, into discrete
digital quantities that represent the magnitude of the data compared to a standard or reference at the
moment the conversion is made. According to the method of conversion, ADCs can be classified into
Direct-Conversion ADCs, Successive Approximation ADCs, Integrating ADC and Sigma-Delta ADCs.
The LPC 2148 has 10-bit successive approximation analog to digital converter. Basic clocking for the
A/D converters is provided by the VPB clock. A programmable divider is included in each converter, to
scale this clock to the 4.5 MHz (max) clock needed by the successive approximation process. A fully
accurate conversion requires 11 of these clocks. The ADC cell can measure the voltage on any of the ADC
input signals. It is noted that these analog inputs are always connected to their pins, even if the Pin function
Select register assigns them to port pins. A simple self-test of the ADC can be done by driving these pins
as port outputs.



17 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Circuit diagram:




18 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus, an embedded c program for interfacing on-chip ADC with ARM processor is written and
executed. The decimal values of the converted voltage are seen in the WinXTalk screen.
Outcome:
Able to interface A/D convertors with ARM system and check its working by connecting an analog
quantity as input.
Applications:
1. ADC used in MODEM for converting analog signals to digital.
2. A fast video ADC in TV tuner cards
3. ADC used in digital storage oscilloscopes
4. Used in music reproduction technology.
5. Used in DSP if input is analog


1. What are the ADC operating modes in LPC2148?
2. What is meant by conversion time?
3. Why are internal ADCs preferred over external ADCs?
4. Why has 16-bit ADC more resolution than from 10-bit and 8-bit ADC?
5. What are ADC & its Resolution?
6. What is Burst conversion mode?
7. What is the function of A/D Control Register?
8. What is the function of A/D Global Data Register?
9. What is the function of A/D Status Register?
10. What is analog-to-digital (ADC) conversion error?
11. What is the function of Sample-and-hold circuits in analog-to digital converters?
12. What is the disadvantage of the flash analog-to digital converter?
Viva-voce




19 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 3 GENERATION OF RAMP AND SQUARE
WAVE USING ON-CHIP DAC
Aim:
To write and execute an embedded c program to generate ramp wave and square wave using on-chip
DAC of LPC2148 ARM controller.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
A digital-to-analog converter is a device for converting a digital signal into an analog signal (current or
voltage). Digital-to-Analog Converters are the interface between the abstract digital world and the analog
real world. Simple switches, a network of resistors, current sources or capacitors may be used to
implement this conversion. A DAC inputs a binary number and outputs an analog voltage or current signal.
The Microchip Technology Inc. MCP4921 is 2.7 ? 5.5V, low-power, 12-Bit Digital-to-Analog Converter
(DAC) with SPI interface. The MCP4921 DAC provides high accuracy and low noise performance for
industrial applications where calibration or compensation of signals is required. With an SPI connection
there is always one master device (usually a microcontroller) which controls the peripheral devices.
Typically there are three lines common to all the devices,
Master In Slave Out (MISO) ? The Slave line for sending data to the master,
Master Out Slave In (MOSI) ? The Master line for sending data to the peripherals,
Serial Clock (SCK) ? The clock pulses which synchronize data transmission generated by the
master and slave
Slave Select pin ? the pin on each device that the master can use to enable and disable specific
devices. When a device Slave Select pin is low, it communicates with the master. When it is high, it ignores
the master. In SPI, the clock signal is controlled by the master device LPC2148. All data is clocked in and
out using this pin. These lines need to be connected to the relevant pins on the LPC21xx processor. Any
unused GIO pin can be used for CS, instead pull this pin high. Conversion speed is the time it takes for the



20 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

DAC to provide an analog output when the digital input word is changed. The MCP4291 DAC ? SPI
connections with LPC21xx have four I/O lines (P0.4 ? P0.7) required. The analog output is generated by
using these four lines.
Circuit diagram:


Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the embedded c programs for generating ramp wave and square wave using ARM LPC2148 are
written and executed successfully and the waveforms are viewed in oscilloscope.
Outcome:
Able to program the DAC in-built inside the ARM controller and get the waveforms using it.




21 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications :
1. DAC used in Audio amplifier.
2. Video encoder
3. Display electronics
4. Data Acquistion systems
5. Motor control



1. What are the features of LPC2148 DAC?
2. What is the function of DAC register?
3. Which pin provides a voltage reference level for the D/A converter?
4. What are the applications of DAC in signal processing applications?
5. What is GIO?
6. What is the resolution of a digital-to-analog converter (DAC)?
7. What is the major advantage of the R/2R ladder digital-to-analog (DAC), as compared to a binary-
weighted digital-to-analog DAC converter?
8. What is the resolution of a 0?5 V 6-bit digital-to-analog converter (DAC) ?
9. What are DAC configurations?
10. What are the different types of DAC Circuits?
11. What are the Limitations of the Binary Weighted DAC?
12. What are the General DAC Characteristics?
13. Define reference voltage in DAC.
14. What is full scale voltage?
15. What is settling time?
VIVA-VOCE




22 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 4 LED DIMMING USING PWM

Aim:
To write an embedded c program for implementing PWM using ARM controller and verify the same by
dimming of LEDs.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
LPC2148 supports 2 types of PWM:
1) Single Edge PWM ? Pulse starts with new Period i.e pulse is always at the beginning
2) Double Edge PWM ? Pulse can be anywhere within the Period
A PWM block, like a Timer block , has a Timer Counter and an associated Pre-scale Register along
with Match Registers. These work exactly the same way as in the case of Timers. Match Registers 1 to 6
(except 0) are pinned on LPC214x i.e. the corresponding outputs are diverted to actual Pins on LPC214x
MCU. The PWM function must be selected for these Pins to get the PWM output.
The basic setup is to simply replace Servo by a LED and no external 5V source is needed. The
anode of LED is connected to P0.0 and cathode to ground. Pulse Widths corresponding to the switches
connected to P0.1/2/3/4 will be 2.5ms/5ms/7.5ms/10ms respectively. As the Pulse Width Increases LED
will keep on getting brighter and the reverse will happen if Pulse Width is decreased.



23 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus embedded c program for implementing Pulse Width Modulation is written and executed and
output has been verified in LED display.
Outcome:
Able to implement PWM using the ARM controller and verify the same in the form of dimming of
LEDS.



24 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Applications :
1. In Visual signals to covey a message
2. Illumination where light is reflected from objects
3. In Narrow band sensors



1. What factors determine the LED dimming performance?
2. What is meant by analog dimming?
3. What is flickering effect?
4. What is the factor determines dimming of the LED
5. Why Silicon is not suitable for fabrication of light-emitting diodes?
6. Why Silicon diode is less suited for low voltage rectifier operation?
7. What is the principle of zener diode?
8. What are the materials used to make LED?
9. What type of diodes is used in FM receivers?
10. Which diode suffers an avalanche breakdown?
11. What happens if the junction temperature of LED is increased?
12. How a transfer characteristic of a diode does is related?
13. What is the requirement of a clipping action of a diode?
14. What type of rectifier circuit requires four diodes?
15. Why are the pulse width modulated outputs required in most of the applications?
16. How do the variations in an average value get affected by PWM period?
17. Name the common formats available for LED display.
18. What are the types of seven segment display?
19. What is PWM?
20. What are the applications of PWM?

Viva-voce




25 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 5 INTERFACING REAL TIME CLOCK
AND SERIAL PORT
Aim:
To write and execute an embedded c program to interface DS1307 RTC using I2C protocol with ARM
controller
Apparatus Required:
1. LPC2148 ARM development board
2. Stepper motor
3. Interfacing cables
4. PC
Theory:
A clock, which is based on the interrupts at preset intervals, is Real Time Clock (RTC). An interrupt
service routine executes on each timeout (overflow) of this clock. This timing device once started never
resets or never reloaded with another value. Once it is set, it is not modified later. It is used in a system to
save the time and date.













26 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the program for interfacing real time clock with ARM controller is written and executed and the
date and time are verified on the screen.
Outcome:
Able to interface real time clock DS1307 with ARM controller and thereby display date and time
Applications :
1. I2C In ARM and PIC microcontrollers
2. Used as serial communication protocol with MASTER and SLAVE operation.

27 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
27 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00




1. What is I2C and how does it work?
2. What are the features of I2C in LPC2148 ARM7 microcontroller?
3. What is the function of I2C0CONSET register?
4. What is I2C0STAT?
5. What is the function of I2C0 Data Register?
6. What is RTC?
7. List the advantages of RTC
8. Through which port the date and time is displayed in RTC?
9. What is a serial port?
10. List the registers used to transfer data in serial port.
11. List the modes used for data transmission.
12. What is a simplex mode?
13. Which pin is used to transmit a character?
14. What is the baud rate of serial port?
15. What is the disadvantage of RS-232C?














Viva-voce




28 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 6 INTERFACING KEYPAD AND LCD

Aim:
To write an embedded c program to interface 4 x 4 matrix keypad with ARM processor and display the
pressed key in an LCD.
Apparatus Required:
1. LPC2148 ARM development board
2. Interfacing cables
3. PC
Theory:

In matrix keypad, keys are connected in rows and columns. When any switch is pressed, rows and
columns come into contact, which is that detected by controller to identify which key has been pressed. A
4?4 matrix keypad consists of 4 rows and 4 columns. There is a switch connecting each row and column.
So the combinations of rows and columns make up the 16 inputs.Initially all the switches are open (not
connected). When any one button is pressed, the switch is closed (connected),hence there is a connection
between the row and column. The first 4 pins are connected to the column as INPUT. The other 4 pins are
connected to the row as OUTPUT. Matrix keypad is a good substitution to normal push button.












29 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Circuit Diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus program for interfacing matrix keypad with ARM controller is written and executed and the key
pressed is seen in the LCD.



30 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Outcome:
Able to interface keypad with ARM controller and see the pressed key in the LCD display.
Applications :
1. Used in password based door locking system
2. Security system with user changeable
3. Used in laptops, computer games
4. Used in portable video games and cell phones



1. What is Matrix keypad?
2. What is the concept behind keypad interface?
3. What are the functions of pull- up resistors?
4. What is key de bouncing?
5. List the steps involved when the key in a 4 x 4 keyboard matrix is being pressed.
6. What is the value obtained if no key is pressed?
7. What kind of interrupt is generated if a key has to be operated in an interrupt mode?
8. How will you identify that the key is pressed?
9. What are the steps involved in Keyboard Interfacing?
10. List the registers used to store the keyboard, display modes and other operations programmed by
CPU.
11. Name the mode when a data is entered from the left side of the display unit.
12. How many rows and columns are present in a 16 x 2 alphanumeric LCD?
13. How many data lines are there in a 16 x 2 alphanumeric LCD?
14. Which pin of the LCD is used for adjusting its contrast?
15. Which command of an LCD is used to shift the entire display to the right?
16. Which command is used to select the 2 lines and 5 x 7 matrix of an LCD?
17. What changes are to be made to send data to an LCD?
18. For reading operation from an LCD what changes in the software are introduced?
19. Which instruction is used to select the first row first column of an LCD?
Viva-voce

31 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
31 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Expt. No. 7 INTERFACING EEPROM AND INTERRUPT

Aim:
To write a program to interface EEPROM using I2C protocol with ARM controller and retrieve the stored
messages inside EEPROM.
Apparatus Required:
1. LPC2148 ARM development board
2. Interfacing cables
3. PC
Theory:
I2C (Inter Integrated Circuit):
The I2C (Inter-IC) bus is a bi-directional two-wire serial bus that provides a communication link between
integrated circuits (ICs).I2C is a synchronous protocol that allows a master device to initiate communication
with a slave device. Data is exchanged between these devices.
EEPROM:
EEPROM (electrically erasable programmable read-only memory) is user-modifiable read-only
memory (ROM) that can be erased and reprogrammed (written to) repeatedly through the application of
higher than normal electrical voltage. It is a type of non-volatile memory used in computers and other
electronic devices to store small amounts of data that must be saved when power is removed, e.g.,
calibration tables or device configuration
Read, write and Erase EEPROM by using I2C in LPC2148 Primer Board. Wiring up an I2C based
EEPROM to the I2C port is relatively simple. The basic operation of the I2C based EEPROM's is to send a
command, such as WRITE, followed by an address and the data. In WRITE operation, the EEPROM is
used to store the data. In LPC2148 Primer Kit, 2 nos. of EEPROM lines are controlled by I2C Enabled
drivers. I2C Lines serial clock SCL (P0.2), serial data SDA (P0.3) connected to the I2C based serial
EEPROM IC. The EEPROM read & write operations are done in LPC2148 Primer Kit by using these SDA &
SCL I2C lines.
32 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
32 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To down load and run this program: Refer General procedure given in Page No: 60
Result:
Thus, the program for interfacing I2C based EEPROM with ARM processor has been written and
executed successfully and the memory content is verified on Win x talk terminal.
Outcome:
Able to interface memory ICs with ARM controller and perform the read and write operations.



33 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications:
1. ROM used in toys,automobiles to store data when power is off
2. In calculators and peripheral devices
3. In laser printers
4. And also in embedded systems where program need not to be changed.


1. How does I2C protocol work?
2. What is EEPROM?
3. What is meant by master slave mode?
4. What is meant by non-volatile memory?
5. What is an interrupt?
6. How does an interrupt request works?
7. What is a nested interrupt?
8. What are the registers used for enabling an interrupt?
9. What is PROM?
10. What is EPROM?
11. What is mask ROM?
12. Which memory allows simultaneous read and write operations?
13. Which memory has the shortest access times?
14. Which interrupt has the highest priority?
15. What is non maskable interrupt?
16. Which is the first level of memory access by the microprocessor?
17. List the types of cache memories.
18. What is the use of an interrupt?
19. What is the use of converting an interrupt to threads in a microprocessor?
20. What are the bits used to control an external interrupts?


Viva-voce




34 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00










CYCLE 2 - EXPERIMENTS




35 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 8 IMPLEMENTATION OF MAILBOX FUNCTION
USING LPC2148
Aim:
To create a mailbox in Micro C/OS ? II using LPC2148 ARM Controller
Apparatus Required:
1. LPC2148 ARM development board
2. Interfacing cables
3. PC
Theory:
System or the user code can send a message by the core services. A typical mail message, also
known as the exchange of information, refers to a task or an ISR using a pointer variable, through the core
services to put a message (that is, a pointer) into the mailbox. Similarly, one or more tasks can receive this
message by the core services. The tasks sending and receiving the message promise that the content that
the pointer points to is just that piece of message.
The mailbox of CooCox CoOS is a typical message mailbox which is composed of two parts: one is
the information which expressed by a pointer of void; the other is the waiting list which composed of the
tasks waiting for this mailbox. The waiting list supports two kinds of sorting: FIFO and preemptive priority.
The sorting mode is determined by the user when creating the mailbox.
Procedure:
To Edit / Compile / generate Hex file: Refer General procedure in Page No: 58
To down load and run this program: Refer General procedure in Page No: 60
Result:
Thus, the mailbox was created in Micro C/OS ?II and implemented using LPC2148.
Outcome:
Able to understand the concept of mail box in embedded systems and its significance in real time
systems





36 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications:
1. Used in Acorn RISC PC700
2. Used in ZIPIT wireless messenger
3. Used in Meizu M6 MINI player


1. What is IPC?
2. Define Queue.
3. What are the different types of mail box functions?
4. What is half duplex mode?
5. How many synchronous and asynchronous modes are there in serial port?
6. List the bits used to generate serial port interrupt
7. What is branch prediction?
8. Mention any two features of ?C/OS ? II.
9. Write the function for creating task in ?C/OS ? II.
10. Mention any two support devices for ?C/OS ? II.
11. How many user tasks can be handled by ?C/OS ? II?



















Viva-voce




37 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 9 INTERRUPT PERFORMANCE
CHARACTERISTICSOF ARM AND FPGA

Aim:
To study the interrupt performance characteristics of ARM and FPGA by using ARM controller kit and
FPGA kit separately.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
External Interrupts:
An interrupt caused by an external source such as the computer operator, external sensor or
monitoring device, or another computer. Interrupts are special events that require immediate attention.
Interfacing External Interrupts with LPC2148:
When an external interrupt signal occurs in LPC2148 Primer Board, the message "LOW" will be
displayed on PC. The interrupt signal occurs using switches. When the switch is pressed to LOW, then the
external interrupt occurs. The Vectored Interrupt Controller (VIC) takes 32 interrupt request inputs and
programmable assigns them into 3 categories, FIQ, vectored IRQ, and non-vectored IRQ. The ARM7
LPC2148 Primer board has two numbers of External Interrupts, connected with I/O Port lines (P0.14 &
P0.15) as switches.







38 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00



Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60


39 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
39 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Result:
Thus the interrupt performance characteristics of ARM and FPGA are studied. On comparison, ARM
counts at slow speed because it consumes more instruction cycle and FPGA is more efficient for servicing
and processing external interrupt pulses.
Outcome:
Able to understand the performance characteristics of ARM and FPGA while dealing with
interrrupts
Applications:
1. Used in random logic and SPLDs
2. Used in cryptography and filtering
3. In medical imaging
4. In bioinformatics and voice recognition



1. When is an Interrupt Request received?
2. What is ISR?
3. How do you initialize interrupt?
4. What is Vectored Interrupt Controller?
5. What are the kinds of protection available for SRAMS ?
6. What is interrupt pipelining?
7. What is pipeline shutdown?
8. What is branch prediction?
9. What is the use of Neon Floating point engine?
10. What is the use of ?vectorize option?
11. What is PTM?
12. What is ITM?
13. What is ETM?
14. What is I2S interface?
15. What is the use of ?SWI? in ARM assembly?

Viva-voce




40 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 10 FLASHING OF LEDS
Aim:
To write and execute an embedded c program to display LEDs using LPC 2148 ARM controller
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
Theory:
LED (Light Emitting Diodes) is the most commonly used components, usually for displaying pins digital
states. Typical uses of LEDs include alarm devices, timers and confirmation of user input such as a mouse
click or keystroke. Interfacing LED with LPC2148 Flash a LED using LPC2148 Primer Board. It works by
turning ON a LED & then turning it OFF & then looping back to START. However the operating speed of
microcontroller is very high so the flashing frequency will also be very fast to be detected by human eye.
The ARM7 LPC2148 Primer board has eight numbers of point LEDs, connected with I/O Port lines (P1.16 ?
P1.23) to make port pins high.










41 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00



Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus program for flashing of LEDs is written and executed using ARM controller LPC2148.



42 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Outcome:
Able to interface LED lights via the input output port and control them
Applications:
1. In Illumination
2. As status indicators in equipments
3. Stadium displays and dynamic decorative displays



1. What is seven segment displays?
2. What are the different configurations of LED?
3. What is the function of GPIO?
4. What are the Pins which are used to connect LEDs?
5. How to identify 'Polarity' of LED?
6. Differentiate LED from LCD.
7. What is a use of Jumper?
8. How many numbers of LEDs present in Primer board?
9. Where LEDs are used?
10. What is the use of flash magic software?
11. Which port is used in ARM 7 processor kit?
12. Which diode suffers an avalanche breakdown?
13. What happens if the junction temperature of LED is increased?
14. What is an anti collision rate light?
15. What is fail-safe conditions






Viva-voce




43 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 11 STEPPER MOTOR INTERFACE WITH
ARM -7 LPC2148
Aim:
To write a program to interface stepper motor using ARM processor and control the movement of motor
in either directions.
Apparatus Required:
1. LPC2148 ARM development board
2. Stepper motor
3. Interfacing cables
4. PC
Theory:
A stepper motor can be viewed as a DC motor with number of poles (on both rotor and stator).
Additionally, soft magnetic material with many teeth on the rotor and stator cheaply multiplies the number of
poles (reluctance motor). Like an AC synchronous motor, it is ideally driven by sinusoidal current, allowing
a step less operation, but this puts some burden on the controller. When using an 8-bit digital controller,
256 micro steps per step are possible. As a digital-to-analog converter produces unwanted ohmic heat in
the controller, pulse-width modulation is used to regulate the mean current. Simpler models switch voltage
only for doing a step, thus needing an extra current limiter: for every step, they switch a single cable to the
motor.
The idea is to connect the output pins of the driver to 4 transistors. The transistor must be
grounded at the emitter and the driver pin must be connected to the base. Collector is connected to the coil
wire of the motor. Stepper motors are rated by the torque they produce. Synchronous electric motors using
soft magnetic materials (having a core) have the ability to provide position holding torque (called detent
torque, and sometimes included in the specifications) while not driven electrically. To achieve full rated
torque, the coils in a stepper motor must reach their full rated current during each step. The voltage rating
(if there is one) is almost meaningless. The motors also suffer from EMF, which means that once the coil is
turned off it starts to generate current because the motor is still rotating. There needs to be an explicit way
to handle this extra current in a circuit otherwise it can cause damage and affect performance of the motor.
44 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
44 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus stepper motor interface with ARM processor has been successfully implemented and the motor is
controlled in clockwise and anticlockwise direction.
Outcome:
Able to interface the stepper motor with ARM controller and thereby create some rotational
movements





45 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Applications:
3. Used for precise positioning with a motor
4. Used in hard disk drives, robotics
5. Used in telescopes and toys







1. Define GPIO.
2. What is the function of ULN2803?
3. How LPC2148 control stepper motor?
4. Which I/O port lines used to rotate stepper motor?
5. How stepper motor reacts for each pulse it receives?
6. What is serial communication?
7. What is parallel communication?
8. What is stepper motor & why it is named so?
9. How can be step angle is calculated?
10. What are the advantages and disadvantages of parallel communication?
11. What does instruction-pipelining mean?
12. What is the power supply required for ARM processor?
13. What is a unit for torque?
14. What is RPM rating for a DC motor?
15. What device that is used to obtain an accurate position control of rotating shafts in terms of steps?
Viva-voce

46 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
46 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Expt. No. 12 LM35 TEMPERATURE SENSOR INTERFACE
WITH ARM-7 LPC2148
Aim:
To write a program to interface of LM35 temperature sensor to on-chip ADC of ARM controller and
display the room temperature value on the screen.
Apparatus Required:
1. LPC2148 ARM development board
2. Temperature sensor
3. Interfacing cables
4. PC
Theory:
Temperature Sensor:
The LM35 series are precision integrated-circuit temperature sensors, whose output voltage is linearly
proportional to the Celsius (Centigrade) temperature. The output of the sensor is converted to digital output
that is easy to connect with microcontroller. Temperature sensor has three terminals and required
Maximum of 5.5 V supply. This type of sensor consists of a material that performs the operation according
to temperature to vary the resistance. This change of resistance is sensed by circuit and it calculates
temperature. When the voltage increases then the temperature also rises. We can see this operation by
using a diode.







47 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
47 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00


Circuit diagram:

48 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
48 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the program for interfacing temperature sensor with ARM controller is written and executed and
the temperature reading is seen on the monitor.
Outcome:
Able to interface different sensors with in-built ADC of the ARM processor and access the data
produced from them
Applications:
1. Used in Ovens, refrigerators
2. In HVAC environmental control
3. coolant or cylinder head temperatures
4. in the automotive industry to monitor air intake



1. What is LM35?
2. Define ISP.
3. How many Analog-to-Digital Converters available as an inner peripheral in LPC2148?
4. What is the main function of analog pin in LPC 2148?
5. What is the output voltage produced by LM35 for one degree temperature?
6. What is the difference between LM 34 and LM 35 sensors?
7. How many pins are available in LM35?
8. Why Vref is set of ADC0848 to 2.56 V if analog input is connected to the LM35?
9. What is operating the operating temperature range in LM35?
10. Why LM35 is used to Measure Temperature?
11. List the devices used to sense temperature.
12. What is the purpose of a thermocouple?
13. What is the output voltage of a thermocouple?
Viva-voce




49 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 13 IMPLEMENTATION OF WIRELESS
COMMUNICATION PROTOCOL
USING ZIGBEE WIRELESS MODULE
Aim:
To implement wireless communication protocol using zigbee wireless module with the help of ARM
processor
Apparatus required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. Zigbee module
5. PC
Theory:
ZigBee is a specification to suite high level communication protocols using small, low-power digital
radios based on an IEEE 802 standard for personal area networks. The ZigBee is the name of a wireless
protocol maintained by the IEEE 802.15 standard. This is a protocol specified for wireless Personal Area
Network (PAN) using low powered wireless transceivers. There are already wireless transmitter and
receiver modules which can do point to point communication. The Xbee is the brand name a wireless
transceiver device introduced by the Digi international which works on the ZigBee protocol and can form
PAN networks. They have an approximate range of 10 to 100 meters and are used in industries, scientific
fields, medical fields etc
Digi ZigBee:
The Digi Xbee 802.15.4 modules are the easiest to use, most reliable and cost-effective RF devices.
The 802.15.4 Xbee modules provide two friendly modes of communication - a simple serial method to
transmit/receive or a framed mode providing advanced features. These modules can communicate point to
point, from one point to a PC, or in a mesh network.



50 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
50 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Circuit diagram:


Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the wireless communication protocol using Zigbee wireless module is implemented using
LPC2148.
Outcome:
Able to form a wireless network using zigbee module and ARM controller




51 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications:
1. Used in traffic lights in non-urban areas
2. Used in building control systems
3. Used in asset tracking
4. Used in parking sensors




1. How many UART ports available in LPC2148?
2. What is the main function of voltage convertors in UART?
3. Why Zigbee based is preferred for wireless communication?
4. What is the IEEE standard for Zigbee protocol?
5. Write the two modes of communication are used in a ZigBee network.
6. What is the function of a scheduler?
7. Mention any two features of ?C/OS ? II.
8. Write the function for creating task in ?C/OS ? II.
9. Mention any two support devices for ?C/OS ? II.
10. How many user tasks can be handled by ?C/OS ? II?







Viva-voce

FirstRanker.com - FirstRanker's Choice
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00






?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING

VII SEMESTER - R 2013

EC6711 ? EMBEDDED LABORATORY






Name : _______________________________________
Register No : _______________________________________
Section : _______________________________________
LABORATORY MANUAL



2 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00




is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and
training.

? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different
levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on
heart and soul
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

To impart professional education integrated with human values to the younger generation, so as to
shape them as proficient and dedicated engineers, capable of providing comprehensive solutions to the
challenges in deploying technology for the service of humanity

? To educate the students with the state-of-art technologies to meet the growing challenges of the
electronics industry
? To carry out research through continuous interaction with research institutes and industry, on
advances in communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning,
innovation and ethical practices
VISION
VISION
MISSION
MISSION



3 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

PROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To provide students with a solid foundation in Mathematics, Science and fundamentals of
engineering, enabling them to apply, to find solutions for engineering problems and use this knowledge
to acquire higher education
2. Core Competence
To train the students in Electronics and Communication technologies so that they apply their
knowledge and training to compare, and to analyze various engineering industrial problems to find
solutions
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice which
enables them to find solutions for the real time problems in industry, and to design products
4. Professionalism
To inculcate professional and effective communication skills, leadership qualities and team spirit in
the students to make them multi-faceted personalities and develop their ability to relate engineering
issues to broader social context
5. Lifelong Learning/Ethics
To demonstrate and practice ethical and professional responsibilities in the industry and society in
the large, through commitment and lifelong learning needed for successful professional career


4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
PROGRAMME OUTCOMES (POs)
a) To demonstrate and apply knowledge of Mathematics, Science and engineering fundamentals in
Electronics and Communication Engineering field
b) To design a component, a system or a process to meet the specific needs within the realistic
constraints such as economics, environment, ethics, health, safety and manufacturability
c) To demonstrate the competency to use software tools for computation, simulation and testing of electronics
and communication engineering circuits
d) To identify, formulate and solve electronic and communication engineering problems
e) To demonstrate an ability to visualize and work on laboratory and multidisciplinary tasks
f) To function as a member or a leader in multidisciplinary activities
g) To communicate in verbal and written form with fellow engineers and society at large
h) To understand the impact of Electronics and Communication Engineering in the society and demonstrate
awareness of contemporary issues and commitment to give solutions exhibiting social responsibility
i) To demonstrate professional & ethical responsibilities
j) To exhibit confidence in self-education and ability for lifelong learning
k) To participate and succeed in competitive exams


5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
SYLLABUS

? Learn the working of ARM processor
? Understand the Building Blocks of Embedded Systems
? Learn the concept of memory map and memory interface
? Know the characteristics of Real Time Systems
? Write programs to interface memory, I/Os with processor
? Study the interrupt performance
LIST OF EXPERIMENTS:
1. Study of ARM evaluation system
2. Interfacing ADC and DAC
3. Interfacing LED and PWM
4. Interfacing real time clock and serial port
5. Interfacing keyboard and LCD
6. Interfacing EPROM and interrupt
7. Mailbox
8. Interrupt performance characteristics of ARM and FPGA
9. Flashing of LEDS
10. Interfacing stepper motor and temperature sensor
11. Implementing zigbee protocol with ARM



? Write programs in ARM for a specific Application
? Interface memory and Write programs related to memory operations
? Interface A/D and D/A convertors with ARM system
? Analyze the performance of interrupt
? Write programmes for interfacing keyboard, display, motor and sensor.
? Formulate a mini project using embedded system
COURSE OBJECTIVES
COURSE OUTCOMES
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
CONTENTS
Sl. No. Name of the Experiment Page No.
CYCLE 1 ? EXPERIMENTS
1
Study of ARM evaluation system 7
2
Analog to Digital Convertor interfacing 16
3
Generation of ramp and square wave using on-Chip DAC 19
4
LED dimming using PWM 22
5
Interfacing real time clock and serial port 25
6
Interfacing keypad and LCD 28
7
Interfacing EPROM and interrupt 31
CYCLE 2 ? EXPERIMENTS
8 Implementation of Mailbox Function using LPC 2148 35
9 Interrupt Performance Characteristics of Arm and FPGA 37
10 Flashing of LEDs 40
11 Stepper Motor Interface with ARM ? 7 LPC2148 43
12 LM35 Temperature Sensor Interface with ARM ? 7 LPC2148 47
13
Implementation of Wireless Communication Protocol using ZIGBEE Wireless
Module
50
ADDITIONAL EXPERIMENTS BEYOND THE SYYLABUS
14 Buzzer Interface with ARM ? 7 54
15 Relay interface with ARM? 7 57
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Expt. No. 1 STUDY OF ARM EVALUATION SYSTEM
Aim:
To study the building blocks of ARM7 system, its features, pin configuration and the components
required for functioning of ARM controller.
Architecture Overview:
A RISC-based computer design approach means ARM processors require significantly fewer transistors
than typical processors in average computers. This approach reduces cost, heat and power usage. These
are desirable traits for light, portable, battery-powered devices (smart phones, laptops, tablet and notepad
computers), and other embedded systems. A simpler design facilitates more efficient multi-core CPUs and
higher core counts at lower cost, providing higher processing power and improved energy efficiency for
servers and supercomputers.
In 2005, about 98% of all mobile phones sold used at least one ARM processor. The low power
consumption of ARM processors has made them very popular: 37 billion ARM processors have been
produced as of 2013, up from 10 billion in 2008. The ARM architecture (32-bit) is the most widely used
architecture in mobile devices, and most popular 32-bit one in embedded systems.
According to ARM Holdings, in 2010 alone, producers of chips based on ARM architectures
reported shipments of 6.1 billion ARM based processors, representing 95% of smart phones, 35% of digital
televisions and set-top boxes and 10% of mobile computers. It is the most widely used 32-bit instruction set
architecture in terms of quantity produced.
LPC 2148:
LPC2148 is the widely used IC from ARM-7 family. It is manufactured by Philips and it is pre-loaded
with many inbuilt peripherals making it more efficient and a reliable option for the beginners as well as high
end application developer.




8 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Features of LPC214x series controllers:
1. 8 to 40 kB of on-chip static RAM and 32 to 512 kB of on-chip flash program memory.128 bit wide
interface/accelerator enables high speed 60 MHz operation.
2. In-System/In-Application Programming (ISP/IAP) via on-chip boot-loader software. Single flash sector or
full chip erase in 400 ms and programming of 256 bytes in 1ms.
3. Embedded ICE RT and Embedded Trace interfaces offer real-time debugging with the on-chip Real
Monitor software and high speed tracing of instruction execution.
4. USB 2.0 Full Speed compliant Device Controller with 2 kB of endpoint RAM. In addition, the LPC2146/8
provides 8 kB of on-chip RAM accessible to USB by DMA.
5. One or two (LPC2141/2 vs. LPC2144/6/8) 10-bit A/D converters provide a total of 6/14analog inputs, with
conversion times as low as 2.44 us per channel.
6. Single 10-bit D/A converter provides variable analog output.
7. Two 32-bit timers/external event counters (with four capture and four compare channels each), PWM unit
(six outputs) and watchdog.
8. Low power real-time clock with independent power and dedicated 32 kHz clock input.
9. Multiple serial interfaces including two UARTs (16C550), two Fast I2C-bus (400 kbit/s), SPI and SSP with
buffering and variable data length capabilities.
10. Vectored interrupt controller with configurable priorities and vector addresses.
11. Up to 45 of 5 V tolerant fast general purpose I/O pins in a tiny LQFP64 package.
12. Up to nine edge or level sensitive external interrupt pins available.
13. On-chip integrated oscillator operates with an external crystal in range from 1 MHz to30 MHz and with
an external oscillator up to 50 MHz
14. Power saving modes include Idle and Power-down.
15. Individual enable/disable of peripheral functions as well as peripheral clock scaling for additional power
optimization.
16. Processor wake-up from Power-down mode via external interrupt, USB, Brown-Out Detect (BOD) or
Real-Time Clock (RTC).




9 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


First Step- Hardware Requirement:
Pin configuration of LPC 2148.

Hardware requirement of LPC2148:
1. LPC2148 need minimum below listed hardware to work properly
2. Power Supply
3. Crystal Oscillator
4. Reset Circuit
5. RTC crystal oscillator
6. UART
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Power Supply:
LPC2148 works on 3.3 V power supply. LM 117 can be used for generating 3.3 V supply. However,
basic peripherals like LCD, ULN 2003 (Motor Driver IC) etc. works on 5V. So AC mains supply is converted
into 5V using below mentioned circuit and after that LM 117 is used to convert 5V into 3.3V.
Block diagram of power Supply

Transformer: It is used to step down 230V AC to 9V AC supply and provides isolation between power grids
and circuit.
Rectifier: It is used to convert AC supply into DC.
Filter: It is used to reduce ripple factor of DC output available from rectifier end.
Regulator: It is used to regulate DC supply output.

11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Circuit Diagram:

Regulator IC 7805 is used to provide fix 5V dc supply.
LM 117 is used for generating 3.3V supply from 5V.

12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Calculations:

From the datasheet of LM117

Taking R 2= 240?, we get R 1=392?
Reset Circuit:
Reset button is essential in a system to avoid programming pitfalls and manually bring back the system
to the initialization mode. MCP 130T is a special IC used for providing stable RESET signal to LPC 2148.


13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Oscillator Circuit:

The value of capacitors C20 & C21 depends upon the frequency of crystal Y3. General circuit and
its equivalent circuit is as shown below.

14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Recommended values are as shown in table:

UART:
LPC 2148 has inbuilt ISP which means we can program it within the system using serial
communication on COM0. It has also COM1 for serial communication. MAX 232/233 IC must be used for
voltage logic conversion. Related connections are as given below.

Once the above listed circuit design is ready, we are ready to go further.



15 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Result:
ARM Evaluation system and the configuration of LPC2148 has been studied fully. The minimal setup
required for the functioning of the ARM processor is studied.
Outcomes:
1. Able to understand the ARM controller, its basic components inside and its features.
2. Able to know the components required for the working of ARM LPC2148

Applications:
ARM controller LPC2148 is used in no. of devices such as
1. Smart phones
2. Net books
3. E Readers
4. Digital TV
5. Home Gateways


1. What are the basic units of ARM 7?
2. What is the address system supported by ARM?
3. Define - RISC
4. What are the instructions used to access the memory in ARM?
5. What are the basic units of Microprocessor?
6. What is an Instruction?
7. What is clock cycle?
8. Define - Pipelining
9. What is cache miss?
10. What is meant by memory mapped I/O?
11. Define ? interrupt
12. What is meant by Exception?
13. What is meant by little ? endian mode?
14. What is meant by big ? endian mode?
15. What is the function of CPSR?
16. What is register - indirect addressing?
Viva-voce




16 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 2 ANALOG TO DIGITAL CONVERTOR
INTERFACING
Aim:
To write an embedded c program for interfacing an on chip ADC with LPC2148 ARM processor and
convert the given input voltage into corresponding decimal values.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. PC
Theory:
Analog to Digital converter (ADC) is a device that converts continuously varying analog signals from
instruments that monitor such conditions as movement, temperature, sound, etc., into binary code for the
computer. It may be either a single chip or can be one circuit within a chip. Analog to Digital conversion is
the process of changing continuously varying data, such as voltage, current, or shaft rotation, into discrete
digital quantities that represent the magnitude of the data compared to a standard or reference at the
moment the conversion is made. According to the method of conversion, ADCs can be classified into
Direct-Conversion ADCs, Successive Approximation ADCs, Integrating ADC and Sigma-Delta ADCs.
The LPC 2148 has 10-bit successive approximation analog to digital converter. Basic clocking for the
A/D converters is provided by the VPB clock. A programmable divider is included in each converter, to
scale this clock to the 4.5 MHz (max) clock needed by the successive approximation process. A fully
accurate conversion requires 11 of these clocks. The ADC cell can measure the voltage on any of the ADC
input signals. It is noted that these analog inputs are always connected to their pins, even if the Pin function
Select register assigns them to port pins. A simple self-test of the ADC can be done by driving these pins
as port outputs.



17 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Circuit diagram:




18 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus, an embedded c program for interfacing on-chip ADC with ARM processor is written and
executed. The decimal values of the converted voltage are seen in the WinXTalk screen.
Outcome:
Able to interface A/D convertors with ARM system and check its working by connecting an analog
quantity as input.
Applications:
1. ADC used in MODEM for converting analog signals to digital.
2. A fast video ADC in TV tuner cards
3. ADC used in digital storage oscilloscopes
4. Used in music reproduction technology.
5. Used in DSP if input is analog


1. What are the ADC operating modes in LPC2148?
2. What is meant by conversion time?
3. Why are internal ADCs preferred over external ADCs?
4. Why has 16-bit ADC more resolution than from 10-bit and 8-bit ADC?
5. What are ADC & its Resolution?
6. What is Burst conversion mode?
7. What is the function of A/D Control Register?
8. What is the function of A/D Global Data Register?
9. What is the function of A/D Status Register?
10. What is analog-to-digital (ADC) conversion error?
11. What is the function of Sample-and-hold circuits in analog-to digital converters?
12. What is the disadvantage of the flash analog-to digital converter?
Viva-voce




19 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 3 GENERATION OF RAMP AND SQUARE
WAVE USING ON-CHIP DAC
Aim:
To write and execute an embedded c program to generate ramp wave and square wave using on-chip
DAC of LPC2148 ARM controller.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
A digital-to-analog converter is a device for converting a digital signal into an analog signal (current or
voltage). Digital-to-Analog Converters are the interface between the abstract digital world and the analog
real world. Simple switches, a network of resistors, current sources or capacitors may be used to
implement this conversion. A DAC inputs a binary number and outputs an analog voltage or current signal.
The Microchip Technology Inc. MCP4921 is 2.7 ? 5.5V, low-power, 12-Bit Digital-to-Analog Converter
(DAC) with SPI interface. The MCP4921 DAC provides high accuracy and low noise performance for
industrial applications where calibration or compensation of signals is required. With an SPI connection
there is always one master device (usually a microcontroller) which controls the peripheral devices.
Typically there are three lines common to all the devices,
Master In Slave Out (MISO) ? The Slave line for sending data to the master,
Master Out Slave In (MOSI) ? The Master line for sending data to the peripherals,
Serial Clock (SCK) ? The clock pulses which synchronize data transmission generated by the
master and slave
Slave Select pin ? the pin on each device that the master can use to enable and disable specific
devices. When a device Slave Select pin is low, it communicates with the master. When it is high, it ignores
the master. In SPI, the clock signal is controlled by the master device LPC2148. All data is clocked in and
out using this pin. These lines need to be connected to the relevant pins on the LPC21xx processor. Any
unused GIO pin can be used for CS, instead pull this pin high. Conversion speed is the time it takes for the



20 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

DAC to provide an analog output when the digital input word is changed. The MCP4291 DAC ? SPI
connections with LPC21xx have four I/O lines (P0.4 ? P0.7) required. The analog output is generated by
using these four lines.
Circuit diagram:


Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the embedded c programs for generating ramp wave and square wave using ARM LPC2148 are
written and executed successfully and the waveforms are viewed in oscilloscope.
Outcome:
Able to program the DAC in-built inside the ARM controller and get the waveforms using it.




21 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications :
1. DAC used in Audio amplifier.
2. Video encoder
3. Display electronics
4. Data Acquistion systems
5. Motor control



1. What are the features of LPC2148 DAC?
2. What is the function of DAC register?
3. Which pin provides a voltage reference level for the D/A converter?
4. What are the applications of DAC in signal processing applications?
5. What is GIO?
6. What is the resolution of a digital-to-analog converter (DAC)?
7. What is the major advantage of the R/2R ladder digital-to-analog (DAC), as compared to a binary-
weighted digital-to-analog DAC converter?
8. What is the resolution of a 0?5 V 6-bit digital-to-analog converter (DAC) ?
9. What are DAC configurations?
10. What are the different types of DAC Circuits?
11. What are the Limitations of the Binary Weighted DAC?
12. What are the General DAC Characteristics?
13. Define reference voltage in DAC.
14. What is full scale voltage?
15. What is settling time?
VIVA-VOCE




22 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 4 LED DIMMING USING PWM

Aim:
To write an embedded c program for implementing PWM using ARM controller and verify the same by
dimming of LEDs.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
LPC2148 supports 2 types of PWM:
1) Single Edge PWM ? Pulse starts with new Period i.e pulse is always at the beginning
2) Double Edge PWM ? Pulse can be anywhere within the Period
A PWM block, like a Timer block , has a Timer Counter and an associated Pre-scale Register along
with Match Registers. These work exactly the same way as in the case of Timers. Match Registers 1 to 6
(except 0) are pinned on LPC214x i.e. the corresponding outputs are diverted to actual Pins on LPC214x
MCU. The PWM function must be selected for these Pins to get the PWM output.
The basic setup is to simply replace Servo by a LED and no external 5V source is needed. The
anode of LED is connected to P0.0 and cathode to ground. Pulse Widths corresponding to the switches
connected to P0.1/2/3/4 will be 2.5ms/5ms/7.5ms/10ms respectively. As the Pulse Width Increases LED
will keep on getting brighter and the reverse will happen if Pulse Width is decreased.



23 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus embedded c program for implementing Pulse Width Modulation is written and executed and
output has been verified in LED display.
Outcome:
Able to implement PWM using the ARM controller and verify the same in the form of dimming of
LEDS.



24 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Applications :
1. In Visual signals to covey a message
2. Illumination where light is reflected from objects
3. In Narrow band sensors



1. What factors determine the LED dimming performance?
2. What is meant by analog dimming?
3. What is flickering effect?
4. What is the factor determines dimming of the LED
5. Why Silicon is not suitable for fabrication of light-emitting diodes?
6. Why Silicon diode is less suited for low voltage rectifier operation?
7. What is the principle of zener diode?
8. What are the materials used to make LED?
9. What type of diodes is used in FM receivers?
10. Which diode suffers an avalanche breakdown?
11. What happens if the junction temperature of LED is increased?
12. How a transfer characteristic of a diode does is related?
13. What is the requirement of a clipping action of a diode?
14. What type of rectifier circuit requires four diodes?
15. Why are the pulse width modulated outputs required in most of the applications?
16. How do the variations in an average value get affected by PWM period?
17. Name the common formats available for LED display.
18. What are the types of seven segment display?
19. What is PWM?
20. What are the applications of PWM?

Viva-voce




25 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 5 INTERFACING REAL TIME CLOCK
AND SERIAL PORT
Aim:
To write and execute an embedded c program to interface DS1307 RTC using I2C protocol with ARM
controller
Apparatus Required:
1. LPC2148 ARM development board
2. Stepper motor
3. Interfacing cables
4. PC
Theory:
A clock, which is based on the interrupts at preset intervals, is Real Time Clock (RTC). An interrupt
service routine executes on each timeout (overflow) of this clock. This timing device once started never
resets or never reloaded with another value. Once it is set, it is not modified later. It is used in a system to
save the time and date.













26 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the program for interfacing real time clock with ARM controller is written and executed and the
date and time are verified on the screen.
Outcome:
Able to interface real time clock DS1307 with ARM controller and thereby display date and time
Applications :
1. I2C In ARM and PIC microcontrollers
2. Used as serial communication protocol with MASTER and SLAVE operation.

27 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
27 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00




1. What is I2C and how does it work?
2. What are the features of I2C in LPC2148 ARM7 microcontroller?
3. What is the function of I2C0CONSET register?
4. What is I2C0STAT?
5. What is the function of I2C0 Data Register?
6. What is RTC?
7. List the advantages of RTC
8. Through which port the date and time is displayed in RTC?
9. What is a serial port?
10. List the registers used to transfer data in serial port.
11. List the modes used for data transmission.
12. What is a simplex mode?
13. Which pin is used to transmit a character?
14. What is the baud rate of serial port?
15. What is the disadvantage of RS-232C?














Viva-voce




28 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 6 INTERFACING KEYPAD AND LCD

Aim:
To write an embedded c program to interface 4 x 4 matrix keypad with ARM processor and display the
pressed key in an LCD.
Apparatus Required:
1. LPC2148 ARM development board
2. Interfacing cables
3. PC
Theory:

In matrix keypad, keys are connected in rows and columns. When any switch is pressed, rows and
columns come into contact, which is that detected by controller to identify which key has been pressed. A
4?4 matrix keypad consists of 4 rows and 4 columns. There is a switch connecting each row and column.
So the combinations of rows and columns make up the 16 inputs.Initially all the switches are open (not
connected). When any one button is pressed, the switch is closed (connected),hence there is a connection
between the row and column. The first 4 pins are connected to the column as INPUT. The other 4 pins are
connected to the row as OUTPUT. Matrix keypad is a good substitution to normal push button.












29 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Circuit Diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus program for interfacing matrix keypad with ARM controller is written and executed and the key
pressed is seen in the LCD.



30 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Outcome:
Able to interface keypad with ARM controller and see the pressed key in the LCD display.
Applications :
1. Used in password based door locking system
2. Security system with user changeable
3. Used in laptops, computer games
4. Used in portable video games and cell phones



1. What is Matrix keypad?
2. What is the concept behind keypad interface?
3. What are the functions of pull- up resistors?
4. What is key de bouncing?
5. List the steps involved when the key in a 4 x 4 keyboard matrix is being pressed.
6. What is the value obtained if no key is pressed?
7. What kind of interrupt is generated if a key has to be operated in an interrupt mode?
8. How will you identify that the key is pressed?
9. What are the steps involved in Keyboard Interfacing?
10. List the registers used to store the keyboard, display modes and other operations programmed by
CPU.
11. Name the mode when a data is entered from the left side of the display unit.
12. How many rows and columns are present in a 16 x 2 alphanumeric LCD?
13. How many data lines are there in a 16 x 2 alphanumeric LCD?
14. Which pin of the LCD is used for adjusting its contrast?
15. Which command of an LCD is used to shift the entire display to the right?
16. Which command is used to select the 2 lines and 5 x 7 matrix of an LCD?
17. What changes are to be made to send data to an LCD?
18. For reading operation from an LCD what changes in the software are introduced?
19. Which instruction is used to select the first row first column of an LCD?
Viva-voce

31 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
31 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Expt. No. 7 INTERFACING EEPROM AND INTERRUPT

Aim:
To write a program to interface EEPROM using I2C protocol with ARM controller and retrieve the stored
messages inside EEPROM.
Apparatus Required:
1. LPC2148 ARM development board
2. Interfacing cables
3. PC
Theory:
I2C (Inter Integrated Circuit):
The I2C (Inter-IC) bus is a bi-directional two-wire serial bus that provides a communication link between
integrated circuits (ICs).I2C is a synchronous protocol that allows a master device to initiate communication
with a slave device. Data is exchanged between these devices.
EEPROM:
EEPROM (electrically erasable programmable read-only memory) is user-modifiable read-only
memory (ROM) that can be erased and reprogrammed (written to) repeatedly through the application of
higher than normal electrical voltage. It is a type of non-volatile memory used in computers and other
electronic devices to store small amounts of data that must be saved when power is removed, e.g.,
calibration tables or device configuration
Read, write and Erase EEPROM by using I2C in LPC2148 Primer Board. Wiring up an I2C based
EEPROM to the I2C port is relatively simple. The basic operation of the I2C based EEPROM's is to send a
command, such as WRITE, followed by an address and the data. In WRITE operation, the EEPROM is
used to store the data. In LPC2148 Primer Kit, 2 nos. of EEPROM lines are controlled by I2C Enabled
drivers. I2C Lines serial clock SCL (P0.2), serial data SDA (P0.3) connected to the I2C based serial
EEPROM IC. The EEPROM read & write operations are done in LPC2148 Primer Kit by using these SDA &
SCL I2C lines.
32 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
32 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To down load and run this program: Refer General procedure given in Page No: 60
Result:
Thus, the program for interfacing I2C based EEPROM with ARM processor has been written and
executed successfully and the memory content is verified on Win x talk terminal.
Outcome:
Able to interface memory ICs with ARM controller and perform the read and write operations.



33 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications:
1. ROM used in toys,automobiles to store data when power is off
2. In calculators and peripheral devices
3. In laser printers
4. And also in embedded systems where program need not to be changed.


1. How does I2C protocol work?
2. What is EEPROM?
3. What is meant by master slave mode?
4. What is meant by non-volatile memory?
5. What is an interrupt?
6. How does an interrupt request works?
7. What is a nested interrupt?
8. What are the registers used for enabling an interrupt?
9. What is PROM?
10. What is EPROM?
11. What is mask ROM?
12. Which memory allows simultaneous read and write operations?
13. Which memory has the shortest access times?
14. Which interrupt has the highest priority?
15. What is non maskable interrupt?
16. Which is the first level of memory access by the microprocessor?
17. List the types of cache memories.
18. What is the use of an interrupt?
19. What is the use of converting an interrupt to threads in a microprocessor?
20. What are the bits used to control an external interrupts?


Viva-voce




34 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00










CYCLE 2 - EXPERIMENTS




35 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 8 IMPLEMENTATION OF MAILBOX FUNCTION
USING LPC2148
Aim:
To create a mailbox in Micro C/OS ? II using LPC2148 ARM Controller
Apparatus Required:
1. LPC2148 ARM development board
2. Interfacing cables
3. PC
Theory:
System or the user code can send a message by the core services. A typical mail message, also
known as the exchange of information, refers to a task or an ISR using a pointer variable, through the core
services to put a message (that is, a pointer) into the mailbox. Similarly, one or more tasks can receive this
message by the core services. The tasks sending and receiving the message promise that the content that
the pointer points to is just that piece of message.
The mailbox of CooCox CoOS is a typical message mailbox which is composed of two parts: one is
the information which expressed by a pointer of void; the other is the waiting list which composed of the
tasks waiting for this mailbox. The waiting list supports two kinds of sorting: FIFO and preemptive priority.
The sorting mode is determined by the user when creating the mailbox.
Procedure:
To Edit / Compile / generate Hex file: Refer General procedure in Page No: 58
To down load and run this program: Refer General procedure in Page No: 60
Result:
Thus, the mailbox was created in Micro C/OS ?II and implemented using LPC2148.
Outcome:
Able to understand the concept of mail box in embedded systems and its significance in real time
systems





36 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications:
1. Used in Acorn RISC PC700
2. Used in ZIPIT wireless messenger
3. Used in Meizu M6 MINI player


1. What is IPC?
2. Define Queue.
3. What are the different types of mail box functions?
4. What is half duplex mode?
5. How many synchronous and asynchronous modes are there in serial port?
6. List the bits used to generate serial port interrupt
7. What is branch prediction?
8. Mention any two features of ?C/OS ? II.
9. Write the function for creating task in ?C/OS ? II.
10. Mention any two support devices for ?C/OS ? II.
11. How many user tasks can be handled by ?C/OS ? II?



















Viva-voce




37 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 9 INTERRUPT PERFORMANCE
CHARACTERISTICSOF ARM AND FPGA

Aim:
To study the interrupt performance characteristics of ARM and FPGA by using ARM controller kit and
FPGA kit separately.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
External Interrupts:
An interrupt caused by an external source such as the computer operator, external sensor or
monitoring device, or another computer. Interrupts are special events that require immediate attention.
Interfacing External Interrupts with LPC2148:
When an external interrupt signal occurs in LPC2148 Primer Board, the message "LOW" will be
displayed on PC. The interrupt signal occurs using switches. When the switch is pressed to LOW, then the
external interrupt occurs. The Vectored Interrupt Controller (VIC) takes 32 interrupt request inputs and
programmable assigns them into 3 categories, FIQ, vectored IRQ, and non-vectored IRQ. The ARM7
LPC2148 Primer board has two numbers of External Interrupts, connected with I/O Port lines (P0.14 &
P0.15) as switches.







38 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00



Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60


39 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
39 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Result:
Thus the interrupt performance characteristics of ARM and FPGA are studied. On comparison, ARM
counts at slow speed because it consumes more instruction cycle and FPGA is more efficient for servicing
and processing external interrupt pulses.
Outcome:
Able to understand the performance characteristics of ARM and FPGA while dealing with
interrrupts
Applications:
1. Used in random logic and SPLDs
2. Used in cryptography and filtering
3. In medical imaging
4. In bioinformatics and voice recognition



1. When is an Interrupt Request received?
2. What is ISR?
3. How do you initialize interrupt?
4. What is Vectored Interrupt Controller?
5. What are the kinds of protection available for SRAMS ?
6. What is interrupt pipelining?
7. What is pipeline shutdown?
8. What is branch prediction?
9. What is the use of Neon Floating point engine?
10. What is the use of ?vectorize option?
11. What is PTM?
12. What is ITM?
13. What is ETM?
14. What is I2S interface?
15. What is the use of ?SWI? in ARM assembly?

Viva-voce




40 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 10 FLASHING OF LEDS
Aim:
To write and execute an embedded c program to display LEDs using LPC 2148 ARM controller
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
Theory:
LED (Light Emitting Diodes) is the most commonly used components, usually for displaying pins digital
states. Typical uses of LEDs include alarm devices, timers and confirmation of user input such as a mouse
click or keystroke. Interfacing LED with LPC2148 Flash a LED using LPC2148 Primer Board. It works by
turning ON a LED & then turning it OFF & then looping back to START. However the operating speed of
microcontroller is very high so the flashing frequency will also be very fast to be detected by human eye.
The ARM7 LPC2148 Primer board has eight numbers of point LEDs, connected with I/O Port lines (P1.16 ?
P1.23) to make port pins high.










41 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00



Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus program for flashing of LEDs is written and executed using ARM controller LPC2148.



42 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Outcome:
Able to interface LED lights via the input output port and control them
Applications:
1. In Illumination
2. As status indicators in equipments
3. Stadium displays and dynamic decorative displays



1. What is seven segment displays?
2. What are the different configurations of LED?
3. What is the function of GPIO?
4. What are the Pins which are used to connect LEDs?
5. How to identify 'Polarity' of LED?
6. Differentiate LED from LCD.
7. What is a use of Jumper?
8. How many numbers of LEDs present in Primer board?
9. Where LEDs are used?
10. What is the use of flash magic software?
11. Which port is used in ARM 7 processor kit?
12. Which diode suffers an avalanche breakdown?
13. What happens if the junction temperature of LED is increased?
14. What is an anti collision rate light?
15. What is fail-safe conditions






Viva-voce




43 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 11 STEPPER MOTOR INTERFACE WITH
ARM -7 LPC2148
Aim:
To write a program to interface stepper motor using ARM processor and control the movement of motor
in either directions.
Apparatus Required:
1. LPC2148 ARM development board
2. Stepper motor
3. Interfacing cables
4. PC
Theory:
A stepper motor can be viewed as a DC motor with number of poles (on both rotor and stator).
Additionally, soft magnetic material with many teeth on the rotor and stator cheaply multiplies the number of
poles (reluctance motor). Like an AC synchronous motor, it is ideally driven by sinusoidal current, allowing
a step less operation, but this puts some burden on the controller. When using an 8-bit digital controller,
256 micro steps per step are possible. As a digital-to-analog converter produces unwanted ohmic heat in
the controller, pulse-width modulation is used to regulate the mean current. Simpler models switch voltage
only for doing a step, thus needing an extra current limiter: for every step, they switch a single cable to the
motor.
The idea is to connect the output pins of the driver to 4 transistors. The transistor must be
grounded at the emitter and the driver pin must be connected to the base. Collector is connected to the coil
wire of the motor. Stepper motors are rated by the torque they produce. Synchronous electric motors using
soft magnetic materials (having a core) have the ability to provide position holding torque (called detent
torque, and sometimes included in the specifications) while not driven electrically. To achieve full rated
torque, the coils in a stepper motor must reach their full rated current during each step. The voltage rating
(if there is one) is almost meaningless. The motors also suffer from EMF, which means that once the coil is
turned off it starts to generate current because the motor is still rotating. There needs to be an explicit way
to handle this extra current in a circuit otherwise it can cause damage and affect performance of the motor.
44 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
44 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus stepper motor interface with ARM processor has been successfully implemented and the motor is
controlled in clockwise and anticlockwise direction.
Outcome:
Able to interface the stepper motor with ARM controller and thereby create some rotational
movements





45 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Applications:
3. Used for precise positioning with a motor
4. Used in hard disk drives, robotics
5. Used in telescopes and toys







1. Define GPIO.
2. What is the function of ULN2803?
3. How LPC2148 control stepper motor?
4. Which I/O port lines used to rotate stepper motor?
5. How stepper motor reacts for each pulse it receives?
6. What is serial communication?
7. What is parallel communication?
8. What is stepper motor & why it is named so?
9. How can be step angle is calculated?
10. What are the advantages and disadvantages of parallel communication?
11. What does instruction-pipelining mean?
12. What is the power supply required for ARM processor?
13. What is a unit for torque?
14. What is RPM rating for a DC motor?
15. What device that is used to obtain an accurate position control of rotating shafts in terms of steps?
Viva-voce

46 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
46 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Expt. No. 12 LM35 TEMPERATURE SENSOR INTERFACE
WITH ARM-7 LPC2148
Aim:
To write a program to interface of LM35 temperature sensor to on-chip ADC of ARM controller and
display the room temperature value on the screen.
Apparatus Required:
1. LPC2148 ARM development board
2. Temperature sensor
3. Interfacing cables
4. PC
Theory:
Temperature Sensor:
The LM35 series are precision integrated-circuit temperature sensors, whose output voltage is linearly
proportional to the Celsius (Centigrade) temperature. The output of the sensor is converted to digital output
that is easy to connect with microcontroller. Temperature sensor has three terminals and required
Maximum of 5.5 V supply. This type of sensor consists of a material that performs the operation according
to temperature to vary the resistance. This change of resistance is sensed by circuit and it calculates
temperature. When the voltage increases then the temperature also rises. We can see this operation by
using a diode.







47 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
47 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00


Circuit diagram:

48 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
48 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the program for interfacing temperature sensor with ARM controller is written and executed and
the temperature reading is seen on the monitor.
Outcome:
Able to interface different sensors with in-built ADC of the ARM processor and access the data
produced from them
Applications:
1. Used in Ovens, refrigerators
2. In HVAC environmental control
3. coolant or cylinder head temperatures
4. in the automotive industry to monitor air intake



1. What is LM35?
2. Define ISP.
3. How many Analog-to-Digital Converters available as an inner peripheral in LPC2148?
4. What is the main function of analog pin in LPC 2148?
5. What is the output voltage produced by LM35 for one degree temperature?
6. What is the difference between LM 34 and LM 35 sensors?
7. How many pins are available in LM35?
8. Why Vref is set of ADC0848 to 2.56 V if analog input is connected to the LM35?
9. What is operating the operating temperature range in LM35?
10. Why LM35 is used to Measure Temperature?
11. List the devices used to sense temperature.
12. What is the purpose of a thermocouple?
13. What is the output voltage of a thermocouple?
Viva-voce




49 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 13 IMPLEMENTATION OF WIRELESS
COMMUNICATION PROTOCOL
USING ZIGBEE WIRELESS MODULE
Aim:
To implement wireless communication protocol using zigbee wireless module with the help of ARM
processor
Apparatus required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. Zigbee module
5. PC
Theory:
ZigBee is a specification to suite high level communication protocols using small, low-power digital
radios based on an IEEE 802 standard for personal area networks. The ZigBee is the name of a wireless
protocol maintained by the IEEE 802.15 standard. This is a protocol specified for wireless Personal Area
Network (PAN) using low powered wireless transceivers. There are already wireless transmitter and
receiver modules which can do point to point communication. The Xbee is the brand name a wireless
transceiver device introduced by the Digi international which works on the ZigBee protocol and can form
PAN networks. They have an approximate range of 10 to 100 meters and are used in industries, scientific
fields, medical fields etc
Digi ZigBee:
The Digi Xbee 802.15.4 modules are the easiest to use, most reliable and cost-effective RF devices.
The 802.15.4 Xbee modules provide two friendly modes of communication - a simple serial method to
transmit/receive or a framed mode providing advanced features. These modules can communicate point to
point, from one point to a PC, or in a mesh network.



50 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
50 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Circuit diagram:


Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the wireless communication protocol using Zigbee wireless module is implemented using
LPC2148.
Outcome:
Able to form a wireless network using zigbee module and ARM controller




51 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications:
1. Used in traffic lights in non-urban areas
2. Used in building control systems
3. Used in asset tracking
4. Used in parking sensors




1. How many UART ports available in LPC2148?
2. What is the main function of voltage convertors in UART?
3. Why Zigbee based is preferred for wireless communication?
4. What is the IEEE standard for Zigbee protocol?
5. Write the two modes of communication are used in a ZigBee network.
6. What is the function of a scheduler?
7. Mention any two features of ?C/OS ? II.
8. Write the function for creating task in ?C/OS ? II.
9. Mention any two support devices for ?C/OS ? II.
10. How many user tasks can be handled by ?C/OS ? II?







Viva-voce




52 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

















ADDITIONAL EXPERIMENTS
FirstRanker.com - FirstRanker's Choice
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00






?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING

VII SEMESTER - R 2013

EC6711 ? EMBEDDED LABORATORY






Name : _______________________________________
Register No : _______________________________________
Section : _______________________________________
LABORATORY MANUAL



2 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00




is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and
training.

? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different
levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on
heart and soul
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

To impart professional education integrated with human values to the younger generation, so as to
shape them as proficient and dedicated engineers, capable of providing comprehensive solutions to the
challenges in deploying technology for the service of humanity

? To educate the students with the state-of-art technologies to meet the growing challenges of the
electronics industry
? To carry out research through continuous interaction with research institutes and industry, on
advances in communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning,
innovation and ethical practices
VISION
VISION
MISSION
MISSION



3 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

PROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To provide students with a solid foundation in Mathematics, Science and fundamentals of
engineering, enabling them to apply, to find solutions for engineering problems and use this knowledge
to acquire higher education
2. Core Competence
To train the students in Electronics and Communication technologies so that they apply their
knowledge and training to compare, and to analyze various engineering industrial problems to find
solutions
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice which
enables them to find solutions for the real time problems in industry, and to design products
4. Professionalism
To inculcate professional and effective communication skills, leadership qualities and team spirit in
the students to make them multi-faceted personalities and develop their ability to relate engineering
issues to broader social context
5. Lifelong Learning/Ethics
To demonstrate and practice ethical and professional responsibilities in the industry and society in
the large, through commitment and lifelong learning needed for successful professional career


4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
PROGRAMME OUTCOMES (POs)
a) To demonstrate and apply knowledge of Mathematics, Science and engineering fundamentals in
Electronics and Communication Engineering field
b) To design a component, a system or a process to meet the specific needs within the realistic
constraints such as economics, environment, ethics, health, safety and manufacturability
c) To demonstrate the competency to use software tools for computation, simulation and testing of electronics
and communication engineering circuits
d) To identify, formulate and solve electronic and communication engineering problems
e) To demonstrate an ability to visualize and work on laboratory and multidisciplinary tasks
f) To function as a member or a leader in multidisciplinary activities
g) To communicate in verbal and written form with fellow engineers and society at large
h) To understand the impact of Electronics and Communication Engineering in the society and demonstrate
awareness of contemporary issues and commitment to give solutions exhibiting social responsibility
i) To demonstrate professional & ethical responsibilities
j) To exhibit confidence in self-education and ability for lifelong learning
k) To participate and succeed in competitive exams


5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
SYLLABUS

? Learn the working of ARM processor
? Understand the Building Blocks of Embedded Systems
? Learn the concept of memory map and memory interface
? Know the characteristics of Real Time Systems
? Write programs to interface memory, I/Os with processor
? Study the interrupt performance
LIST OF EXPERIMENTS:
1. Study of ARM evaluation system
2. Interfacing ADC and DAC
3. Interfacing LED and PWM
4. Interfacing real time clock and serial port
5. Interfacing keyboard and LCD
6. Interfacing EPROM and interrupt
7. Mailbox
8. Interrupt performance characteristics of ARM and FPGA
9. Flashing of LEDS
10. Interfacing stepper motor and temperature sensor
11. Implementing zigbee protocol with ARM



? Write programs in ARM for a specific Application
? Interface memory and Write programs related to memory operations
? Interface A/D and D/A convertors with ARM system
? Analyze the performance of interrupt
? Write programmes for interfacing keyboard, display, motor and sensor.
? Formulate a mini project using embedded system
COURSE OBJECTIVES
COURSE OUTCOMES
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
CONTENTS
Sl. No. Name of the Experiment Page No.
CYCLE 1 ? EXPERIMENTS
1
Study of ARM evaluation system 7
2
Analog to Digital Convertor interfacing 16
3
Generation of ramp and square wave using on-Chip DAC 19
4
LED dimming using PWM 22
5
Interfacing real time clock and serial port 25
6
Interfacing keypad and LCD 28
7
Interfacing EPROM and interrupt 31
CYCLE 2 ? EXPERIMENTS
8 Implementation of Mailbox Function using LPC 2148 35
9 Interrupt Performance Characteristics of Arm and FPGA 37
10 Flashing of LEDs 40
11 Stepper Motor Interface with ARM ? 7 LPC2148 43
12 LM35 Temperature Sensor Interface with ARM ? 7 LPC2148 47
13
Implementation of Wireless Communication Protocol using ZIGBEE Wireless
Module
50
ADDITIONAL EXPERIMENTS BEYOND THE SYYLABUS
14 Buzzer Interface with ARM ? 7 54
15 Relay interface with ARM? 7 57
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Expt. No. 1 STUDY OF ARM EVALUATION SYSTEM
Aim:
To study the building blocks of ARM7 system, its features, pin configuration and the components
required for functioning of ARM controller.
Architecture Overview:
A RISC-based computer design approach means ARM processors require significantly fewer transistors
than typical processors in average computers. This approach reduces cost, heat and power usage. These
are desirable traits for light, portable, battery-powered devices (smart phones, laptops, tablet and notepad
computers), and other embedded systems. A simpler design facilitates more efficient multi-core CPUs and
higher core counts at lower cost, providing higher processing power and improved energy efficiency for
servers and supercomputers.
In 2005, about 98% of all mobile phones sold used at least one ARM processor. The low power
consumption of ARM processors has made them very popular: 37 billion ARM processors have been
produced as of 2013, up from 10 billion in 2008. The ARM architecture (32-bit) is the most widely used
architecture in mobile devices, and most popular 32-bit one in embedded systems.
According to ARM Holdings, in 2010 alone, producers of chips based on ARM architectures
reported shipments of 6.1 billion ARM based processors, representing 95% of smart phones, 35% of digital
televisions and set-top boxes and 10% of mobile computers. It is the most widely used 32-bit instruction set
architecture in terms of quantity produced.
LPC 2148:
LPC2148 is the widely used IC from ARM-7 family. It is manufactured by Philips and it is pre-loaded
with many inbuilt peripherals making it more efficient and a reliable option for the beginners as well as high
end application developer.




8 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Features of LPC214x series controllers:
1. 8 to 40 kB of on-chip static RAM and 32 to 512 kB of on-chip flash program memory.128 bit wide
interface/accelerator enables high speed 60 MHz operation.
2. In-System/In-Application Programming (ISP/IAP) via on-chip boot-loader software. Single flash sector or
full chip erase in 400 ms and programming of 256 bytes in 1ms.
3. Embedded ICE RT and Embedded Trace interfaces offer real-time debugging with the on-chip Real
Monitor software and high speed tracing of instruction execution.
4. USB 2.0 Full Speed compliant Device Controller with 2 kB of endpoint RAM. In addition, the LPC2146/8
provides 8 kB of on-chip RAM accessible to USB by DMA.
5. One or two (LPC2141/2 vs. LPC2144/6/8) 10-bit A/D converters provide a total of 6/14analog inputs, with
conversion times as low as 2.44 us per channel.
6. Single 10-bit D/A converter provides variable analog output.
7. Two 32-bit timers/external event counters (with four capture and four compare channels each), PWM unit
(six outputs) and watchdog.
8. Low power real-time clock with independent power and dedicated 32 kHz clock input.
9. Multiple serial interfaces including two UARTs (16C550), two Fast I2C-bus (400 kbit/s), SPI and SSP with
buffering and variable data length capabilities.
10. Vectored interrupt controller with configurable priorities and vector addresses.
11. Up to 45 of 5 V tolerant fast general purpose I/O pins in a tiny LQFP64 package.
12. Up to nine edge or level sensitive external interrupt pins available.
13. On-chip integrated oscillator operates with an external crystal in range from 1 MHz to30 MHz and with
an external oscillator up to 50 MHz
14. Power saving modes include Idle and Power-down.
15. Individual enable/disable of peripheral functions as well as peripheral clock scaling for additional power
optimization.
16. Processor wake-up from Power-down mode via external interrupt, USB, Brown-Out Detect (BOD) or
Real-Time Clock (RTC).




9 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


First Step- Hardware Requirement:
Pin configuration of LPC 2148.

Hardware requirement of LPC2148:
1. LPC2148 need minimum below listed hardware to work properly
2. Power Supply
3. Crystal Oscillator
4. Reset Circuit
5. RTC crystal oscillator
6. UART
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Power Supply:
LPC2148 works on 3.3 V power supply. LM 117 can be used for generating 3.3 V supply. However,
basic peripherals like LCD, ULN 2003 (Motor Driver IC) etc. works on 5V. So AC mains supply is converted
into 5V using below mentioned circuit and after that LM 117 is used to convert 5V into 3.3V.
Block diagram of power Supply

Transformer: It is used to step down 230V AC to 9V AC supply and provides isolation between power grids
and circuit.
Rectifier: It is used to convert AC supply into DC.
Filter: It is used to reduce ripple factor of DC output available from rectifier end.
Regulator: It is used to regulate DC supply output.

11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Circuit Diagram:

Regulator IC 7805 is used to provide fix 5V dc supply.
LM 117 is used for generating 3.3V supply from 5V.

12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Calculations:

From the datasheet of LM117

Taking R 2= 240?, we get R 1=392?
Reset Circuit:
Reset button is essential in a system to avoid programming pitfalls and manually bring back the system
to the initialization mode. MCP 130T is a special IC used for providing stable RESET signal to LPC 2148.


13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Oscillator Circuit:

The value of capacitors C20 & C21 depends upon the frequency of crystal Y3. General circuit and
its equivalent circuit is as shown below.

14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Recommended values are as shown in table:

UART:
LPC 2148 has inbuilt ISP which means we can program it within the system using serial
communication on COM0. It has also COM1 for serial communication. MAX 232/233 IC must be used for
voltage logic conversion. Related connections are as given below.

Once the above listed circuit design is ready, we are ready to go further.



15 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Result:
ARM Evaluation system and the configuration of LPC2148 has been studied fully. The minimal setup
required for the functioning of the ARM processor is studied.
Outcomes:
1. Able to understand the ARM controller, its basic components inside and its features.
2. Able to know the components required for the working of ARM LPC2148

Applications:
ARM controller LPC2148 is used in no. of devices such as
1. Smart phones
2. Net books
3. E Readers
4. Digital TV
5. Home Gateways


1. What are the basic units of ARM 7?
2. What is the address system supported by ARM?
3. Define - RISC
4. What are the instructions used to access the memory in ARM?
5. What are the basic units of Microprocessor?
6. What is an Instruction?
7. What is clock cycle?
8. Define - Pipelining
9. What is cache miss?
10. What is meant by memory mapped I/O?
11. Define ? interrupt
12. What is meant by Exception?
13. What is meant by little ? endian mode?
14. What is meant by big ? endian mode?
15. What is the function of CPSR?
16. What is register - indirect addressing?
Viva-voce




16 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 2 ANALOG TO DIGITAL CONVERTOR
INTERFACING
Aim:
To write an embedded c program for interfacing an on chip ADC with LPC2148 ARM processor and
convert the given input voltage into corresponding decimal values.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. PC
Theory:
Analog to Digital converter (ADC) is a device that converts continuously varying analog signals from
instruments that monitor such conditions as movement, temperature, sound, etc., into binary code for the
computer. It may be either a single chip or can be one circuit within a chip. Analog to Digital conversion is
the process of changing continuously varying data, such as voltage, current, or shaft rotation, into discrete
digital quantities that represent the magnitude of the data compared to a standard or reference at the
moment the conversion is made. According to the method of conversion, ADCs can be classified into
Direct-Conversion ADCs, Successive Approximation ADCs, Integrating ADC and Sigma-Delta ADCs.
The LPC 2148 has 10-bit successive approximation analog to digital converter. Basic clocking for the
A/D converters is provided by the VPB clock. A programmable divider is included in each converter, to
scale this clock to the 4.5 MHz (max) clock needed by the successive approximation process. A fully
accurate conversion requires 11 of these clocks. The ADC cell can measure the voltage on any of the ADC
input signals. It is noted that these analog inputs are always connected to their pins, even if the Pin function
Select register assigns them to port pins. A simple self-test of the ADC can be done by driving these pins
as port outputs.



17 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Circuit diagram:




18 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus, an embedded c program for interfacing on-chip ADC with ARM processor is written and
executed. The decimal values of the converted voltage are seen in the WinXTalk screen.
Outcome:
Able to interface A/D convertors with ARM system and check its working by connecting an analog
quantity as input.
Applications:
1. ADC used in MODEM for converting analog signals to digital.
2. A fast video ADC in TV tuner cards
3. ADC used in digital storage oscilloscopes
4. Used in music reproduction technology.
5. Used in DSP if input is analog


1. What are the ADC operating modes in LPC2148?
2. What is meant by conversion time?
3. Why are internal ADCs preferred over external ADCs?
4. Why has 16-bit ADC more resolution than from 10-bit and 8-bit ADC?
5. What are ADC & its Resolution?
6. What is Burst conversion mode?
7. What is the function of A/D Control Register?
8. What is the function of A/D Global Data Register?
9. What is the function of A/D Status Register?
10. What is analog-to-digital (ADC) conversion error?
11. What is the function of Sample-and-hold circuits in analog-to digital converters?
12. What is the disadvantage of the flash analog-to digital converter?
Viva-voce




19 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 3 GENERATION OF RAMP AND SQUARE
WAVE USING ON-CHIP DAC
Aim:
To write and execute an embedded c program to generate ramp wave and square wave using on-chip
DAC of LPC2148 ARM controller.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
A digital-to-analog converter is a device for converting a digital signal into an analog signal (current or
voltage). Digital-to-Analog Converters are the interface between the abstract digital world and the analog
real world. Simple switches, a network of resistors, current sources or capacitors may be used to
implement this conversion. A DAC inputs a binary number and outputs an analog voltage or current signal.
The Microchip Technology Inc. MCP4921 is 2.7 ? 5.5V, low-power, 12-Bit Digital-to-Analog Converter
(DAC) with SPI interface. The MCP4921 DAC provides high accuracy and low noise performance for
industrial applications where calibration or compensation of signals is required. With an SPI connection
there is always one master device (usually a microcontroller) which controls the peripheral devices.
Typically there are three lines common to all the devices,
Master In Slave Out (MISO) ? The Slave line for sending data to the master,
Master Out Slave In (MOSI) ? The Master line for sending data to the peripherals,
Serial Clock (SCK) ? The clock pulses which synchronize data transmission generated by the
master and slave
Slave Select pin ? the pin on each device that the master can use to enable and disable specific
devices. When a device Slave Select pin is low, it communicates with the master. When it is high, it ignores
the master. In SPI, the clock signal is controlled by the master device LPC2148. All data is clocked in and
out using this pin. These lines need to be connected to the relevant pins on the LPC21xx processor. Any
unused GIO pin can be used for CS, instead pull this pin high. Conversion speed is the time it takes for the



20 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

DAC to provide an analog output when the digital input word is changed. The MCP4291 DAC ? SPI
connections with LPC21xx have four I/O lines (P0.4 ? P0.7) required. The analog output is generated by
using these four lines.
Circuit diagram:


Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the embedded c programs for generating ramp wave and square wave using ARM LPC2148 are
written and executed successfully and the waveforms are viewed in oscilloscope.
Outcome:
Able to program the DAC in-built inside the ARM controller and get the waveforms using it.




21 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications :
1. DAC used in Audio amplifier.
2. Video encoder
3. Display electronics
4. Data Acquistion systems
5. Motor control



1. What are the features of LPC2148 DAC?
2. What is the function of DAC register?
3. Which pin provides a voltage reference level for the D/A converter?
4. What are the applications of DAC in signal processing applications?
5. What is GIO?
6. What is the resolution of a digital-to-analog converter (DAC)?
7. What is the major advantage of the R/2R ladder digital-to-analog (DAC), as compared to a binary-
weighted digital-to-analog DAC converter?
8. What is the resolution of a 0?5 V 6-bit digital-to-analog converter (DAC) ?
9. What are DAC configurations?
10. What are the different types of DAC Circuits?
11. What are the Limitations of the Binary Weighted DAC?
12. What are the General DAC Characteristics?
13. Define reference voltage in DAC.
14. What is full scale voltage?
15. What is settling time?
VIVA-VOCE




22 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 4 LED DIMMING USING PWM

Aim:
To write an embedded c program for implementing PWM using ARM controller and verify the same by
dimming of LEDs.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
LPC2148 supports 2 types of PWM:
1) Single Edge PWM ? Pulse starts with new Period i.e pulse is always at the beginning
2) Double Edge PWM ? Pulse can be anywhere within the Period
A PWM block, like a Timer block , has a Timer Counter and an associated Pre-scale Register along
with Match Registers. These work exactly the same way as in the case of Timers. Match Registers 1 to 6
(except 0) are pinned on LPC214x i.e. the corresponding outputs are diverted to actual Pins on LPC214x
MCU. The PWM function must be selected for these Pins to get the PWM output.
The basic setup is to simply replace Servo by a LED and no external 5V source is needed. The
anode of LED is connected to P0.0 and cathode to ground. Pulse Widths corresponding to the switches
connected to P0.1/2/3/4 will be 2.5ms/5ms/7.5ms/10ms respectively. As the Pulse Width Increases LED
will keep on getting brighter and the reverse will happen if Pulse Width is decreased.



23 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus embedded c program for implementing Pulse Width Modulation is written and executed and
output has been verified in LED display.
Outcome:
Able to implement PWM using the ARM controller and verify the same in the form of dimming of
LEDS.



24 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Applications :
1. In Visual signals to covey a message
2. Illumination where light is reflected from objects
3. In Narrow band sensors



1. What factors determine the LED dimming performance?
2. What is meant by analog dimming?
3. What is flickering effect?
4. What is the factor determines dimming of the LED
5. Why Silicon is not suitable for fabrication of light-emitting diodes?
6. Why Silicon diode is less suited for low voltage rectifier operation?
7. What is the principle of zener diode?
8. What are the materials used to make LED?
9. What type of diodes is used in FM receivers?
10. Which diode suffers an avalanche breakdown?
11. What happens if the junction temperature of LED is increased?
12. How a transfer characteristic of a diode does is related?
13. What is the requirement of a clipping action of a diode?
14. What type of rectifier circuit requires four diodes?
15. Why are the pulse width modulated outputs required in most of the applications?
16. How do the variations in an average value get affected by PWM period?
17. Name the common formats available for LED display.
18. What are the types of seven segment display?
19. What is PWM?
20. What are the applications of PWM?

Viva-voce




25 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 5 INTERFACING REAL TIME CLOCK
AND SERIAL PORT
Aim:
To write and execute an embedded c program to interface DS1307 RTC using I2C protocol with ARM
controller
Apparatus Required:
1. LPC2148 ARM development board
2. Stepper motor
3. Interfacing cables
4. PC
Theory:
A clock, which is based on the interrupts at preset intervals, is Real Time Clock (RTC). An interrupt
service routine executes on each timeout (overflow) of this clock. This timing device once started never
resets or never reloaded with another value. Once it is set, it is not modified later. It is used in a system to
save the time and date.













26 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the program for interfacing real time clock with ARM controller is written and executed and the
date and time are verified on the screen.
Outcome:
Able to interface real time clock DS1307 with ARM controller and thereby display date and time
Applications :
1. I2C In ARM and PIC microcontrollers
2. Used as serial communication protocol with MASTER and SLAVE operation.

27 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
27 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00




1. What is I2C and how does it work?
2. What are the features of I2C in LPC2148 ARM7 microcontroller?
3. What is the function of I2C0CONSET register?
4. What is I2C0STAT?
5. What is the function of I2C0 Data Register?
6. What is RTC?
7. List the advantages of RTC
8. Through which port the date and time is displayed in RTC?
9. What is a serial port?
10. List the registers used to transfer data in serial port.
11. List the modes used for data transmission.
12. What is a simplex mode?
13. Which pin is used to transmit a character?
14. What is the baud rate of serial port?
15. What is the disadvantage of RS-232C?














Viva-voce




28 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 6 INTERFACING KEYPAD AND LCD

Aim:
To write an embedded c program to interface 4 x 4 matrix keypad with ARM processor and display the
pressed key in an LCD.
Apparatus Required:
1. LPC2148 ARM development board
2. Interfacing cables
3. PC
Theory:

In matrix keypad, keys are connected in rows and columns. When any switch is pressed, rows and
columns come into contact, which is that detected by controller to identify which key has been pressed. A
4?4 matrix keypad consists of 4 rows and 4 columns. There is a switch connecting each row and column.
So the combinations of rows and columns make up the 16 inputs.Initially all the switches are open (not
connected). When any one button is pressed, the switch is closed (connected),hence there is a connection
between the row and column. The first 4 pins are connected to the column as INPUT. The other 4 pins are
connected to the row as OUTPUT. Matrix keypad is a good substitution to normal push button.












29 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Circuit Diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus program for interfacing matrix keypad with ARM controller is written and executed and the key
pressed is seen in the LCD.



30 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Outcome:
Able to interface keypad with ARM controller and see the pressed key in the LCD display.
Applications :
1. Used in password based door locking system
2. Security system with user changeable
3. Used in laptops, computer games
4. Used in portable video games and cell phones



1. What is Matrix keypad?
2. What is the concept behind keypad interface?
3. What are the functions of pull- up resistors?
4. What is key de bouncing?
5. List the steps involved when the key in a 4 x 4 keyboard matrix is being pressed.
6. What is the value obtained if no key is pressed?
7. What kind of interrupt is generated if a key has to be operated in an interrupt mode?
8. How will you identify that the key is pressed?
9. What are the steps involved in Keyboard Interfacing?
10. List the registers used to store the keyboard, display modes and other operations programmed by
CPU.
11. Name the mode when a data is entered from the left side of the display unit.
12. How many rows and columns are present in a 16 x 2 alphanumeric LCD?
13. How many data lines are there in a 16 x 2 alphanumeric LCD?
14. Which pin of the LCD is used for adjusting its contrast?
15. Which command of an LCD is used to shift the entire display to the right?
16. Which command is used to select the 2 lines and 5 x 7 matrix of an LCD?
17. What changes are to be made to send data to an LCD?
18. For reading operation from an LCD what changes in the software are introduced?
19. Which instruction is used to select the first row first column of an LCD?
Viva-voce

31 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
31 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Expt. No. 7 INTERFACING EEPROM AND INTERRUPT

Aim:
To write a program to interface EEPROM using I2C protocol with ARM controller and retrieve the stored
messages inside EEPROM.
Apparatus Required:
1. LPC2148 ARM development board
2. Interfacing cables
3. PC
Theory:
I2C (Inter Integrated Circuit):
The I2C (Inter-IC) bus is a bi-directional two-wire serial bus that provides a communication link between
integrated circuits (ICs).I2C is a synchronous protocol that allows a master device to initiate communication
with a slave device. Data is exchanged between these devices.
EEPROM:
EEPROM (electrically erasable programmable read-only memory) is user-modifiable read-only
memory (ROM) that can be erased and reprogrammed (written to) repeatedly through the application of
higher than normal electrical voltage. It is a type of non-volatile memory used in computers and other
electronic devices to store small amounts of data that must be saved when power is removed, e.g.,
calibration tables or device configuration
Read, write and Erase EEPROM by using I2C in LPC2148 Primer Board. Wiring up an I2C based
EEPROM to the I2C port is relatively simple. The basic operation of the I2C based EEPROM's is to send a
command, such as WRITE, followed by an address and the data. In WRITE operation, the EEPROM is
used to store the data. In LPC2148 Primer Kit, 2 nos. of EEPROM lines are controlled by I2C Enabled
drivers. I2C Lines serial clock SCL (P0.2), serial data SDA (P0.3) connected to the I2C based serial
EEPROM IC. The EEPROM read & write operations are done in LPC2148 Primer Kit by using these SDA &
SCL I2C lines.
32 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
32 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To down load and run this program: Refer General procedure given in Page No: 60
Result:
Thus, the program for interfacing I2C based EEPROM with ARM processor has been written and
executed successfully and the memory content is verified on Win x talk terminal.
Outcome:
Able to interface memory ICs with ARM controller and perform the read and write operations.



33 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications:
1. ROM used in toys,automobiles to store data when power is off
2. In calculators and peripheral devices
3. In laser printers
4. And also in embedded systems where program need not to be changed.


1. How does I2C protocol work?
2. What is EEPROM?
3. What is meant by master slave mode?
4. What is meant by non-volatile memory?
5. What is an interrupt?
6. How does an interrupt request works?
7. What is a nested interrupt?
8. What are the registers used for enabling an interrupt?
9. What is PROM?
10. What is EPROM?
11. What is mask ROM?
12. Which memory allows simultaneous read and write operations?
13. Which memory has the shortest access times?
14. Which interrupt has the highest priority?
15. What is non maskable interrupt?
16. Which is the first level of memory access by the microprocessor?
17. List the types of cache memories.
18. What is the use of an interrupt?
19. What is the use of converting an interrupt to threads in a microprocessor?
20. What are the bits used to control an external interrupts?


Viva-voce




34 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00










CYCLE 2 - EXPERIMENTS




35 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 8 IMPLEMENTATION OF MAILBOX FUNCTION
USING LPC2148
Aim:
To create a mailbox in Micro C/OS ? II using LPC2148 ARM Controller
Apparatus Required:
1. LPC2148 ARM development board
2. Interfacing cables
3. PC
Theory:
System or the user code can send a message by the core services. A typical mail message, also
known as the exchange of information, refers to a task or an ISR using a pointer variable, through the core
services to put a message (that is, a pointer) into the mailbox. Similarly, one or more tasks can receive this
message by the core services. The tasks sending and receiving the message promise that the content that
the pointer points to is just that piece of message.
The mailbox of CooCox CoOS is a typical message mailbox which is composed of two parts: one is
the information which expressed by a pointer of void; the other is the waiting list which composed of the
tasks waiting for this mailbox. The waiting list supports two kinds of sorting: FIFO and preemptive priority.
The sorting mode is determined by the user when creating the mailbox.
Procedure:
To Edit / Compile / generate Hex file: Refer General procedure in Page No: 58
To down load and run this program: Refer General procedure in Page No: 60
Result:
Thus, the mailbox was created in Micro C/OS ?II and implemented using LPC2148.
Outcome:
Able to understand the concept of mail box in embedded systems and its significance in real time
systems





36 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications:
1. Used in Acorn RISC PC700
2. Used in ZIPIT wireless messenger
3. Used in Meizu M6 MINI player


1. What is IPC?
2. Define Queue.
3. What are the different types of mail box functions?
4. What is half duplex mode?
5. How many synchronous and asynchronous modes are there in serial port?
6. List the bits used to generate serial port interrupt
7. What is branch prediction?
8. Mention any two features of ?C/OS ? II.
9. Write the function for creating task in ?C/OS ? II.
10. Mention any two support devices for ?C/OS ? II.
11. How many user tasks can be handled by ?C/OS ? II?



















Viva-voce




37 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 9 INTERRUPT PERFORMANCE
CHARACTERISTICSOF ARM AND FPGA

Aim:
To study the interrupt performance characteristics of ARM and FPGA by using ARM controller kit and
FPGA kit separately.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
External Interrupts:
An interrupt caused by an external source such as the computer operator, external sensor or
monitoring device, or another computer. Interrupts are special events that require immediate attention.
Interfacing External Interrupts with LPC2148:
When an external interrupt signal occurs in LPC2148 Primer Board, the message "LOW" will be
displayed on PC. The interrupt signal occurs using switches. When the switch is pressed to LOW, then the
external interrupt occurs. The Vectored Interrupt Controller (VIC) takes 32 interrupt request inputs and
programmable assigns them into 3 categories, FIQ, vectored IRQ, and non-vectored IRQ. The ARM7
LPC2148 Primer board has two numbers of External Interrupts, connected with I/O Port lines (P0.14 &
P0.15) as switches.







38 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00



Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60


39 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
39 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Result:
Thus the interrupt performance characteristics of ARM and FPGA are studied. On comparison, ARM
counts at slow speed because it consumes more instruction cycle and FPGA is more efficient for servicing
and processing external interrupt pulses.
Outcome:
Able to understand the performance characteristics of ARM and FPGA while dealing with
interrrupts
Applications:
1. Used in random logic and SPLDs
2. Used in cryptography and filtering
3. In medical imaging
4. In bioinformatics and voice recognition



1. When is an Interrupt Request received?
2. What is ISR?
3. How do you initialize interrupt?
4. What is Vectored Interrupt Controller?
5. What are the kinds of protection available for SRAMS ?
6. What is interrupt pipelining?
7. What is pipeline shutdown?
8. What is branch prediction?
9. What is the use of Neon Floating point engine?
10. What is the use of ?vectorize option?
11. What is PTM?
12. What is ITM?
13. What is ETM?
14. What is I2S interface?
15. What is the use of ?SWI? in ARM assembly?

Viva-voce




40 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 10 FLASHING OF LEDS
Aim:
To write and execute an embedded c program to display LEDs using LPC 2148 ARM controller
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
Theory:
LED (Light Emitting Diodes) is the most commonly used components, usually for displaying pins digital
states. Typical uses of LEDs include alarm devices, timers and confirmation of user input such as a mouse
click or keystroke. Interfacing LED with LPC2148 Flash a LED using LPC2148 Primer Board. It works by
turning ON a LED & then turning it OFF & then looping back to START. However the operating speed of
microcontroller is very high so the flashing frequency will also be very fast to be detected by human eye.
The ARM7 LPC2148 Primer board has eight numbers of point LEDs, connected with I/O Port lines (P1.16 ?
P1.23) to make port pins high.










41 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00



Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus program for flashing of LEDs is written and executed using ARM controller LPC2148.



42 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Outcome:
Able to interface LED lights via the input output port and control them
Applications:
1. In Illumination
2. As status indicators in equipments
3. Stadium displays and dynamic decorative displays



1. What is seven segment displays?
2. What are the different configurations of LED?
3. What is the function of GPIO?
4. What are the Pins which are used to connect LEDs?
5. How to identify 'Polarity' of LED?
6. Differentiate LED from LCD.
7. What is a use of Jumper?
8. How many numbers of LEDs present in Primer board?
9. Where LEDs are used?
10. What is the use of flash magic software?
11. Which port is used in ARM 7 processor kit?
12. Which diode suffers an avalanche breakdown?
13. What happens if the junction temperature of LED is increased?
14. What is an anti collision rate light?
15. What is fail-safe conditions






Viva-voce




43 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 11 STEPPER MOTOR INTERFACE WITH
ARM -7 LPC2148
Aim:
To write a program to interface stepper motor using ARM processor and control the movement of motor
in either directions.
Apparatus Required:
1. LPC2148 ARM development board
2. Stepper motor
3. Interfacing cables
4. PC
Theory:
A stepper motor can be viewed as a DC motor with number of poles (on both rotor and stator).
Additionally, soft magnetic material with many teeth on the rotor and stator cheaply multiplies the number of
poles (reluctance motor). Like an AC synchronous motor, it is ideally driven by sinusoidal current, allowing
a step less operation, but this puts some burden on the controller. When using an 8-bit digital controller,
256 micro steps per step are possible. As a digital-to-analog converter produces unwanted ohmic heat in
the controller, pulse-width modulation is used to regulate the mean current. Simpler models switch voltage
only for doing a step, thus needing an extra current limiter: for every step, they switch a single cable to the
motor.
The idea is to connect the output pins of the driver to 4 transistors. The transistor must be
grounded at the emitter and the driver pin must be connected to the base. Collector is connected to the coil
wire of the motor. Stepper motors are rated by the torque they produce. Synchronous electric motors using
soft magnetic materials (having a core) have the ability to provide position holding torque (called detent
torque, and sometimes included in the specifications) while not driven electrically. To achieve full rated
torque, the coils in a stepper motor must reach their full rated current during each step. The voltage rating
(if there is one) is almost meaningless. The motors also suffer from EMF, which means that once the coil is
turned off it starts to generate current because the motor is still rotating. There needs to be an explicit way
to handle this extra current in a circuit otherwise it can cause damage and affect performance of the motor.
44 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
44 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus stepper motor interface with ARM processor has been successfully implemented and the motor is
controlled in clockwise and anticlockwise direction.
Outcome:
Able to interface the stepper motor with ARM controller and thereby create some rotational
movements





45 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Applications:
3. Used for precise positioning with a motor
4. Used in hard disk drives, robotics
5. Used in telescopes and toys







1. Define GPIO.
2. What is the function of ULN2803?
3. How LPC2148 control stepper motor?
4. Which I/O port lines used to rotate stepper motor?
5. How stepper motor reacts for each pulse it receives?
6. What is serial communication?
7. What is parallel communication?
8. What is stepper motor & why it is named so?
9. How can be step angle is calculated?
10. What are the advantages and disadvantages of parallel communication?
11. What does instruction-pipelining mean?
12. What is the power supply required for ARM processor?
13. What is a unit for torque?
14. What is RPM rating for a DC motor?
15. What device that is used to obtain an accurate position control of rotating shafts in terms of steps?
Viva-voce

46 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
46 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Expt. No. 12 LM35 TEMPERATURE SENSOR INTERFACE
WITH ARM-7 LPC2148
Aim:
To write a program to interface of LM35 temperature sensor to on-chip ADC of ARM controller and
display the room temperature value on the screen.
Apparatus Required:
1. LPC2148 ARM development board
2. Temperature sensor
3. Interfacing cables
4. PC
Theory:
Temperature Sensor:
The LM35 series are precision integrated-circuit temperature sensors, whose output voltage is linearly
proportional to the Celsius (Centigrade) temperature. The output of the sensor is converted to digital output
that is easy to connect with microcontroller. Temperature sensor has three terminals and required
Maximum of 5.5 V supply. This type of sensor consists of a material that performs the operation according
to temperature to vary the resistance. This change of resistance is sensed by circuit and it calculates
temperature. When the voltage increases then the temperature also rises. We can see this operation by
using a diode.







47 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
47 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00


Circuit diagram:

48 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
48 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the program for interfacing temperature sensor with ARM controller is written and executed and
the temperature reading is seen on the monitor.
Outcome:
Able to interface different sensors with in-built ADC of the ARM processor and access the data
produced from them
Applications:
1. Used in Ovens, refrigerators
2. In HVAC environmental control
3. coolant or cylinder head temperatures
4. in the automotive industry to monitor air intake



1. What is LM35?
2. Define ISP.
3. How many Analog-to-Digital Converters available as an inner peripheral in LPC2148?
4. What is the main function of analog pin in LPC 2148?
5. What is the output voltage produced by LM35 for one degree temperature?
6. What is the difference between LM 34 and LM 35 sensors?
7. How many pins are available in LM35?
8. Why Vref is set of ADC0848 to 2.56 V if analog input is connected to the LM35?
9. What is operating the operating temperature range in LM35?
10. Why LM35 is used to Measure Temperature?
11. List the devices used to sense temperature.
12. What is the purpose of a thermocouple?
13. What is the output voltage of a thermocouple?
Viva-voce




49 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 13 IMPLEMENTATION OF WIRELESS
COMMUNICATION PROTOCOL
USING ZIGBEE WIRELESS MODULE
Aim:
To implement wireless communication protocol using zigbee wireless module with the help of ARM
processor
Apparatus required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. Zigbee module
5. PC
Theory:
ZigBee is a specification to suite high level communication protocols using small, low-power digital
radios based on an IEEE 802 standard for personal area networks. The ZigBee is the name of a wireless
protocol maintained by the IEEE 802.15 standard. This is a protocol specified for wireless Personal Area
Network (PAN) using low powered wireless transceivers. There are already wireless transmitter and
receiver modules which can do point to point communication. The Xbee is the brand name a wireless
transceiver device introduced by the Digi international which works on the ZigBee protocol and can form
PAN networks. They have an approximate range of 10 to 100 meters and are used in industries, scientific
fields, medical fields etc
Digi ZigBee:
The Digi Xbee 802.15.4 modules are the easiest to use, most reliable and cost-effective RF devices.
The 802.15.4 Xbee modules provide two friendly modes of communication - a simple serial method to
transmit/receive or a framed mode providing advanced features. These modules can communicate point to
point, from one point to a PC, or in a mesh network.



50 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
50 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Circuit diagram:


Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the wireless communication protocol using Zigbee wireless module is implemented using
LPC2148.
Outcome:
Able to form a wireless network using zigbee module and ARM controller




51 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications:
1. Used in traffic lights in non-urban areas
2. Used in building control systems
3. Used in asset tracking
4. Used in parking sensors




1. How many UART ports available in LPC2148?
2. What is the main function of voltage convertors in UART?
3. Why Zigbee based is preferred for wireless communication?
4. What is the IEEE standard for Zigbee protocol?
5. Write the two modes of communication are used in a ZigBee network.
6. What is the function of a scheduler?
7. Mention any two features of ?C/OS ? II.
8. Write the function for creating task in ?C/OS ? II.
9. Mention any two support devices for ?C/OS ? II.
10. How many user tasks can be handled by ?C/OS ? II?







Viva-voce




52 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

















ADDITIONAL EXPERIMENTS
53 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
53 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Expt. No. 14 BUZZER INTERFACE WITH ARM-7 LPC2148
Aim:
To write a program for buzzer interface with ARM processor and control its operation.
Apparatus required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
Theory:
Buzzer is an electronic device commonly used to produce sound. Light weight, simple construction and
low price make it usable in various applications like car/truck reversing indicator, computers, call bells etc.
Piezo buzzer is based on the inverse principle of piezo electricity discovered in 1880 by Jacques and Pierre
Curie. It is the phenomena of generating electricity when mechanical pressure is applied to certain
materials and the vice versa is also true. Such materials are called piezo electric materials. Piezo electric
materials are either naturally available or manmade. Piezo ceramic is class of manmade material, which
poses piezo electric effect and is widely used to make disc, the heart of piezo buzzer. When subjected to
an alternating electric field they stretch or compress, in accordance with the frequency of the signal thereby
producing sound.







FirstRanker.com - FirstRanker's Choice
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00






?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING

VII SEMESTER - R 2013

EC6711 ? EMBEDDED LABORATORY






Name : _______________________________________
Register No : _______________________________________
Section : _______________________________________
LABORATORY MANUAL



2 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00




is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and
training.

? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different
levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on
heart and soul
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

To impart professional education integrated with human values to the younger generation, so as to
shape them as proficient and dedicated engineers, capable of providing comprehensive solutions to the
challenges in deploying technology for the service of humanity

? To educate the students with the state-of-art technologies to meet the growing challenges of the
electronics industry
? To carry out research through continuous interaction with research institutes and industry, on
advances in communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning,
innovation and ethical practices
VISION
VISION
MISSION
MISSION



3 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

PROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To provide students with a solid foundation in Mathematics, Science and fundamentals of
engineering, enabling them to apply, to find solutions for engineering problems and use this knowledge
to acquire higher education
2. Core Competence
To train the students in Electronics and Communication technologies so that they apply their
knowledge and training to compare, and to analyze various engineering industrial problems to find
solutions
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice which
enables them to find solutions for the real time problems in industry, and to design products
4. Professionalism
To inculcate professional and effective communication skills, leadership qualities and team spirit in
the students to make them multi-faceted personalities and develop their ability to relate engineering
issues to broader social context
5. Lifelong Learning/Ethics
To demonstrate and practice ethical and professional responsibilities in the industry and society in
the large, through commitment and lifelong learning needed for successful professional career


4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
PROGRAMME OUTCOMES (POs)
a) To demonstrate and apply knowledge of Mathematics, Science and engineering fundamentals in
Electronics and Communication Engineering field
b) To design a component, a system or a process to meet the specific needs within the realistic
constraints such as economics, environment, ethics, health, safety and manufacturability
c) To demonstrate the competency to use software tools for computation, simulation and testing of electronics
and communication engineering circuits
d) To identify, formulate and solve electronic and communication engineering problems
e) To demonstrate an ability to visualize and work on laboratory and multidisciplinary tasks
f) To function as a member or a leader in multidisciplinary activities
g) To communicate in verbal and written form with fellow engineers and society at large
h) To understand the impact of Electronics and Communication Engineering in the society and demonstrate
awareness of contemporary issues and commitment to give solutions exhibiting social responsibility
i) To demonstrate professional & ethical responsibilities
j) To exhibit confidence in self-education and ability for lifelong learning
k) To participate and succeed in competitive exams


5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
SYLLABUS

? Learn the working of ARM processor
? Understand the Building Blocks of Embedded Systems
? Learn the concept of memory map and memory interface
? Know the characteristics of Real Time Systems
? Write programs to interface memory, I/Os with processor
? Study the interrupt performance
LIST OF EXPERIMENTS:
1. Study of ARM evaluation system
2. Interfacing ADC and DAC
3. Interfacing LED and PWM
4. Interfacing real time clock and serial port
5. Interfacing keyboard and LCD
6. Interfacing EPROM and interrupt
7. Mailbox
8. Interrupt performance characteristics of ARM and FPGA
9. Flashing of LEDS
10. Interfacing stepper motor and temperature sensor
11. Implementing zigbee protocol with ARM



? Write programs in ARM for a specific Application
? Interface memory and Write programs related to memory operations
? Interface A/D and D/A convertors with ARM system
? Analyze the performance of interrupt
? Write programmes for interfacing keyboard, display, motor and sensor.
? Formulate a mini project using embedded system
COURSE OBJECTIVES
COURSE OUTCOMES
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
CONTENTS
Sl. No. Name of the Experiment Page No.
CYCLE 1 ? EXPERIMENTS
1
Study of ARM evaluation system 7
2
Analog to Digital Convertor interfacing 16
3
Generation of ramp and square wave using on-Chip DAC 19
4
LED dimming using PWM 22
5
Interfacing real time clock and serial port 25
6
Interfacing keypad and LCD 28
7
Interfacing EPROM and interrupt 31
CYCLE 2 ? EXPERIMENTS
8 Implementation of Mailbox Function using LPC 2148 35
9 Interrupt Performance Characteristics of Arm and FPGA 37
10 Flashing of LEDs 40
11 Stepper Motor Interface with ARM ? 7 LPC2148 43
12 LM35 Temperature Sensor Interface with ARM ? 7 LPC2148 47
13
Implementation of Wireless Communication Protocol using ZIGBEE Wireless
Module
50
ADDITIONAL EXPERIMENTS BEYOND THE SYYLABUS
14 Buzzer Interface with ARM ? 7 54
15 Relay interface with ARM? 7 57
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Expt. No. 1 STUDY OF ARM EVALUATION SYSTEM
Aim:
To study the building blocks of ARM7 system, its features, pin configuration and the components
required for functioning of ARM controller.
Architecture Overview:
A RISC-based computer design approach means ARM processors require significantly fewer transistors
than typical processors in average computers. This approach reduces cost, heat and power usage. These
are desirable traits for light, portable, battery-powered devices (smart phones, laptops, tablet and notepad
computers), and other embedded systems. A simpler design facilitates more efficient multi-core CPUs and
higher core counts at lower cost, providing higher processing power and improved energy efficiency for
servers and supercomputers.
In 2005, about 98% of all mobile phones sold used at least one ARM processor. The low power
consumption of ARM processors has made them very popular: 37 billion ARM processors have been
produced as of 2013, up from 10 billion in 2008. The ARM architecture (32-bit) is the most widely used
architecture in mobile devices, and most popular 32-bit one in embedded systems.
According to ARM Holdings, in 2010 alone, producers of chips based on ARM architectures
reported shipments of 6.1 billion ARM based processors, representing 95% of smart phones, 35% of digital
televisions and set-top boxes and 10% of mobile computers. It is the most widely used 32-bit instruction set
architecture in terms of quantity produced.
LPC 2148:
LPC2148 is the widely used IC from ARM-7 family. It is manufactured by Philips and it is pre-loaded
with many inbuilt peripherals making it more efficient and a reliable option for the beginners as well as high
end application developer.




8 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Features of LPC214x series controllers:
1. 8 to 40 kB of on-chip static RAM and 32 to 512 kB of on-chip flash program memory.128 bit wide
interface/accelerator enables high speed 60 MHz operation.
2. In-System/In-Application Programming (ISP/IAP) via on-chip boot-loader software. Single flash sector or
full chip erase in 400 ms and programming of 256 bytes in 1ms.
3. Embedded ICE RT and Embedded Trace interfaces offer real-time debugging with the on-chip Real
Monitor software and high speed tracing of instruction execution.
4. USB 2.0 Full Speed compliant Device Controller with 2 kB of endpoint RAM. In addition, the LPC2146/8
provides 8 kB of on-chip RAM accessible to USB by DMA.
5. One or two (LPC2141/2 vs. LPC2144/6/8) 10-bit A/D converters provide a total of 6/14analog inputs, with
conversion times as low as 2.44 us per channel.
6. Single 10-bit D/A converter provides variable analog output.
7. Two 32-bit timers/external event counters (with four capture and four compare channels each), PWM unit
(six outputs) and watchdog.
8. Low power real-time clock with independent power and dedicated 32 kHz clock input.
9. Multiple serial interfaces including two UARTs (16C550), two Fast I2C-bus (400 kbit/s), SPI and SSP with
buffering and variable data length capabilities.
10. Vectored interrupt controller with configurable priorities and vector addresses.
11. Up to 45 of 5 V tolerant fast general purpose I/O pins in a tiny LQFP64 package.
12. Up to nine edge or level sensitive external interrupt pins available.
13. On-chip integrated oscillator operates with an external crystal in range from 1 MHz to30 MHz and with
an external oscillator up to 50 MHz
14. Power saving modes include Idle and Power-down.
15. Individual enable/disable of peripheral functions as well as peripheral clock scaling for additional power
optimization.
16. Processor wake-up from Power-down mode via external interrupt, USB, Brown-Out Detect (BOD) or
Real-Time Clock (RTC).




9 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


First Step- Hardware Requirement:
Pin configuration of LPC 2148.

Hardware requirement of LPC2148:
1. LPC2148 need minimum below listed hardware to work properly
2. Power Supply
3. Crystal Oscillator
4. Reset Circuit
5. RTC crystal oscillator
6. UART
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Power Supply:
LPC2148 works on 3.3 V power supply. LM 117 can be used for generating 3.3 V supply. However,
basic peripherals like LCD, ULN 2003 (Motor Driver IC) etc. works on 5V. So AC mains supply is converted
into 5V using below mentioned circuit and after that LM 117 is used to convert 5V into 3.3V.
Block diagram of power Supply

Transformer: It is used to step down 230V AC to 9V AC supply and provides isolation between power grids
and circuit.
Rectifier: It is used to convert AC supply into DC.
Filter: It is used to reduce ripple factor of DC output available from rectifier end.
Regulator: It is used to regulate DC supply output.

11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Circuit Diagram:

Regulator IC 7805 is used to provide fix 5V dc supply.
LM 117 is used for generating 3.3V supply from 5V.

12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Calculations:

From the datasheet of LM117

Taking R 2= 240?, we get R 1=392?
Reset Circuit:
Reset button is essential in a system to avoid programming pitfalls and manually bring back the system
to the initialization mode. MCP 130T is a special IC used for providing stable RESET signal to LPC 2148.


13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Oscillator Circuit:

The value of capacitors C20 & C21 depends upon the frequency of crystal Y3. General circuit and
its equivalent circuit is as shown below.

14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Recommended values are as shown in table:

UART:
LPC 2148 has inbuilt ISP which means we can program it within the system using serial
communication on COM0. It has also COM1 for serial communication. MAX 232/233 IC must be used for
voltage logic conversion. Related connections are as given below.

Once the above listed circuit design is ready, we are ready to go further.



15 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Result:
ARM Evaluation system and the configuration of LPC2148 has been studied fully. The minimal setup
required for the functioning of the ARM processor is studied.
Outcomes:
1. Able to understand the ARM controller, its basic components inside and its features.
2. Able to know the components required for the working of ARM LPC2148

Applications:
ARM controller LPC2148 is used in no. of devices such as
1. Smart phones
2. Net books
3. E Readers
4. Digital TV
5. Home Gateways


1. What are the basic units of ARM 7?
2. What is the address system supported by ARM?
3. Define - RISC
4. What are the instructions used to access the memory in ARM?
5. What are the basic units of Microprocessor?
6. What is an Instruction?
7. What is clock cycle?
8. Define - Pipelining
9. What is cache miss?
10. What is meant by memory mapped I/O?
11. Define ? interrupt
12. What is meant by Exception?
13. What is meant by little ? endian mode?
14. What is meant by big ? endian mode?
15. What is the function of CPSR?
16. What is register - indirect addressing?
Viva-voce




16 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 2 ANALOG TO DIGITAL CONVERTOR
INTERFACING
Aim:
To write an embedded c program for interfacing an on chip ADC with LPC2148 ARM processor and
convert the given input voltage into corresponding decimal values.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. PC
Theory:
Analog to Digital converter (ADC) is a device that converts continuously varying analog signals from
instruments that monitor such conditions as movement, temperature, sound, etc., into binary code for the
computer. It may be either a single chip or can be one circuit within a chip. Analog to Digital conversion is
the process of changing continuously varying data, such as voltage, current, or shaft rotation, into discrete
digital quantities that represent the magnitude of the data compared to a standard or reference at the
moment the conversion is made. According to the method of conversion, ADCs can be classified into
Direct-Conversion ADCs, Successive Approximation ADCs, Integrating ADC and Sigma-Delta ADCs.
The LPC 2148 has 10-bit successive approximation analog to digital converter. Basic clocking for the
A/D converters is provided by the VPB clock. A programmable divider is included in each converter, to
scale this clock to the 4.5 MHz (max) clock needed by the successive approximation process. A fully
accurate conversion requires 11 of these clocks. The ADC cell can measure the voltage on any of the ADC
input signals. It is noted that these analog inputs are always connected to their pins, even if the Pin function
Select register assigns them to port pins. A simple self-test of the ADC can be done by driving these pins
as port outputs.



17 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Circuit diagram:




18 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus, an embedded c program for interfacing on-chip ADC with ARM processor is written and
executed. The decimal values of the converted voltage are seen in the WinXTalk screen.
Outcome:
Able to interface A/D convertors with ARM system and check its working by connecting an analog
quantity as input.
Applications:
1. ADC used in MODEM for converting analog signals to digital.
2. A fast video ADC in TV tuner cards
3. ADC used in digital storage oscilloscopes
4. Used in music reproduction technology.
5. Used in DSP if input is analog


1. What are the ADC operating modes in LPC2148?
2. What is meant by conversion time?
3. Why are internal ADCs preferred over external ADCs?
4. Why has 16-bit ADC more resolution than from 10-bit and 8-bit ADC?
5. What are ADC & its Resolution?
6. What is Burst conversion mode?
7. What is the function of A/D Control Register?
8. What is the function of A/D Global Data Register?
9. What is the function of A/D Status Register?
10. What is analog-to-digital (ADC) conversion error?
11. What is the function of Sample-and-hold circuits in analog-to digital converters?
12. What is the disadvantage of the flash analog-to digital converter?
Viva-voce




19 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 3 GENERATION OF RAMP AND SQUARE
WAVE USING ON-CHIP DAC
Aim:
To write and execute an embedded c program to generate ramp wave and square wave using on-chip
DAC of LPC2148 ARM controller.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
A digital-to-analog converter is a device for converting a digital signal into an analog signal (current or
voltage). Digital-to-Analog Converters are the interface between the abstract digital world and the analog
real world. Simple switches, a network of resistors, current sources or capacitors may be used to
implement this conversion. A DAC inputs a binary number and outputs an analog voltage or current signal.
The Microchip Technology Inc. MCP4921 is 2.7 ? 5.5V, low-power, 12-Bit Digital-to-Analog Converter
(DAC) with SPI interface. The MCP4921 DAC provides high accuracy and low noise performance for
industrial applications where calibration or compensation of signals is required. With an SPI connection
there is always one master device (usually a microcontroller) which controls the peripheral devices.
Typically there are three lines common to all the devices,
Master In Slave Out (MISO) ? The Slave line for sending data to the master,
Master Out Slave In (MOSI) ? The Master line for sending data to the peripherals,
Serial Clock (SCK) ? The clock pulses which synchronize data transmission generated by the
master and slave
Slave Select pin ? the pin on each device that the master can use to enable and disable specific
devices. When a device Slave Select pin is low, it communicates with the master. When it is high, it ignores
the master. In SPI, the clock signal is controlled by the master device LPC2148. All data is clocked in and
out using this pin. These lines need to be connected to the relevant pins on the LPC21xx processor. Any
unused GIO pin can be used for CS, instead pull this pin high. Conversion speed is the time it takes for the



20 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

DAC to provide an analog output when the digital input word is changed. The MCP4291 DAC ? SPI
connections with LPC21xx have four I/O lines (P0.4 ? P0.7) required. The analog output is generated by
using these four lines.
Circuit diagram:


Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the embedded c programs for generating ramp wave and square wave using ARM LPC2148 are
written and executed successfully and the waveforms are viewed in oscilloscope.
Outcome:
Able to program the DAC in-built inside the ARM controller and get the waveforms using it.




21 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications :
1. DAC used in Audio amplifier.
2. Video encoder
3. Display electronics
4. Data Acquistion systems
5. Motor control



1. What are the features of LPC2148 DAC?
2. What is the function of DAC register?
3. Which pin provides a voltage reference level for the D/A converter?
4. What are the applications of DAC in signal processing applications?
5. What is GIO?
6. What is the resolution of a digital-to-analog converter (DAC)?
7. What is the major advantage of the R/2R ladder digital-to-analog (DAC), as compared to a binary-
weighted digital-to-analog DAC converter?
8. What is the resolution of a 0?5 V 6-bit digital-to-analog converter (DAC) ?
9. What are DAC configurations?
10. What are the different types of DAC Circuits?
11. What are the Limitations of the Binary Weighted DAC?
12. What are the General DAC Characteristics?
13. Define reference voltage in DAC.
14. What is full scale voltage?
15. What is settling time?
VIVA-VOCE




22 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 4 LED DIMMING USING PWM

Aim:
To write an embedded c program for implementing PWM using ARM controller and verify the same by
dimming of LEDs.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
LPC2148 supports 2 types of PWM:
1) Single Edge PWM ? Pulse starts with new Period i.e pulse is always at the beginning
2) Double Edge PWM ? Pulse can be anywhere within the Period
A PWM block, like a Timer block , has a Timer Counter and an associated Pre-scale Register along
with Match Registers. These work exactly the same way as in the case of Timers. Match Registers 1 to 6
(except 0) are pinned on LPC214x i.e. the corresponding outputs are diverted to actual Pins on LPC214x
MCU. The PWM function must be selected for these Pins to get the PWM output.
The basic setup is to simply replace Servo by a LED and no external 5V source is needed. The
anode of LED is connected to P0.0 and cathode to ground. Pulse Widths corresponding to the switches
connected to P0.1/2/3/4 will be 2.5ms/5ms/7.5ms/10ms respectively. As the Pulse Width Increases LED
will keep on getting brighter and the reverse will happen if Pulse Width is decreased.



23 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus embedded c program for implementing Pulse Width Modulation is written and executed and
output has been verified in LED display.
Outcome:
Able to implement PWM using the ARM controller and verify the same in the form of dimming of
LEDS.



24 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Applications :
1. In Visual signals to covey a message
2. Illumination where light is reflected from objects
3. In Narrow band sensors



1. What factors determine the LED dimming performance?
2. What is meant by analog dimming?
3. What is flickering effect?
4. What is the factor determines dimming of the LED
5. Why Silicon is not suitable for fabrication of light-emitting diodes?
6. Why Silicon diode is less suited for low voltage rectifier operation?
7. What is the principle of zener diode?
8. What are the materials used to make LED?
9. What type of diodes is used in FM receivers?
10. Which diode suffers an avalanche breakdown?
11. What happens if the junction temperature of LED is increased?
12. How a transfer characteristic of a diode does is related?
13. What is the requirement of a clipping action of a diode?
14. What type of rectifier circuit requires four diodes?
15. Why are the pulse width modulated outputs required in most of the applications?
16. How do the variations in an average value get affected by PWM period?
17. Name the common formats available for LED display.
18. What are the types of seven segment display?
19. What is PWM?
20. What are the applications of PWM?

Viva-voce




25 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 5 INTERFACING REAL TIME CLOCK
AND SERIAL PORT
Aim:
To write and execute an embedded c program to interface DS1307 RTC using I2C protocol with ARM
controller
Apparatus Required:
1. LPC2148 ARM development board
2. Stepper motor
3. Interfacing cables
4. PC
Theory:
A clock, which is based on the interrupts at preset intervals, is Real Time Clock (RTC). An interrupt
service routine executes on each timeout (overflow) of this clock. This timing device once started never
resets or never reloaded with another value. Once it is set, it is not modified later. It is used in a system to
save the time and date.













26 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the program for interfacing real time clock with ARM controller is written and executed and the
date and time are verified on the screen.
Outcome:
Able to interface real time clock DS1307 with ARM controller and thereby display date and time
Applications :
1. I2C In ARM and PIC microcontrollers
2. Used as serial communication protocol with MASTER and SLAVE operation.

27 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
27 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00




1. What is I2C and how does it work?
2. What are the features of I2C in LPC2148 ARM7 microcontroller?
3. What is the function of I2C0CONSET register?
4. What is I2C0STAT?
5. What is the function of I2C0 Data Register?
6. What is RTC?
7. List the advantages of RTC
8. Through which port the date and time is displayed in RTC?
9. What is a serial port?
10. List the registers used to transfer data in serial port.
11. List the modes used for data transmission.
12. What is a simplex mode?
13. Which pin is used to transmit a character?
14. What is the baud rate of serial port?
15. What is the disadvantage of RS-232C?














Viva-voce




28 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 6 INTERFACING KEYPAD AND LCD

Aim:
To write an embedded c program to interface 4 x 4 matrix keypad with ARM processor and display the
pressed key in an LCD.
Apparatus Required:
1. LPC2148 ARM development board
2. Interfacing cables
3. PC
Theory:

In matrix keypad, keys are connected in rows and columns. When any switch is pressed, rows and
columns come into contact, which is that detected by controller to identify which key has been pressed. A
4?4 matrix keypad consists of 4 rows and 4 columns. There is a switch connecting each row and column.
So the combinations of rows and columns make up the 16 inputs.Initially all the switches are open (not
connected). When any one button is pressed, the switch is closed (connected),hence there is a connection
between the row and column. The first 4 pins are connected to the column as INPUT. The other 4 pins are
connected to the row as OUTPUT. Matrix keypad is a good substitution to normal push button.












29 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Circuit Diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus program for interfacing matrix keypad with ARM controller is written and executed and the key
pressed is seen in the LCD.



30 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Outcome:
Able to interface keypad with ARM controller and see the pressed key in the LCD display.
Applications :
1. Used in password based door locking system
2. Security system with user changeable
3. Used in laptops, computer games
4. Used in portable video games and cell phones



1. What is Matrix keypad?
2. What is the concept behind keypad interface?
3. What are the functions of pull- up resistors?
4. What is key de bouncing?
5. List the steps involved when the key in a 4 x 4 keyboard matrix is being pressed.
6. What is the value obtained if no key is pressed?
7. What kind of interrupt is generated if a key has to be operated in an interrupt mode?
8. How will you identify that the key is pressed?
9. What are the steps involved in Keyboard Interfacing?
10. List the registers used to store the keyboard, display modes and other operations programmed by
CPU.
11. Name the mode when a data is entered from the left side of the display unit.
12. How many rows and columns are present in a 16 x 2 alphanumeric LCD?
13. How many data lines are there in a 16 x 2 alphanumeric LCD?
14. Which pin of the LCD is used for adjusting its contrast?
15. Which command of an LCD is used to shift the entire display to the right?
16. Which command is used to select the 2 lines and 5 x 7 matrix of an LCD?
17. What changes are to be made to send data to an LCD?
18. For reading operation from an LCD what changes in the software are introduced?
19. Which instruction is used to select the first row first column of an LCD?
Viva-voce

31 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
31 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Expt. No. 7 INTERFACING EEPROM AND INTERRUPT

Aim:
To write a program to interface EEPROM using I2C protocol with ARM controller and retrieve the stored
messages inside EEPROM.
Apparatus Required:
1. LPC2148 ARM development board
2. Interfacing cables
3. PC
Theory:
I2C (Inter Integrated Circuit):
The I2C (Inter-IC) bus is a bi-directional two-wire serial bus that provides a communication link between
integrated circuits (ICs).I2C is a synchronous protocol that allows a master device to initiate communication
with a slave device. Data is exchanged between these devices.
EEPROM:
EEPROM (electrically erasable programmable read-only memory) is user-modifiable read-only
memory (ROM) that can be erased and reprogrammed (written to) repeatedly through the application of
higher than normal electrical voltage. It is a type of non-volatile memory used in computers and other
electronic devices to store small amounts of data that must be saved when power is removed, e.g.,
calibration tables or device configuration
Read, write and Erase EEPROM by using I2C in LPC2148 Primer Board. Wiring up an I2C based
EEPROM to the I2C port is relatively simple. The basic operation of the I2C based EEPROM's is to send a
command, such as WRITE, followed by an address and the data. In WRITE operation, the EEPROM is
used to store the data. In LPC2148 Primer Kit, 2 nos. of EEPROM lines are controlled by I2C Enabled
drivers. I2C Lines serial clock SCL (P0.2), serial data SDA (P0.3) connected to the I2C based serial
EEPROM IC. The EEPROM read & write operations are done in LPC2148 Primer Kit by using these SDA &
SCL I2C lines.
32 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
32 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To down load and run this program: Refer General procedure given in Page No: 60
Result:
Thus, the program for interfacing I2C based EEPROM with ARM processor has been written and
executed successfully and the memory content is verified on Win x talk terminal.
Outcome:
Able to interface memory ICs with ARM controller and perform the read and write operations.



33 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications:
1. ROM used in toys,automobiles to store data when power is off
2. In calculators and peripheral devices
3. In laser printers
4. And also in embedded systems where program need not to be changed.


1. How does I2C protocol work?
2. What is EEPROM?
3. What is meant by master slave mode?
4. What is meant by non-volatile memory?
5. What is an interrupt?
6. How does an interrupt request works?
7. What is a nested interrupt?
8. What are the registers used for enabling an interrupt?
9. What is PROM?
10. What is EPROM?
11. What is mask ROM?
12. Which memory allows simultaneous read and write operations?
13. Which memory has the shortest access times?
14. Which interrupt has the highest priority?
15. What is non maskable interrupt?
16. Which is the first level of memory access by the microprocessor?
17. List the types of cache memories.
18. What is the use of an interrupt?
19. What is the use of converting an interrupt to threads in a microprocessor?
20. What are the bits used to control an external interrupts?


Viva-voce




34 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00










CYCLE 2 - EXPERIMENTS




35 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 8 IMPLEMENTATION OF MAILBOX FUNCTION
USING LPC2148
Aim:
To create a mailbox in Micro C/OS ? II using LPC2148 ARM Controller
Apparatus Required:
1. LPC2148 ARM development board
2. Interfacing cables
3. PC
Theory:
System or the user code can send a message by the core services. A typical mail message, also
known as the exchange of information, refers to a task or an ISR using a pointer variable, through the core
services to put a message (that is, a pointer) into the mailbox. Similarly, one or more tasks can receive this
message by the core services. The tasks sending and receiving the message promise that the content that
the pointer points to is just that piece of message.
The mailbox of CooCox CoOS is a typical message mailbox which is composed of two parts: one is
the information which expressed by a pointer of void; the other is the waiting list which composed of the
tasks waiting for this mailbox. The waiting list supports two kinds of sorting: FIFO and preemptive priority.
The sorting mode is determined by the user when creating the mailbox.
Procedure:
To Edit / Compile / generate Hex file: Refer General procedure in Page No: 58
To down load and run this program: Refer General procedure in Page No: 60
Result:
Thus, the mailbox was created in Micro C/OS ?II and implemented using LPC2148.
Outcome:
Able to understand the concept of mail box in embedded systems and its significance in real time
systems





36 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications:
1. Used in Acorn RISC PC700
2. Used in ZIPIT wireless messenger
3. Used in Meizu M6 MINI player


1. What is IPC?
2. Define Queue.
3. What are the different types of mail box functions?
4. What is half duplex mode?
5. How many synchronous and asynchronous modes are there in serial port?
6. List the bits used to generate serial port interrupt
7. What is branch prediction?
8. Mention any two features of ?C/OS ? II.
9. Write the function for creating task in ?C/OS ? II.
10. Mention any two support devices for ?C/OS ? II.
11. How many user tasks can be handled by ?C/OS ? II?



















Viva-voce




37 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 9 INTERRUPT PERFORMANCE
CHARACTERISTICSOF ARM AND FPGA

Aim:
To study the interrupt performance characteristics of ARM and FPGA by using ARM controller kit and
FPGA kit separately.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
External Interrupts:
An interrupt caused by an external source such as the computer operator, external sensor or
monitoring device, or another computer. Interrupts are special events that require immediate attention.
Interfacing External Interrupts with LPC2148:
When an external interrupt signal occurs in LPC2148 Primer Board, the message "LOW" will be
displayed on PC. The interrupt signal occurs using switches. When the switch is pressed to LOW, then the
external interrupt occurs. The Vectored Interrupt Controller (VIC) takes 32 interrupt request inputs and
programmable assigns them into 3 categories, FIQ, vectored IRQ, and non-vectored IRQ. The ARM7
LPC2148 Primer board has two numbers of External Interrupts, connected with I/O Port lines (P0.14 &
P0.15) as switches.







38 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00



Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60


39 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
39 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Result:
Thus the interrupt performance characteristics of ARM and FPGA are studied. On comparison, ARM
counts at slow speed because it consumes more instruction cycle and FPGA is more efficient for servicing
and processing external interrupt pulses.
Outcome:
Able to understand the performance characteristics of ARM and FPGA while dealing with
interrrupts
Applications:
1. Used in random logic and SPLDs
2. Used in cryptography and filtering
3. In medical imaging
4. In bioinformatics and voice recognition



1. When is an Interrupt Request received?
2. What is ISR?
3. How do you initialize interrupt?
4. What is Vectored Interrupt Controller?
5. What are the kinds of protection available for SRAMS ?
6. What is interrupt pipelining?
7. What is pipeline shutdown?
8. What is branch prediction?
9. What is the use of Neon Floating point engine?
10. What is the use of ?vectorize option?
11. What is PTM?
12. What is ITM?
13. What is ETM?
14. What is I2S interface?
15. What is the use of ?SWI? in ARM assembly?

Viva-voce




40 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 10 FLASHING OF LEDS
Aim:
To write and execute an embedded c program to display LEDs using LPC 2148 ARM controller
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
Theory:
LED (Light Emitting Diodes) is the most commonly used components, usually for displaying pins digital
states. Typical uses of LEDs include alarm devices, timers and confirmation of user input such as a mouse
click or keystroke. Interfacing LED with LPC2148 Flash a LED using LPC2148 Primer Board. It works by
turning ON a LED & then turning it OFF & then looping back to START. However the operating speed of
microcontroller is very high so the flashing frequency will also be very fast to be detected by human eye.
The ARM7 LPC2148 Primer board has eight numbers of point LEDs, connected with I/O Port lines (P1.16 ?
P1.23) to make port pins high.










41 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00



Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus program for flashing of LEDs is written and executed using ARM controller LPC2148.



42 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Outcome:
Able to interface LED lights via the input output port and control them
Applications:
1. In Illumination
2. As status indicators in equipments
3. Stadium displays and dynamic decorative displays



1. What is seven segment displays?
2. What are the different configurations of LED?
3. What is the function of GPIO?
4. What are the Pins which are used to connect LEDs?
5. How to identify 'Polarity' of LED?
6. Differentiate LED from LCD.
7. What is a use of Jumper?
8. How many numbers of LEDs present in Primer board?
9. Where LEDs are used?
10. What is the use of flash magic software?
11. Which port is used in ARM 7 processor kit?
12. Which diode suffers an avalanche breakdown?
13. What happens if the junction temperature of LED is increased?
14. What is an anti collision rate light?
15. What is fail-safe conditions






Viva-voce




43 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 11 STEPPER MOTOR INTERFACE WITH
ARM -7 LPC2148
Aim:
To write a program to interface stepper motor using ARM processor and control the movement of motor
in either directions.
Apparatus Required:
1. LPC2148 ARM development board
2. Stepper motor
3. Interfacing cables
4. PC
Theory:
A stepper motor can be viewed as a DC motor with number of poles (on both rotor and stator).
Additionally, soft magnetic material with many teeth on the rotor and stator cheaply multiplies the number of
poles (reluctance motor). Like an AC synchronous motor, it is ideally driven by sinusoidal current, allowing
a step less operation, but this puts some burden on the controller. When using an 8-bit digital controller,
256 micro steps per step are possible. As a digital-to-analog converter produces unwanted ohmic heat in
the controller, pulse-width modulation is used to regulate the mean current. Simpler models switch voltage
only for doing a step, thus needing an extra current limiter: for every step, they switch a single cable to the
motor.
The idea is to connect the output pins of the driver to 4 transistors. The transistor must be
grounded at the emitter and the driver pin must be connected to the base. Collector is connected to the coil
wire of the motor. Stepper motors are rated by the torque they produce. Synchronous electric motors using
soft magnetic materials (having a core) have the ability to provide position holding torque (called detent
torque, and sometimes included in the specifications) while not driven electrically. To achieve full rated
torque, the coils in a stepper motor must reach their full rated current during each step. The voltage rating
(if there is one) is almost meaningless. The motors also suffer from EMF, which means that once the coil is
turned off it starts to generate current because the motor is still rotating. There needs to be an explicit way
to handle this extra current in a circuit otherwise it can cause damage and affect performance of the motor.
44 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
44 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus stepper motor interface with ARM processor has been successfully implemented and the motor is
controlled in clockwise and anticlockwise direction.
Outcome:
Able to interface the stepper motor with ARM controller and thereby create some rotational
movements





45 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Applications:
3. Used for precise positioning with a motor
4. Used in hard disk drives, robotics
5. Used in telescopes and toys







1. Define GPIO.
2. What is the function of ULN2803?
3. How LPC2148 control stepper motor?
4. Which I/O port lines used to rotate stepper motor?
5. How stepper motor reacts for each pulse it receives?
6. What is serial communication?
7. What is parallel communication?
8. What is stepper motor & why it is named so?
9. How can be step angle is calculated?
10. What are the advantages and disadvantages of parallel communication?
11. What does instruction-pipelining mean?
12. What is the power supply required for ARM processor?
13. What is a unit for torque?
14. What is RPM rating for a DC motor?
15. What device that is used to obtain an accurate position control of rotating shafts in terms of steps?
Viva-voce

46 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
46 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Expt. No. 12 LM35 TEMPERATURE SENSOR INTERFACE
WITH ARM-7 LPC2148
Aim:
To write a program to interface of LM35 temperature sensor to on-chip ADC of ARM controller and
display the room temperature value on the screen.
Apparatus Required:
1. LPC2148 ARM development board
2. Temperature sensor
3. Interfacing cables
4. PC
Theory:
Temperature Sensor:
The LM35 series are precision integrated-circuit temperature sensors, whose output voltage is linearly
proportional to the Celsius (Centigrade) temperature. The output of the sensor is converted to digital output
that is easy to connect with microcontroller. Temperature sensor has three terminals and required
Maximum of 5.5 V supply. This type of sensor consists of a material that performs the operation according
to temperature to vary the resistance. This change of resistance is sensed by circuit and it calculates
temperature. When the voltage increases then the temperature also rises. We can see this operation by
using a diode.







47 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
47 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00


Circuit diagram:

48 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
48 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the program for interfacing temperature sensor with ARM controller is written and executed and
the temperature reading is seen on the monitor.
Outcome:
Able to interface different sensors with in-built ADC of the ARM processor and access the data
produced from them
Applications:
1. Used in Ovens, refrigerators
2. In HVAC environmental control
3. coolant or cylinder head temperatures
4. in the automotive industry to monitor air intake



1. What is LM35?
2. Define ISP.
3. How many Analog-to-Digital Converters available as an inner peripheral in LPC2148?
4. What is the main function of analog pin in LPC 2148?
5. What is the output voltage produced by LM35 for one degree temperature?
6. What is the difference between LM 34 and LM 35 sensors?
7. How many pins are available in LM35?
8. Why Vref is set of ADC0848 to 2.56 V if analog input is connected to the LM35?
9. What is operating the operating temperature range in LM35?
10. Why LM35 is used to Measure Temperature?
11. List the devices used to sense temperature.
12. What is the purpose of a thermocouple?
13. What is the output voltage of a thermocouple?
Viva-voce




49 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 13 IMPLEMENTATION OF WIRELESS
COMMUNICATION PROTOCOL
USING ZIGBEE WIRELESS MODULE
Aim:
To implement wireless communication protocol using zigbee wireless module with the help of ARM
processor
Apparatus required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. Zigbee module
5. PC
Theory:
ZigBee is a specification to suite high level communication protocols using small, low-power digital
radios based on an IEEE 802 standard for personal area networks. The ZigBee is the name of a wireless
protocol maintained by the IEEE 802.15 standard. This is a protocol specified for wireless Personal Area
Network (PAN) using low powered wireless transceivers. There are already wireless transmitter and
receiver modules which can do point to point communication. The Xbee is the brand name a wireless
transceiver device introduced by the Digi international which works on the ZigBee protocol and can form
PAN networks. They have an approximate range of 10 to 100 meters and are used in industries, scientific
fields, medical fields etc
Digi ZigBee:
The Digi Xbee 802.15.4 modules are the easiest to use, most reliable and cost-effective RF devices.
The 802.15.4 Xbee modules provide two friendly modes of communication - a simple serial method to
transmit/receive or a framed mode providing advanced features. These modules can communicate point to
point, from one point to a PC, or in a mesh network.



50 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
50 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Circuit diagram:


Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the wireless communication protocol using Zigbee wireless module is implemented using
LPC2148.
Outcome:
Able to form a wireless network using zigbee module and ARM controller




51 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications:
1. Used in traffic lights in non-urban areas
2. Used in building control systems
3. Used in asset tracking
4. Used in parking sensors




1. How many UART ports available in LPC2148?
2. What is the main function of voltage convertors in UART?
3. Why Zigbee based is preferred for wireless communication?
4. What is the IEEE standard for Zigbee protocol?
5. Write the two modes of communication are used in a ZigBee network.
6. What is the function of a scheduler?
7. Mention any two features of ?C/OS ? II.
8. Write the function for creating task in ?C/OS ? II.
9. Mention any two support devices for ?C/OS ? II.
10. How many user tasks can be handled by ?C/OS ? II?







Viva-voce




52 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

















ADDITIONAL EXPERIMENTS
53 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
53 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Expt. No. 14 BUZZER INTERFACE WITH ARM-7 LPC2148
Aim:
To write a program for buzzer interface with ARM processor and control its operation.
Apparatus required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
Theory:
Buzzer is an electronic device commonly used to produce sound. Light weight, simple construction and
low price make it usable in various applications like car/truck reversing indicator, computers, call bells etc.
Piezo buzzer is based on the inverse principle of piezo electricity discovered in 1880 by Jacques and Pierre
Curie. It is the phenomena of generating electricity when mechanical pressure is applied to certain
materials and the vice versa is also true. Such materials are called piezo electric materials. Piezo electric
materials are either naturally available or manmade. Piezo ceramic is class of manmade material, which
poses piezo electric effect and is widely used to make disc, the heart of piezo buzzer. When subjected to
an alternating electric field they stretch or compress, in accordance with the frequency of the signal thereby
producing sound.







54 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
54 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the program for interfacing buzzer with ARM processor is written and executed and output is
verified.
Outcome:
Able to interface devices such as buzzer, relay with ARM controller


FirstRanker.com - FirstRanker's Choice
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00






?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING

VII SEMESTER - R 2013

EC6711 ? EMBEDDED LABORATORY






Name : _______________________________________
Register No : _______________________________________
Section : _______________________________________
LABORATORY MANUAL



2 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00




is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and
training.

? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different
levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on
heart and soul
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

To impart professional education integrated with human values to the younger generation, so as to
shape them as proficient and dedicated engineers, capable of providing comprehensive solutions to the
challenges in deploying technology for the service of humanity

? To educate the students with the state-of-art technologies to meet the growing challenges of the
electronics industry
? To carry out research through continuous interaction with research institutes and industry, on
advances in communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning,
innovation and ethical practices
VISION
VISION
MISSION
MISSION



3 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

PROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To provide students with a solid foundation in Mathematics, Science and fundamentals of
engineering, enabling them to apply, to find solutions for engineering problems and use this knowledge
to acquire higher education
2. Core Competence
To train the students in Electronics and Communication technologies so that they apply their
knowledge and training to compare, and to analyze various engineering industrial problems to find
solutions
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice which
enables them to find solutions for the real time problems in industry, and to design products
4. Professionalism
To inculcate professional and effective communication skills, leadership qualities and team spirit in
the students to make them multi-faceted personalities and develop their ability to relate engineering
issues to broader social context
5. Lifelong Learning/Ethics
To demonstrate and practice ethical and professional responsibilities in the industry and society in
the large, through commitment and lifelong learning needed for successful professional career


4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
PROGRAMME OUTCOMES (POs)
a) To demonstrate and apply knowledge of Mathematics, Science and engineering fundamentals in
Electronics and Communication Engineering field
b) To design a component, a system or a process to meet the specific needs within the realistic
constraints such as economics, environment, ethics, health, safety and manufacturability
c) To demonstrate the competency to use software tools for computation, simulation and testing of electronics
and communication engineering circuits
d) To identify, formulate and solve electronic and communication engineering problems
e) To demonstrate an ability to visualize and work on laboratory and multidisciplinary tasks
f) To function as a member or a leader in multidisciplinary activities
g) To communicate in verbal and written form with fellow engineers and society at large
h) To understand the impact of Electronics and Communication Engineering in the society and demonstrate
awareness of contemporary issues and commitment to give solutions exhibiting social responsibility
i) To demonstrate professional & ethical responsibilities
j) To exhibit confidence in self-education and ability for lifelong learning
k) To participate and succeed in competitive exams


5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
SYLLABUS

? Learn the working of ARM processor
? Understand the Building Blocks of Embedded Systems
? Learn the concept of memory map and memory interface
? Know the characteristics of Real Time Systems
? Write programs to interface memory, I/Os with processor
? Study the interrupt performance
LIST OF EXPERIMENTS:
1. Study of ARM evaluation system
2. Interfacing ADC and DAC
3. Interfacing LED and PWM
4. Interfacing real time clock and serial port
5. Interfacing keyboard and LCD
6. Interfacing EPROM and interrupt
7. Mailbox
8. Interrupt performance characteristics of ARM and FPGA
9. Flashing of LEDS
10. Interfacing stepper motor and temperature sensor
11. Implementing zigbee protocol with ARM



? Write programs in ARM for a specific Application
? Interface memory and Write programs related to memory operations
? Interface A/D and D/A convertors with ARM system
? Analyze the performance of interrupt
? Write programmes for interfacing keyboard, display, motor and sensor.
? Formulate a mini project using embedded system
COURSE OBJECTIVES
COURSE OUTCOMES
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
CONTENTS
Sl. No. Name of the Experiment Page No.
CYCLE 1 ? EXPERIMENTS
1
Study of ARM evaluation system 7
2
Analog to Digital Convertor interfacing 16
3
Generation of ramp and square wave using on-Chip DAC 19
4
LED dimming using PWM 22
5
Interfacing real time clock and serial port 25
6
Interfacing keypad and LCD 28
7
Interfacing EPROM and interrupt 31
CYCLE 2 ? EXPERIMENTS
8 Implementation of Mailbox Function using LPC 2148 35
9 Interrupt Performance Characteristics of Arm and FPGA 37
10 Flashing of LEDs 40
11 Stepper Motor Interface with ARM ? 7 LPC2148 43
12 LM35 Temperature Sensor Interface with ARM ? 7 LPC2148 47
13
Implementation of Wireless Communication Protocol using ZIGBEE Wireless
Module
50
ADDITIONAL EXPERIMENTS BEYOND THE SYYLABUS
14 Buzzer Interface with ARM ? 7 54
15 Relay interface with ARM? 7 57
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Expt. No. 1 STUDY OF ARM EVALUATION SYSTEM
Aim:
To study the building blocks of ARM7 system, its features, pin configuration and the components
required for functioning of ARM controller.
Architecture Overview:
A RISC-based computer design approach means ARM processors require significantly fewer transistors
than typical processors in average computers. This approach reduces cost, heat and power usage. These
are desirable traits for light, portable, battery-powered devices (smart phones, laptops, tablet and notepad
computers), and other embedded systems. A simpler design facilitates more efficient multi-core CPUs and
higher core counts at lower cost, providing higher processing power and improved energy efficiency for
servers and supercomputers.
In 2005, about 98% of all mobile phones sold used at least one ARM processor. The low power
consumption of ARM processors has made them very popular: 37 billion ARM processors have been
produced as of 2013, up from 10 billion in 2008. The ARM architecture (32-bit) is the most widely used
architecture in mobile devices, and most popular 32-bit one in embedded systems.
According to ARM Holdings, in 2010 alone, producers of chips based on ARM architectures
reported shipments of 6.1 billion ARM based processors, representing 95% of smart phones, 35% of digital
televisions and set-top boxes and 10% of mobile computers. It is the most widely used 32-bit instruction set
architecture in terms of quantity produced.
LPC 2148:
LPC2148 is the widely used IC from ARM-7 family. It is manufactured by Philips and it is pre-loaded
with many inbuilt peripherals making it more efficient and a reliable option for the beginners as well as high
end application developer.




8 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Features of LPC214x series controllers:
1. 8 to 40 kB of on-chip static RAM and 32 to 512 kB of on-chip flash program memory.128 bit wide
interface/accelerator enables high speed 60 MHz operation.
2. In-System/In-Application Programming (ISP/IAP) via on-chip boot-loader software. Single flash sector or
full chip erase in 400 ms and programming of 256 bytes in 1ms.
3. Embedded ICE RT and Embedded Trace interfaces offer real-time debugging with the on-chip Real
Monitor software and high speed tracing of instruction execution.
4. USB 2.0 Full Speed compliant Device Controller with 2 kB of endpoint RAM. In addition, the LPC2146/8
provides 8 kB of on-chip RAM accessible to USB by DMA.
5. One or two (LPC2141/2 vs. LPC2144/6/8) 10-bit A/D converters provide a total of 6/14analog inputs, with
conversion times as low as 2.44 us per channel.
6. Single 10-bit D/A converter provides variable analog output.
7. Two 32-bit timers/external event counters (with four capture and four compare channels each), PWM unit
(six outputs) and watchdog.
8. Low power real-time clock with independent power and dedicated 32 kHz clock input.
9. Multiple serial interfaces including two UARTs (16C550), two Fast I2C-bus (400 kbit/s), SPI and SSP with
buffering and variable data length capabilities.
10. Vectored interrupt controller with configurable priorities and vector addresses.
11. Up to 45 of 5 V tolerant fast general purpose I/O pins in a tiny LQFP64 package.
12. Up to nine edge or level sensitive external interrupt pins available.
13. On-chip integrated oscillator operates with an external crystal in range from 1 MHz to30 MHz and with
an external oscillator up to 50 MHz
14. Power saving modes include Idle and Power-down.
15. Individual enable/disable of peripheral functions as well as peripheral clock scaling for additional power
optimization.
16. Processor wake-up from Power-down mode via external interrupt, USB, Brown-Out Detect (BOD) or
Real-Time Clock (RTC).




9 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


First Step- Hardware Requirement:
Pin configuration of LPC 2148.

Hardware requirement of LPC2148:
1. LPC2148 need minimum below listed hardware to work properly
2. Power Supply
3. Crystal Oscillator
4. Reset Circuit
5. RTC crystal oscillator
6. UART
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Power Supply:
LPC2148 works on 3.3 V power supply. LM 117 can be used for generating 3.3 V supply. However,
basic peripherals like LCD, ULN 2003 (Motor Driver IC) etc. works on 5V. So AC mains supply is converted
into 5V using below mentioned circuit and after that LM 117 is used to convert 5V into 3.3V.
Block diagram of power Supply

Transformer: It is used to step down 230V AC to 9V AC supply and provides isolation between power grids
and circuit.
Rectifier: It is used to convert AC supply into DC.
Filter: It is used to reduce ripple factor of DC output available from rectifier end.
Regulator: It is used to regulate DC supply output.

11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Circuit Diagram:

Regulator IC 7805 is used to provide fix 5V dc supply.
LM 117 is used for generating 3.3V supply from 5V.

12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Calculations:

From the datasheet of LM117

Taking R 2= 240?, we get R 1=392?
Reset Circuit:
Reset button is essential in a system to avoid programming pitfalls and manually bring back the system
to the initialization mode. MCP 130T is a special IC used for providing stable RESET signal to LPC 2148.


13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Oscillator Circuit:

The value of capacitors C20 & C21 depends upon the frequency of crystal Y3. General circuit and
its equivalent circuit is as shown below.

14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Recommended values are as shown in table:

UART:
LPC 2148 has inbuilt ISP which means we can program it within the system using serial
communication on COM0. It has also COM1 for serial communication. MAX 232/233 IC must be used for
voltage logic conversion. Related connections are as given below.

Once the above listed circuit design is ready, we are ready to go further.



15 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Result:
ARM Evaluation system and the configuration of LPC2148 has been studied fully. The minimal setup
required for the functioning of the ARM processor is studied.
Outcomes:
1. Able to understand the ARM controller, its basic components inside and its features.
2. Able to know the components required for the working of ARM LPC2148

Applications:
ARM controller LPC2148 is used in no. of devices such as
1. Smart phones
2. Net books
3. E Readers
4. Digital TV
5. Home Gateways


1. What are the basic units of ARM 7?
2. What is the address system supported by ARM?
3. Define - RISC
4. What are the instructions used to access the memory in ARM?
5. What are the basic units of Microprocessor?
6. What is an Instruction?
7. What is clock cycle?
8. Define - Pipelining
9. What is cache miss?
10. What is meant by memory mapped I/O?
11. Define ? interrupt
12. What is meant by Exception?
13. What is meant by little ? endian mode?
14. What is meant by big ? endian mode?
15. What is the function of CPSR?
16. What is register - indirect addressing?
Viva-voce




16 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 2 ANALOG TO DIGITAL CONVERTOR
INTERFACING
Aim:
To write an embedded c program for interfacing an on chip ADC with LPC2148 ARM processor and
convert the given input voltage into corresponding decimal values.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. PC
Theory:
Analog to Digital converter (ADC) is a device that converts continuously varying analog signals from
instruments that monitor such conditions as movement, temperature, sound, etc., into binary code for the
computer. It may be either a single chip or can be one circuit within a chip. Analog to Digital conversion is
the process of changing continuously varying data, such as voltage, current, or shaft rotation, into discrete
digital quantities that represent the magnitude of the data compared to a standard or reference at the
moment the conversion is made. According to the method of conversion, ADCs can be classified into
Direct-Conversion ADCs, Successive Approximation ADCs, Integrating ADC and Sigma-Delta ADCs.
The LPC 2148 has 10-bit successive approximation analog to digital converter. Basic clocking for the
A/D converters is provided by the VPB clock. A programmable divider is included in each converter, to
scale this clock to the 4.5 MHz (max) clock needed by the successive approximation process. A fully
accurate conversion requires 11 of these clocks. The ADC cell can measure the voltage on any of the ADC
input signals. It is noted that these analog inputs are always connected to their pins, even if the Pin function
Select register assigns them to port pins. A simple self-test of the ADC can be done by driving these pins
as port outputs.



17 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Circuit diagram:




18 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus, an embedded c program for interfacing on-chip ADC with ARM processor is written and
executed. The decimal values of the converted voltage are seen in the WinXTalk screen.
Outcome:
Able to interface A/D convertors with ARM system and check its working by connecting an analog
quantity as input.
Applications:
1. ADC used in MODEM for converting analog signals to digital.
2. A fast video ADC in TV tuner cards
3. ADC used in digital storage oscilloscopes
4. Used in music reproduction technology.
5. Used in DSP if input is analog


1. What are the ADC operating modes in LPC2148?
2. What is meant by conversion time?
3. Why are internal ADCs preferred over external ADCs?
4. Why has 16-bit ADC more resolution than from 10-bit and 8-bit ADC?
5. What are ADC & its Resolution?
6. What is Burst conversion mode?
7. What is the function of A/D Control Register?
8. What is the function of A/D Global Data Register?
9. What is the function of A/D Status Register?
10. What is analog-to-digital (ADC) conversion error?
11. What is the function of Sample-and-hold circuits in analog-to digital converters?
12. What is the disadvantage of the flash analog-to digital converter?
Viva-voce




19 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 3 GENERATION OF RAMP AND SQUARE
WAVE USING ON-CHIP DAC
Aim:
To write and execute an embedded c program to generate ramp wave and square wave using on-chip
DAC of LPC2148 ARM controller.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
A digital-to-analog converter is a device for converting a digital signal into an analog signal (current or
voltage). Digital-to-Analog Converters are the interface between the abstract digital world and the analog
real world. Simple switches, a network of resistors, current sources or capacitors may be used to
implement this conversion. A DAC inputs a binary number and outputs an analog voltage or current signal.
The Microchip Technology Inc. MCP4921 is 2.7 ? 5.5V, low-power, 12-Bit Digital-to-Analog Converter
(DAC) with SPI interface. The MCP4921 DAC provides high accuracy and low noise performance for
industrial applications where calibration or compensation of signals is required. With an SPI connection
there is always one master device (usually a microcontroller) which controls the peripheral devices.
Typically there are three lines common to all the devices,
Master In Slave Out (MISO) ? The Slave line for sending data to the master,
Master Out Slave In (MOSI) ? The Master line for sending data to the peripherals,
Serial Clock (SCK) ? The clock pulses which synchronize data transmission generated by the
master and slave
Slave Select pin ? the pin on each device that the master can use to enable and disable specific
devices. When a device Slave Select pin is low, it communicates with the master. When it is high, it ignores
the master. In SPI, the clock signal is controlled by the master device LPC2148. All data is clocked in and
out using this pin. These lines need to be connected to the relevant pins on the LPC21xx processor. Any
unused GIO pin can be used for CS, instead pull this pin high. Conversion speed is the time it takes for the



20 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

DAC to provide an analog output when the digital input word is changed. The MCP4291 DAC ? SPI
connections with LPC21xx have four I/O lines (P0.4 ? P0.7) required. The analog output is generated by
using these four lines.
Circuit diagram:


Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the embedded c programs for generating ramp wave and square wave using ARM LPC2148 are
written and executed successfully and the waveforms are viewed in oscilloscope.
Outcome:
Able to program the DAC in-built inside the ARM controller and get the waveforms using it.




21 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications :
1. DAC used in Audio amplifier.
2. Video encoder
3. Display electronics
4. Data Acquistion systems
5. Motor control



1. What are the features of LPC2148 DAC?
2. What is the function of DAC register?
3. Which pin provides a voltage reference level for the D/A converter?
4. What are the applications of DAC in signal processing applications?
5. What is GIO?
6. What is the resolution of a digital-to-analog converter (DAC)?
7. What is the major advantage of the R/2R ladder digital-to-analog (DAC), as compared to a binary-
weighted digital-to-analog DAC converter?
8. What is the resolution of a 0?5 V 6-bit digital-to-analog converter (DAC) ?
9. What are DAC configurations?
10. What are the different types of DAC Circuits?
11. What are the Limitations of the Binary Weighted DAC?
12. What are the General DAC Characteristics?
13. Define reference voltage in DAC.
14. What is full scale voltage?
15. What is settling time?
VIVA-VOCE




22 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 4 LED DIMMING USING PWM

Aim:
To write an embedded c program for implementing PWM using ARM controller and verify the same by
dimming of LEDs.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
LPC2148 supports 2 types of PWM:
1) Single Edge PWM ? Pulse starts with new Period i.e pulse is always at the beginning
2) Double Edge PWM ? Pulse can be anywhere within the Period
A PWM block, like a Timer block , has a Timer Counter and an associated Pre-scale Register along
with Match Registers. These work exactly the same way as in the case of Timers. Match Registers 1 to 6
(except 0) are pinned on LPC214x i.e. the corresponding outputs are diverted to actual Pins on LPC214x
MCU. The PWM function must be selected for these Pins to get the PWM output.
The basic setup is to simply replace Servo by a LED and no external 5V source is needed. The
anode of LED is connected to P0.0 and cathode to ground. Pulse Widths corresponding to the switches
connected to P0.1/2/3/4 will be 2.5ms/5ms/7.5ms/10ms respectively. As the Pulse Width Increases LED
will keep on getting brighter and the reverse will happen if Pulse Width is decreased.



23 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus embedded c program for implementing Pulse Width Modulation is written and executed and
output has been verified in LED display.
Outcome:
Able to implement PWM using the ARM controller and verify the same in the form of dimming of
LEDS.



24 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Applications :
1. In Visual signals to covey a message
2. Illumination where light is reflected from objects
3. In Narrow band sensors



1. What factors determine the LED dimming performance?
2. What is meant by analog dimming?
3. What is flickering effect?
4. What is the factor determines dimming of the LED
5. Why Silicon is not suitable for fabrication of light-emitting diodes?
6. Why Silicon diode is less suited for low voltage rectifier operation?
7. What is the principle of zener diode?
8. What are the materials used to make LED?
9. What type of diodes is used in FM receivers?
10. Which diode suffers an avalanche breakdown?
11. What happens if the junction temperature of LED is increased?
12. How a transfer characteristic of a diode does is related?
13. What is the requirement of a clipping action of a diode?
14. What type of rectifier circuit requires four diodes?
15. Why are the pulse width modulated outputs required in most of the applications?
16. How do the variations in an average value get affected by PWM period?
17. Name the common formats available for LED display.
18. What are the types of seven segment display?
19. What is PWM?
20. What are the applications of PWM?

Viva-voce




25 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 5 INTERFACING REAL TIME CLOCK
AND SERIAL PORT
Aim:
To write and execute an embedded c program to interface DS1307 RTC using I2C protocol with ARM
controller
Apparatus Required:
1. LPC2148 ARM development board
2. Stepper motor
3. Interfacing cables
4. PC
Theory:
A clock, which is based on the interrupts at preset intervals, is Real Time Clock (RTC). An interrupt
service routine executes on each timeout (overflow) of this clock. This timing device once started never
resets or never reloaded with another value. Once it is set, it is not modified later. It is used in a system to
save the time and date.













26 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the program for interfacing real time clock with ARM controller is written and executed and the
date and time are verified on the screen.
Outcome:
Able to interface real time clock DS1307 with ARM controller and thereby display date and time
Applications :
1. I2C In ARM and PIC microcontrollers
2. Used as serial communication protocol with MASTER and SLAVE operation.

27 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
27 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00




1. What is I2C and how does it work?
2. What are the features of I2C in LPC2148 ARM7 microcontroller?
3. What is the function of I2C0CONSET register?
4. What is I2C0STAT?
5. What is the function of I2C0 Data Register?
6. What is RTC?
7. List the advantages of RTC
8. Through which port the date and time is displayed in RTC?
9. What is a serial port?
10. List the registers used to transfer data in serial port.
11. List the modes used for data transmission.
12. What is a simplex mode?
13. Which pin is used to transmit a character?
14. What is the baud rate of serial port?
15. What is the disadvantage of RS-232C?














Viva-voce




28 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 6 INTERFACING KEYPAD AND LCD

Aim:
To write an embedded c program to interface 4 x 4 matrix keypad with ARM processor and display the
pressed key in an LCD.
Apparatus Required:
1. LPC2148 ARM development board
2. Interfacing cables
3. PC
Theory:

In matrix keypad, keys are connected in rows and columns. When any switch is pressed, rows and
columns come into contact, which is that detected by controller to identify which key has been pressed. A
4?4 matrix keypad consists of 4 rows and 4 columns. There is a switch connecting each row and column.
So the combinations of rows and columns make up the 16 inputs.Initially all the switches are open (not
connected). When any one button is pressed, the switch is closed (connected),hence there is a connection
between the row and column. The first 4 pins are connected to the column as INPUT. The other 4 pins are
connected to the row as OUTPUT. Matrix keypad is a good substitution to normal push button.












29 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Circuit Diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus program for interfacing matrix keypad with ARM controller is written and executed and the key
pressed is seen in the LCD.



30 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Outcome:
Able to interface keypad with ARM controller and see the pressed key in the LCD display.
Applications :
1. Used in password based door locking system
2. Security system with user changeable
3. Used in laptops, computer games
4. Used in portable video games and cell phones



1. What is Matrix keypad?
2. What is the concept behind keypad interface?
3. What are the functions of pull- up resistors?
4. What is key de bouncing?
5. List the steps involved when the key in a 4 x 4 keyboard matrix is being pressed.
6. What is the value obtained if no key is pressed?
7. What kind of interrupt is generated if a key has to be operated in an interrupt mode?
8. How will you identify that the key is pressed?
9. What are the steps involved in Keyboard Interfacing?
10. List the registers used to store the keyboard, display modes and other operations programmed by
CPU.
11. Name the mode when a data is entered from the left side of the display unit.
12. How many rows and columns are present in a 16 x 2 alphanumeric LCD?
13. How many data lines are there in a 16 x 2 alphanumeric LCD?
14. Which pin of the LCD is used for adjusting its contrast?
15. Which command of an LCD is used to shift the entire display to the right?
16. Which command is used to select the 2 lines and 5 x 7 matrix of an LCD?
17. What changes are to be made to send data to an LCD?
18. For reading operation from an LCD what changes in the software are introduced?
19. Which instruction is used to select the first row first column of an LCD?
Viva-voce

31 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
31 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Expt. No. 7 INTERFACING EEPROM AND INTERRUPT

Aim:
To write a program to interface EEPROM using I2C protocol with ARM controller and retrieve the stored
messages inside EEPROM.
Apparatus Required:
1. LPC2148 ARM development board
2. Interfacing cables
3. PC
Theory:
I2C (Inter Integrated Circuit):
The I2C (Inter-IC) bus is a bi-directional two-wire serial bus that provides a communication link between
integrated circuits (ICs).I2C is a synchronous protocol that allows a master device to initiate communication
with a slave device. Data is exchanged between these devices.
EEPROM:
EEPROM (electrically erasable programmable read-only memory) is user-modifiable read-only
memory (ROM) that can be erased and reprogrammed (written to) repeatedly through the application of
higher than normal electrical voltage. It is a type of non-volatile memory used in computers and other
electronic devices to store small amounts of data that must be saved when power is removed, e.g.,
calibration tables or device configuration
Read, write and Erase EEPROM by using I2C in LPC2148 Primer Board. Wiring up an I2C based
EEPROM to the I2C port is relatively simple. The basic operation of the I2C based EEPROM's is to send a
command, such as WRITE, followed by an address and the data. In WRITE operation, the EEPROM is
used to store the data. In LPC2148 Primer Kit, 2 nos. of EEPROM lines are controlled by I2C Enabled
drivers. I2C Lines serial clock SCL (P0.2), serial data SDA (P0.3) connected to the I2C based serial
EEPROM IC. The EEPROM read & write operations are done in LPC2148 Primer Kit by using these SDA &
SCL I2C lines.
32 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
32 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To down load and run this program: Refer General procedure given in Page No: 60
Result:
Thus, the program for interfacing I2C based EEPROM with ARM processor has been written and
executed successfully and the memory content is verified on Win x talk terminal.
Outcome:
Able to interface memory ICs with ARM controller and perform the read and write operations.



33 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications:
1. ROM used in toys,automobiles to store data when power is off
2. In calculators and peripheral devices
3. In laser printers
4. And also in embedded systems where program need not to be changed.


1. How does I2C protocol work?
2. What is EEPROM?
3. What is meant by master slave mode?
4. What is meant by non-volatile memory?
5. What is an interrupt?
6. How does an interrupt request works?
7. What is a nested interrupt?
8. What are the registers used for enabling an interrupt?
9. What is PROM?
10. What is EPROM?
11. What is mask ROM?
12. Which memory allows simultaneous read and write operations?
13. Which memory has the shortest access times?
14. Which interrupt has the highest priority?
15. What is non maskable interrupt?
16. Which is the first level of memory access by the microprocessor?
17. List the types of cache memories.
18. What is the use of an interrupt?
19. What is the use of converting an interrupt to threads in a microprocessor?
20. What are the bits used to control an external interrupts?


Viva-voce




34 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00










CYCLE 2 - EXPERIMENTS




35 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 8 IMPLEMENTATION OF MAILBOX FUNCTION
USING LPC2148
Aim:
To create a mailbox in Micro C/OS ? II using LPC2148 ARM Controller
Apparatus Required:
1. LPC2148 ARM development board
2. Interfacing cables
3. PC
Theory:
System or the user code can send a message by the core services. A typical mail message, also
known as the exchange of information, refers to a task or an ISR using a pointer variable, through the core
services to put a message (that is, a pointer) into the mailbox. Similarly, one or more tasks can receive this
message by the core services. The tasks sending and receiving the message promise that the content that
the pointer points to is just that piece of message.
The mailbox of CooCox CoOS is a typical message mailbox which is composed of two parts: one is
the information which expressed by a pointer of void; the other is the waiting list which composed of the
tasks waiting for this mailbox. The waiting list supports two kinds of sorting: FIFO and preemptive priority.
The sorting mode is determined by the user when creating the mailbox.
Procedure:
To Edit / Compile / generate Hex file: Refer General procedure in Page No: 58
To down load and run this program: Refer General procedure in Page No: 60
Result:
Thus, the mailbox was created in Micro C/OS ?II and implemented using LPC2148.
Outcome:
Able to understand the concept of mail box in embedded systems and its significance in real time
systems





36 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications:
1. Used in Acorn RISC PC700
2. Used in ZIPIT wireless messenger
3. Used in Meizu M6 MINI player


1. What is IPC?
2. Define Queue.
3. What are the different types of mail box functions?
4. What is half duplex mode?
5. How many synchronous and asynchronous modes are there in serial port?
6. List the bits used to generate serial port interrupt
7. What is branch prediction?
8. Mention any two features of ?C/OS ? II.
9. Write the function for creating task in ?C/OS ? II.
10. Mention any two support devices for ?C/OS ? II.
11. How many user tasks can be handled by ?C/OS ? II?



















Viva-voce




37 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 9 INTERRUPT PERFORMANCE
CHARACTERISTICSOF ARM AND FPGA

Aim:
To study the interrupt performance characteristics of ARM and FPGA by using ARM controller kit and
FPGA kit separately.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
External Interrupts:
An interrupt caused by an external source such as the computer operator, external sensor or
monitoring device, or another computer. Interrupts are special events that require immediate attention.
Interfacing External Interrupts with LPC2148:
When an external interrupt signal occurs in LPC2148 Primer Board, the message "LOW" will be
displayed on PC. The interrupt signal occurs using switches. When the switch is pressed to LOW, then the
external interrupt occurs. The Vectored Interrupt Controller (VIC) takes 32 interrupt request inputs and
programmable assigns them into 3 categories, FIQ, vectored IRQ, and non-vectored IRQ. The ARM7
LPC2148 Primer board has two numbers of External Interrupts, connected with I/O Port lines (P0.14 &
P0.15) as switches.







38 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00



Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60


39 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
39 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Result:
Thus the interrupt performance characteristics of ARM and FPGA are studied. On comparison, ARM
counts at slow speed because it consumes more instruction cycle and FPGA is more efficient for servicing
and processing external interrupt pulses.
Outcome:
Able to understand the performance characteristics of ARM and FPGA while dealing with
interrrupts
Applications:
1. Used in random logic and SPLDs
2. Used in cryptography and filtering
3. In medical imaging
4. In bioinformatics and voice recognition



1. When is an Interrupt Request received?
2. What is ISR?
3. How do you initialize interrupt?
4. What is Vectored Interrupt Controller?
5. What are the kinds of protection available for SRAMS ?
6. What is interrupt pipelining?
7. What is pipeline shutdown?
8. What is branch prediction?
9. What is the use of Neon Floating point engine?
10. What is the use of ?vectorize option?
11. What is PTM?
12. What is ITM?
13. What is ETM?
14. What is I2S interface?
15. What is the use of ?SWI? in ARM assembly?

Viva-voce




40 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 10 FLASHING OF LEDS
Aim:
To write and execute an embedded c program to display LEDs using LPC 2148 ARM controller
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
Theory:
LED (Light Emitting Diodes) is the most commonly used components, usually for displaying pins digital
states. Typical uses of LEDs include alarm devices, timers and confirmation of user input such as a mouse
click or keystroke. Interfacing LED with LPC2148 Flash a LED using LPC2148 Primer Board. It works by
turning ON a LED & then turning it OFF & then looping back to START. However the operating speed of
microcontroller is very high so the flashing frequency will also be very fast to be detected by human eye.
The ARM7 LPC2148 Primer board has eight numbers of point LEDs, connected with I/O Port lines (P1.16 ?
P1.23) to make port pins high.










41 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00



Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus program for flashing of LEDs is written and executed using ARM controller LPC2148.



42 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Outcome:
Able to interface LED lights via the input output port and control them
Applications:
1. In Illumination
2. As status indicators in equipments
3. Stadium displays and dynamic decorative displays



1. What is seven segment displays?
2. What are the different configurations of LED?
3. What is the function of GPIO?
4. What are the Pins which are used to connect LEDs?
5. How to identify 'Polarity' of LED?
6. Differentiate LED from LCD.
7. What is a use of Jumper?
8. How many numbers of LEDs present in Primer board?
9. Where LEDs are used?
10. What is the use of flash magic software?
11. Which port is used in ARM 7 processor kit?
12. Which diode suffers an avalanche breakdown?
13. What happens if the junction temperature of LED is increased?
14. What is an anti collision rate light?
15. What is fail-safe conditions






Viva-voce




43 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 11 STEPPER MOTOR INTERFACE WITH
ARM -7 LPC2148
Aim:
To write a program to interface stepper motor using ARM processor and control the movement of motor
in either directions.
Apparatus Required:
1. LPC2148 ARM development board
2. Stepper motor
3. Interfacing cables
4. PC
Theory:
A stepper motor can be viewed as a DC motor with number of poles (on both rotor and stator).
Additionally, soft magnetic material with many teeth on the rotor and stator cheaply multiplies the number of
poles (reluctance motor). Like an AC synchronous motor, it is ideally driven by sinusoidal current, allowing
a step less operation, but this puts some burden on the controller. When using an 8-bit digital controller,
256 micro steps per step are possible. As a digital-to-analog converter produces unwanted ohmic heat in
the controller, pulse-width modulation is used to regulate the mean current. Simpler models switch voltage
only for doing a step, thus needing an extra current limiter: for every step, they switch a single cable to the
motor.
The idea is to connect the output pins of the driver to 4 transistors. The transistor must be
grounded at the emitter and the driver pin must be connected to the base. Collector is connected to the coil
wire of the motor. Stepper motors are rated by the torque they produce. Synchronous electric motors using
soft magnetic materials (having a core) have the ability to provide position holding torque (called detent
torque, and sometimes included in the specifications) while not driven electrically. To achieve full rated
torque, the coils in a stepper motor must reach their full rated current during each step. The voltage rating
(if there is one) is almost meaningless. The motors also suffer from EMF, which means that once the coil is
turned off it starts to generate current because the motor is still rotating. There needs to be an explicit way
to handle this extra current in a circuit otherwise it can cause damage and affect performance of the motor.
44 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
44 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus stepper motor interface with ARM processor has been successfully implemented and the motor is
controlled in clockwise and anticlockwise direction.
Outcome:
Able to interface the stepper motor with ARM controller and thereby create some rotational
movements





45 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Applications:
3. Used for precise positioning with a motor
4. Used in hard disk drives, robotics
5. Used in telescopes and toys







1. Define GPIO.
2. What is the function of ULN2803?
3. How LPC2148 control stepper motor?
4. Which I/O port lines used to rotate stepper motor?
5. How stepper motor reacts for each pulse it receives?
6. What is serial communication?
7. What is parallel communication?
8. What is stepper motor & why it is named so?
9. How can be step angle is calculated?
10. What are the advantages and disadvantages of parallel communication?
11. What does instruction-pipelining mean?
12. What is the power supply required for ARM processor?
13. What is a unit for torque?
14. What is RPM rating for a DC motor?
15. What device that is used to obtain an accurate position control of rotating shafts in terms of steps?
Viva-voce

46 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
46 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Expt. No. 12 LM35 TEMPERATURE SENSOR INTERFACE
WITH ARM-7 LPC2148
Aim:
To write a program to interface of LM35 temperature sensor to on-chip ADC of ARM controller and
display the room temperature value on the screen.
Apparatus Required:
1. LPC2148 ARM development board
2. Temperature sensor
3. Interfacing cables
4. PC
Theory:
Temperature Sensor:
The LM35 series are precision integrated-circuit temperature sensors, whose output voltage is linearly
proportional to the Celsius (Centigrade) temperature. The output of the sensor is converted to digital output
that is easy to connect with microcontroller. Temperature sensor has three terminals and required
Maximum of 5.5 V supply. This type of sensor consists of a material that performs the operation according
to temperature to vary the resistance. This change of resistance is sensed by circuit and it calculates
temperature. When the voltage increases then the temperature also rises. We can see this operation by
using a diode.







47 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
47 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00


Circuit diagram:

48 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
48 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the program for interfacing temperature sensor with ARM controller is written and executed and
the temperature reading is seen on the monitor.
Outcome:
Able to interface different sensors with in-built ADC of the ARM processor and access the data
produced from them
Applications:
1. Used in Ovens, refrigerators
2. In HVAC environmental control
3. coolant or cylinder head temperatures
4. in the automotive industry to monitor air intake



1. What is LM35?
2. Define ISP.
3. How many Analog-to-Digital Converters available as an inner peripheral in LPC2148?
4. What is the main function of analog pin in LPC 2148?
5. What is the output voltage produced by LM35 for one degree temperature?
6. What is the difference between LM 34 and LM 35 sensors?
7. How many pins are available in LM35?
8. Why Vref is set of ADC0848 to 2.56 V if analog input is connected to the LM35?
9. What is operating the operating temperature range in LM35?
10. Why LM35 is used to Measure Temperature?
11. List the devices used to sense temperature.
12. What is the purpose of a thermocouple?
13. What is the output voltage of a thermocouple?
Viva-voce




49 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 13 IMPLEMENTATION OF WIRELESS
COMMUNICATION PROTOCOL
USING ZIGBEE WIRELESS MODULE
Aim:
To implement wireless communication protocol using zigbee wireless module with the help of ARM
processor
Apparatus required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. Zigbee module
5. PC
Theory:
ZigBee is a specification to suite high level communication protocols using small, low-power digital
radios based on an IEEE 802 standard for personal area networks. The ZigBee is the name of a wireless
protocol maintained by the IEEE 802.15 standard. This is a protocol specified for wireless Personal Area
Network (PAN) using low powered wireless transceivers. There are already wireless transmitter and
receiver modules which can do point to point communication. The Xbee is the brand name a wireless
transceiver device introduced by the Digi international which works on the ZigBee protocol and can form
PAN networks. They have an approximate range of 10 to 100 meters and are used in industries, scientific
fields, medical fields etc
Digi ZigBee:
The Digi Xbee 802.15.4 modules are the easiest to use, most reliable and cost-effective RF devices.
The 802.15.4 Xbee modules provide two friendly modes of communication - a simple serial method to
transmit/receive or a framed mode providing advanced features. These modules can communicate point to
point, from one point to a PC, or in a mesh network.



50 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
50 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Circuit diagram:


Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the wireless communication protocol using Zigbee wireless module is implemented using
LPC2148.
Outcome:
Able to form a wireless network using zigbee module and ARM controller




51 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications:
1. Used in traffic lights in non-urban areas
2. Used in building control systems
3. Used in asset tracking
4. Used in parking sensors




1. How many UART ports available in LPC2148?
2. What is the main function of voltage convertors in UART?
3. Why Zigbee based is preferred for wireless communication?
4. What is the IEEE standard for Zigbee protocol?
5. Write the two modes of communication are used in a ZigBee network.
6. What is the function of a scheduler?
7. Mention any two features of ?C/OS ? II.
8. Write the function for creating task in ?C/OS ? II.
9. Mention any two support devices for ?C/OS ? II.
10. How many user tasks can be handled by ?C/OS ? II?







Viva-voce




52 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

















ADDITIONAL EXPERIMENTS
53 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
53 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Expt. No. 14 BUZZER INTERFACE WITH ARM-7 LPC2148
Aim:
To write a program for buzzer interface with ARM processor and control its operation.
Apparatus required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
Theory:
Buzzer is an electronic device commonly used to produce sound. Light weight, simple construction and
low price make it usable in various applications like car/truck reversing indicator, computers, call bells etc.
Piezo buzzer is based on the inverse principle of piezo electricity discovered in 1880 by Jacques and Pierre
Curie. It is the phenomena of generating electricity when mechanical pressure is applied to certain
materials and the vice versa is also true. Such materials are called piezo electric materials. Piezo electric
materials are either naturally available or manmade. Piezo ceramic is class of manmade material, which
poses piezo electric effect and is widely used to make disc, the heart of piezo buzzer. When subjected to
an alternating electric field they stretch or compress, in accordance with the frequency of the signal thereby
producing sound.







54 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
54 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the program for interfacing buzzer with ARM processor is written and executed and output is
verified.
Outcome:
Able to interface devices such as buzzer, relay with ARM controller





55 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Applications:

1. In alarm devices and timers
2. In confirmation of user input such as mouse click or keystroke
3. Alarming Circuits
4. Communication equipments
5. Automobile electronics
6. Portable equipments, due to its compact size





1. Define Buzzer.
2. Which pin in ARM can be used to modulate Buzzer?
3. What is the function Flash magic software?
4. How the Buzzer can be disconnected in LPC2148?
5. How the volume of sound will be changed in Buzzer?
6. What is a buzzer
7. What are the applications of buzzer?
8. How buzzer is used in embedded system?
9. What is race round condition?
10. What is digital signal controller?
11. What are the features of buzzer circuit?
12. What is a semaphore?
13. What is mutexes?
14. What is the role of segment register?
15. What is watch dog timer?

Viva-voce

FirstRanker.com - FirstRanker's Choice
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00






?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING

VII SEMESTER - R 2013

EC6711 ? EMBEDDED LABORATORY






Name : _______________________________________
Register No : _______________________________________
Section : _______________________________________
LABORATORY MANUAL



2 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00




is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and
training.

? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different
levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on
heart and soul
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

To impart professional education integrated with human values to the younger generation, so as to
shape them as proficient and dedicated engineers, capable of providing comprehensive solutions to the
challenges in deploying technology for the service of humanity

? To educate the students with the state-of-art technologies to meet the growing challenges of the
electronics industry
? To carry out research through continuous interaction with research institutes and industry, on
advances in communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning,
innovation and ethical practices
VISION
VISION
MISSION
MISSION



3 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

PROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To provide students with a solid foundation in Mathematics, Science and fundamentals of
engineering, enabling them to apply, to find solutions for engineering problems and use this knowledge
to acquire higher education
2. Core Competence
To train the students in Electronics and Communication technologies so that they apply their
knowledge and training to compare, and to analyze various engineering industrial problems to find
solutions
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice which
enables them to find solutions for the real time problems in industry, and to design products
4. Professionalism
To inculcate professional and effective communication skills, leadership qualities and team spirit in
the students to make them multi-faceted personalities and develop their ability to relate engineering
issues to broader social context
5. Lifelong Learning/Ethics
To demonstrate and practice ethical and professional responsibilities in the industry and society in
the large, through commitment and lifelong learning needed for successful professional career


4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
PROGRAMME OUTCOMES (POs)
a) To demonstrate and apply knowledge of Mathematics, Science and engineering fundamentals in
Electronics and Communication Engineering field
b) To design a component, a system or a process to meet the specific needs within the realistic
constraints such as economics, environment, ethics, health, safety and manufacturability
c) To demonstrate the competency to use software tools for computation, simulation and testing of electronics
and communication engineering circuits
d) To identify, formulate and solve electronic and communication engineering problems
e) To demonstrate an ability to visualize and work on laboratory and multidisciplinary tasks
f) To function as a member or a leader in multidisciplinary activities
g) To communicate in verbal and written form with fellow engineers and society at large
h) To understand the impact of Electronics and Communication Engineering in the society and demonstrate
awareness of contemporary issues and commitment to give solutions exhibiting social responsibility
i) To demonstrate professional & ethical responsibilities
j) To exhibit confidence in self-education and ability for lifelong learning
k) To participate and succeed in competitive exams


5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
SYLLABUS

? Learn the working of ARM processor
? Understand the Building Blocks of Embedded Systems
? Learn the concept of memory map and memory interface
? Know the characteristics of Real Time Systems
? Write programs to interface memory, I/Os with processor
? Study the interrupt performance
LIST OF EXPERIMENTS:
1. Study of ARM evaluation system
2. Interfacing ADC and DAC
3. Interfacing LED and PWM
4. Interfacing real time clock and serial port
5. Interfacing keyboard and LCD
6. Interfacing EPROM and interrupt
7. Mailbox
8. Interrupt performance characteristics of ARM and FPGA
9. Flashing of LEDS
10. Interfacing stepper motor and temperature sensor
11. Implementing zigbee protocol with ARM



? Write programs in ARM for a specific Application
? Interface memory and Write programs related to memory operations
? Interface A/D and D/A convertors with ARM system
? Analyze the performance of interrupt
? Write programmes for interfacing keyboard, display, motor and sensor.
? Formulate a mini project using embedded system
COURSE OBJECTIVES
COURSE OUTCOMES
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
CONTENTS
Sl. No. Name of the Experiment Page No.
CYCLE 1 ? EXPERIMENTS
1
Study of ARM evaluation system 7
2
Analog to Digital Convertor interfacing 16
3
Generation of ramp and square wave using on-Chip DAC 19
4
LED dimming using PWM 22
5
Interfacing real time clock and serial port 25
6
Interfacing keypad and LCD 28
7
Interfacing EPROM and interrupt 31
CYCLE 2 ? EXPERIMENTS
8 Implementation of Mailbox Function using LPC 2148 35
9 Interrupt Performance Characteristics of Arm and FPGA 37
10 Flashing of LEDs 40
11 Stepper Motor Interface with ARM ? 7 LPC2148 43
12 LM35 Temperature Sensor Interface with ARM ? 7 LPC2148 47
13
Implementation of Wireless Communication Protocol using ZIGBEE Wireless
Module
50
ADDITIONAL EXPERIMENTS BEYOND THE SYYLABUS
14 Buzzer Interface with ARM ? 7 54
15 Relay interface with ARM? 7 57
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Expt. No. 1 STUDY OF ARM EVALUATION SYSTEM
Aim:
To study the building blocks of ARM7 system, its features, pin configuration and the components
required for functioning of ARM controller.
Architecture Overview:
A RISC-based computer design approach means ARM processors require significantly fewer transistors
than typical processors in average computers. This approach reduces cost, heat and power usage. These
are desirable traits for light, portable, battery-powered devices (smart phones, laptops, tablet and notepad
computers), and other embedded systems. A simpler design facilitates more efficient multi-core CPUs and
higher core counts at lower cost, providing higher processing power and improved energy efficiency for
servers and supercomputers.
In 2005, about 98% of all mobile phones sold used at least one ARM processor. The low power
consumption of ARM processors has made them very popular: 37 billion ARM processors have been
produced as of 2013, up from 10 billion in 2008. The ARM architecture (32-bit) is the most widely used
architecture in mobile devices, and most popular 32-bit one in embedded systems.
According to ARM Holdings, in 2010 alone, producers of chips based on ARM architectures
reported shipments of 6.1 billion ARM based processors, representing 95% of smart phones, 35% of digital
televisions and set-top boxes and 10% of mobile computers. It is the most widely used 32-bit instruction set
architecture in terms of quantity produced.
LPC 2148:
LPC2148 is the widely used IC from ARM-7 family. It is manufactured by Philips and it is pre-loaded
with many inbuilt peripherals making it more efficient and a reliable option for the beginners as well as high
end application developer.




8 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Features of LPC214x series controllers:
1. 8 to 40 kB of on-chip static RAM and 32 to 512 kB of on-chip flash program memory.128 bit wide
interface/accelerator enables high speed 60 MHz operation.
2. In-System/In-Application Programming (ISP/IAP) via on-chip boot-loader software. Single flash sector or
full chip erase in 400 ms and programming of 256 bytes in 1ms.
3. Embedded ICE RT and Embedded Trace interfaces offer real-time debugging with the on-chip Real
Monitor software and high speed tracing of instruction execution.
4. USB 2.0 Full Speed compliant Device Controller with 2 kB of endpoint RAM. In addition, the LPC2146/8
provides 8 kB of on-chip RAM accessible to USB by DMA.
5. One or two (LPC2141/2 vs. LPC2144/6/8) 10-bit A/D converters provide a total of 6/14analog inputs, with
conversion times as low as 2.44 us per channel.
6. Single 10-bit D/A converter provides variable analog output.
7. Two 32-bit timers/external event counters (with four capture and four compare channels each), PWM unit
(six outputs) and watchdog.
8. Low power real-time clock with independent power and dedicated 32 kHz clock input.
9. Multiple serial interfaces including two UARTs (16C550), two Fast I2C-bus (400 kbit/s), SPI and SSP with
buffering and variable data length capabilities.
10. Vectored interrupt controller with configurable priorities and vector addresses.
11. Up to 45 of 5 V tolerant fast general purpose I/O pins in a tiny LQFP64 package.
12. Up to nine edge or level sensitive external interrupt pins available.
13. On-chip integrated oscillator operates with an external crystal in range from 1 MHz to30 MHz and with
an external oscillator up to 50 MHz
14. Power saving modes include Idle and Power-down.
15. Individual enable/disable of peripheral functions as well as peripheral clock scaling for additional power
optimization.
16. Processor wake-up from Power-down mode via external interrupt, USB, Brown-Out Detect (BOD) or
Real-Time Clock (RTC).




9 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


First Step- Hardware Requirement:
Pin configuration of LPC 2148.

Hardware requirement of LPC2148:
1. LPC2148 need minimum below listed hardware to work properly
2. Power Supply
3. Crystal Oscillator
4. Reset Circuit
5. RTC crystal oscillator
6. UART
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Power Supply:
LPC2148 works on 3.3 V power supply. LM 117 can be used for generating 3.3 V supply. However,
basic peripherals like LCD, ULN 2003 (Motor Driver IC) etc. works on 5V. So AC mains supply is converted
into 5V using below mentioned circuit and after that LM 117 is used to convert 5V into 3.3V.
Block diagram of power Supply

Transformer: It is used to step down 230V AC to 9V AC supply and provides isolation between power grids
and circuit.
Rectifier: It is used to convert AC supply into DC.
Filter: It is used to reduce ripple factor of DC output available from rectifier end.
Regulator: It is used to regulate DC supply output.

11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Circuit Diagram:

Regulator IC 7805 is used to provide fix 5V dc supply.
LM 117 is used for generating 3.3V supply from 5V.

12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Calculations:

From the datasheet of LM117

Taking R 2= 240?, we get R 1=392?
Reset Circuit:
Reset button is essential in a system to avoid programming pitfalls and manually bring back the system
to the initialization mode. MCP 130T is a special IC used for providing stable RESET signal to LPC 2148.


13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Oscillator Circuit:

The value of capacitors C20 & C21 depends upon the frequency of crystal Y3. General circuit and
its equivalent circuit is as shown below.

14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Recommended values are as shown in table:

UART:
LPC 2148 has inbuilt ISP which means we can program it within the system using serial
communication on COM0. It has also COM1 for serial communication. MAX 232/233 IC must be used for
voltage logic conversion. Related connections are as given below.

Once the above listed circuit design is ready, we are ready to go further.



15 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Result:
ARM Evaluation system and the configuration of LPC2148 has been studied fully. The minimal setup
required for the functioning of the ARM processor is studied.
Outcomes:
1. Able to understand the ARM controller, its basic components inside and its features.
2. Able to know the components required for the working of ARM LPC2148

Applications:
ARM controller LPC2148 is used in no. of devices such as
1. Smart phones
2. Net books
3. E Readers
4. Digital TV
5. Home Gateways


1. What are the basic units of ARM 7?
2. What is the address system supported by ARM?
3. Define - RISC
4. What are the instructions used to access the memory in ARM?
5. What are the basic units of Microprocessor?
6. What is an Instruction?
7. What is clock cycle?
8. Define - Pipelining
9. What is cache miss?
10. What is meant by memory mapped I/O?
11. Define ? interrupt
12. What is meant by Exception?
13. What is meant by little ? endian mode?
14. What is meant by big ? endian mode?
15. What is the function of CPSR?
16. What is register - indirect addressing?
Viva-voce




16 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 2 ANALOG TO DIGITAL CONVERTOR
INTERFACING
Aim:
To write an embedded c program for interfacing an on chip ADC with LPC2148 ARM processor and
convert the given input voltage into corresponding decimal values.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. PC
Theory:
Analog to Digital converter (ADC) is a device that converts continuously varying analog signals from
instruments that monitor such conditions as movement, temperature, sound, etc., into binary code for the
computer. It may be either a single chip or can be one circuit within a chip. Analog to Digital conversion is
the process of changing continuously varying data, such as voltage, current, or shaft rotation, into discrete
digital quantities that represent the magnitude of the data compared to a standard or reference at the
moment the conversion is made. According to the method of conversion, ADCs can be classified into
Direct-Conversion ADCs, Successive Approximation ADCs, Integrating ADC and Sigma-Delta ADCs.
The LPC 2148 has 10-bit successive approximation analog to digital converter. Basic clocking for the
A/D converters is provided by the VPB clock. A programmable divider is included in each converter, to
scale this clock to the 4.5 MHz (max) clock needed by the successive approximation process. A fully
accurate conversion requires 11 of these clocks. The ADC cell can measure the voltage on any of the ADC
input signals. It is noted that these analog inputs are always connected to their pins, even if the Pin function
Select register assigns them to port pins. A simple self-test of the ADC can be done by driving these pins
as port outputs.



17 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Circuit diagram:




18 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus, an embedded c program for interfacing on-chip ADC with ARM processor is written and
executed. The decimal values of the converted voltage are seen in the WinXTalk screen.
Outcome:
Able to interface A/D convertors with ARM system and check its working by connecting an analog
quantity as input.
Applications:
1. ADC used in MODEM for converting analog signals to digital.
2. A fast video ADC in TV tuner cards
3. ADC used in digital storage oscilloscopes
4. Used in music reproduction technology.
5. Used in DSP if input is analog


1. What are the ADC operating modes in LPC2148?
2. What is meant by conversion time?
3. Why are internal ADCs preferred over external ADCs?
4. Why has 16-bit ADC more resolution than from 10-bit and 8-bit ADC?
5. What are ADC & its Resolution?
6. What is Burst conversion mode?
7. What is the function of A/D Control Register?
8. What is the function of A/D Global Data Register?
9. What is the function of A/D Status Register?
10. What is analog-to-digital (ADC) conversion error?
11. What is the function of Sample-and-hold circuits in analog-to digital converters?
12. What is the disadvantage of the flash analog-to digital converter?
Viva-voce




19 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 3 GENERATION OF RAMP AND SQUARE
WAVE USING ON-CHIP DAC
Aim:
To write and execute an embedded c program to generate ramp wave and square wave using on-chip
DAC of LPC2148 ARM controller.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
A digital-to-analog converter is a device for converting a digital signal into an analog signal (current or
voltage). Digital-to-Analog Converters are the interface between the abstract digital world and the analog
real world. Simple switches, a network of resistors, current sources or capacitors may be used to
implement this conversion. A DAC inputs a binary number and outputs an analog voltage or current signal.
The Microchip Technology Inc. MCP4921 is 2.7 ? 5.5V, low-power, 12-Bit Digital-to-Analog Converter
(DAC) with SPI interface. The MCP4921 DAC provides high accuracy and low noise performance for
industrial applications where calibration or compensation of signals is required. With an SPI connection
there is always one master device (usually a microcontroller) which controls the peripheral devices.
Typically there are three lines common to all the devices,
Master In Slave Out (MISO) ? The Slave line for sending data to the master,
Master Out Slave In (MOSI) ? The Master line for sending data to the peripherals,
Serial Clock (SCK) ? The clock pulses which synchronize data transmission generated by the
master and slave
Slave Select pin ? the pin on each device that the master can use to enable and disable specific
devices. When a device Slave Select pin is low, it communicates with the master. When it is high, it ignores
the master. In SPI, the clock signal is controlled by the master device LPC2148. All data is clocked in and
out using this pin. These lines need to be connected to the relevant pins on the LPC21xx processor. Any
unused GIO pin can be used for CS, instead pull this pin high. Conversion speed is the time it takes for the



20 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

DAC to provide an analog output when the digital input word is changed. The MCP4291 DAC ? SPI
connections with LPC21xx have four I/O lines (P0.4 ? P0.7) required. The analog output is generated by
using these four lines.
Circuit diagram:


Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the embedded c programs for generating ramp wave and square wave using ARM LPC2148 are
written and executed successfully and the waveforms are viewed in oscilloscope.
Outcome:
Able to program the DAC in-built inside the ARM controller and get the waveforms using it.




21 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications :
1. DAC used in Audio amplifier.
2. Video encoder
3. Display electronics
4. Data Acquistion systems
5. Motor control



1. What are the features of LPC2148 DAC?
2. What is the function of DAC register?
3. Which pin provides a voltage reference level for the D/A converter?
4. What are the applications of DAC in signal processing applications?
5. What is GIO?
6. What is the resolution of a digital-to-analog converter (DAC)?
7. What is the major advantage of the R/2R ladder digital-to-analog (DAC), as compared to a binary-
weighted digital-to-analog DAC converter?
8. What is the resolution of a 0?5 V 6-bit digital-to-analog converter (DAC) ?
9. What are DAC configurations?
10. What are the different types of DAC Circuits?
11. What are the Limitations of the Binary Weighted DAC?
12. What are the General DAC Characteristics?
13. Define reference voltage in DAC.
14. What is full scale voltage?
15. What is settling time?
VIVA-VOCE




22 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 4 LED DIMMING USING PWM

Aim:
To write an embedded c program for implementing PWM using ARM controller and verify the same by
dimming of LEDs.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
LPC2148 supports 2 types of PWM:
1) Single Edge PWM ? Pulse starts with new Period i.e pulse is always at the beginning
2) Double Edge PWM ? Pulse can be anywhere within the Period
A PWM block, like a Timer block , has a Timer Counter and an associated Pre-scale Register along
with Match Registers. These work exactly the same way as in the case of Timers. Match Registers 1 to 6
(except 0) are pinned on LPC214x i.e. the corresponding outputs are diverted to actual Pins on LPC214x
MCU. The PWM function must be selected for these Pins to get the PWM output.
The basic setup is to simply replace Servo by a LED and no external 5V source is needed. The
anode of LED is connected to P0.0 and cathode to ground. Pulse Widths corresponding to the switches
connected to P0.1/2/3/4 will be 2.5ms/5ms/7.5ms/10ms respectively. As the Pulse Width Increases LED
will keep on getting brighter and the reverse will happen if Pulse Width is decreased.



23 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus embedded c program for implementing Pulse Width Modulation is written and executed and
output has been verified in LED display.
Outcome:
Able to implement PWM using the ARM controller and verify the same in the form of dimming of
LEDS.



24 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Applications :
1. In Visual signals to covey a message
2. Illumination where light is reflected from objects
3. In Narrow band sensors



1. What factors determine the LED dimming performance?
2. What is meant by analog dimming?
3. What is flickering effect?
4. What is the factor determines dimming of the LED
5. Why Silicon is not suitable for fabrication of light-emitting diodes?
6. Why Silicon diode is less suited for low voltage rectifier operation?
7. What is the principle of zener diode?
8. What are the materials used to make LED?
9. What type of diodes is used in FM receivers?
10. Which diode suffers an avalanche breakdown?
11. What happens if the junction temperature of LED is increased?
12. How a transfer characteristic of a diode does is related?
13. What is the requirement of a clipping action of a diode?
14. What type of rectifier circuit requires four diodes?
15. Why are the pulse width modulated outputs required in most of the applications?
16. How do the variations in an average value get affected by PWM period?
17. Name the common formats available for LED display.
18. What are the types of seven segment display?
19. What is PWM?
20. What are the applications of PWM?

Viva-voce




25 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 5 INTERFACING REAL TIME CLOCK
AND SERIAL PORT
Aim:
To write and execute an embedded c program to interface DS1307 RTC using I2C protocol with ARM
controller
Apparatus Required:
1. LPC2148 ARM development board
2. Stepper motor
3. Interfacing cables
4. PC
Theory:
A clock, which is based on the interrupts at preset intervals, is Real Time Clock (RTC). An interrupt
service routine executes on each timeout (overflow) of this clock. This timing device once started never
resets or never reloaded with another value. Once it is set, it is not modified later. It is used in a system to
save the time and date.













26 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the program for interfacing real time clock with ARM controller is written and executed and the
date and time are verified on the screen.
Outcome:
Able to interface real time clock DS1307 with ARM controller and thereby display date and time
Applications :
1. I2C In ARM and PIC microcontrollers
2. Used as serial communication protocol with MASTER and SLAVE operation.

27 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
27 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00




1. What is I2C and how does it work?
2. What are the features of I2C in LPC2148 ARM7 microcontroller?
3. What is the function of I2C0CONSET register?
4. What is I2C0STAT?
5. What is the function of I2C0 Data Register?
6. What is RTC?
7. List the advantages of RTC
8. Through which port the date and time is displayed in RTC?
9. What is a serial port?
10. List the registers used to transfer data in serial port.
11. List the modes used for data transmission.
12. What is a simplex mode?
13. Which pin is used to transmit a character?
14. What is the baud rate of serial port?
15. What is the disadvantage of RS-232C?














Viva-voce




28 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 6 INTERFACING KEYPAD AND LCD

Aim:
To write an embedded c program to interface 4 x 4 matrix keypad with ARM processor and display the
pressed key in an LCD.
Apparatus Required:
1. LPC2148 ARM development board
2. Interfacing cables
3. PC
Theory:

In matrix keypad, keys are connected in rows and columns. When any switch is pressed, rows and
columns come into contact, which is that detected by controller to identify which key has been pressed. A
4?4 matrix keypad consists of 4 rows and 4 columns. There is a switch connecting each row and column.
So the combinations of rows and columns make up the 16 inputs.Initially all the switches are open (not
connected). When any one button is pressed, the switch is closed (connected),hence there is a connection
between the row and column. The first 4 pins are connected to the column as INPUT. The other 4 pins are
connected to the row as OUTPUT. Matrix keypad is a good substitution to normal push button.












29 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Circuit Diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus program for interfacing matrix keypad with ARM controller is written and executed and the key
pressed is seen in the LCD.



30 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Outcome:
Able to interface keypad with ARM controller and see the pressed key in the LCD display.
Applications :
1. Used in password based door locking system
2. Security system with user changeable
3. Used in laptops, computer games
4. Used in portable video games and cell phones



1. What is Matrix keypad?
2. What is the concept behind keypad interface?
3. What are the functions of pull- up resistors?
4. What is key de bouncing?
5. List the steps involved when the key in a 4 x 4 keyboard matrix is being pressed.
6. What is the value obtained if no key is pressed?
7. What kind of interrupt is generated if a key has to be operated in an interrupt mode?
8. How will you identify that the key is pressed?
9. What are the steps involved in Keyboard Interfacing?
10. List the registers used to store the keyboard, display modes and other operations programmed by
CPU.
11. Name the mode when a data is entered from the left side of the display unit.
12. How many rows and columns are present in a 16 x 2 alphanumeric LCD?
13. How many data lines are there in a 16 x 2 alphanumeric LCD?
14. Which pin of the LCD is used for adjusting its contrast?
15. Which command of an LCD is used to shift the entire display to the right?
16. Which command is used to select the 2 lines and 5 x 7 matrix of an LCD?
17. What changes are to be made to send data to an LCD?
18. For reading operation from an LCD what changes in the software are introduced?
19. Which instruction is used to select the first row first column of an LCD?
Viva-voce

31 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
31 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Expt. No. 7 INTERFACING EEPROM AND INTERRUPT

Aim:
To write a program to interface EEPROM using I2C protocol with ARM controller and retrieve the stored
messages inside EEPROM.
Apparatus Required:
1. LPC2148 ARM development board
2. Interfacing cables
3. PC
Theory:
I2C (Inter Integrated Circuit):
The I2C (Inter-IC) bus is a bi-directional two-wire serial bus that provides a communication link between
integrated circuits (ICs).I2C is a synchronous protocol that allows a master device to initiate communication
with a slave device. Data is exchanged between these devices.
EEPROM:
EEPROM (electrically erasable programmable read-only memory) is user-modifiable read-only
memory (ROM) that can be erased and reprogrammed (written to) repeatedly through the application of
higher than normal electrical voltage. It is a type of non-volatile memory used in computers and other
electronic devices to store small amounts of data that must be saved when power is removed, e.g.,
calibration tables or device configuration
Read, write and Erase EEPROM by using I2C in LPC2148 Primer Board. Wiring up an I2C based
EEPROM to the I2C port is relatively simple. The basic operation of the I2C based EEPROM's is to send a
command, such as WRITE, followed by an address and the data. In WRITE operation, the EEPROM is
used to store the data. In LPC2148 Primer Kit, 2 nos. of EEPROM lines are controlled by I2C Enabled
drivers. I2C Lines serial clock SCL (P0.2), serial data SDA (P0.3) connected to the I2C based serial
EEPROM IC. The EEPROM read & write operations are done in LPC2148 Primer Kit by using these SDA &
SCL I2C lines.
32 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
32 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To down load and run this program: Refer General procedure given in Page No: 60
Result:
Thus, the program for interfacing I2C based EEPROM with ARM processor has been written and
executed successfully and the memory content is verified on Win x talk terminal.
Outcome:
Able to interface memory ICs with ARM controller and perform the read and write operations.



33 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications:
1. ROM used in toys,automobiles to store data when power is off
2. In calculators and peripheral devices
3. In laser printers
4. And also in embedded systems where program need not to be changed.


1. How does I2C protocol work?
2. What is EEPROM?
3. What is meant by master slave mode?
4. What is meant by non-volatile memory?
5. What is an interrupt?
6. How does an interrupt request works?
7. What is a nested interrupt?
8. What are the registers used for enabling an interrupt?
9. What is PROM?
10. What is EPROM?
11. What is mask ROM?
12. Which memory allows simultaneous read and write operations?
13. Which memory has the shortest access times?
14. Which interrupt has the highest priority?
15. What is non maskable interrupt?
16. Which is the first level of memory access by the microprocessor?
17. List the types of cache memories.
18. What is the use of an interrupt?
19. What is the use of converting an interrupt to threads in a microprocessor?
20. What are the bits used to control an external interrupts?


Viva-voce




34 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00










CYCLE 2 - EXPERIMENTS




35 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 8 IMPLEMENTATION OF MAILBOX FUNCTION
USING LPC2148
Aim:
To create a mailbox in Micro C/OS ? II using LPC2148 ARM Controller
Apparatus Required:
1. LPC2148 ARM development board
2. Interfacing cables
3. PC
Theory:
System or the user code can send a message by the core services. A typical mail message, also
known as the exchange of information, refers to a task or an ISR using a pointer variable, through the core
services to put a message (that is, a pointer) into the mailbox. Similarly, one or more tasks can receive this
message by the core services. The tasks sending and receiving the message promise that the content that
the pointer points to is just that piece of message.
The mailbox of CooCox CoOS is a typical message mailbox which is composed of two parts: one is
the information which expressed by a pointer of void; the other is the waiting list which composed of the
tasks waiting for this mailbox. The waiting list supports two kinds of sorting: FIFO and preemptive priority.
The sorting mode is determined by the user when creating the mailbox.
Procedure:
To Edit / Compile / generate Hex file: Refer General procedure in Page No: 58
To down load and run this program: Refer General procedure in Page No: 60
Result:
Thus, the mailbox was created in Micro C/OS ?II and implemented using LPC2148.
Outcome:
Able to understand the concept of mail box in embedded systems and its significance in real time
systems





36 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications:
1. Used in Acorn RISC PC700
2. Used in ZIPIT wireless messenger
3. Used in Meizu M6 MINI player


1. What is IPC?
2. Define Queue.
3. What are the different types of mail box functions?
4. What is half duplex mode?
5. How many synchronous and asynchronous modes are there in serial port?
6. List the bits used to generate serial port interrupt
7. What is branch prediction?
8. Mention any two features of ?C/OS ? II.
9. Write the function for creating task in ?C/OS ? II.
10. Mention any two support devices for ?C/OS ? II.
11. How many user tasks can be handled by ?C/OS ? II?



















Viva-voce




37 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 9 INTERRUPT PERFORMANCE
CHARACTERISTICSOF ARM AND FPGA

Aim:
To study the interrupt performance characteristics of ARM and FPGA by using ARM controller kit and
FPGA kit separately.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
External Interrupts:
An interrupt caused by an external source such as the computer operator, external sensor or
monitoring device, or another computer. Interrupts are special events that require immediate attention.
Interfacing External Interrupts with LPC2148:
When an external interrupt signal occurs in LPC2148 Primer Board, the message "LOW" will be
displayed on PC. The interrupt signal occurs using switches. When the switch is pressed to LOW, then the
external interrupt occurs. The Vectored Interrupt Controller (VIC) takes 32 interrupt request inputs and
programmable assigns them into 3 categories, FIQ, vectored IRQ, and non-vectored IRQ. The ARM7
LPC2148 Primer board has two numbers of External Interrupts, connected with I/O Port lines (P0.14 &
P0.15) as switches.







38 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00



Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60


39 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
39 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Result:
Thus the interrupt performance characteristics of ARM and FPGA are studied. On comparison, ARM
counts at slow speed because it consumes more instruction cycle and FPGA is more efficient for servicing
and processing external interrupt pulses.
Outcome:
Able to understand the performance characteristics of ARM and FPGA while dealing with
interrrupts
Applications:
1. Used in random logic and SPLDs
2. Used in cryptography and filtering
3. In medical imaging
4. In bioinformatics and voice recognition



1. When is an Interrupt Request received?
2. What is ISR?
3. How do you initialize interrupt?
4. What is Vectored Interrupt Controller?
5. What are the kinds of protection available for SRAMS ?
6. What is interrupt pipelining?
7. What is pipeline shutdown?
8. What is branch prediction?
9. What is the use of Neon Floating point engine?
10. What is the use of ?vectorize option?
11. What is PTM?
12. What is ITM?
13. What is ETM?
14. What is I2S interface?
15. What is the use of ?SWI? in ARM assembly?

Viva-voce




40 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 10 FLASHING OF LEDS
Aim:
To write and execute an embedded c program to display LEDs using LPC 2148 ARM controller
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
Theory:
LED (Light Emitting Diodes) is the most commonly used components, usually for displaying pins digital
states. Typical uses of LEDs include alarm devices, timers and confirmation of user input such as a mouse
click or keystroke. Interfacing LED with LPC2148 Flash a LED using LPC2148 Primer Board. It works by
turning ON a LED & then turning it OFF & then looping back to START. However the operating speed of
microcontroller is very high so the flashing frequency will also be very fast to be detected by human eye.
The ARM7 LPC2148 Primer board has eight numbers of point LEDs, connected with I/O Port lines (P1.16 ?
P1.23) to make port pins high.










41 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00



Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus program for flashing of LEDs is written and executed using ARM controller LPC2148.



42 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Outcome:
Able to interface LED lights via the input output port and control them
Applications:
1. In Illumination
2. As status indicators in equipments
3. Stadium displays and dynamic decorative displays



1. What is seven segment displays?
2. What are the different configurations of LED?
3. What is the function of GPIO?
4. What are the Pins which are used to connect LEDs?
5. How to identify 'Polarity' of LED?
6. Differentiate LED from LCD.
7. What is a use of Jumper?
8. How many numbers of LEDs present in Primer board?
9. Where LEDs are used?
10. What is the use of flash magic software?
11. Which port is used in ARM 7 processor kit?
12. Which diode suffers an avalanche breakdown?
13. What happens if the junction temperature of LED is increased?
14. What is an anti collision rate light?
15. What is fail-safe conditions






Viva-voce




43 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 11 STEPPER MOTOR INTERFACE WITH
ARM -7 LPC2148
Aim:
To write a program to interface stepper motor using ARM processor and control the movement of motor
in either directions.
Apparatus Required:
1. LPC2148 ARM development board
2. Stepper motor
3. Interfacing cables
4. PC
Theory:
A stepper motor can be viewed as a DC motor with number of poles (on both rotor and stator).
Additionally, soft magnetic material with many teeth on the rotor and stator cheaply multiplies the number of
poles (reluctance motor). Like an AC synchronous motor, it is ideally driven by sinusoidal current, allowing
a step less operation, but this puts some burden on the controller. When using an 8-bit digital controller,
256 micro steps per step are possible. As a digital-to-analog converter produces unwanted ohmic heat in
the controller, pulse-width modulation is used to regulate the mean current. Simpler models switch voltage
only for doing a step, thus needing an extra current limiter: for every step, they switch a single cable to the
motor.
The idea is to connect the output pins of the driver to 4 transistors. The transistor must be
grounded at the emitter and the driver pin must be connected to the base. Collector is connected to the coil
wire of the motor. Stepper motors are rated by the torque they produce. Synchronous electric motors using
soft magnetic materials (having a core) have the ability to provide position holding torque (called detent
torque, and sometimes included in the specifications) while not driven electrically. To achieve full rated
torque, the coils in a stepper motor must reach their full rated current during each step. The voltage rating
(if there is one) is almost meaningless. The motors also suffer from EMF, which means that once the coil is
turned off it starts to generate current because the motor is still rotating. There needs to be an explicit way
to handle this extra current in a circuit otherwise it can cause damage and affect performance of the motor.
44 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
44 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus stepper motor interface with ARM processor has been successfully implemented and the motor is
controlled in clockwise and anticlockwise direction.
Outcome:
Able to interface the stepper motor with ARM controller and thereby create some rotational
movements





45 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Applications:
3. Used for precise positioning with a motor
4. Used in hard disk drives, robotics
5. Used in telescopes and toys







1. Define GPIO.
2. What is the function of ULN2803?
3. How LPC2148 control stepper motor?
4. Which I/O port lines used to rotate stepper motor?
5. How stepper motor reacts for each pulse it receives?
6. What is serial communication?
7. What is parallel communication?
8. What is stepper motor & why it is named so?
9. How can be step angle is calculated?
10. What are the advantages and disadvantages of parallel communication?
11. What does instruction-pipelining mean?
12. What is the power supply required for ARM processor?
13. What is a unit for torque?
14. What is RPM rating for a DC motor?
15. What device that is used to obtain an accurate position control of rotating shafts in terms of steps?
Viva-voce

46 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
46 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Expt. No. 12 LM35 TEMPERATURE SENSOR INTERFACE
WITH ARM-7 LPC2148
Aim:
To write a program to interface of LM35 temperature sensor to on-chip ADC of ARM controller and
display the room temperature value on the screen.
Apparatus Required:
1. LPC2148 ARM development board
2. Temperature sensor
3. Interfacing cables
4. PC
Theory:
Temperature Sensor:
The LM35 series are precision integrated-circuit temperature sensors, whose output voltage is linearly
proportional to the Celsius (Centigrade) temperature. The output of the sensor is converted to digital output
that is easy to connect with microcontroller. Temperature sensor has three terminals and required
Maximum of 5.5 V supply. This type of sensor consists of a material that performs the operation according
to temperature to vary the resistance. This change of resistance is sensed by circuit and it calculates
temperature. When the voltage increases then the temperature also rises. We can see this operation by
using a diode.







47 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
47 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00


Circuit diagram:

48 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
48 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the program for interfacing temperature sensor with ARM controller is written and executed and
the temperature reading is seen on the monitor.
Outcome:
Able to interface different sensors with in-built ADC of the ARM processor and access the data
produced from them
Applications:
1. Used in Ovens, refrigerators
2. In HVAC environmental control
3. coolant or cylinder head temperatures
4. in the automotive industry to monitor air intake



1. What is LM35?
2. Define ISP.
3. How many Analog-to-Digital Converters available as an inner peripheral in LPC2148?
4. What is the main function of analog pin in LPC 2148?
5. What is the output voltage produced by LM35 for one degree temperature?
6. What is the difference between LM 34 and LM 35 sensors?
7. How many pins are available in LM35?
8. Why Vref is set of ADC0848 to 2.56 V if analog input is connected to the LM35?
9. What is operating the operating temperature range in LM35?
10. Why LM35 is used to Measure Temperature?
11. List the devices used to sense temperature.
12. What is the purpose of a thermocouple?
13. What is the output voltage of a thermocouple?
Viva-voce




49 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 13 IMPLEMENTATION OF WIRELESS
COMMUNICATION PROTOCOL
USING ZIGBEE WIRELESS MODULE
Aim:
To implement wireless communication protocol using zigbee wireless module with the help of ARM
processor
Apparatus required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. Zigbee module
5. PC
Theory:
ZigBee is a specification to suite high level communication protocols using small, low-power digital
radios based on an IEEE 802 standard for personal area networks. The ZigBee is the name of a wireless
protocol maintained by the IEEE 802.15 standard. This is a protocol specified for wireless Personal Area
Network (PAN) using low powered wireless transceivers. There are already wireless transmitter and
receiver modules which can do point to point communication. The Xbee is the brand name a wireless
transceiver device introduced by the Digi international which works on the ZigBee protocol and can form
PAN networks. They have an approximate range of 10 to 100 meters and are used in industries, scientific
fields, medical fields etc
Digi ZigBee:
The Digi Xbee 802.15.4 modules are the easiest to use, most reliable and cost-effective RF devices.
The 802.15.4 Xbee modules provide two friendly modes of communication - a simple serial method to
transmit/receive or a framed mode providing advanced features. These modules can communicate point to
point, from one point to a PC, or in a mesh network.



50 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
50 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Circuit diagram:


Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the wireless communication protocol using Zigbee wireless module is implemented using
LPC2148.
Outcome:
Able to form a wireless network using zigbee module and ARM controller




51 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications:
1. Used in traffic lights in non-urban areas
2. Used in building control systems
3. Used in asset tracking
4. Used in parking sensors




1. How many UART ports available in LPC2148?
2. What is the main function of voltage convertors in UART?
3. Why Zigbee based is preferred for wireless communication?
4. What is the IEEE standard for Zigbee protocol?
5. Write the two modes of communication are used in a ZigBee network.
6. What is the function of a scheduler?
7. Mention any two features of ?C/OS ? II.
8. Write the function for creating task in ?C/OS ? II.
9. Mention any two support devices for ?C/OS ? II.
10. How many user tasks can be handled by ?C/OS ? II?







Viva-voce




52 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

















ADDITIONAL EXPERIMENTS
53 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
53 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Expt. No. 14 BUZZER INTERFACE WITH ARM-7 LPC2148
Aim:
To write a program for buzzer interface with ARM processor and control its operation.
Apparatus required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
Theory:
Buzzer is an electronic device commonly used to produce sound. Light weight, simple construction and
low price make it usable in various applications like car/truck reversing indicator, computers, call bells etc.
Piezo buzzer is based on the inverse principle of piezo electricity discovered in 1880 by Jacques and Pierre
Curie. It is the phenomena of generating electricity when mechanical pressure is applied to certain
materials and the vice versa is also true. Such materials are called piezo electric materials. Piezo electric
materials are either naturally available or manmade. Piezo ceramic is class of manmade material, which
poses piezo electric effect and is widely used to make disc, the heart of piezo buzzer. When subjected to
an alternating electric field they stretch or compress, in accordance with the frequency of the signal thereby
producing sound.







54 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
54 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the program for interfacing buzzer with ARM processor is written and executed and output is
verified.
Outcome:
Able to interface devices such as buzzer, relay with ARM controller





55 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Applications:

1. In alarm devices and timers
2. In confirmation of user input such as mouse click or keystroke
3. Alarming Circuits
4. Communication equipments
5. Automobile electronics
6. Portable equipments, due to its compact size





1. Define Buzzer.
2. Which pin in ARM can be used to modulate Buzzer?
3. What is the function Flash magic software?
4. How the Buzzer can be disconnected in LPC2148?
5. How the volume of sound will be changed in Buzzer?
6. What is a buzzer
7. What are the applications of buzzer?
8. How buzzer is used in embedded system?
9. What is race round condition?
10. What is digital signal controller?
11. What are the features of buzzer circuit?
12. What is a semaphore?
13. What is mutexes?
14. What is the role of segment register?
15. What is watch dog timer?

Viva-voce

56 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
56 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Expt. No. 15 RELAY INTERFACE WITH ARM - 7
Aim:
To write a program to interface 2 relays with LPC 2148 ARM Controller and verify its working.
Apparatus required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
Theory:
A relay is an electrically operated switch. Many relays use an electromagnet to mechanically operate a
switch, but other operating principles are also used, such as solid-state relays. Relays are used where it is
necessary to control a circuit by a low-power signal (with complete electrical isolation between control and
controlled circuits), or where several circuits must be controlled by one signal. The first relays were used in
long distance telegraph circuits as amplifiers: they repeated the signal coming in from one circuit and re-
transmitted it on another circuit. Relays were used extensively in telephone exchanges and early
computers to perform logical operations.
FirstRanker.com - FirstRanker's Choice
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00






?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING

VII SEMESTER - R 2013

EC6711 ? EMBEDDED LABORATORY






Name : _______________________________________
Register No : _______________________________________
Section : _______________________________________
LABORATORY MANUAL



2 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00




is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and
training.

? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different
levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on
heart and soul
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

To impart professional education integrated with human values to the younger generation, so as to
shape them as proficient and dedicated engineers, capable of providing comprehensive solutions to the
challenges in deploying technology for the service of humanity

? To educate the students with the state-of-art technologies to meet the growing challenges of the
electronics industry
? To carry out research through continuous interaction with research institutes and industry, on
advances in communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning,
innovation and ethical practices
VISION
VISION
MISSION
MISSION



3 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

PROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To provide students with a solid foundation in Mathematics, Science and fundamentals of
engineering, enabling them to apply, to find solutions for engineering problems and use this knowledge
to acquire higher education
2. Core Competence
To train the students in Electronics and Communication technologies so that they apply their
knowledge and training to compare, and to analyze various engineering industrial problems to find
solutions
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice which
enables them to find solutions for the real time problems in industry, and to design products
4. Professionalism
To inculcate professional and effective communication skills, leadership qualities and team spirit in
the students to make them multi-faceted personalities and develop their ability to relate engineering
issues to broader social context
5. Lifelong Learning/Ethics
To demonstrate and practice ethical and professional responsibilities in the industry and society in
the large, through commitment and lifelong learning needed for successful professional career


4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
PROGRAMME OUTCOMES (POs)
a) To demonstrate and apply knowledge of Mathematics, Science and engineering fundamentals in
Electronics and Communication Engineering field
b) To design a component, a system or a process to meet the specific needs within the realistic
constraints such as economics, environment, ethics, health, safety and manufacturability
c) To demonstrate the competency to use software tools for computation, simulation and testing of electronics
and communication engineering circuits
d) To identify, formulate and solve electronic and communication engineering problems
e) To demonstrate an ability to visualize and work on laboratory and multidisciplinary tasks
f) To function as a member or a leader in multidisciplinary activities
g) To communicate in verbal and written form with fellow engineers and society at large
h) To understand the impact of Electronics and Communication Engineering in the society and demonstrate
awareness of contemporary issues and commitment to give solutions exhibiting social responsibility
i) To demonstrate professional & ethical responsibilities
j) To exhibit confidence in self-education and ability for lifelong learning
k) To participate and succeed in competitive exams


5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
SYLLABUS

? Learn the working of ARM processor
? Understand the Building Blocks of Embedded Systems
? Learn the concept of memory map and memory interface
? Know the characteristics of Real Time Systems
? Write programs to interface memory, I/Os with processor
? Study the interrupt performance
LIST OF EXPERIMENTS:
1. Study of ARM evaluation system
2. Interfacing ADC and DAC
3. Interfacing LED and PWM
4. Interfacing real time clock and serial port
5. Interfacing keyboard and LCD
6. Interfacing EPROM and interrupt
7. Mailbox
8. Interrupt performance characteristics of ARM and FPGA
9. Flashing of LEDS
10. Interfacing stepper motor and temperature sensor
11. Implementing zigbee protocol with ARM



? Write programs in ARM for a specific Application
? Interface memory and Write programs related to memory operations
? Interface A/D and D/A convertors with ARM system
? Analyze the performance of interrupt
? Write programmes for interfacing keyboard, display, motor and sensor.
? Formulate a mini project using embedded system
COURSE OBJECTIVES
COURSE OUTCOMES
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
CONTENTS
Sl. No. Name of the Experiment Page No.
CYCLE 1 ? EXPERIMENTS
1
Study of ARM evaluation system 7
2
Analog to Digital Convertor interfacing 16
3
Generation of ramp and square wave using on-Chip DAC 19
4
LED dimming using PWM 22
5
Interfacing real time clock and serial port 25
6
Interfacing keypad and LCD 28
7
Interfacing EPROM and interrupt 31
CYCLE 2 ? EXPERIMENTS
8 Implementation of Mailbox Function using LPC 2148 35
9 Interrupt Performance Characteristics of Arm and FPGA 37
10 Flashing of LEDs 40
11 Stepper Motor Interface with ARM ? 7 LPC2148 43
12 LM35 Temperature Sensor Interface with ARM ? 7 LPC2148 47
13
Implementation of Wireless Communication Protocol using ZIGBEE Wireless
Module
50
ADDITIONAL EXPERIMENTS BEYOND THE SYYLABUS
14 Buzzer Interface with ARM ? 7 54
15 Relay interface with ARM? 7 57
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Expt. No. 1 STUDY OF ARM EVALUATION SYSTEM
Aim:
To study the building blocks of ARM7 system, its features, pin configuration and the components
required for functioning of ARM controller.
Architecture Overview:
A RISC-based computer design approach means ARM processors require significantly fewer transistors
than typical processors in average computers. This approach reduces cost, heat and power usage. These
are desirable traits for light, portable, battery-powered devices (smart phones, laptops, tablet and notepad
computers), and other embedded systems. A simpler design facilitates more efficient multi-core CPUs and
higher core counts at lower cost, providing higher processing power and improved energy efficiency for
servers and supercomputers.
In 2005, about 98% of all mobile phones sold used at least one ARM processor. The low power
consumption of ARM processors has made them very popular: 37 billion ARM processors have been
produced as of 2013, up from 10 billion in 2008. The ARM architecture (32-bit) is the most widely used
architecture in mobile devices, and most popular 32-bit one in embedded systems.
According to ARM Holdings, in 2010 alone, producers of chips based on ARM architectures
reported shipments of 6.1 billion ARM based processors, representing 95% of smart phones, 35% of digital
televisions and set-top boxes and 10% of mobile computers. It is the most widely used 32-bit instruction set
architecture in terms of quantity produced.
LPC 2148:
LPC2148 is the widely used IC from ARM-7 family. It is manufactured by Philips and it is pre-loaded
with many inbuilt peripherals making it more efficient and a reliable option for the beginners as well as high
end application developer.




8 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Features of LPC214x series controllers:
1. 8 to 40 kB of on-chip static RAM and 32 to 512 kB of on-chip flash program memory.128 bit wide
interface/accelerator enables high speed 60 MHz operation.
2. In-System/In-Application Programming (ISP/IAP) via on-chip boot-loader software. Single flash sector or
full chip erase in 400 ms and programming of 256 bytes in 1ms.
3. Embedded ICE RT and Embedded Trace interfaces offer real-time debugging with the on-chip Real
Monitor software and high speed tracing of instruction execution.
4. USB 2.0 Full Speed compliant Device Controller with 2 kB of endpoint RAM. In addition, the LPC2146/8
provides 8 kB of on-chip RAM accessible to USB by DMA.
5. One or two (LPC2141/2 vs. LPC2144/6/8) 10-bit A/D converters provide a total of 6/14analog inputs, with
conversion times as low as 2.44 us per channel.
6. Single 10-bit D/A converter provides variable analog output.
7. Two 32-bit timers/external event counters (with four capture and four compare channels each), PWM unit
(six outputs) and watchdog.
8. Low power real-time clock with independent power and dedicated 32 kHz clock input.
9. Multiple serial interfaces including two UARTs (16C550), two Fast I2C-bus (400 kbit/s), SPI and SSP with
buffering and variable data length capabilities.
10. Vectored interrupt controller with configurable priorities and vector addresses.
11. Up to 45 of 5 V tolerant fast general purpose I/O pins in a tiny LQFP64 package.
12. Up to nine edge or level sensitive external interrupt pins available.
13. On-chip integrated oscillator operates with an external crystal in range from 1 MHz to30 MHz and with
an external oscillator up to 50 MHz
14. Power saving modes include Idle and Power-down.
15. Individual enable/disable of peripheral functions as well as peripheral clock scaling for additional power
optimization.
16. Processor wake-up from Power-down mode via external interrupt, USB, Brown-Out Detect (BOD) or
Real-Time Clock (RTC).




9 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


First Step- Hardware Requirement:
Pin configuration of LPC 2148.

Hardware requirement of LPC2148:
1. LPC2148 need minimum below listed hardware to work properly
2. Power Supply
3. Crystal Oscillator
4. Reset Circuit
5. RTC crystal oscillator
6. UART
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Power Supply:
LPC2148 works on 3.3 V power supply. LM 117 can be used for generating 3.3 V supply. However,
basic peripherals like LCD, ULN 2003 (Motor Driver IC) etc. works on 5V. So AC mains supply is converted
into 5V using below mentioned circuit and after that LM 117 is used to convert 5V into 3.3V.
Block diagram of power Supply

Transformer: It is used to step down 230V AC to 9V AC supply and provides isolation between power grids
and circuit.
Rectifier: It is used to convert AC supply into DC.
Filter: It is used to reduce ripple factor of DC output available from rectifier end.
Regulator: It is used to regulate DC supply output.

11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Circuit Diagram:

Regulator IC 7805 is used to provide fix 5V dc supply.
LM 117 is used for generating 3.3V supply from 5V.

12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Calculations:

From the datasheet of LM117

Taking R 2= 240?, we get R 1=392?
Reset Circuit:
Reset button is essential in a system to avoid programming pitfalls and manually bring back the system
to the initialization mode. MCP 130T is a special IC used for providing stable RESET signal to LPC 2148.


13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Oscillator Circuit:

The value of capacitors C20 & C21 depends upon the frequency of crystal Y3. General circuit and
its equivalent circuit is as shown below.

14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Recommended values are as shown in table:

UART:
LPC 2148 has inbuilt ISP which means we can program it within the system using serial
communication on COM0. It has also COM1 for serial communication. MAX 232/233 IC must be used for
voltage logic conversion. Related connections are as given below.

Once the above listed circuit design is ready, we are ready to go further.



15 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Result:
ARM Evaluation system and the configuration of LPC2148 has been studied fully. The minimal setup
required for the functioning of the ARM processor is studied.
Outcomes:
1. Able to understand the ARM controller, its basic components inside and its features.
2. Able to know the components required for the working of ARM LPC2148

Applications:
ARM controller LPC2148 is used in no. of devices such as
1. Smart phones
2. Net books
3. E Readers
4. Digital TV
5. Home Gateways


1. What are the basic units of ARM 7?
2. What is the address system supported by ARM?
3. Define - RISC
4. What are the instructions used to access the memory in ARM?
5. What are the basic units of Microprocessor?
6. What is an Instruction?
7. What is clock cycle?
8. Define - Pipelining
9. What is cache miss?
10. What is meant by memory mapped I/O?
11. Define ? interrupt
12. What is meant by Exception?
13. What is meant by little ? endian mode?
14. What is meant by big ? endian mode?
15. What is the function of CPSR?
16. What is register - indirect addressing?
Viva-voce




16 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 2 ANALOG TO DIGITAL CONVERTOR
INTERFACING
Aim:
To write an embedded c program for interfacing an on chip ADC with LPC2148 ARM processor and
convert the given input voltage into corresponding decimal values.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. PC
Theory:
Analog to Digital converter (ADC) is a device that converts continuously varying analog signals from
instruments that monitor such conditions as movement, temperature, sound, etc., into binary code for the
computer. It may be either a single chip or can be one circuit within a chip. Analog to Digital conversion is
the process of changing continuously varying data, such as voltage, current, or shaft rotation, into discrete
digital quantities that represent the magnitude of the data compared to a standard or reference at the
moment the conversion is made. According to the method of conversion, ADCs can be classified into
Direct-Conversion ADCs, Successive Approximation ADCs, Integrating ADC and Sigma-Delta ADCs.
The LPC 2148 has 10-bit successive approximation analog to digital converter. Basic clocking for the
A/D converters is provided by the VPB clock. A programmable divider is included in each converter, to
scale this clock to the 4.5 MHz (max) clock needed by the successive approximation process. A fully
accurate conversion requires 11 of these clocks. The ADC cell can measure the voltage on any of the ADC
input signals. It is noted that these analog inputs are always connected to their pins, even if the Pin function
Select register assigns them to port pins. A simple self-test of the ADC can be done by driving these pins
as port outputs.



17 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Circuit diagram:




18 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus, an embedded c program for interfacing on-chip ADC with ARM processor is written and
executed. The decimal values of the converted voltage are seen in the WinXTalk screen.
Outcome:
Able to interface A/D convertors with ARM system and check its working by connecting an analog
quantity as input.
Applications:
1. ADC used in MODEM for converting analog signals to digital.
2. A fast video ADC in TV tuner cards
3. ADC used in digital storage oscilloscopes
4. Used in music reproduction technology.
5. Used in DSP if input is analog


1. What are the ADC operating modes in LPC2148?
2. What is meant by conversion time?
3. Why are internal ADCs preferred over external ADCs?
4. Why has 16-bit ADC more resolution than from 10-bit and 8-bit ADC?
5. What are ADC & its Resolution?
6. What is Burst conversion mode?
7. What is the function of A/D Control Register?
8. What is the function of A/D Global Data Register?
9. What is the function of A/D Status Register?
10. What is analog-to-digital (ADC) conversion error?
11. What is the function of Sample-and-hold circuits in analog-to digital converters?
12. What is the disadvantage of the flash analog-to digital converter?
Viva-voce




19 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 3 GENERATION OF RAMP AND SQUARE
WAVE USING ON-CHIP DAC
Aim:
To write and execute an embedded c program to generate ramp wave and square wave using on-chip
DAC of LPC2148 ARM controller.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
A digital-to-analog converter is a device for converting a digital signal into an analog signal (current or
voltage). Digital-to-Analog Converters are the interface between the abstract digital world and the analog
real world. Simple switches, a network of resistors, current sources or capacitors may be used to
implement this conversion. A DAC inputs a binary number and outputs an analog voltage or current signal.
The Microchip Technology Inc. MCP4921 is 2.7 ? 5.5V, low-power, 12-Bit Digital-to-Analog Converter
(DAC) with SPI interface. The MCP4921 DAC provides high accuracy and low noise performance for
industrial applications where calibration or compensation of signals is required. With an SPI connection
there is always one master device (usually a microcontroller) which controls the peripheral devices.
Typically there are three lines common to all the devices,
Master In Slave Out (MISO) ? The Slave line for sending data to the master,
Master Out Slave In (MOSI) ? The Master line for sending data to the peripherals,
Serial Clock (SCK) ? The clock pulses which synchronize data transmission generated by the
master and slave
Slave Select pin ? the pin on each device that the master can use to enable and disable specific
devices. When a device Slave Select pin is low, it communicates with the master. When it is high, it ignores
the master. In SPI, the clock signal is controlled by the master device LPC2148. All data is clocked in and
out using this pin. These lines need to be connected to the relevant pins on the LPC21xx processor. Any
unused GIO pin can be used for CS, instead pull this pin high. Conversion speed is the time it takes for the



20 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

DAC to provide an analog output when the digital input word is changed. The MCP4291 DAC ? SPI
connections with LPC21xx have four I/O lines (P0.4 ? P0.7) required. The analog output is generated by
using these four lines.
Circuit diagram:


Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the embedded c programs for generating ramp wave and square wave using ARM LPC2148 are
written and executed successfully and the waveforms are viewed in oscilloscope.
Outcome:
Able to program the DAC in-built inside the ARM controller and get the waveforms using it.




21 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications :
1. DAC used in Audio amplifier.
2. Video encoder
3. Display electronics
4. Data Acquistion systems
5. Motor control



1. What are the features of LPC2148 DAC?
2. What is the function of DAC register?
3. Which pin provides a voltage reference level for the D/A converter?
4. What are the applications of DAC in signal processing applications?
5. What is GIO?
6. What is the resolution of a digital-to-analog converter (DAC)?
7. What is the major advantage of the R/2R ladder digital-to-analog (DAC), as compared to a binary-
weighted digital-to-analog DAC converter?
8. What is the resolution of a 0?5 V 6-bit digital-to-analog converter (DAC) ?
9. What are DAC configurations?
10. What are the different types of DAC Circuits?
11. What are the Limitations of the Binary Weighted DAC?
12. What are the General DAC Characteristics?
13. Define reference voltage in DAC.
14. What is full scale voltage?
15. What is settling time?
VIVA-VOCE




22 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 4 LED DIMMING USING PWM

Aim:
To write an embedded c program for implementing PWM using ARM controller and verify the same by
dimming of LEDs.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
LPC2148 supports 2 types of PWM:
1) Single Edge PWM ? Pulse starts with new Period i.e pulse is always at the beginning
2) Double Edge PWM ? Pulse can be anywhere within the Period
A PWM block, like a Timer block , has a Timer Counter and an associated Pre-scale Register along
with Match Registers. These work exactly the same way as in the case of Timers. Match Registers 1 to 6
(except 0) are pinned on LPC214x i.e. the corresponding outputs are diverted to actual Pins on LPC214x
MCU. The PWM function must be selected for these Pins to get the PWM output.
The basic setup is to simply replace Servo by a LED and no external 5V source is needed. The
anode of LED is connected to P0.0 and cathode to ground. Pulse Widths corresponding to the switches
connected to P0.1/2/3/4 will be 2.5ms/5ms/7.5ms/10ms respectively. As the Pulse Width Increases LED
will keep on getting brighter and the reverse will happen if Pulse Width is decreased.



23 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus embedded c program for implementing Pulse Width Modulation is written and executed and
output has been verified in LED display.
Outcome:
Able to implement PWM using the ARM controller and verify the same in the form of dimming of
LEDS.



24 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Applications :
1. In Visual signals to covey a message
2. Illumination where light is reflected from objects
3. In Narrow band sensors



1. What factors determine the LED dimming performance?
2. What is meant by analog dimming?
3. What is flickering effect?
4. What is the factor determines dimming of the LED
5. Why Silicon is not suitable for fabrication of light-emitting diodes?
6. Why Silicon diode is less suited for low voltage rectifier operation?
7. What is the principle of zener diode?
8. What are the materials used to make LED?
9. What type of diodes is used in FM receivers?
10. Which diode suffers an avalanche breakdown?
11. What happens if the junction temperature of LED is increased?
12. How a transfer characteristic of a diode does is related?
13. What is the requirement of a clipping action of a diode?
14. What type of rectifier circuit requires four diodes?
15. Why are the pulse width modulated outputs required in most of the applications?
16. How do the variations in an average value get affected by PWM period?
17. Name the common formats available for LED display.
18. What are the types of seven segment display?
19. What is PWM?
20. What are the applications of PWM?

Viva-voce




25 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 5 INTERFACING REAL TIME CLOCK
AND SERIAL PORT
Aim:
To write and execute an embedded c program to interface DS1307 RTC using I2C protocol with ARM
controller
Apparatus Required:
1. LPC2148 ARM development board
2. Stepper motor
3. Interfacing cables
4. PC
Theory:
A clock, which is based on the interrupts at preset intervals, is Real Time Clock (RTC). An interrupt
service routine executes on each timeout (overflow) of this clock. This timing device once started never
resets or never reloaded with another value. Once it is set, it is not modified later. It is used in a system to
save the time and date.













26 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the program for interfacing real time clock with ARM controller is written and executed and the
date and time are verified on the screen.
Outcome:
Able to interface real time clock DS1307 with ARM controller and thereby display date and time
Applications :
1. I2C In ARM and PIC microcontrollers
2. Used as serial communication protocol with MASTER and SLAVE operation.

27 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
27 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00




1. What is I2C and how does it work?
2. What are the features of I2C in LPC2148 ARM7 microcontroller?
3. What is the function of I2C0CONSET register?
4. What is I2C0STAT?
5. What is the function of I2C0 Data Register?
6. What is RTC?
7. List the advantages of RTC
8. Through which port the date and time is displayed in RTC?
9. What is a serial port?
10. List the registers used to transfer data in serial port.
11. List the modes used for data transmission.
12. What is a simplex mode?
13. Which pin is used to transmit a character?
14. What is the baud rate of serial port?
15. What is the disadvantage of RS-232C?














Viva-voce




28 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 6 INTERFACING KEYPAD AND LCD

Aim:
To write an embedded c program to interface 4 x 4 matrix keypad with ARM processor and display the
pressed key in an LCD.
Apparatus Required:
1. LPC2148 ARM development board
2. Interfacing cables
3. PC
Theory:

In matrix keypad, keys are connected in rows and columns. When any switch is pressed, rows and
columns come into contact, which is that detected by controller to identify which key has been pressed. A
4?4 matrix keypad consists of 4 rows and 4 columns. There is a switch connecting each row and column.
So the combinations of rows and columns make up the 16 inputs.Initially all the switches are open (not
connected). When any one button is pressed, the switch is closed (connected),hence there is a connection
between the row and column. The first 4 pins are connected to the column as INPUT. The other 4 pins are
connected to the row as OUTPUT. Matrix keypad is a good substitution to normal push button.












29 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Circuit Diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus program for interfacing matrix keypad with ARM controller is written and executed and the key
pressed is seen in the LCD.



30 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Outcome:
Able to interface keypad with ARM controller and see the pressed key in the LCD display.
Applications :
1. Used in password based door locking system
2. Security system with user changeable
3. Used in laptops, computer games
4. Used in portable video games and cell phones



1. What is Matrix keypad?
2. What is the concept behind keypad interface?
3. What are the functions of pull- up resistors?
4. What is key de bouncing?
5. List the steps involved when the key in a 4 x 4 keyboard matrix is being pressed.
6. What is the value obtained if no key is pressed?
7. What kind of interrupt is generated if a key has to be operated in an interrupt mode?
8. How will you identify that the key is pressed?
9. What are the steps involved in Keyboard Interfacing?
10. List the registers used to store the keyboard, display modes and other operations programmed by
CPU.
11. Name the mode when a data is entered from the left side of the display unit.
12. How many rows and columns are present in a 16 x 2 alphanumeric LCD?
13. How many data lines are there in a 16 x 2 alphanumeric LCD?
14. Which pin of the LCD is used for adjusting its contrast?
15. Which command of an LCD is used to shift the entire display to the right?
16. Which command is used to select the 2 lines and 5 x 7 matrix of an LCD?
17. What changes are to be made to send data to an LCD?
18. For reading operation from an LCD what changes in the software are introduced?
19. Which instruction is used to select the first row first column of an LCD?
Viva-voce

31 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
31 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Expt. No. 7 INTERFACING EEPROM AND INTERRUPT

Aim:
To write a program to interface EEPROM using I2C protocol with ARM controller and retrieve the stored
messages inside EEPROM.
Apparatus Required:
1. LPC2148 ARM development board
2. Interfacing cables
3. PC
Theory:
I2C (Inter Integrated Circuit):
The I2C (Inter-IC) bus is a bi-directional two-wire serial bus that provides a communication link between
integrated circuits (ICs).I2C is a synchronous protocol that allows a master device to initiate communication
with a slave device. Data is exchanged between these devices.
EEPROM:
EEPROM (electrically erasable programmable read-only memory) is user-modifiable read-only
memory (ROM) that can be erased and reprogrammed (written to) repeatedly through the application of
higher than normal electrical voltage. It is a type of non-volatile memory used in computers and other
electronic devices to store small amounts of data that must be saved when power is removed, e.g.,
calibration tables or device configuration
Read, write and Erase EEPROM by using I2C in LPC2148 Primer Board. Wiring up an I2C based
EEPROM to the I2C port is relatively simple. The basic operation of the I2C based EEPROM's is to send a
command, such as WRITE, followed by an address and the data. In WRITE operation, the EEPROM is
used to store the data. In LPC2148 Primer Kit, 2 nos. of EEPROM lines are controlled by I2C Enabled
drivers. I2C Lines serial clock SCL (P0.2), serial data SDA (P0.3) connected to the I2C based serial
EEPROM IC. The EEPROM read & write operations are done in LPC2148 Primer Kit by using these SDA &
SCL I2C lines.
32 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
32 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To down load and run this program: Refer General procedure given in Page No: 60
Result:
Thus, the program for interfacing I2C based EEPROM with ARM processor has been written and
executed successfully and the memory content is verified on Win x talk terminal.
Outcome:
Able to interface memory ICs with ARM controller and perform the read and write operations.



33 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications:
1. ROM used in toys,automobiles to store data when power is off
2. In calculators and peripheral devices
3. In laser printers
4. And also in embedded systems where program need not to be changed.


1. How does I2C protocol work?
2. What is EEPROM?
3. What is meant by master slave mode?
4. What is meant by non-volatile memory?
5. What is an interrupt?
6. How does an interrupt request works?
7. What is a nested interrupt?
8. What are the registers used for enabling an interrupt?
9. What is PROM?
10. What is EPROM?
11. What is mask ROM?
12. Which memory allows simultaneous read and write operations?
13. Which memory has the shortest access times?
14. Which interrupt has the highest priority?
15. What is non maskable interrupt?
16. Which is the first level of memory access by the microprocessor?
17. List the types of cache memories.
18. What is the use of an interrupt?
19. What is the use of converting an interrupt to threads in a microprocessor?
20. What are the bits used to control an external interrupts?


Viva-voce




34 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00










CYCLE 2 - EXPERIMENTS




35 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 8 IMPLEMENTATION OF MAILBOX FUNCTION
USING LPC2148
Aim:
To create a mailbox in Micro C/OS ? II using LPC2148 ARM Controller
Apparatus Required:
1. LPC2148 ARM development board
2. Interfacing cables
3. PC
Theory:
System or the user code can send a message by the core services. A typical mail message, also
known as the exchange of information, refers to a task or an ISR using a pointer variable, through the core
services to put a message (that is, a pointer) into the mailbox. Similarly, one or more tasks can receive this
message by the core services. The tasks sending and receiving the message promise that the content that
the pointer points to is just that piece of message.
The mailbox of CooCox CoOS is a typical message mailbox which is composed of two parts: one is
the information which expressed by a pointer of void; the other is the waiting list which composed of the
tasks waiting for this mailbox. The waiting list supports two kinds of sorting: FIFO and preemptive priority.
The sorting mode is determined by the user when creating the mailbox.
Procedure:
To Edit / Compile / generate Hex file: Refer General procedure in Page No: 58
To down load and run this program: Refer General procedure in Page No: 60
Result:
Thus, the mailbox was created in Micro C/OS ?II and implemented using LPC2148.
Outcome:
Able to understand the concept of mail box in embedded systems and its significance in real time
systems





36 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications:
1. Used in Acorn RISC PC700
2. Used in ZIPIT wireless messenger
3. Used in Meizu M6 MINI player


1. What is IPC?
2. Define Queue.
3. What are the different types of mail box functions?
4. What is half duplex mode?
5. How many synchronous and asynchronous modes are there in serial port?
6. List the bits used to generate serial port interrupt
7. What is branch prediction?
8. Mention any two features of ?C/OS ? II.
9. Write the function for creating task in ?C/OS ? II.
10. Mention any two support devices for ?C/OS ? II.
11. How many user tasks can be handled by ?C/OS ? II?



















Viva-voce




37 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 9 INTERRUPT PERFORMANCE
CHARACTERISTICSOF ARM AND FPGA

Aim:
To study the interrupt performance characteristics of ARM and FPGA by using ARM controller kit and
FPGA kit separately.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
External Interrupts:
An interrupt caused by an external source such as the computer operator, external sensor or
monitoring device, or another computer. Interrupts are special events that require immediate attention.
Interfacing External Interrupts with LPC2148:
When an external interrupt signal occurs in LPC2148 Primer Board, the message "LOW" will be
displayed on PC. The interrupt signal occurs using switches. When the switch is pressed to LOW, then the
external interrupt occurs. The Vectored Interrupt Controller (VIC) takes 32 interrupt request inputs and
programmable assigns them into 3 categories, FIQ, vectored IRQ, and non-vectored IRQ. The ARM7
LPC2148 Primer board has two numbers of External Interrupts, connected with I/O Port lines (P0.14 &
P0.15) as switches.







38 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00



Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60


39 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
39 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Result:
Thus the interrupt performance characteristics of ARM and FPGA are studied. On comparison, ARM
counts at slow speed because it consumes more instruction cycle and FPGA is more efficient for servicing
and processing external interrupt pulses.
Outcome:
Able to understand the performance characteristics of ARM and FPGA while dealing with
interrrupts
Applications:
1. Used in random logic and SPLDs
2. Used in cryptography and filtering
3. In medical imaging
4. In bioinformatics and voice recognition



1. When is an Interrupt Request received?
2. What is ISR?
3. How do you initialize interrupt?
4. What is Vectored Interrupt Controller?
5. What are the kinds of protection available for SRAMS ?
6. What is interrupt pipelining?
7. What is pipeline shutdown?
8. What is branch prediction?
9. What is the use of Neon Floating point engine?
10. What is the use of ?vectorize option?
11. What is PTM?
12. What is ITM?
13. What is ETM?
14. What is I2S interface?
15. What is the use of ?SWI? in ARM assembly?

Viva-voce




40 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 10 FLASHING OF LEDS
Aim:
To write and execute an embedded c program to display LEDs using LPC 2148 ARM controller
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
Theory:
LED (Light Emitting Diodes) is the most commonly used components, usually for displaying pins digital
states. Typical uses of LEDs include alarm devices, timers and confirmation of user input such as a mouse
click or keystroke. Interfacing LED with LPC2148 Flash a LED using LPC2148 Primer Board. It works by
turning ON a LED & then turning it OFF & then looping back to START. However the operating speed of
microcontroller is very high so the flashing frequency will also be very fast to be detected by human eye.
The ARM7 LPC2148 Primer board has eight numbers of point LEDs, connected with I/O Port lines (P1.16 ?
P1.23) to make port pins high.










41 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00



Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus program for flashing of LEDs is written and executed using ARM controller LPC2148.



42 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Outcome:
Able to interface LED lights via the input output port and control them
Applications:
1. In Illumination
2. As status indicators in equipments
3. Stadium displays and dynamic decorative displays



1. What is seven segment displays?
2. What are the different configurations of LED?
3. What is the function of GPIO?
4. What are the Pins which are used to connect LEDs?
5. How to identify 'Polarity' of LED?
6. Differentiate LED from LCD.
7. What is a use of Jumper?
8. How many numbers of LEDs present in Primer board?
9. Where LEDs are used?
10. What is the use of flash magic software?
11. Which port is used in ARM 7 processor kit?
12. Which diode suffers an avalanche breakdown?
13. What happens if the junction temperature of LED is increased?
14. What is an anti collision rate light?
15. What is fail-safe conditions






Viva-voce




43 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 11 STEPPER MOTOR INTERFACE WITH
ARM -7 LPC2148
Aim:
To write a program to interface stepper motor using ARM processor and control the movement of motor
in either directions.
Apparatus Required:
1. LPC2148 ARM development board
2. Stepper motor
3. Interfacing cables
4. PC
Theory:
A stepper motor can be viewed as a DC motor with number of poles (on both rotor and stator).
Additionally, soft magnetic material with many teeth on the rotor and stator cheaply multiplies the number of
poles (reluctance motor). Like an AC synchronous motor, it is ideally driven by sinusoidal current, allowing
a step less operation, but this puts some burden on the controller. When using an 8-bit digital controller,
256 micro steps per step are possible. As a digital-to-analog converter produces unwanted ohmic heat in
the controller, pulse-width modulation is used to regulate the mean current. Simpler models switch voltage
only for doing a step, thus needing an extra current limiter: for every step, they switch a single cable to the
motor.
The idea is to connect the output pins of the driver to 4 transistors. The transistor must be
grounded at the emitter and the driver pin must be connected to the base. Collector is connected to the coil
wire of the motor. Stepper motors are rated by the torque they produce. Synchronous electric motors using
soft magnetic materials (having a core) have the ability to provide position holding torque (called detent
torque, and sometimes included in the specifications) while not driven electrically. To achieve full rated
torque, the coils in a stepper motor must reach their full rated current during each step. The voltage rating
(if there is one) is almost meaningless. The motors also suffer from EMF, which means that once the coil is
turned off it starts to generate current because the motor is still rotating. There needs to be an explicit way
to handle this extra current in a circuit otherwise it can cause damage and affect performance of the motor.
44 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
44 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus stepper motor interface with ARM processor has been successfully implemented and the motor is
controlled in clockwise and anticlockwise direction.
Outcome:
Able to interface the stepper motor with ARM controller and thereby create some rotational
movements





45 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Applications:
3. Used for precise positioning with a motor
4. Used in hard disk drives, robotics
5. Used in telescopes and toys







1. Define GPIO.
2. What is the function of ULN2803?
3. How LPC2148 control stepper motor?
4. Which I/O port lines used to rotate stepper motor?
5. How stepper motor reacts for each pulse it receives?
6. What is serial communication?
7. What is parallel communication?
8. What is stepper motor & why it is named so?
9. How can be step angle is calculated?
10. What are the advantages and disadvantages of parallel communication?
11. What does instruction-pipelining mean?
12. What is the power supply required for ARM processor?
13. What is a unit for torque?
14. What is RPM rating for a DC motor?
15. What device that is used to obtain an accurate position control of rotating shafts in terms of steps?
Viva-voce

46 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
46 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Expt. No. 12 LM35 TEMPERATURE SENSOR INTERFACE
WITH ARM-7 LPC2148
Aim:
To write a program to interface of LM35 temperature sensor to on-chip ADC of ARM controller and
display the room temperature value on the screen.
Apparatus Required:
1. LPC2148 ARM development board
2. Temperature sensor
3. Interfacing cables
4. PC
Theory:
Temperature Sensor:
The LM35 series are precision integrated-circuit temperature sensors, whose output voltage is linearly
proportional to the Celsius (Centigrade) temperature. The output of the sensor is converted to digital output
that is easy to connect with microcontroller. Temperature sensor has three terminals and required
Maximum of 5.5 V supply. This type of sensor consists of a material that performs the operation according
to temperature to vary the resistance. This change of resistance is sensed by circuit and it calculates
temperature. When the voltage increases then the temperature also rises. We can see this operation by
using a diode.







47 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
47 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00


Circuit diagram:

48 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
48 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the program for interfacing temperature sensor with ARM controller is written and executed and
the temperature reading is seen on the monitor.
Outcome:
Able to interface different sensors with in-built ADC of the ARM processor and access the data
produced from them
Applications:
1. Used in Ovens, refrigerators
2. In HVAC environmental control
3. coolant or cylinder head temperatures
4. in the automotive industry to monitor air intake



1. What is LM35?
2. Define ISP.
3. How many Analog-to-Digital Converters available as an inner peripheral in LPC2148?
4. What is the main function of analog pin in LPC 2148?
5. What is the output voltage produced by LM35 for one degree temperature?
6. What is the difference between LM 34 and LM 35 sensors?
7. How many pins are available in LM35?
8. Why Vref is set of ADC0848 to 2.56 V if analog input is connected to the LM35?
9. What is operating the operating temperature range in LM35?
10. Why LM35 is used to Measure Temperature?
11. List the devices used to sense temperature.
12. What is the purpose of a thermocouple?
13. What is the output voltage of a thermocouple?
Viva-voce




49 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 13 IMPLEMENTATION OF WIRELESS
COMMUNICATION PROTOCOL
USING ZIGBEE WIRELESS MODULE
Aim:
To implement wireless communication protocol using zigbee wireless module with the help of ARM
processor
Apparatus required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. Zigbee module
5. PC
Theory:
ZigBee is a specification to suite high level communication protocols using small, low-power digital
radios based on an IEEE 802 standard for personal area networks. The ZigBee is the name of a wireless
protocol maintained by the IEEE 802.15 standard. This is a protocol specified for wireless Personal Area
Network (PAN) using low powered wireless transceivers. There are already wireless transmitter and
receiver modules which can do point to point communication. The Xbee is the brand name a wireless
transceiver device introduced by the Digi international which works on the ZigBee protocol and can form
PAN networks. They have an approximate range of 10 to 100 meters and are used in industries, scientific
fields, medical fields etc
Digi ZigBee:
The Digi Xbee 802.15.4 modules are the easiest to use, most reliable and cost-effective RF devices.
The 802.15.4 Xbee modules provide two friendly modes of communication - a simple serial method to
transmit/receive or a framed mode providing advanced features. These modules can communicate point to
point, from one point to a PC, or in a mesh network.



50 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
50 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Circuit diagram:


Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the wireless communication protocol using Zigbee wireless module is implemented using
LPC2148.
Outcome:
Able to form a wireless network using zigbee module and ARM controller




51 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications:
1. Used in traffic lights in non-urban areas
2. Used in building control systems
3. Used in asset tracking
4. Used in parking sensors




1. How many UART ports available in LPC2148?
2. What is the main function of voltage convertors in UART?
3. Why Zigbee based is preferred for wireless communication?
4. What is the IEEE standard for Zigbee protocol?
5. Write the two modes of communication are used in a ZigBee network.
6. What is the function of a scheduler?
7. Mention any two features of ?C/OS ? II.
8. Write the function for creating task in ?C/OS ? II.
9. Mention any two support devices for ?C/OS ? II.
10. How many user tasks can be handled by ?C/OS ? II?







Viva-voce




52 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

















ADDITIONAL EXPERIMENTS
53 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
53 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Expt. No. 14 BUZZER INTERFACE WITH ARM-7 LPC2148
Aim:
To write a program for buzzer interface with ARM processor and control its operation.
Apparatus required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
Theory:
Buzzer is an electronic device commonly used to produce sound. Light weight, simple construction and
low price make it usable in various applications like car/truck reversing indicator, computers, call bells etc.
Piezo buzzer is based on the inverse principle of piezo electricity discovered in 1880 by Jacques and Pierre
Curie. It is the phenomena of generating electricity when mechanical pressure is applied to certain
materials and the vice versa is also true. Such materials are called piezo electric materials. Piezo electric
materials are either naturally available or manmade. Piezo ceramic is class of manmade material, which
poses piezo electric effect and is widely used to make disc, the heart of piezo buzzer. When subjected to
an alternating electric field they stretch or compress, in accordance with the frequency of the signal thereby
producing sound.







54 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
54 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the program for interfacing buzzer with ARM processor is written and executed and output is
verified.
Outcome:
Able to interface devices such as buzzer, relay with ARM controller





55 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Applications:

1. In alarm devices and timers
2. In confirmation of user input such as mouse click or keystroke
3. Alarming Circuits
4. Communication equipments
5. Automobile electronics
6. Portable equipments, due to its compact size





1. Define Buzzer.
2. Which pin in ARM can be used to modulate Buzzer?
3. What is the function Flash magic software?
4. How the Buzzer can be disconnected in LPC2148?
5. How the volume of sound will be changed in Buzzer?
6. What is a buzzer
7. What are the applications of buzzer?
8. How buzzer is used in embedded system?
9. What is race round condition?
10. What is digital signal controller?
11. What are the features of buzzer circuit?
12. What is a semaphore?
13. What is mutexes?
14. What is the role of segment register?
15. What is watch dog timer?

Viva-voce

56 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
56 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Expt. No. 15 RELAY INTERFACE WITH ARM - 7
Aim:
To write a program to interface 2 relays with LPC 2148 ARM Controller and verify its working.
Apparatus required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
Theory:
A relay is an electrically operated switch. Many relays use an electromagnet to mechanically operate a
switch, but other operating principles are also used, such as solid-state relays. Relays are used where it is
necessary to control a circuit by a low-power signal (with complete electrical isolation between control and
controlled circuits), or where several circuits must be controlled by one signal. The first relays were used in
long distance telegraph circuits as amplifiers: they repeated the signal coming in from one circuit and re-
transmitted it on another circuit. Relays were used extensively in telephone exchanges and early
computers to perform logical operations.
57 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
57 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
The program for interfacing relays with ARM controller is done and its working is verified.
Outcome:
Able to interface devices such as relay with ARM controller and control them using programs.



FirstRanker.com - FirstRanker's Choice
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00






?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING

VII SEMESTER - R 2013

EC6711 ? EMBEDDED LABORATORY






Name : _______________________________________
Register No : _______________________________________
Section : _______________________________________
LABORATORY MANUAL



2 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00




is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and
training.

? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different
levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on
heart and soul
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

To impart professional education integrated with human values to the younger generation, so as to
shape them as proficient and dedicated engineers, capable of providing comprehensive solutions to the
challenges in deploying technology for the service of humanity

? To educate the students with the state-of-art technologies to meet the growing challenges of the
electronics industry
? To carry out research through continuous interaction with research institutes and industry, on
advances in communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning,
innovation and ethical practices
VISION
VISION
MISSION
MISSION



3 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

PROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To provide students with a solid foundation in Mathematics, Science and fundamentals of
engineering, enabling them to apply, to find solutions for engineering problems and use this knowledge
to acquire higher education
2. Core Competence
To train the students in Electronics and Communication technologies so that they apply their
knowledge and training to compare, and to analyze various engineering industrial problems to find
solutions
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice which
enables them to find solutions for the real time problems in industry, and to design products
4. Professionalism
To inculcate professional and effective communication skills, leadership qualities and team spirit in
the students to make them multi-faceted personalities and develop their ability to relate engineering
issues to broader social context
5. Lifelong Learning/Ethics
To demonstrate and practice ethical and professional responsibilities in the industry and society in
the large, through commitment and lifelong learning needed for successful professional career


4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
PROGRAMME OUTCOMES (POs)
a) To demonstrate and apply knowledge of Mathematics, Science and engineering fundamentals in
Electronics and Communication Engineering field
b) To design a component, a system or a process to meet the specific needs within the realistic
constraints such as economics, environment, ethics, health, safety and manufacturability
c) To demonstrate the competency to use software tools for computation, simulation and testing of electronics
and communication engineering circuits
d) To identify, formulate and solve electronic and communication engineering problems
e) To demonstrate an ability to visualize and work on laboratory and multidisciplinary tasks
f) To function as a member or a leader in multidisciplinary activities
g) To communicate in verbal and written form with fellow engineers and society at large
h) To understand the impact of Electronics and Communication Engineering in the society and demonstrate
awareness of contemporary issues and commitment to give solutions exhibiting social responsibility
i) To demonstrate professional & ethical responsibilities
j) To exhibit confidence in self-education and ability for lifelong learning
k) To participate and succeed in competitive exams


5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
SYLLABUS

? Learn the working of ARM processor
? Understand the Building Blocks of Embedded Systems
? Learn the concept of memory map and memory interface
? Know the characteristics of Real Time Systems
? Write programs to interface memory, I/Os with processor
? Study the interrupt performance
LIST OF EXPERIMENTS:
1. Study of ARM evaluation system
2. Interfacing ADC and DAC
3. Interfacing LED and PWM
4. Interfacing real time clock and serial port
5. Interfacing keyboard and LCD
6. Interfacing EPROM and interrupt
7. Mailbox
8. Interrupt performance characteristics of ARM and FPGA
9. Flashing of LEDS
10. Interfacing stepper motor and temperature sensor
11. Implementing zigbee protocol with ARM



? Write programs in ARM for a specific Application
? Interface memory and Write programs related to memory operations
? Interface A/D and D/A convertors with ARM system
? Analyze the performance of interrupt
? Write programmes for interfacing keyboard, display, motor and sensor.
? Formulate a mini project using embedded system
COURSE OBJECTIVES
COURSE OUTCOMES
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
CONTENTS
Sl. No. Name of the Experiment Page No.
CYCLE 1 ? EXPERIMENTS
1
Study of ARM evaluation system 7
2
Analog to Digital Convertor interfacing 16
3
Generation of ramp and square wave using on-Chip DAC 19
4
LED dimming using PWM 22
5
Interfacing real time clock and serial port 25
6
Interfacing keypad and LCD 28
7
Interfacing EPROM and interrupt 31
CYCLE 2 ? EXPERIMENTS
8 Implementation of Mailbox Function using LPC 2148 35
9 Interrupt Performance Characteristics of Arm and FPGA 37
10 Flashing of LEDs 40
11 Stepper Motor Interface with ARM ? 7 LPC2148 43
12 LM35 Temperature Sensor Interface with ARM ? 7 LPC2148 47
13
Implementation of Wireless Communication Protocol using ZIGBEE Wireless
Module
50
ADDITIONAL EXPERIMENTS BEYOND THE SYYLABUS
14 Buzzer Interface with ARM ? 7 54
15 Relay interface with ARM? 7 57
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Expt. No. 1 STUDY OF ARM EVALUATION SYSTEM
Aim:
To study the building blocks of ARM7 system, its features, pin configuration and the components
required for functioning of ARM controller.
Architecture Overview:
A RISC-based computer design approach means ARM processors require significantly fewer transistors
than typical processors in average computers. This approach reduces cost, heat and power usage. These
are desirable traits for light, portable, battery-powered devices (smart phones, laptops, tablet and notepad
computers), and other embedded systems. A simpler design facilitates more efficient multi-core CPUs and
higher core counts at lower cost, providing higher processing power and improved energy efficiency for
servers and supercomputers.
In 2005, about 98% of all mobile phones sold used at least one ARM processor. The low power
consumption of ARM processors has made them very popular: 37 billion ARM processors have been
produced as of 2013, up from 10 billion in 2008. The ARM architecture (32-bit) is the most widely used
architecture in mobile devices, and most popular 32-bit one in embedded systems.
According to ARM Holdings, in 2010 alone, producers of chips based on ARM architectures
reported shipments of 6.1 billion ARM based processors, representing 95% of smart phones, 35% of digital
televisions and set-top boxes and 10% of mobile computers. It is the most widely used 32-bit instruction set
architecture in terms of quantity produced.
LPC 2148:
LPC2148 is the widely used IC from ARM-7 family. It is manufactured by Philips and it is pre-loaded
with many inbuilt peripherals making it more efficient and a reliable option for the beginners as well as high
end application developer.




8 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Features of LPC214x series controllers:
1. 8 to 40 kB of on-chip static RAM and 32 to 512 kB of on-chip flash program memory.128 bit wide
interface/accelerator enables high speed 60 MHz operation.
2. In-System/In-Application Programming (ISP/IAP) via on-chip boot-loader software. Single flash sector or
full chip erase in 400 ms and programming of 256 bytes in 1ms.
3. Embedded ICE RT and Embedded Trace interfaces offer real-time debugging with the on-chip Real
Monitor software and high speed tracing of instruction execution.
4. USB 2.0 Full Speed compliant Device Controller with 2 kB of endpoint RAM. In addition, the LPC2146/8
provides 8 kB of on-chip RAM accessible to USB by DMA.
5. One or two (LPC2141/2 vs. LPC2144/6/8) 10-bit A/D converters provide a total of 6/14analog inputs, with
conversion times as low as 2.44 us per channel.
6. Single 10-bit D/A converter provides variable analog output.
7. Two 32-bit timers/external event counters (with four capture and four compare channels each), PWM unit
(six outputs) and watchdog.
8. Low power real-time clock with independent power and dedicated 32 kHz clock input.
9. Multiple serial interfaces including two UARTs (16C550), two Fast I2C-bus (400 kbit/s), SPI and SSP with
buffering and variable data length capabilities.
10. Vectored interrupt controller with configurable priorities and vector addresses.
11. Up to 45 of 5 V tolerant fast general purpose I/O pins in a tiny LQFP64 package.
12. Up to nine edge or level sensitive external interrupt pins available.
13. On-chip integrated oscillator operates with an external crystal in range from 1 MHz to30 MHz and with
an external oscillator up to 50 MHz
14. Power saving modes include Idle and Power-down.
15. Individual enable/disable of peripheral functions as well as peripheral clock scaling for additional power
optimization.
16. Processor wake-up from Power-down mode via external interrupt, USB, Brown-Out Detect (BOD) or
Real-Time Clock (RTC).




9 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


First Step- Hardware Requirement:
Pin configuration of LPC 2148.

Hardware requirement of LPC2148:
1. LPC2148 need minimum below listed hardware to work properly
2. Power Supply
3. Crystal Oscillator
4. Reset Circuit
5. RTC crystal oscillator
6. UART
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Power Supply:
LPC2148 works on 3.3 V power supply. LM 117 can be used for generating 3.3 V supply. However,
basic peripherals like LCD, ULN 2003 (Motor Driver IC) etc. works on 5V. So AC mains supply is converted
into 5V using below mentioned circuit and after that LM 117 is used to convert 5V into 3.3V.
Block diagram of power Supply

Transformer: It is used to step down 230V AC to 9V AC supply and provides isolation between power grids
and circuit.
Rectifier: It is used to convert AC supply into DC.
Filter: It is used to reduce ripple factor of DC output available from rectifier end.
Regulator: It is used to regulate DC supply output.

11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Circuit Diagram:

Regulator IC 7805 is used to provide fix 5V dc supply.
LM 117 is used for generating 3.3V supply from 5V.

12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Calculations:

From the datasheet of LM117

Taking R 2= 240?, we get R 1=392?
Reset Circuit:
Reset button is essential in a system to avoid programming pitfalls and manually bring back the system
to the initialization mode. MCP 130T is a special IC used for providing stable RESET signal to LPC 2148.


13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Oscillator Circuit:

The value of capacitors C20 & C21 depends upon the frequency of crystal Y3. General circuit and
its equivalent circuit is as shown below.

14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Recommended values are as shown in table:

UART:
LPC 2148 has inbuilt ISP which means we can program it within the system using serial
communication on COM0. It has also COM1 for serial communication. MAX 232/233 IC must be used for
voltage logic conversion. Related connections are as given below.

Once the above listed circuit design is ready, we are ready to go further.



15 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Result:
ARM Evaluation system and the configuration of LPC2148 has been studied fully. The minimal setup
required for the functioning of the ARM processor is studied.
Outcomes:
1. Able to understand the ARM controller, its basic components inside and its features.
2. Able to know the components required for the working of ARM LPC2148

Applications:
ARM controller LPC2148 is used in no. of devices such as
1. Smart phones
2. Net books
3. E Readers
4. Digital TV
5. Home Gateways


1. What are the basic units of ARM 7?
2. What is the address system supported by ARM?
3. Define - RISC
4. What are the instructions used to access the memory in ARM?
5. What are the basic units of Microprocessor?
6. What is an Instruction?
7. What is clock cycle?
8. Define - Pipelining
9. What is cache miss?
10. What is meant by memory mapped I/O?
11. Define ? interrupt
12. What is meant by Exception?
13. What is meant by little ? endian mode?
14. What is meant by big ? endian mode?
15. What is the function of CPSR?
16. What is register - indirect addressing?
Viva-voce




16 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 2 ANALOG TO DIGITAL CONVERTOR
INTERFACING
Aim:
To write an embedded c program for interfacing an on chip ADC with LPC2148 ARM processor and
convert the given input voltage into corresponding decimal values.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. PC
Theory:
Analog to Digital converter (ADC) is a device that converts continuously varying analog signals from
instruments that monitor such conditions as movement, temperature, sound, etc., into binary code for the
computer. It may be either a single chip or can be one circuit within a chip. Analog to Digital conversion is
the process of changing continuously varying data, such as voltage, current, or shaft rotation, into discrete
digital quantities that represent the magnitude of the data compared to a standard or reference at the
moment the conversion is made. According to the method of conversion, ADCs can be classified into
Direct-Conversion ADCs, Successive Approximation ADCs, Integrating ADC and Sigma-Delta ADCs.
The LPC 2148 has 10-bit successive approximation analog to digital converter. Basic clocking for the
A/D converters is provided by the VPB clock. A programmable divider is included in each converter, to
scale this clock to the 4.5 MHz (max) clock needed by the successive approximation process. A fully
accurate conversion requires 11 of these clocks. The ADC cell can measure the voltage on any of the ADC
input signals. It is noted that these analog inputs are always connected to their pins, even if the Pin function
Select register assigns them to port pins. A simple self-test of the ADC can be done by driving these pins
as port outputs.



17 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Circuit diagram:




18 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus, an embedded c program for interfacing on-chip ADC with ARM processor is written and
executed. The decimal values of the converted voltage are seen in the WinXTalk screen.
Outcome:
Able to interface A/D convertors with ARM system and check its working by connecting an analog
quantity as input.
Applications:
1. ADC used in MODEM for converting analog signals to digital.
2. A fast video ADC in TV tuner cards
3. ADC used in digital storage oscilloscopes
4. Used in music reproduction technology.
5. Used in DSP if input is analog


1. What are the ADC operating modes in LPC2148?
2. What is meant by conversion time?
3. Why are internal ADCs preferred over external ADCs?
4. Why has 16-bit ADC more resolution than from 10-bit and 8-bit ADC?
5. What are ADC & its Resolution?
6. What is Burst conversion mode?
7. What is the function of A/D Control Register?
8. What is the function of A/D Global Data Register?
9. What is the function of A/D Status Register?
10. What is analog-to-digital (ADC) conversion error?
11. What is the function of Sample-and-hold circuits in analog-to digital converters?
12. What is the disadvantage of the flash analog-to digital converter?
Viva-voce




19 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 3 GENERATION OF RAMP AND SQUARE
WAVE USING ON-CHIP DAC
Aim:
To write and execute an embedded c program to generate ramp wave and square wave using on-chip
DAC of LPC2148 ARM controller.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
A digital-to-analog converter is a device for converting a digital signal into an analog signal (current or
voltage). Digital-to-Analog Converters are the interface between the abstract digital world and the analog
real world. Simple switches, a network of resistors, current sources or capacitors may be used to
implement this conversion. A DAC inputs a binary number and outputs an analog voltage or current signal.
The Microchip Technology Inc. MCP4921 is 2.7 ? 5.5V, low-power, 12-Bit Digital-to-Analog Converter
(DAC) with SPI interface. The MCP4921 DAC provides high accuracy and low noise performance for
industrial applications where calibration or compensation of signals is required. With an SPI connection
there is always one master device (usually a microcontroller) which controls the peripheral devices.
Typically there are three lines common to all the devices,
Master In Slave Out (MISO) ? The Slave line for sending data to the master,
Master Out Slave In (MOSI) ? The Master line for sending data to the peripherals,
Serial Clock (SCK) ? The clock pulses which synchronize data transmission generated by the
master and slave
Slave Select pin ? the pin on each device that the master can use to enable and disable specific
devices. When a device Slave Select pin is low, it communicates with the master. When it is high, it ignores
the master. In SPI, the clock signal is controlled by the master device LPC2148. All data is clocked in and
out using this pin. These lines need to be connected to the relevant pins on the LPC21xx processor. Any
unused GIO pin can be used for CS, instead pull this pin high. Conversion speed is the time it takes for the



20 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

DAC to provide an analog output when the digital input word is changed. The MCP4291 DAC ? SPI
connections with LPC21xx have four I/O lines (P0.4 ? P0.7) required. The analog output is generated by
using these four lines.
Circuit diagram:


Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the embedded c programs for generating ramp wave and square wave using ARM LPC2148 are
written and executed successfully and the waveforms are viewed in oscilloscope.
Outcome:
Able to program the DAC in-built inside the ARM controller and get the waveforms using it.




21 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications :
1. DAC used in Audio amplifier.
2. Video encoder
3. Display electronics
4. Data Acquistion systems
5. Motor control



1. What are the features of LPC2148 DAC?
2. What is the function of DAC register?
3. Which pin provides a voltage reference level for the D/A converter?
4. What are the applications of DAC in signal processing applications?
5. What is GIO?
6. What is the resolution of a digital-to-analog converter (DAC)?
7. What is the major advantage of the R/2R ladder digital-to-analog (DAC), as compared to a binary-
weighted digital-to-analog DAC converter?
8. What is the resolution of a 0?5 V 6-bit digital-to-analog converter (DAC) ?
9. What are DAC configurations?
10. What are the different types of DAC Circuits?
11. What are the Limitations of the Binary Weighted DAC?
12. What are the General DAC Characteristics?
13. Define reference voltage in DAC.
14. What is full scale voltage?
15. What is settling time?
VIVA-VOCE




22 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 4 LED DIMMING USING PWM

Aim:
To write an embedded c program for implementing PWM using ARM controller and verify the same by
dimming of LEDs.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
LPC2148 supports 2 types of PWM:
1) Single Edge PWM ? Pulse starts with new Period i.e pulse is always at the beginning
2) Double Edge PWM ? Pulse can be anywhere within the Period
A PWM block, like a Timer block , has a Timer Counter and an associated Pre-scale Register along
with Match Registers. These work exactly the same way as in the case of Timers. Match Registers 1 to 6
(except 0) are pinned on LPC214x i.e. the corresponding outputs are diverted to actual Pins on LPC214x
MCU. The PWM function must be selected for these Pins to get the PWM output.
The basic setup is to simply replace Servo by a LED and no external 5V source is needed. The
anode of LED is connected to P0.0 and cathode to ground. Pulse Widths corresponding to the switches
connected to P0.1/2/3/4 will be 2.5ms/5ms/7.5ms/10ms respectively. As the Pulse Width Increases LED
will keep on getting brighter and the reverse will happen if Pulse Width is decreased.



23 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus embedded c program for implementing Pulse Width Modulation is written and executed and
output has been verified in LED display.
Outcome:
Able to implement PWM using the ARM controller and verify the same in the form of dimming of
LEDS.



24 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Applications :
1. In Visual signals to covey a message
2. Illumination where light is reflected from objects
3. In Narrow band sensors



1. What factors determine the LED dimming performance?
2. What is meant by analog dimming?
3. What is flickering effect?
4. What is the factor determines dimming of the LED
5. Why Silicon is not suitable for fabrication of light-emitting diodes?
6. Why Silicon diode is less suited for low voltage rectifier operation?
7. What is the principle of zener diode?
8. What are the materials used to make LED?
9. What type of diodes is used in FM receivers?
10. Which diode suffers an avalanche breakdown?
11. What happens if the junction temperature of LED is increased?
12. How a transfer characteristic of a diode does is related?
13. What is the requirement of a clipping action of a diode?
14. What type of rectifier circuit requires four diodes?
15. Why are the pulse width modulated outputs required in most of the applications?
16. How do the variations in an average value get affected by PWM period?
17. Name the common formats available for LED display.
18. What are the types of seven segment display?
19. What is PWM?
20. What are the applications of PWM?

Viva-voce




25 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 5 INTERFACING REAL TIME CLOCK
AND SERIAL PORT
Aim:
To write and execute an embedded c program to interface DS1307 RTC using I2C protocol with ARM
controller
Apparatus Required:
1. LPC2148 ARM development board
2. Stepper motor
3. Interfacing cables
4. PC
Theory:
A clock, which is based on the interrupts at preset intervals, is Real Time Clock (RTC). An interrupt
service routine executes on each timeout (overflow) of this clock. This timing device once started never
resets or never reloaded with another value. Once it is set, it is not modified later. It is used in a system to
save the time and date.













26 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the program for interfacing real time clock with ARM controller is written and executed and the
date and time are verified on the screen.
Outcome:
Able to interface real time clock DS1307 with ARM controller and thereby display date and time
Applications :
1. I2C In ARM and PIC microcontrollers
2. Used as serial communication protocol with MASTER and SLAVE operation.

27 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
27 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00




1. What is I2C and how does it work?
2. What are the features of I2C in LPC2148 ARM7 microcontroller?
3. What is the function of I2C0CONSET register?
4. What is I2C0STAT?
5. What is the function of I2C0 Data Register?
6. What is RTC?
7. List the advantages of RTC
8. Through which port the date and time is displayed in RTC?
9. What is a serial port?
10. List the registers used to transfer data in serial port.
11. List the modes used for data transmission.
12. What is a simplex mode?
13. Which pin is used to transmit a character?
14. What is the baud rate of serial port?
15. What is the disadvantage of RS-232C?














Viva-voce




28 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 6 INTERFACING KEYPAD AND LCD

Aim:
To write an embedded c program to interface 4 x 4 matrix keypad with ARM processor and display the
pressed key in an LCD.
Apparatus Required:
1. LPC2148 ARM development board
2. Interfacing cables
3. PC
Theory:

In matrix keypad, keys are connected in rows and columns. When any switch is pressed, rows and
columns come into contact, which is that detected by controller to identify which key has been pressed. A
4?4 matrix keypad consists of 4 rows and 4 columns. There is a switch connecting each row and column.
So the combinations of rows and columns make up the 16 inputs.Initially all the switches are open (not
connected). When any one button is pressed, the switch is closed (connected),hence there is a connection
between the row and column. The first 4 pins are connected to the column as INPUT. The other 4 pins are
connected to the row as OUTPUT. Matrix keypad is a good substitution to normal push button.












29 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Circuit Diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus program for interfacing matrix keypad with ARM controller is written and executed and the key
pressed is seen in the LCD.



30 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Outcome:
Able to interface keypad with ARM controller and see the pressed key in the LCD display.
Applications :
1. Used in password based door locking system
2. Security system with user changeable
3. Used in laptops, computer games
4. Used in portable video games and cell phones



1. What is Matrix keypad?
2. What is the concept behind keypad interface?
3. What are the functions of pull- up resistors?
4. What is key de bouncing?
5. List the steps involved when the key in a 4 x 4 keyboard matrix is being pressed.
6. What is the value obtained if no key is pressed?
7. What kind of interrupt is generated if a key has to be operated in an interrupt mode?
8. How will you identify that the key is pressed?
9. What are the steps involved in Keyboard Interfacing?
10. List the registers used to store the keyboard, display modes and other operations programmed by
CPU.
11. Name the mode when a data is entered from the left side of the display unit.
12. How many rows and columns are present in a 16 x 2 alphanumeric LCD?
13. How many data lines are there in a 16 x 2 alphanumeric LCD?
14. Which pin of the LCD is used for adjusting its contrast?
15. Which command of an LCD is used to shift the entire display to the right?
16. Which command is used to select the 2 lines and 5 x 7 matrix of an LCD?
17. What changes are to be made to send data to an LCD?
18. For reading operation from an LCD what changes in the software are introduced?
19. Which instruction is used to select the first row first column of an LCD?
Viva-voce

31 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
31 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Expt. No. 7 INTERFACING EEPROM AND INTERRUPT

Aim:
To write a program to interface EEPROM using I2C protocol with ARM controller and retrieve the stored
messages inside EEPROM.
Apparatus Required:
1. LPC2148 ARM development board
2. Interfacing cables
3. PC
Theory:
I2C (Inter Integrated Circuit):
The I2C (Inter-IC) bus is a bi-directional two-wire serial bus that provides a communication link between
integrated circuits (ICs).I2C is a synchronous protocol that allows a master device to initiate communication
with a slave device. Data is exchanged between these devices.
EEPROM:
EEPROM (electrically erasable programmable read-only memory) is user-modifiable read-only
memory (ROM) that can be erased and reprogrammed (written to) repeatedly through the application of
higher than normal electrical voltage. It is a type of non-volatile memory used in computers and other
electronic devices to store small amounts of data that must be saved when power is removed, e.g.,
calibration tables or device configuration
Read, write and Erase EEPROM by using I2C in LPC2148 Primer Board. Wiring up an I2C based
EEPROM to the I2C port is relatively simple. The basic operation of the I2C based EEPROM's is to send a
command, such as WRITE, followed by an address and the data. In WRITE operation, the EEPROM is
used to store the data. In LPC2148 Primer Kit, 2 nos. of EEPROM lines are controlled by I2C Enabled
drivers. I2C Lines serial clock SCL (P0.2), serial data SDA (P0.3) connected to the I2C based serial
EEPROM IC. The EEPROM read & write operations are done in LPC2148 Primer Kit by using these SDA &
SCL I2C lines.
32 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
32 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To down load and run this program: Refer General procedure given in Page No: 60
Result:
Thus, the program for interfacing I2C based EEPROM with ARM processor has been written and
executed successfully and the memory content is verified on Win x talk terminal.
Outcome:
Able to interface memory ICs with ARM controller and perform the read and write operations.



33 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications:
1. ROM used in toys,automobiles to store data when power is off
2. In calculators and peripheral devices
3. In laser printers
4. And also in embedded systems where program need not to be changed.


1. How does I2C protocol work?
2. What is EEPROM?
3. What is meant by master slave mode?
4. What is meant by non-volatile memory?
5. What is an interrupt?
6. How does an interrupt request works?
7. What is a nested interrupt?
8. What are the registers used for enabling an interrupt?
9. What is PROM?
10. What is EPROM?
11. What is mask ROM?
12. Which memory allows simultaneous read and write operations?
13. Which memory has the shortest access times?
14. Which interrupt has the highest priority?
15. What is non maskable interrupt?
16. Which is the first level of memory access by the microprocessor?
17. List the types of cache memories.
18. What is the use of an interrupt?
19. What is the use of converting an interrupt to threads in a microprocessor?
20. What are the bits used to control an external interrupts?


Viva-voce




34 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00










CYCLE 2 - EXPERIMENTS




35 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 8 IMPLEMENTATION OF MAILBOX FUNCTION
USING LPC2148
Aim:
To create a mailbox in Micro C/OS ? II using LPC2148 ARM Controller
Apparatus Required:
1. LPC2148 ARM development board
2. Interfacing cables
3. PC
Theory:
System or the user code can send a message by the core services. A typical mail message, also
known as the exchange of information, refers to a task or an ISR using a pointer variable, through the core
services to put a message (that is, a pointer) into the mailbox. Similarly, one or more tasks can receive this
message by the core services. The tasks sending and receiving the message promise that the content that
the pointer points to is just that piece of message.
The mailbox of CooCox CoOS is a typical message mailbox which is composed of two parts: one is
the information which expressed by a pointer of void; the other is the waiting list which composed of the
tasks waiting for this mailbox. The waiting list supports two kinds of sorting: FIFO and preemptive priority.
The sorting mode is determined by the user when creating the mailbox.
Procedure:
To Edit / Compile / generate Hex file: Refer General procedure in Page No: 58
To down load and run this program: Refer General procedure in Page No: 60
Result:
Thus, the mailbox was created in Micro C/OS ?II and implemented using LPC2148.
Outcome:
Able to understand the concept of mail box in embedded systems and its significance in real time
systems





36 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications:
1. Used in Acorn RISC PC700
2. Used in ZIPIT wireless messenger
3. Used in Meizu M6 MINI player


1. What is IPC?
2. Define Queue.
3. What are the different types of mail box functions?
4. What is half duplex mode?
5. How many synchronous and asynchronous modes are there in serial port?
6. List the bits used to generate serial port interrupt
7. What is branch prediction?
8. Mention any two features of ?C/OS ? II.
9. Write the function for creating task in ?C/OS ? II.
10. Mention any two support devices for ?C/OS ? II.
11. How many user tasks can be handled by ?C/OS ? II?



















Viva-voce




37 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 9 INTERRUPT PERFORMANCE
CHARACTERISTICSOF ARM AND FPGA

Aim:
To study the interrupt performance characteristics of ARM and FPGA by using ARM controller kit and
FPGA kit separately.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
External Interrupts:
An interrupt caused by an external source such as the computer operator, external sensor or
monitoring device, or another computer. Interrupts are special events that require immediate attention.
Interfacing External Interrupts with LPC2148:
When an external interrupt signal occurs in LPC2148 Primer Board, the message "LOW" will be
displayed on PC. The interrupt signal occurs using switches. When the switch is pressed to LOW, then the
external interrupt occurs. The Vectored Interrupt Controller (VIC) takes 32 interrupt request inputs and
programmable assigns them into 3 categories, FIQ, vectored IRQ, and non-vectored IRQ. The ARM7
LPC2148 Primer board has two numbers of External Interrupts, connected with I/O Port lines (P0.14 &
P0.15) as switches.







38 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00



Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60


39 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
39 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Result:
Thus the interrupt performance characteristics of ARM and FPGA are studied. On comparison, ARM
counts at slow speed because it consumes more instruction cycle and FPGA is more efficient for servicing
and processing external interrupt pulses.
Outcome:
Able to understand the performance characteristics of ARM and FPGA while dealing with
interrrupts
Applications:
1. Used in random logic and SPLDs
2. Used in cryptography and filtering
3. In medical imaging
4. In bioinformatics and voice recognition



1. When is an Interrupt Request received?
2. What is ISR?
3. How do you initialize interrupt?
4. What is Vectored Interrupt Controller?
5. What are the kinds of protection available for SRAMS ?
6. What is interrupt pipelining?
7. What is pipeline shutdown?
8. What is branch prediction?
9. What is the use of Neon Floating point engine?
10. What is the use of ?vectorize option?
11. What is PTM?
12. What is ITM?
13. What is ETM?
14. What is I2S interface?
15. What is the use of ?SWI? in ARM assembly?

Viva-voce




40 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 10 FLASHING OF LEDS
Aim:
To write and execute an embedded c program to display LEDs using LPC 2148 ARM controller
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
Theory:
LED (Light Emitting Diodes) is the most commonly used components, usually for displaying pins digital
states. Typical uses of LEDs include alarm devices, timers and confirmation of user input such as a mouse
click or keystroke. Interfacing LED with LPC2148 Flash a LED using LPC2148 Primer Board. It works by
turning ON a LED & then turning it OFF & then looping back to START. However the operating speed of
microcontroller is very high so the flashing frequency will also be very fast to be detected by human eye.
The ARM7 LPC2148 Primer board has eight numbers of point LEDs, connected with I/O Port lines (P1.16 ?
P1.23) to make port pins high.










41 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00



Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus program for flashing of LEDs is written and executed using ARM controller LPC2148.



42 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Outcome:
Able to interface LED lights via the input output port and control them
Applications:
1. In Illumination
2. As status indicators in equipments
3. Stadium displays and dynamic decorative displays



1. What is seven segment displays?
2. What are the different configurations of LED?
3. What is the function of GPIO?
4. What are the Pins which are used to connect LEDs?
5. How to identify 'Polarity' of LED?
6. Differentiate LED from LCD.
7. What is a use of Jumper?
8. How many numbers of LEDs present in Primer board?
9. Where LEDs are used?
10. What is the use of flash magic software?
11. Which port is used in ARM 7 processor kit?
12. Which diode suffers an avalanche breakdown?
13. What happens if the junction temperature of LED is increased?
14. What is an anti collision rate light?
15. What is fail-safe conditions






Viva-voce




43 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 11 STEPPER MOTOR INTERFACE WITH
ARM -7 LPC2148
Aim:
To write a program to interface stepper motor using ARM processor and control the movement of motor
in either directions.
Apparatus Required:
1. LPC2148 ARM development board
2. Stepper motor
3. Interfacing cables
4. PC
Theory:
A stepper motor can be viewed as a DC motor with number of poles (on both rotor and stator).
Additionally, soft magnetic material with many teeth on the rotor and stator cheaply multiplies the number of
poles (reluctance motor). Like an AC synchronous motor, it is ideally driven by sinusoidal current, allowing
a step less operation, but this puts some burden on the controller. When using an 8-bit digital controller,
256 micro steps per step are possible. As a digital-to-analog converter produces unwanted ohmic heat in
the controller, pulse-width modulation is used to regulate the mean current. Simpler models switch voltage
only for doing a step, thus needing an extra current limiter: for every step, they switch a single cable to the
motor.
The idea is to connect the output pins of the driver to 4 transistors. The transistor must be
grounded at the emitter and the driver pin must be connected to the base. Collector is connected to the coil
wire of the motor. Stepper motors are rated by the torque they produce. Synchronous electric motors using
soft magnetic materials (having a core) have the ability to provide position holding torque (called detent
torque, and sometimes included in the specifications) while not driven electrically. To achieve full rated
torque, the coils in a stepper motor must reach their full rated current during each step. The voltage rating
(if there is one) is almost meaningless. The motors also suffer from EMF, which means that once the coil is
turned off it starts to generate current because the motor is still rotating. There needs to be an explicit way
to handle this extra current in a circuit otherwise it can cause damage and affect performance of the motor.
44 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
44 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus stepper motor interface with ARM processor has been successfully implemented and the motor is
controlled in clockwise and anticlockwise direction.
Outcome:
Able to interface the stepper motor with ARM controller and thereby create some rotational
movements





45 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Applications:
3. Used for precise positioning with a motor
4. Used in hard disk drives, robotics
5. Used in telescopes and toys







1. Define GPIO.
2. What is the function of ULN2803?
3. How LPC2148 control stepper motor?
4. Which I/O port lines used to rotate stepper motor?
5. How stepper motor reacts for each pulse it receives?
6. What is serial communication?
7. What is parallel communication?
8. What is stepper motor & why it is named so?
9. How can be step angle is calculated?
10. What are the advantages and disadvantages of parallel communication?
11. What does instruction-pipelining mean?
12. What is the power supply required for ARM processor?
13. What is a unit for torque?
14. What is RPM rating for a DC motor?
15. What device that is used to obtain an accurate position control of rotating shafts in terms of steps?
Viva-voce

46 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
46 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Expt. No. 12 LM35 TEMPERATURE SENSOR INTERFACE
WITH ARM-7 LPC2148
Aim:
To write a program to interface of LM35 temperature sensor to on-chip ADC of ARM controller and
display the room temperature value on the screen.
Apparatus Required:
1. LPC2148 ARM development board
2. Temperature sensor
3. Interfacing cables
4. PC
Theory:
Temperature Sensor:
The LM35 series are precision integrated-circuit temperature sensors, whose output voltage is linearly
proportional to the Celsius (Centigrade) temperature. The output of the sensor is converted to digital output
that is easy to connect with microcontroller. Temperature sensor has three terminals and required
Maximum of 5.5 V supply. This type of sensor consists of a material that performs the operation according
to temperature to vary the resistance. This change of resistance is sensed by circuit and it calculates
temperature. When the voltage increases then the temperature also rises. We can see this operation by
using a diode.







47 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
47 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00


Circuit diagram:

48 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
48 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the program for interfacing temperature sensor with ARM controller is written and executed and
the temperature reading is seen on the monitor.
Outcome:
Able to interface different sensors with in-built ADC of the ARM processor and access the data
produced from them
Applications:
1. Used in Ovens, refrigerators
2. In HVAC environmental control
3. coolant or cylinder head temperatures
4. in the automotive industry to monitor air intake



1. What is LM35?
2. Define ISP.
3. How many Analog-to-Digital Converters available as an inner peripheral in LPC2148?
4. What is the main function of analog pin in LPC 2148?
5. What is the output voltage produced by LM35 for one degree temperature?
6. What is the difference between LM 34 and LM 35 sensors?
7. How many pins are available in LM35?
8. Why Vref is set of ADC0848 to 2.56 V if analog input is connected to the LM35?
9. What is operating the operating temperature range in LM35?
10. Why LM35 is used to Measure Temperature?
11. List the devices used to sense temperature.
12. What is the purpose of a thermocouple?
13. What is the output voltage of a thermocouple?
Viva-voce




49 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 13 IMPLEMENTATION OF WIRELESS
COMMUNICATION PROTOCOL
USING ZIGBEE WIRELESS MODULE
Aim:
To implement wireless communication protocol using zigbee wireless module with the help of ARM
processor
Apparatus required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. Zigbee module
5. PC
Theory:
ZigBee is a specification to suite high level communication protocols using small, low-power digital
radios based on an IEEE 802 standard for personal area networks. The ZigBee is the name of a wireless
protocol maintained by the IEEE 802.15 standard. This is a protocol specified for wireless Personal Area
Network (PAN) using low powered wireless transceivers. There are already wireless transmitter and
receiver modules which can do point to point communication. The Xbee is the brand name a wireless
transceiver device introduced by the Digi international which works on the ZigBee protocol and can form
PAN networks. They have an approximate range of 10 to 100 meters and are used in industries, scientific
fields, medical fields etc
Digi ZigBee:
The Digi Xbee 802.15.4 modules are the easiest to use, most reliable and cost-effective RF devices.
The 802.15.4 Xbee modules provide two friendly modes of communication - a simple serial method to
transmit/receive or a framed mode providing advanced features. These modules can communicate point to
point, from one point to a PC, or in a mesh network.



50 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
50 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Circuit diagram:


Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the wireless communication protocol using Zigbee wireless module is implemented using
LPC2148.
Outcome:
Able to form a wireless network using zigbee module and ARM controller




51 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications:
1. Used in traffic lights in non-urban areas
2. Used in building control systems
3. Used in asset tracking
4. Used in parking sensors




1. How many UART ports available in LPC2148?
2. What is the main function of voltage convertors in UART?
3. Why Zigbee based is preferred for wireless communication?
4. What is the IEEE standard for Zigbee protocol?
5. Write the two modes of communication are used in a ZigBee network.
6. What is the function of a scheduler?
7. Mention any two features of ?C/OS ? II.
8. Write the function for creating task in ?C/OS ? II.
9. Mention any two support devices for ?C/OS ? II.
10. How many user tasks can be handled by ?C/OS ? II?







Viva-voce




52 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

















ADDITIONAL EXPERIMENTS
53 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
53 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Expt. No. 14 BUZZER INTERFACE WITH ARM-7 LPC2148
Aim:
To write a program for buzzer interface with ARM processor and control its operation.
Apparatus required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
Theory:
Buzzer is an electronic device commonly used to produce sound. Light weight, simple construction and
low price make it usable in various applications like car/truck reversing indicator, computers, call bells etc.
Piezo buzzer is based on the inverse principle of piezo electricity discovered in 1880 by Jacques and Pierre
Curie. It is the phenomena of generating electricity when mechanical pressure is applied to certain
materials and the vice versa is also true. Such materials are called piezo electric materials. Piezo electric
materials are either naturally available or manmade. Piezo ceramic is class of manmade material, which
poses piezo electric effect and is widely used to make disc, the heart of piezo buzzer. When subjected to
an alternating electric field they stretch or compress, in accordance with the frequency of the signal thereby
producing sound.







54 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
54 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the program for interfacing buzzer with ARM processor is written and executed and output is
verified.
Outcome:
Able to interface devices such as buzzer, relay with ARM controller





55 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Applications:

1. In alarm devices and timers
2. In confirmation of user input such as mouse click or keystroke
3. Alarming Circuits
4. Communication equipments
5. Automobile electronics
6. Portable equipments, due to its compact size





1. Define Buzzer.
2. Which pin in ARM can be used to modulate Buzzer?
3. What is the function Flash magic software?
4. How the Buzzer can be disconnected in LPC2148?
5. How the volume of sound will be changed in Buzzer?
6. What is a buzzer
7. What are the applications of buzzer?
8. How buzzer is used in embedded system?
9. What is race round condition?
10. What is digital signal controller?
11. What are the features of buzzer circuit?
12. What is a semaphore?
13. What is mutexes?
14. What is the role of segment register?
15. What is watch dog timer?

Viva-voce

56 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
56 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Expt. No. 15 RELAY INTERFACE WITH ARM - 7
Aim:
To write a program to interface 2 relays with LPC 2148 ARM Controller and verify its working.
Apparatus required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
Theory:
A relay is an electrically operated switch. Many relays use an electromagnet to mechanically operate a
switch, but other operating principles are also used, such as solid-state relays. Relays are used where it is
necessary to control a circuit by a low-power signal (with complete electrical isolation between control and
controlled circuits), or where several circuits must be controlled by one signal. The first relays were used in
long distance telegraph circuits as amplifiers: they repeated the signal coming in from one circuit and re-
transmitted it on another circuit. Relays were used extensively in telephone exchanges and early
computers to perform logical operations.
57 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
57 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
The program for interfacing relays with ARM controller is done and its working is verified.
Outcome:
Able to interface devices such as relay with ARM controller and control them using programs.






58 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications:
1. Used in homes, even in streets.
2. In automatic garage door for its movement and direction.
3. And even in refrigerators
4. In industries to provide energy on machineries.
5. In electrical fuel pump



1. What is the function of relay?
2. What is the function of Opto-isolator?
3. What is the function of power transistor in LPC2148?
4. Which pin acts as an output port for relay?
5. What is a relay circuit
6. what are the applications of relay circuit
7. what are the advantages of relay circuit
8. How does combination of functions reduce memory requirements in embedded systems?
9. What is the need for DMAC in ES?
10. Mention how I/O devices are classified for embedded system?
11. Explain what is interrupt latency? How can you reduce it?
12. What does DMA address will deal with?
13. List out various uses of timers in embedded system?
14. List out some of the commonly found errors in Embedded Systems?
15. What is the difference between macro and line function.



Viva-voce

FirstRanker.com - FirstRanker's Choice
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00






?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING

VII SEMESTER - R 2013

EC6711 ? EMBEDDED LABORATORY






Name : _______________________________________
Register No : _______________________________________
Section : _______________________________________
LABORATORY MANUAL



2 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00




is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and
training.

? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different
levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on
heart and soul
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

To impart professional education integrated with human values to the younger generation, so as to
shape them as proficient and dedicated engineers, capable of providing comprehensive solutions to the
challenges in deploying technology for the service of humanity

? To educate the students with the state-of-art technologies to meet the growing challenges of the
electronics industry
? To carry out research through continuous interaction with research institutes and industry, on
advances in communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning,
innovation and ethical practices
VISION
VISION
MISSION
MISSION



3 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

PROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To provide students with a solid foundation in Mathematics, Science and fundamentals of
engineering, enabling them to apply, to find solutions for engineering problems and use this knowledge
to acquire higher education
2. Core Competence
To train the students in Electronics and Communication technologies so that they apply their
knowledge and training to compare, and to analyze various engineering industrial problems to find
solutions
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice which
enables them to find solutions for the real time problems in industry, and to design products
4. Professionalism
To inculcate professional and effective communication skills, leadership qualities and team spirit in
the students to make them multi-faceted personalities and develop their ability to relate engineering
issues to broader social context
5. Lifelong Learning/Ethics
To demonstrate and practice ethical and professional responsibilities in the industry and society in
the large, through commitment and lifelong learning needed for successful professional career


4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
PROGRAMME OUTCOMES (POs)
a) To demonstrate and apply knowledge of Mathematics, Science and engineering fundamentals in
Electronics and Communication Engineering field
b) To design a component, a system or a process to meet the specific needs within the realistic
constraints such as economics, environment, ethics, health, safety and manufacturability
c) To demonstrate the competency to use software tools for computation, simulation and testing of electronics
and communication engineering circuits
d) To identify, formulate and solve electronic and communication engineering problems
e) To demonstrate an ability to visualize and work on laboratory and multidisciplinary tasks
f) To function as a member or a leader in multidisciplinary activities
g) To communicate in verbal and written form with fellow engineers and society at large
h) To understand the impact of Electronics and Communication Engineering in the society and demonstrate
awareness of contemporary issues and commitment to give solutions exhibiting social responsibility
i) To demonstrate professional & ethical responsibilities
j) To exhibit confidence in self-education and ability for lifelong learning
k) To participate and succeed in competitive exams


5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
SYLLABUS

? Learn the working of ARM processor
? Understand the Building Blocks of Embedded Systems
? Learn the concept of memory map and memory interface
? Know the characteristics of Real Time Systems
? Write programs to interface memory, I/Os with processor
? Study the interrupt performance
LIST OF EXPERIMENTS:
1. Study of ARM evaluation system
2. Interfacing ADC and DAC
3. Interfacing LED and PWM
4. Interfacing real time clock and serial port
5. Interfacing keyboard and LCD
6. Interfacing EPROM and interrupt
7. Mailbox
8. Interrupt performance characteristics of ARM and FPGA
9. Flashing of LEDS
10. Interfacing stepper motor and temperature sensor
11. Implementing zigbee protocol with ARM



? Write programs in ARM for a specific Application
? Interface memory and Write programs related to memory operations
? Interface A/D and D/A convertors with ARM system
? Analyze the performance of interrupt
? Write programmes for interfacing keyboard, display, motor and sensor.
? Formulate a mini project using embedded system
COURSE OBJECTIVES
COURSE OUTCOMES
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
CONTENTS
Sl. No. Name of the Experiment Page No.
CYCLE 1 ? EXPERIMENTS
1
Study of ARM evaluation system 7
2
Analog to Digital Convertor interfacing 16
3
Generation of ramp and square wave using on-Chip DAC 19
4
LED dimming using PWM 22
5
Interfacing real time clock and serial port 25
6
Interfacing keypad and LCD 28
7
Interfacing EPROM and interrupt 31
CYCLE 2 ? EXPERIMENTS
8 Implementation of Mailbox Function using LPC 2148 35
9 Interrupt Performance Characteristics of Arm and FPGA 37
10 Flashing of LEDs 40
11 Stepper Motor Interface with ARM ? 7 LPC2148 43
12 LM35 Temperature Sensor Interface with ARM ? 7 LPC2148 47
13
Implementation of Wireless Communication Protocol using ZIGBEE Wireless
Module
50
ADDITIONAL EXPERIMENTS BEYOND THE SYYLABUS
14 Buzzer Interface with ARM ? 7 54
15 Relay interface with ARM? 7 57
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Expt. No. 1 STUDY OF ARM EVALUATION SYSTEM
Aim:
To study the building blocks of ARM7 system, its features, pin configuration and the components
required for functioning of ARM controller.
Architecture Overview:
A RISC-based computer design approach means ARM processors require significantly fewer transistors
than typical processors in average computers. This approach reduces cost, heat and power usage. These
are desirable traits for light, portable, battery-powered devices (smart phones, laptops, tablet and notepad
computers), and other embedded systems. A simpler design facilitates more efficient multi-core CPUs and
higher core counts at lower cost, providing higher processing power and improved energy efficiency for
servers and supercomputers.
In 2005, about 98% of all mobile phones sold used at least one ARM processor. The low power
consumption of ARM processors has made them very popular: 37 billion ARM processors have been
produced as of 2013, up from 10 billion in 2008. The ARM architecture (32-bit) is the most widely used
architecture in mobile devices, and most popular 32-bit one in embedded systems.
According to ARM Holdings, in 2010 alone, producers of chips based on ARM architectures
reported shipments of 6.1 billion ARM based processors, representing 95% of smart phones, 35% of digital
televisions and set-top boxes and 10% of mobile computers. It is the most widely used 32-bit instruction set
architecture in terms of quantity produced.
LPC 2148:
LPC2148 is the widely used IC from ARM-7 family. It is manufactured by Philips and it is pre-loaded
with many inbuilt peripherals making it more efficient and a reliable option for the beginners as well as high
end application developer.




8 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Features of LPC214x series controllers:
1. 8 to 40 kB of on-chip static RAM and 32 to 512 kB of on-chip flash program memory.128 bit wide
interface/accelerator enables high speed 60 MHz operation.
2. In-System/In-Application Programming (ISP/IAP) via on-chip boot-loader software. Single flash sector or
full chip erase in 400 ms and programming of 256 bytes in 1ms.
3. Embedded ICE RT and Embedded Trace interfaces offer real-time debugging with the on-chip Real
Monitor software and high speed tracing of instruction execution.
4. USB 2.0 Full Speed compliant Device Controller with 2 kB of endpoint RAM. In addition, the LPC2146/8
provides 8 kB of on-chip RAM accessible to USB by DMA.
5. One or two (LPC2141/2 vs. LPC2144/6/8) 10-bit A/D converters provide a total of 6/14analog inputs, with
conversion times as low as 2.44 us per channel.
6. Single 10-bit D/A converter provides variable analog output.
7. Two 32-bit timers/external event counters (with four capture and four compare channels each), PWM unit
(six outputs) and watchdog.
8. Low power real-time clock with independent power and dedicated 32 kHz clock input.
9. Multiple serial interfaces including two UARTs (16C550), two Fast I2C-bus (400 kbit/s), SPI and SSP with
buffering and variable data length capabilities.
10. Vectored interrupt controller with configurable priorities and vector addresses.
11. Up to 45 of 5 V tolerant fast general purpose I/O pins in a tiny LQFP64 package.
12. Up to nine edge or level sensitive external interrupt pins available.
13. On-chip integrated oscillator operates with an external crystal in range from 1 MHz to30 MHz and with
an external oscillator up to 50 MHz
14. Power saving modes include Idle and Power-down.
15. Individual enable/disable of peripheral functions as well as peripheral clock scaling for additional power
optimization.
16. Processor wake-up from Power-down mode via external interrupt, USB, Brown-Out Detect (BOD) or
Real-Time Clock (RTC).




9 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


First Step- Hardware Requirement:
Pin configuration of LPC 2148.

Hardware requirement of LPC2148:
1. LPC2148 need minimum below listed hardware to work properly
2. Power Supply
3. Crystal Oscillator
4. Reset Circuit
5. RTC crystal oscillator
6. UART
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Power Supply:
LPC2148 works on 3.3 V power supply. LM 117 can be used for generating 3.3 V supply. However,
basic peripherals like LCD, ULN 2003 (Motor Driver IC) etc. works on 5V. So AC mains supply is converted
into 5V using below mentioned circuit and after that LM 117 is used to convert 5V into 3.3V.
Block diagram of power Supply

Transformer: It is used to step down 230V AC to 9V AC supply and provides isolation between power grids
and circuit.
Rectifier: It is used to convert AC supply into DC.
Filter: It is used to reduce ripple factor of DC output available from rectifier end.
Regulator: It is used to regulate DC supply output.

11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Circuit Diagram:

Regulator IC 7805 is used to provide fix 5V dc supply.
LM 117 is used for generating 3.3V supply from 5V.

12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Calculations:

From the datasheet of LM117

Taking R 2= 240?, we get R 1=392?
Reset Circuit:
Reset button is essential in a system to avoid programming pitfalls and manually bring back the system
to the initialization mode. MCP 130T is a special IC used for providing stable RESET signal to LPC 2148.


13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Oscillator Circuit:

The value of capacitors C20 & C21 depends upon the frequency of crystal Y3. General circuit and
its equivalent circuit is as shown below.

14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Recommended values are as shown in table:

UART:
LPC 2148 has inbuilt ISP which means we can program it within the system using serial
communication on COM0. It has also COM1 for serial communication. MAX 232/233 IC must be used for
voltage logic conversion. Related connections are as given below.

Once the above listed circuit design is ready, we are ready to go further.



15 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Result:
ARM Evaluation system and the configuration of LPC2148 has been studied fully. The minimal setup
required for the functioning of the ARM processor is studied.
Outcomes:
1. Able to understand the ARM controller, its basic components inside and its features.
2. Able to know the components required for the working of ARM LPC2148

Applications:
ARM controller LPC2148 is used in no. of devices such as
1. Smart phones
2. Net books
3. E Readers
4. Digital TV
5. Home Gateways


1. What are the basic units of ARM 7?
2. What is the address system supported by ARM?
3. Define - RISC
4. What are the instructions used to access the memory in ARM?
5. What are the basic units of Microprocessor?
6. What is an Instruction?
7. What is clock cycle?
8. Define - Pipelining
9. What is cache miss?
10. What is meant by memory mapped I/O?
11. Define ? interrupt
12. What is meant by Exception?
13. What is meant by little ? endian mode?
14. What is meant by big ? endian mode?
15. What is the function of CPSR?
16. What is register - indirect addressing?
Viva-voce




16 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 2 ANALOG TO DIGITAL CONVERTOR
INTERFACING
Aim:
To write an embedded c program for interfacing an on chip ADC with LPC2148 ARM processor and
convert the given input voltage into corresponding decimal values.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. PC
Theory:
Analog to Digital converter (ADC) is a device that converts continuously varying analog signals from
instruments that monitor such conditions as movement, temperature, sound, etc., into binary code for the
computer. It may be either a single chip or can be one circuit within a chip. Analog to Digital conversion is
the process of changing continuously varying data, such as voltage, current, or shaft rotation, into discrete
digital quantities that represent the magnitude of the data compared to a standard or reference at the
moment the conversion is made. According to the method of conversion, ADCs can be classified into
Direct-Conversion ADCs, Successive Approximation ADCs, Integrating ADC and Sigma-Delta ADCs.
The LPC 2148 has 10-bit successive approximation analog to digital converter. Basic clocking for the
A/D converters is provided by the VPB clock. A programmable divider is included in each converter, to
scale this clock to the 4.5 MHz (max) clock needed by the successive approximation process. A fully
accurate conversion requires 11 of these clocks. The ADC cell can measure the voltage on any of the ADC
input signals. It is noted that these analog inputs are always connected to their pins, even if the Pin function
Select register assigns them to port pins. A simple self-test of the ADC can be done by driving these pins
as port outputs.



17 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Circuit diagram:




18 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus, an embedded c program for interfacing on-chip ADC with ARM processor is written and
executed. The decimal values of the converted voltage are seen in the WinXTalk screen.
Outcome:
Able to interface A/D convertors with ARM system and check its working by connecting an analog
quantity as input.
Applications:
1. ADC used in MODEM for converting analog signals to digital.
2. A fast video ADC in TV tuner cards
3. ADC used in digital storage oscilloscopes
4. Used in music reproduction technology.
5. Used in DSP if input is analog


1. What are the ADC operating modes in LPC2148?
2. What is meant by conversion time?
3. Why are internal ADCs preferred over external ADCs?
4. Why has 16-bit ADC more resolution than from 10-bit and 8-bit ADC?
5. What are ADC & its Resolution?
6. What is Burst conversion mode?
7. What is the function of A/D Control Register?
8. What is the function of A/D Global Data Register?
9. What is the function of A/D Status Register?
10. What is analog-to-digital (ADC) conversion error?
11. What is the function of Sample-and-hold circuits in analog-to digital converters?
12. What is the disadvantage of the flash analog-to digital converter?
Viva-voce




19 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 3 GENERATION OF RAMP AND SQUARE
WAVE USING ON-CHIP DAC
Aim:
To write and execute an embedded c program to generate ramp wave and square wave using on-chip
DAC of LPC2148 ARM controller.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
A digital-to-analog converter is a device for converting a digital signal into an analog signal (current or
voltage). Digital-to-Analog Converters are the interface between the abstract digital world and the analog
real world. Simple switches, a network of resistors, current sources or capacitors may be used to
implement this conversion. A DAC inputs a binary number and outputs an analog voltage or current signal.
The Microchip Technology Inc. MCP4921 is 2.7 ? 5.5V, low-power, 12-Bit Digital-to-Analog Converter
(DAC) with SPI interface. The MCP4921 DAC provides high accuracy and low noise performance for
industrial applications where calibration or compensation of signals is required. With an SPI connection
there is always one master device (usually a microcontroller) which controls the peripheral devices.
Typically there are three lines common to all the devices,
Master In Slave Out (MISO) ? The Slave line for sending data to the master,
Master Out Slave In (MOSI) ? The Master line for sending data to the peripherals,
Serial Clock (SCK) ? The clock pulses which synchronize data transmission generated by the
master and slave
Slave Select pin ? the pin on each device that the master can use to enable and disable specific
devices. When a device Slave Select pin is low, it communicates with the master. When it is high, it ignores
the master. In SPI, the clock signal is controlled by the master device LPC2148. All data is clocked in and
out using this pin. These lines need to be connected to the relevant pins on the LPC21xx processor. Any
unused GIO pin can be used for CS, instead pull this pin high. Conversion speed is the time it takes for the



20 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

DAC to provide an analog output when the digital input word is changed. The MCP4291 DAC ? SPI
connections with LPC21xx have four I/O lines (P0.4 ? P0.7) required. The analog output is generated by
using these four lines.
Circuit diagram:


Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the embedded c programs for generating ramp wave and square wave using ARM LPC2148 are
written and executed successfully and the waveforms are viewed in oscilloscope.
Outcome:
Able to program the DAC in-built inside the ARM controller and get the waveforms using it.




21 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications :
1. DAC used in Audio amplifier.
2. Video encoder
3. Display electronics
4. Data Acquistion systems
5. Motor control



1. What are the features of LPC2148 DAC?
2. What is the function of DAC register?
3. Which pin provides a voltage reference level for the D/A converter?
4. What are the applications of DAC in signal processing applications?
5. What is GIO?
6. What is the resolution of a digital-to-analog converter (DAC)?
7. What is the major advantage of the R/2R ladder digital-to-analog (DAC), as compared to a binary-
weighted digital-to-analog DAC converter?
8. What is the resolution of a 0?5 V 6-bit digital-to-analog converter (DAC) ?
9. What are DAC configurations?
10. What are the different types of DAC Circuits?
11. What are the Limitations of the Binary Weighted DAC?
12. What are the General DAC Characteristics?
13. Define reference voltage in DAC.
14. What is full scale voltage?
15. What is settling time?
VIVA-VOCE




22 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 4 LED DIMMING USING PWM

Aim:
To write an embedded c program for implementing PWM using ARM controller and verify the same by
dimming of LEDs.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
LPC2148 supports 2 types of PWM:
1) Single Edge PWM ? Pulse starts with new Period i.e pulse is always at the beginning
2) Double Edge PWM ? Pulse can be anywhere within the Period
A PWM block, like a Timer block , has a Timer Counter and an associated Pre-scale Register along
with Match Registers. These work exactly the same way as in the case of Timers. Match Registers 1 to 6
(except 0) are pinned on LPC214x i.e. the corresponding outputs are diverted to actual Pins on LPC214x
MCU. The PWM function must be selected for these Pins to get the PWM output.
The basic setup is to simply replace Servo by a LED and no external 5V source is needed. The
anode of LED is connected to P0.0 and cathode to ground. Pulse Widths corresponding to the switches
connected to P0.1/2/3/4 will be 2.5ms/5ms/7.5ms/10ms respectively. As the Pulse Width Increases LED
will keep on getting brighter and the reverse will happen if Pulse Width is decreased.



23 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus embedded c program for implementing Pulse Width Modulation is written and executed and
output has been verified in LED display.
Outcome:
Able to implement PWM using the ARM controller and verify the same in the form of dimming of
LEDS.



24 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Applications :
1. In Visual signals to covey a message
2. Illumination where light is reflected from objects
3. In Narrow band sensors



1. What factors determine the LED dimming performance?
2. What is meant by analog dimming?
3. What is flickering effect?
4. What is the factor determines dimming of the LED
5. Why Silicon is not suitable for fabrication of light-emitting diodes?
6. Why Silicon diode is less suited for low voltage rectifier operation?
7. What is the principle of zener diode?
8. What are the materials used to make LED?
9. What type of diodes is used in FM receivers?
10. Which diode suffers an avalanche breakdown?
11. What happens if the junction temperature of LED is increased?
12. How a transfer characteristic of a diode does is related?
13. What is the requirement of a clipping action of a diode?
14. What type of rectifier circuit requires four diodes?
15. Why are the pulse width modulated outputs required in most of the applications?
16. How do the variations in an average value get affected by PWM period?
17. Name the common formats available for LED display.
18. What are the types of seven segment display?
19. What is PWM?
20. What are the applications of PWM?

Viva-voce




25 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 5 INTERFACING REAL TIME CLOCK
AND SERIAL PORT
Aim:
To write and execute an embedded c program to interface DS1307 RTC using I2C protocol with ARM
controller
Apparatus Required:
1. LPC2148 ARM development board
2. Stepper motor
3. Interfacing cables
4. PC
Theory:
A clock, which is based on the interrupts at preset intervals, is Real Time Clock (RTC). An interrupt
service routine executes on each timeout (overflow) of this clock. This timing device once started never
resets or never reloaded with another value. Once it is set, it is not modified later. It is used in a system to
save the time and date.













26 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the program for interfacing real time clock with ARM controller is written and executed and the
date and time are verified on the screen.
Outcome:
Able to interface real time clock DS1307 with ARM controller and thereby display date and time
Applications :
1. I2C In ARM and PIC microcontrollers
2. Used as serial communication protocol with MASTER and SLAVE operation.

27 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
27 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00




1. What is I2C and how does it work?
2. What are the features of I2C in LPC2148 ARM7 microcontroller?
3. What is the function of I2C0CONSET register?
4. What is I2C0STAT?
5. What is the function of I2C0 Data Register?
6. What is RTC?
7. List the advantages of RTC
8. Through which port the date and time is displayed in RTC?
9. What is a serial port?
10. List the registers used to transfer data in serial port.
11. List the modes used for data transmission.
12. What is a simplex mode?
13. Which pin is used to transmit a character?
14. What is the baud rate of serial port?
15. What is the disadvantage of RS-232C?














Viva-voce




28 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 6 INTERFACING KEYPAD AND LCD

Aim:
To write an embedded c program to interface 4 x 4 matrix keypad with ARM processor and display the
pressed key in an LCD.
Apparatus Required:
1. LPC2148 ARM development board
2. Interfacing cables
3. PC
Theory:

In matrix keypad, keys are connected in rows and columns. When any switch is pressed, rows and
columns come into contact, which is that detected by controller to identify which key has been pressed. A
4?4 matrix keypad consists of 4 rows and 4 columns. There is a switch connecting each row and column.
So the combinations of rows and columns make up the 16 inputs.Initially all the switches are open (not
connected). When any one button is pressed, the switch is closed (connected),hence there is a connection
between the row and column. The first 4 pins are connected to the column as INPUT. The other 4 pins are
connected to the row as OUTPUT. Matrix keypad is a good substitution to normal push button.












29 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Circuit Diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus program for interfacing matrix keypad with ARM controller is written and executed and the key
pressed is seen in the LCD.



30 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Outcome:
Able to interface keypad with ARM controller and see the pressed key in the LCD display.
Applications :
1. Used in password based door locking system
2. Security system with user changeable
3. Used in laptops, computer games
4. Used in portable video games and cell phones



1. What is Matrix keypad?
2. What is the concept behind keypad interface?
3. What are the functions of pull- up resistors?
4. What is key de bouncing?
5. List the steps involved when the key in a 4 x 4 keyboard matrix is being pressed.
6. What is the value obtained if no key is pressed?
7. What kind of interrupt is generated if a key has to be operated in an interrupt mode?
8. How will you identify that the key is pressed?
9. What are the steps involved in Keyboard Interfacing?
10. List the registers used to store the keyboard, display modes and other operations programmed by
CPU.
11. Name the mode when a data is entered from the left side of the display unit.
12. How many rows and columns are present in a 16 x 2 alphanumeric LCD?
13. How many data lines are there in a 16 x 2 alphanumeric LCD?
14. Which pin of the LCD is used for adjusting its contrast?
15. Which command of an LCD is used to shift the entire display to the right?
16. Which command is used to select the 2 lines and 5 x 7 matrix of an LCD?
17. What changes are to be made to send data to an LCD?
18. For reading operation from an LCD what changes in the software are introduced?
19. Which instruction is used to select the first row first column of an LCD?
Viva-voce

31 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
31 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Expt. No. 7 INTERFACING EEPROM AND INTERRUPT

Aim:
To write a program to interface EEPROM using I2C protocol with ARM controller and retrieve the stored
messages inside EEPROM.
Apparatus Required:
1. LPC2148 ARM development board
2. Interfacing cables
3. PC
Theory:
I2C (Inter Integrated Circuit):
The I2C (Inter-IC) bus is a bi-directional two-wire serial bus that provides a communication link between
integrated circuits (ICs).I2C is a synchronous protocol that allows a master device to initiate communication
with a slave device. Data is exchanged between these devices.
EEPROM:
EEPROM (electrically erasable programmable read-only memory) is user-modifiable read-only
memory (ROM) that can be erased and reprogrammed (written to) repeatedly through the application of
higher than normal electrical voltage. It is a type of non-volatile memory used in computers and other
electronic devices to store small amounts of data that must be saved when power is removed, e.g.,
calibration tables or device configuration
Read, write and Erase EEPROM by using I2C in LPC2148 Primer Board. Wiring up an I2C based
EEPROM to the I2C port is relatively simple. The basic operation of the I2C based EEPROM's is to send a
command, such as WRITE, followed by an address and the data. In WRITE operation, the EEPROM is
used to store the data. In LPC2148 Primer Kit, 2 nos. of EEPROM lines are controlled by I2C Enabled
drivers. I2C Lines serial clock SCL (P0.2), serial data SDA (P0.3) connected to the I2C based serial
EEPROM IC. The EEPROM read & write operations are done in LPC2148 Primer Kit by using these SDA &
SCL I2C lines.
32 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
32 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To down load and run this program: Refer General procedure given in Page No: 60
Result:
Thus, the program for interfacing I2C based EEPROM with ARM processor has been written and
executed successfully and the memory content is verified on Win x talk terminal.
Outcome:
Able to interface memory ICs with ARM controller and perform the read and write operations.



33 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications:
1. ROM used in toys,automobiles to store data when power is off
2. In calculators and peripheral devices
3. In laser printers
4. And also in embedded systems where program need not to be changed.


1. How does I2C protocol work?
2. What is EEPROM?
3. What is meant by master slave mode?
4. What is meant by non-volatile memory?
5. What is an interrupt?
6. How does an interrupt request works?
7. What is a nested interrupt?
8. What are the registers used for enabling an interrupt?
9. What is PROM?
10. What is EPROM?
11. What is mask ROM?
12. Which memory allows simultaneous read and write operations?
13. Which memory has the shortest access times?
14. Which interrupt has the highest priority?
15. What is non maskable interrupt?
16. Which is the first level of memory access by the microprocessor?
17. List the types of cache memories.
18. What is the use of an interrupt?
19. What is the use of converting an interrupt to threads in a microprocessor?
20. What are the bits used to control an external interrupts?


Viva-voce




34 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00










CYCLE 2 - EXPERIMENTS




35 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 8 IMPLEMENTATION OF MAILBOX FUNCTION
USING LPC2148
Aim:
To create a mailbox in Micro C/OS ? II using LPC2148 ARM Controller
Apparatus Required:
1. LPC2148 ARM development board
2. Interfacing cables
3. PC
Theory:
System or the user code can send a message by the core services. A typical mail message, also
known as the exchange of information, refers to a task or an ISR using a pointer variable, through the core
services to put a message (that is, a pointer) into the mailbox. Similarly, one or more tasks can receive this
message by the core services. The tasks sending and receiving the message promise that the content that
the pointer points to is just that piece of message.
The mailbox of CooCox CoOS is a typical message mailbox which is composed of two parts: one is
the information which expressed by a pointer of void; the other is the waiting list which composed of the
tasks waiting for this mailbox. The waiting list supports two kinds of sorting: FIFO and preemptive priority.
The sorting mode is determined by the user when creating the mailbox.
Procedure:
To Edit / Compile / generate Hex file: Refer General procedure in Page No: 58
To down load and run this program: Refer General procedure in Page No: 60
Result:
Thus, the mailbox was created in Micro C/OS ?II and implemented using LPC2148.
Outcome:
Able to understand the concept of mail box in embedded systems and its significance in real time
systems





36 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications:
1. Used in Acorn RISC PC700
2. Used in ZIPIT wireless messenger
3. Used in Meizu M6 MINI player


1. What is IPC?
2. Define Queue.
3. What are the different types of mail box functions?
4. What is half duplex mode?
5. How many synchronous and asynchronous modes are there in serial port?
6. List the bits used to generate serial port interrupt
7. What is branch prediction?
8. Mention any two features of ?C/OS ? II.
9. Write the function for creating task in ?C/OS ? II.
10. Mention any two support devices for ?C/OS ? II.
11. How many user tasks can be handled by ?C/OS ? II?



















Viva-voce




37 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 9 INTERRUPT PERFORMANCE
CHARACTERISTICSOF ARM AND FPGA

Aim:
To study the interrupt performance characteristics of ARM and FPGA by using ARM controller kit and
FPGA kit separately.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
External Interrupts:
An interrupt caused by an external source such as the computer operator, external sensor or
monitoring device, or another computer. Interrupts are special events that require immediate attention.
Interfacing External Interrupts with LPC2148:
When an external interrupt signal occurs in LPC2148 Primer Board, the message "LOW" will be
displayed on PC. The interrupt signal occurs using switches. When the switch is pressed to LOW, then the
external interrupt occurs. The Vectored Interrupt Controller (VIC) takes 32 interrupt request inputs and
programmable assigns them into 3 categories, FIQ, vectored IRQ, and non-vectored IRQ. The ARM7
LPC2148 Primer board has two numbers of External Interrupts, connected with I/O Port lines (P0.14 &
P0.15) as switches.







38 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00



Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60


39 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
39 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Result:
Thus the interrupt performance characteristics of ARM and FPGA are studied. On comparison, ARM
counts at slow speed because it consumes more instruction cycle and FPGA is more efficient for servicing
and processing external interrupt pulses.
Outcome:
Able to understand the performance characteristics of ARM and FPGA while dealing with
interrrupts
Applications:
1. Used in random logic and SPLDs
2. Used in cryptography and filtering
3. In medical imaging
4. In bioinformatics and voice recognition



1. When is an Interrupt Request received?
2. What is ISR?
3. How do you initialize interrupt?
4. What is Vectored Interrupt Controller?
5. What are the kinds of protection available for SRAMS ?
6. What is interrupt pipelining?
7. What is pipeline shutdown?
8. What is branch prediction?
9. What is the use of Neon Floating point engine?
10. What is the use of ?vectorize option?
11. What is PTM?
12. What is ITM?
13. What is ETM?
14. What is I2S interface?
15. What is the use of ?SWI? in ARM assembly?

Viva-voce




40 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 10 FLASHING OF LEDS
Aim:
To write and execute an embedded c program to display LEDs using LPC 2148 ARM controller
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
Theory:
LED (Light Emitting Diodes) is the most commonly used components, usually for displaying pins digital
states. Typical uses of LEDs include alarm devices, timers and confirmation of user input such as a mouse
click or keystroke. Interfacing LED with LPC2148 Flash a LED using LPC2148 Primer Board. It works by
turning ON a LED & then turning it OFF & then looping back to START. However the operating speed of
microcontroller is very high so the flashing frequency will also be very fast to be detected by human eye.
The ARM7 LPC2148 Primer board has eight numbers of point LEDs, connected with I/O Port lines (P1.16 ?
P1.23) to make port pins high.










41 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00



Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus program for flashing of LEDs is written and executed using ARM controller LPC2148.



42 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Outcome:
Able to interface LED lights via the input output port and control them
Applications:
1. In Illumination
2. As status indicators in equipments
3. Stadium displays and dynamic decorative displays



1. What is seven segment displays?
2. What are the different configurations of LED?
3. What is the function of GPIO?
4. What are the Pins which are used to connect LEDs?
5. How to identify 'Polarity' of LED?
6. Differentiate LED from LCD.
7. What is a use of Jumper?
8. How many numbers of LEDs present in Primer board?
9. Where LEDs are used?
10. What is the use of flash magic software?
11. Which port is used in ARM 7 processor kit?
12. Which diode suffers an avalanche breakdown?
13. What happens if the junction temperature of LED is increased?
14. What is an anti collision rate light?
15. What is fail-safe conditions






Viva-voce




43 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 11 STEPPER MOTOR INTERFACE WITH
ARM -7 LPC2148
Aim:
To write a program to interface stepper motor using ARM processor and control the movement of motor
in either directions.
Apparatus Required:
1. LPC2148 ARM development board
2. Stepper motor
3. Interfacing cables
4. PC
Theory:
A stepper motor can be viewed as a DC motor with number of poles (on both rotor and stator).
Additionally, soft magnetic material with many teeth on the rotor and stator cheaply multiplies the number of
poles (reluctance motor). Like an AC synchronous motor, it is ideally driven by sinusoidal current, allowing
a step less operation, but this puts some burden on the controller. When using an 8-bit digital controller,
256 micro steps per step are possible. As a digital-to-analog converter produces unwanted ohmic heat in
the controller, pulse-width modulation is used to regulate the mean current. Simpler models switch voltage
only for doing a step, thus needing an extra current limiter: for every step, they switch a single cable to the
motor.
The idea is to connect the output pins of the driver to 4 transistors. The transistor must be
grounded at the emitter and the driver pin must be connected to the base. Collector is connected to the coil
wire of the motor. Stepper motors are rated by the torque they produce. Synchronous electric motors using
soft magnetic materials (having a core) have the ability to provide position holding torque (called detent
torque, and sometimes included in the specifications) while not driven electrically. To achieve full rated
torque, the coils in a stepper motor must reach their full rated current during each step. The voltage rating
(if there is one) is almost meaningless. The motors also suffer from EMF, which means that once the coil is
turned off it starts to generate current because the motor is still rotating. There needs to be an explicit way
to handle this extra current in a circuit otherwise it can cause damage and affect performance of the motor.
44 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
44 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus stepper motor interface with ARM processor has been successfully implemented and the motor is
controlled in clockwise and anticlockwise direction.
Outcome:
Able to interface the stepper motor with ARM controller and thereby create some rotational
movements





45 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Applications:
3. Used for precise positioning with a motor
4. Used in hard disk drives, robotics
5. Used in telescopes and toys







1. Define GPIO.
2. What is the function of ULN2803?
3. How LPC2148 control stepper motor?
4. Which I/O port lines used to rotate stepper motor?
5. How stepper motor reacts for each pulse it receives?
6. What is serial communication?
7. What is parallel communication?
8. What is stepper motor & why it is named so?
9. How can be step angle is calculated?
10. What are the advantages and disadvantages of parallel communication?
11. What does instruction-pipelining mean?
12. What is the power supply required for ARM processor?
13. What is a unit for torque?
14. What is RPM rating for a DC motor?
15. What device that is used to obtain an accurate position control of rotating shafts in terms of steps?
Viva-voce

46 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
46 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Expt. No. 12 LM35 TEMPERATURE SENSOR INTERFACE
WITH ARM-7 LPC2148
Aim:
To write a program to interface of LM35 temperature sensor to on-chip ADC of ARM controller and
display the room temperature value on the screen.
Apparatus Required:
1. LPC2148 ARM development board
2. Temperature sensor
3. Interfacing cables
4. PC
Theory:
Temperature Sensor:
The LM35 series are precision integrated-circuit temperature sensors, whose output voltage is linearly
proportional to the Celsius (Centigrade) temperature. The output of the sensor is converted to digital output
that is easy to connect with microcontroller. Temperature sensor has three terminals and required
Maximum of 5.5 V supply. This type of sensor consists of a material that performs the operation according
to temperature to vary the resistance. This change of resistance is sensed by circuit and it calculates
temperature. When the voltage increases then the temperature also rises. We can see this operation by
using a diode.







47 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
47 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00


Circuit diagram:

48 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
48 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the program for interfacing temperature sensor with ARM controller is written and executed and
the temperature reading is seen on the monitor.
Outcome:
Able to interface different sensors with in-built ADC of the ARM processor and access the data
produced from them
Applications:
1. Used in Ovens, refrigerators
2. In HVAC environmental control
3. coolant or cylinder head temperatures
4. in the automotive industry to monitor air intake



1. What is LM35?
2. Define ISP.
3. How many Analog-to-Digital Converters available as an inner peripheral in LPC2148?
4. What is the main function of analog pin in LPC 2148?
5. What is the output voltage produced by LM35 for one degree temperature?
6. What is the difference between LM 34 and LM 35 sensors?
7. How many pins are available in LM35?
8. Why Vref is set of ADC0848 to 2.56 V if analog input is connected to the LM35?
9. What is operating the operating temperature range in LM35?
10. Why LM35 is used to Measure Temperature?
11. List the devices used to sense temperature.
12. What is the purpose of a thermocouple?
13. What is the output voltage of a thermocouple?
Viva-voce




49 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 13 IMPLEMENTATION OF WIRELESS
COMMUNICATION PROTOCOL
USING ZIGBEE WIRELESS MODULE
Aim:
To implement wireless communication protocol using zigbee wireless module with the help of ARM
processor
Apparatus required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. Zigbee module
5. PC
Theory:
ZigBee is a specification to suite high level communication protocols using small, low-power digital
radios based on an IEEE 802 standard for personal area networks. The ZigBee is the name of a wireless
protocol maintained by the IEEE 802.15 standard. This is a protocol specified for wireless Personal Area
Network (PAN) using low powered wireless transceivers. There are already wireless transmitter and
receiver modules which can do point to point communication. The Xbee is the brand name a wireless
transceiver device introduced by the Digi international which works on the ZigBee protocol and can form
PAN networks. They have an approximate range of 10 to 100 meters and are used in industries, scientific
fields, medical fields etc
Digi ZigBee:
The Digi Xbee 802.15.4 modules are the easiest to use, most reliable and cost-effective RF devices.
The 802.15.4 Xbee modules provide two friendly modes of communication - a simple serial method to
transmit/receive or a framed mode providing advanced features. These modules can communicate point to
point, from one point to a PC, or in a mesh network.



50 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
50 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Circuit diagram:


Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the wireless communication protocol using Zigbee wireless module is implemented using
LPC2148.
Outcome:
Able to form a wireless network using zigbee module and ARM controller




51 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications:
1. Used in traffic lights in non-urban areas
2. Used in building control systems
3. Used in asset tracking
4. Used in parking sensors




1. How many UART ports available in LPC2148?
2. What is the main function of voltage convertors in UART?
3. Why Zigbee based is preferred for wireless communication?
4. What is the IEEE standard for Zigbee protocol?
5. Write the two modes of communication are used in a ZigBee network.
6. What is the function of a scheduler?
7. Mention any two features of ?C/OS ? II.
8. Write the function for creating task in ?C/OS ? II.
9. Mention any two support devices for ?C/OS ? II.
10. How many user tasks can be handled by ?C/OS ? II?







Viva-voce




52 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

















ADDITIONAL EXPERIMENTS
53 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
53 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Expt. No. 14 BUZZER INTERFACE WITH ARM-7 LPC2148
Aim:
To write a program for buzzer interface with ARM processor and control its operation.
Apparatus required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
Theory:
Buzzer is an electronic device commonly used to produce sound. Light weight, simple construction and
low price make it usable in various applications like car/truck reversing indicator, computers, call bells etc.
Piezo buzzer is based on the inverse principle of piezo electricity discovered in 1880 by Jacques and Pierre
Curie. It is the phenomena of generating electricity when mechanical pressure is applied to certain
materials and the vice versa is also true. Such materials are called piezo electric materials. Piezo electric
materials are either naturally available or manmade. Piezo ceramic is class of manmade material, which
poses piezo electric effect and is widely used to make disc, the heart of piezo buzzer. When subjected to
an alternating electric field they stretch or compress, in accordance with the frequency of the signal thereby
producing sound.







54 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
54 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the program for interfacing buzzer with ARM processor is written and executed and output is
verified.
Outcome:
Able to interface devices such as buzzer, relay with ARM controller





55 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Applications:

1. In alarm devices and timers
2. In confirmation of user input such as mouse click or keystroke
3. Alarming Circuits
4. Communication equipments
5. Automobile electronics
6. Portable equipments, due to its compact size





1. Define Buzzer.
2. Which pin in ARM can be used to modulate Buzzer?
3. What is the function Flash magic software?
4. How the Buzzer can be disconnected in LPC2148?
5. How the volume of sound will be changed in Buzzer?
6. What is a buzzer
7. What are the applications of buzzer?
8. How buzzer is used in embedded system?
9. What is race round condition?
10. What is digital signal controller?
11. What are the features of buzzer circuit?
12. What is a semaphore?
13. What is mutexes?
14. What is the role of segment register?
15. What is watch dog timer?

Viva-voce

56 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
56 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Expt. No. 15 RELAY INTERFACE WITH ARM - 7
Aim:
To write a program to interface 2 relays with LPC 2148 ARM Controller and verify its working.
Apparatus required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
Theory:
A relay is an electrically operated switch. Many relays use an electromagnet to mechanically operate a
switch, but other operating principles are also used, such as solid-state relays. Relays are used where it is
necessary to control a circuit by a low-power signal (with complete electrical isolation between control and
controlled circuits), or where several circuits must be controlled by one signal. The first relays were used in
long distance telegraph circuits as amplifiers: they repeated the signal coming in from one circuit and re-
transmitted it on another circuit. Relays were used extensively in telephone exchanges and early
computers to perform logical operations.
57 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
57 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
The program for interfacing relays with ARM controller is done and its working is verified.
Outcome:
Able to interface devices such as relay with ARM controller and control them using programs.






58 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications:
1. Used in homes, even in streets.
2. In automatic garage door for its movement and direction.
3. And even in refrigerators
4. In industries to provide energy on machineries.
5. In electrical fuel pump



1. What is the function of relay?
2. What is the function of Opto-isolator?
3. What is the function of power transistor in LPC2148?
4. Which pin acts as an output port for relay?
5. What is a relay circuit
6. what are the applications of relay circuit
7. what are the advantages of relay circuit
8. How does combination of functions reduce memory requirements in embedded systems?
9. What is the need for DMAC in ES?
10. Mention how I/O devices are classified for embedded system?
11. Explain what is interrupt latency? How can you reduce it?
12. What does DMA address will deal with?
13. List out various uses of timers in embedded system?
14. List out some of the commonly found errors in Embedded Systems?
15. What is the difference between macro and line function.



Viva-voce




59 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Creating the New Project:
1. To create a new project, choose Project>Create New Project. The Create New Project dialog box
appears which lets you base your new project on a project template.
2. Make sure the Tool chain is set to ARM, and click OK.
3. Select the project template Empty project, and click ok button. Which simply creates an empty project
that uses default project setting?
4. In the standard Save As dialog box that appears, specify where you want to place your project file, that
is, in your newly created projects directory. Type your project name in the File name box, and click Save
to create the new project. Eg. LED.
The project will appear in the Workspace window.
To Creating your Application ?C? file, Choose FILE menu and select NEW > File.
Edit the application code in C Language. Eg. Led.c
To Save your ?C? file, Choose File >Save As. In the standard Save As dialog box that appears, specify
where you want to place your project file, that is, in your project directory. Type your filename in the
Filename box, and click Save to create the new project. Eg. Led.c
Adding Files to the Project:
1. In the Workspace window, select the destination to which you want to add a source file; a group or, as in
this case, directly to the project.
2. Choose Project>Add Files to open a standard browse dialog box. Locate the files led.c select them in
the file selection list, and click Open to add them to the project1 project.
To save your work space, Choose File>Save Workspace and specify where you want to place your
workspace file. In this tutorial, you should place it in your newly created project directory. Type LED in
the File name box, and click save button.
GENERAL PROCEDURE


FirstRanker.com - FirstRanker's Choice
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00






?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING

VII SEMESTER - R 2013

EC6711 ? EMBEDDED LABORATORY






Name : _______________________________________
Register No : _______________________________________
Section : _______________________________________
LABORATORY MANUAL



2 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00




is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and
training.

? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different
levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on
heart and soul
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

To impart professional education integrated with human values to the younger generation, so as to
shape them as proficient and dedicated engineers, capable of providing comprehensive solutions to the
challenges in deploying technology for the service of humanity

? To educate the students with the state-of-art technologies to meet the growing challenges of the
electronics industry
? To carry out research through continuous interaction with research institutes and industry, on
advances in communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning,
innovation and ethical practices
VISION
VISION
MISSION
MISSION



3 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

PROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To provide students with a solid foundation in Mathematics, Science and fundamentals of
engineering, enabling them to apply, to find solutions for engineering problems and use this knowledge
to acquire higher education
2. Core Competence
To train the students in Electronics and Communication technologies so that they apply their
knowledge and training to compare, and to analyze various engineering industrial problems to find
solutions
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice which
enables them to find solutions for the real time problems in industry, and to design products
4. Professionalism
To inculcate professional and effective communication skills, leadership qualities and team spirit in
the students to make them multi-faceted personalities and develop their ability to relate engineering
issues to broader social context
5. Lifelong Learning/Ethics
To demonstrate and practice ethical and professional responsibilities in the industry and society in
the large, through commitment and lifelong learning needed for successful professional career


4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
PROGRAMME OUTCOMES (POs)
a) To demonstrate and apply knowledge of Mathematics, Science and engineering fundamentals in
Electronics and Communication Engineering field
b) To design a component, a system or a process to meet the specific needs within the realistic
constraints such as economics, environment, ethics, health, safety and manufacturability
c) To demonstrate the competency to use software tools for computation, simulation and testing of electronics
and communication engineering circuits
d) To identify, formulate and solve electronic and communication engineering problems
e) To demonstrate an ability to visualize and work on laboratory and multidisciplinary tasks
f) To function as a member or a leader in multidisciplinary activities
g) To communicate in verbal and written form with fellow engineers and society at large
h) To understand the impact of Electronics and Communication Engineering in the society and demonstrate
awareness of contemporary issues and commitment to give solutions exhibiting social responsibility
i) To demonstrate professional & ethical responsibilities
j) To exhibit confidence in self-education and ability for lifelong learning
k) To participate and succeed in competitive exams


5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
SYLLABUS

? Learn the working of ARM processor
? Understand the Building Blocks of Embedded Systems
? Learn the concept of memory map and memory interface
? Know the characteristics of Real Time Systems
? Write programs to interface memory, I/Os with processor
? Study the interrupt performance
LIST OF EXPERIMENTS:
1. Study of ARM evaluation system
2. Interfacing ADC and DAC
3. Interfacing LED and PWM
4. Interfacing real time clock and serial port
5. Interfacing keyboard and LCD
6. Interfacing EPROM and interrupt
7. Mailbox
8. Interrupt performance characteristics of ARM and FPGA
9. Flashing of LEDS
10. Interfacing stepper motor and temperature sensor
11. Implementing zigbee protocol with ARM



? Write programs in ARM for a specific Application
? Interface memory and Write programs related to memory operations
? Interface A/D and D/A convertors with ARM system
? Analyze the performance of interrupt
? Write programmes for interfacing keyboard, display, motor and sensor.
? Formulate a mini project using embedded system
COURSE OBJECTIVES
COURSE OUTCOMES
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
CONTENTS
Sl. No. Name of the Experiment Page No.
CYCLE 1 ? EXPERIMENTS
1
Study of ARM evaluation system 7
2
Analog to Digital Convertor interfacing 16
3
Generation of ramp and square wave using on-Chip DAC 19
4
LED dimming using PWM 22
5
Interfacing real time clock and serial port 25
6
Interfacing keypad and LCD 28
7
Interfacing EPROM and interrupt 31
CYCLE 2 ? EXPERIMENTS
8 Implementation of Mailbox Function using LPC 2148 35
9 Interrupt Performance Characteristics of Arm and FPGA 37
10 Flashing of LEDs 40
11 Stepper Motor Interface with ARM ? 7 LPC2148 43
12 LM35 Temperature Sensor Interface with ARM ? 7 LPC2148 47
13
Implementation of Wireless Communication Protocol using ZIGBEE Wireless
Module
50
ADDITIONAL EXPERIMENTS BEYOND THE SYYLABUS
14 Buzzer Interface with ARM ? 7 54
15 Relay interface with ARM? 7 57
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Expt. No. 1 STUDY OF ARM EVALUATION SYSTEM
Aim:
To study the building blocks of ARM7 system, its features, pin configuration and the components
required for functioning of ARM controller.
Architecture Overview:
A RISC-based computer design approach means ARM processors require significantly fewer transistors
than typical processors in average computers. This approach reduces cost, heat and power usage. These
are desirable traits for light, portable, battery-powered devices (smart phones, laptops, tablet and notepad
computers), and other embedded systems. A simpler design facilitates more efficient multi-core CPUs and
higher core counts at lower cost, providing higher processing power and improved energy efficiency for
servers and supercomputers.
In 2005, about 98% of all mobile phones sold used at least one ARM processor. The low power
consumption of ARM processors has made them very popular: 37 billion ARM processors have been
produced as of 2013, up from 10 billion in 2008. The ARM architecture (32-bit) is the most widely used
architecture in mobile devices, and most popular 32-bit one in embedded systems.
According to ARM Holdings, in 2010 alone, producers of chips based on ARM architectures
reported shipments of 6.1 billion ARM based processors, representing 95% of smart phones, 35% of digital
televisions and set-top boxes and 10% of mobile computers. It is the most widely used 32-bit instruction set
architecture in terms of quantity produced.
LPC 2148:
LPC2148 is the widely used IC from ARM-7 family. It is manufactured by Philips and it is pre-loaded
with many inbuilt peripherals making it more efficient and a reliable option for the beginners as well as high
end application developer.




8 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Features of LPC214x series controllers:
1. 8 to 40 kB of on-chip static RAM and 32 to 512 kB of on-chip flash program memory.128 bit wide
interface/accelerator enables high speed 60 MHz operation.
2. In-System/In-Application Programming (ISP/IAP) via on-chip boot-loader software. Single flash sector or
full chip erase in 400 ms and programming of 256 bytes in 1ms.
3. Embedded ICE RT and Embedded Trace interfaces offer real-time debugging with the on-chip Real
Monitor software and high speed tracing of instruction execution.
4. USB 2.0 Full Speed compliant Device Controller with 2 kB of endpoint RAM. In addition, the LPC2146/8
provides 8 kB of on-chip RAM accessible to USB by DMA.
5. One or two (LPC2141/2 vs. LPC2144/6/8) 10-bit A/D converters provide a total of 6/14analog inputs, with
conversion times as low as 2.44 us per channel.
6. Single 10-bit D/A converter provides variable analog output.
7. Two 32-bit timers/external event counters (with four capture and four compare channels each), PWM unit
(six outputs) and watchdog.
8. Low power real-time clock with independent power and dedicated 32 kHz clock input.
9. Multiple serial interfaces including two UARTs (16C550), two Fast I2C-bus (400 kbit/s), SPI and SSP with
buffering and variable data length capabilities.
10. Vectored interrupt controller with configurable priorities and vector addresses.
11. Up to 45 of 5 V tolerant fast general purpose I/O pins in a tiny LQFP64 package.
12. Up to nine edge or level sensitive external interrupt pins available.
13. On-chip integrated oscillator operates with an external crystal in range from 1 MHz to30 MHz and with
an external oscillator up to 50 MHz
14. Power saving modes include Idle and Power-down.
15. Individual enable/disable of peripheral functions as well as peripheral clock scaling for additional power
optimization.
16. Processor wake-up from Power-down mode via external interrupt, USB, Brown-Out Detect (BOD) or
Real-Time Clock (RTC).




9 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


First Step- Hardware Requirement:
Pin configuration of LPC 2148.

Hardware requirement of LPC2148:
1. LPC2148 need minimum below listed hardware to work properly
2. Power Supply
3. Crystal Oscillator
4. Reset Circuit
5. RTC crystal oscillator
6. UART
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Power Supply:
LPC2148 works on 3.3 V power supply. LM 117 can be used for generating 3.3 V supply. However,
basic peripherals like LCD, ULN 2003 (Motor Driver IC) etc. works on 5V. So AC mains supply is converted
into 5V using below mentioned circuit and after that LM 117 is used to convert 5V into 3.3V.
Block diagram of power Supply

Transformer: It is used to step down 230V AC to 9V AC supply and provides isolation between power grids
and circuit.
Rectifier: It is used to convert AC supply into DC.
Filter: It is used to reduce ripple factor of DC output available from rectifier end.
Regulator: It is used to regulate DC supply output.

11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Circuit Diagram:

Regulator IC 7805 is used to provide fix 5V dc supply.
LM 117 is used for generating 3.3V supply from 5V.

12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Calculations:

From the datasheet of LM117

Taking R 2= 240?, we get R 1=392?
Reset Circuit:
Reset button is essential in a system to avoid programming pitfalls and manually bring back the system
to the initialization mode. MCP 130T is a special IC used for providing stable RESET signal to LPC 2148.


13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Oscillator Circuit:

The value of capacitors C20 & C21 depends upon the frequency of crystal Y3. General circuit and
its equivalent circuit is as shown below.

14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Recommended values are as shown in table:

UART:
LPC 2148 has inbuilt ISP which means we can program it within the system using serial
communication on COM0. It has also COM1 for serial communication. MAX 232/233 IC must be used for
voltage logic conversion. Related connections are as given below.

Once the above listed circuit design is ready, we are ready to go further.



15 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Result:
ARM Evaluation system and the configuration of LPC2148 has been studied fully. The minimal setup
required for the functioning of the ARM processor is studied.
Outcomes:
1. Able to understand the ARM controller, its basic components inside and its features.
2. Able to know the components required for the working of ARM LPC2148

Applications:
ARM controller LPC2148 is used in no. of devices such as
1. Smart phones
2. Net books
3. E Readers
4. Digital TV
5. Home Gateways


1. What are the basic units of ARM 7?
2. What is the address system supported by ARM?
3. Define - RISC
4. What are the instructions used to access the memory in ARM?
5. What are the basic units of Microprocessor?
6. What is an Instruction?
7. What is clock cycle?
8. Define - Pipelining
9. What is cache miss?
10. What is meant by memory mapped I/O?
11. Define ? interrupt
12. What is meant by Exception?
13. What is meant by little ? endian mode?
14. What is meant by big ? endian mode?
15. What is the function of CPSR?
16. What is register - indirect addressing?
Viva-voce




16 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 2 ANALOG TO DIGITAL CONVERTOR
INTERFACING
Aim:
To write an embedded c program for interfacing an on chip ADC with LPC2148 ARM processor and
convert the given input voltage into corresponding decimal values.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. PC
Theory:
Analog to Digital converter (ADC) is a device that converts continuously varying analog signals from
instruments that monitor such conditions as movement, temperature, sound, etc., into binary code for the
computer. It may be either a single chip or can be one circuit within a chip. Analog to Digital conversion is
the process of changing continuously varying data, such as voltage, current, or shaft rotation, into discrete
digital quantities that represent the magnitude of the data compared to a standard or reference at the
moment the conversion is made. According to the method of conversion, ADCs can be classified into
Direct-Conversion ADCs, Successive Approximation ADCs, Integrating ADC and Sigma-Delta ADCs.
The LPC 2148 has 10-bit successive approximation analog to digital converter. Basic clocking for the
A/D converters is provided by the VPB clock. A programmable divider is included in each converter, to
scale this clock to the 4.5 MHz (max) clock needed by the successive approximation process. A fully
accurate conversion requires 11 of these clocks. The ADC cell can measure the voltage on any of the ADC
input signals. It is noted that these analog inputs are always connected to their pins, even if the Pin function
Select register assigns them to port pins. A simple self-test of the ADC can be done by driving these pins
as port outputs.



17 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Circuit diagram:




18 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus, an embedded c program for interfacing on-chip ADC with ARM processor is written and
executed. The decimal values of the converted voltage are seen in the WinXTalk screen.
Outcome:
Able to interface A/D convertors with ARM system and check its working by connecting an analog
quantity as input.
Applications:
1. ADC used in MODEM for converting analog signals to digital.
2. A fast video ADC in TV tuner cards
3. ADC used in digital storage oscilloscopes
4. Used in music reproduction technology.
5. Used in DSP if input is analog


1. What are the ADC operating modes in LPC2148?
2. What is meant by conversion time?
3. Why are internal ADCs preferred over external ADCs?
4. Why has 16-bit ADC more resolution than from 10-bit and 8-bit ADC?
5. What are ADC & its Resolution?
6. What is Burst conversion mode?
7. What is the function of A/D Control Register?
8. What is the function of A/D Global Data Register?
9. What is the function of A/D Status Register?
10. What is analog-to-digital (ADC) conversion error?
11. What is the function of Sample-and-hold circuits in analog-to digital converters?
12. What is the disadvantage of the flash analog-to digital converter?
Viva-voce




19 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 3 GENERATION OF RAMP AND SQUARE
WAVE USING ON-CHIP DAC
Aim:
To write and execute an embedded c program to generate ramp wave and square wave using on-chip
DAC of LPC2148 ARM controller.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
A digital-to-analog converter is a device for converting a digital signal into an analog signal (current or
voltage). Digital-to-Analog Converters are the interface between the abstract digital world and the analog
real world. Simple switches, a network of resistors, current sources or capacitors may be used to
implement this conversion. A DAC inputs a binary number and outputs an analog voltage or current signal.
The Microchip Technology Inc. MCP4921 is 2.7 ? 5.5V, low-power, 12-Bit Digital-to-Analog Converter
(DAC) with SPI interface. The MCP4921 DAC provides high accuracy and low noise performance for
industrial applications where calibration or compensation of signals is required. With an SPI connection
there is always one master device (usually a microcontroller) which controls the peripheral devices.
Typically there are three lines common to all the devices,
Master In Slave Out (MISO) ? The Slave line for sending data to the master,
Master Out Slave In (MOSI) ? The Master line for sending data to the peripherals,
Serial Clock (SCK) ? The clock pulses which synchronize data transmission generated by the
master and slave
Slave Select pin ? the pin on each device that the master can use to enable and disable specific
devices. When a device Slave Select pin is low, it communicates with the master. When it is high, it ignores
the master. In SPI, the clock signal is controlled by the master device LPC2148. All data is clocked in and
out using this pin. These lines need to be connected to the relevant pins on the LPC21xx processor. Any
unused GIO pin can be used for CS, instead pull this pin high. Conversion speed is the time it takes for the



20 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

DAC to provide an analog output when the digital input word is changed. The MCP4291 DAC ? SPI
connections with LPC21xx have four I/O lines (P0.4 ? P0.7) required. The analog output is generated by
using these four lines.
Circuit diagram:


Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the embedded c programs for generating ramp wave and square wave using ARM LPC2148 are
written and executed successfully and the waveforms are viewed in oscilloscope.
Outcome:
Able to program the DAC in-built inside the ARM controller and get the waveforms using it.




21 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications :
1. DAC used in Audio amplifier.
2. Video encoder
3. Display electronics
4. Data Acquistion systems
5. Motor control



1. What are the features of LPC2148 DAC?
2. What is the function of DAC register?
3. Which pin provides a voltage reference level for the D/A converter?
4. What are the applications of DAC in signal processing applications?
5. What is GIO?
6. What is the resolution of a digital-to-analog converter (DAC)?
7. What is the major advantage of the R/2R ladder digital-to-analog (DAC), as compared to a binary-
weighted digital-to-analog DAC converter?
8. What is the resolution of a 0?5 V 6-bit digital-to-analog converter (DAC) ?
9. What are DAC configurations?
10. What are the different types of DAC Circuits?
11. What are the Limitations of the Binary Weighted DAC?
12. What are the General DAC Characteristics?
13. Define reference voltage in DAC.
14. What is full scale voltage?
15. What is settling time?
VIVA-VOCE




22 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 4 LED DIMMING USING PWM

Aim:
To write an embedded c program for implementing PWM using ARM controller and verify the same by
dimming of LEDs.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
LPC2148 supports 2 types of PWM:
1) Single Edge PWM ? Pulse starts with new Period i.e pulse is always at the beginning
2) Double Edge PWM ? Pulse can be anywhere within the Period
A PWM block, like a Timer block , has a Timer Counter and an associated Pre-scale Register along
with Match Registers. These work exactly the same way as in the case of Timers. Match Registers 1 to 6
(except 0) are pinned on LPC214x i.e. the corresponding outputs are diverted to actual Pins on LPC214x
MCU. The PWM function must be selected for these Pins to get the PWM output.
The basic setup is to simply replace Servo by a LED and no external 5V source is needed. The
anode of LED is connected to P0.0 and cathode to ground. Pulse Widths corresponding to the switches
connected to P0.1/2/3/4 will be 2.5ms/5ms/7.5ms/10ms respectively. As the Pulse Width Increases LED
will keep on getting brighter and the reverse will happen if Pulse Width is decreased.



23 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus embedded c program for implementing Pulse Width Modulation is written and executed and
output has been verified in LED display.
Outcome:
Able to implement PWM using the ARM controller and verify the same in the form of dimming of
LEDS.



24 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Applications :
1. In Visual signals to covey a message
2. Illumination where light is reflected from objects
3. In Narrow band sensors



1. What factors determine the LED dimming performance?
2. What is meant by analog dimming?
3. What is flickering effect?
4. What is the factor determines dimming of the LED
5. Why Silicon is not suitable for fabrication of light-emitting diodes?
6. Why Silicon diode is less suited for low voltage rectifier operation?
7. What is the principle of zener diode?
8. What are the materials used to make LED?
9. What type of diodes is used in FM receivers?
10. Which diode suffers an avalanche breakdown?
11. What happens if the junction temperature of LED is increased?
12. How a transfer characteristic of a diode does is related?
13. What is the requirement of a clipping action of a diode?
14. What type of rectifier circuit requires four diodes?
15. Why are the pulse width modulated outputs required in most of the applications?
16. How do the variations in an average value get affected by PWM period?
17. Name the common formats available for LED display.
18. What are the types of seven segment display?
19. What is PWM?
20. What are the applications of PWM?

Viva-voce




25 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 5 INTERFACING REAL TIME CLOCK
AND SERIAL PORT
Aim:
To write and execute an embedded c program to interface DS1307 RTC using I2C protocol with ARM
controller
Apparatus Required:
1. LPC2148 ARM development board
2. Stepper motor
3. Interfacing cables
4. PC
Theory:
A clock, which is based on the interrupts at preset intervals, is Real Time Clock (RTC). An interrupt
service routine executes on each timeout (overflow) of this clock. This timing device once started never
resets or never reloaded with another value. Once it is set, it is not modified later. It is used in a system to
save the time and date.













26 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the program for interfacing real time clock with ARM controller is written and executed and the
date and time are verified on the screen.
Outcome:
Able to interface real time clock DS1307 with ARM controller and thereby display date and time
Applications :
1. I2C In ARM and PIC microcontrollers
2. Used as serial communication protocol with MASTER and SLAVE operation.

27 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
27 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00




1. What is I2C and how does it work?
2. What are the features of I2C in LPC2148 ARM7 microcontroller?
3. What is the function of I2C0CONSET register?
4. What is I2C0STAT?
5. What is the function of I2C0 Data Register?
6. What is RTC?
7. List the advantages of RTC
8. Through which port the date and time is displayed in RTC?
9. What is a serial port?
10. List the registers used to transfer data in serial port.
11. List the modes used for data transmission.
12. What is a simplex mode?
13. Which pin is used to transmit a character?
14. What is the baud rate of serial port?
15. What is the disadvantage of RS-232C?














Viva-voce




28 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 6 INTERFACING KEYPAD AND LCD

Aim:
To write an embedded c program to interface 4 x 4 matrix keypad with ARM processor and display the
pressed key in an LCD.
Apparatus Required:
1. LPC2148 ARM development board
2. Interfacing cables
3. PC
Theory:

In matrix keypad, keys are connected in rows and columns. When any switch is pressed, rows and
columns come into contact, which is that detected by controller to identify which key has been pressed. A
4?4 matrix keypad consists of 4 rows and 4 columns. There is a switch connecting each row and column.
So the combinations of rows and columns make up the 16 inputs.Initially all the switches are open (not
connected). When any one button is pressed, the switch is closed (connected),hence there is a connection
between the row and column. The first 4 pins are connected to the column as INPUT. The other 4 pins are
connected to the row as OUTPUT. Matrix keypad is a good substitution to normal push button.












29 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Circuit Diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus program for interfacing matrix keypad with ARM controller is written and executed and the key
pressed is seen in the LCD.



30 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Outcome:
Able to interface keypad with ARM controller and see the pressed key in the LCD display.
Applications :
1. Used in password based door locking system
2. Security system with user changeable
3. Used in laptops, computer games
4. Used in portable video games and cell phones



1. What is Matrix keypad?
2. What is the concept behind keypad interface?
3. What are the functions of pull- up resistors?
4. What is key de bouncing?
5. List the steps involved when the key in a 4 x 4 keyboard matrix is being pressed.
6. What is the value obtained if no key is pressed?
7. What kind of interrupt is generated if a key has to be operated in an interrupt mode?
8. How will you identify that the key is pressed?
9. What are the steps involved in Keyboard Interfacing?
10. List the registers used to store the keyboard, display modes and other operations programmed by
CPU.
11. Name the mode when a data is entered from the left side of the display unit.
12. How many rows and columns are present in a 16 x 2 alphanumeric LCD?
13. How many data lines are there in a 16 x 2 alphanumeric LCD?
14. Which pin of the LCD is used for adjusting its contrast?
15. Which command of an LCD is used to shift the entire display to the right?
16. Which command is used to select the 2 lines and 5 x 7 matrix of an LCD?
17. What changes are to be made to send data to an LCD?
18. For reading operation from an LCD what changes in the software are introduced?
19. Which instruction is used to select the first row first column of an LCD?
Viva-voce

31 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
31 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Expt. No. 7 INTERFACING EEPROM AND INTERRUPT

Aim:
To write a program to interface EEPROM using I2C protocol with ARM controller and retrieve the stored
messages inside EEPROM.
Apparatus Required:
1. LPC2148 ARM development board
2. Interfacing cables
3. PC
Theory:
I2C (Inter Integrated Circuit):
The I2C (Inter-IC) bus is a bi-directional two-wire serial bus that provides a communication link between
integrated circuits (ICs).I2C is a synchronous protocol that allows a master device to initiate communication
with a slave device. Data is exchanged between these devices.
EEPROM:
EEPROM (electrically erasable programmable read-only memory) is user-modifiable read-only
memory (ROM) that can be erased and reprogrammed (written to) repeatedly through the application of
higher than normal electrical voltage. It is a type of non-volatile memory used in computers and other
electronic devices to store small amounts of data that must be saved when power is removed, e.g.,
calibration tables or device configuration
Read, write and Erase EEPROM by using I2C in LPC2148 Primer Board. Wiring up an I2C based
EEPROM to the I2C port is relatively simple. The basic operation of the I2C based EEPROM's is to send a
command, such as WRITE, followed by an address and the data. In WRITE operation, the EEPROM is
used to store the data. In LPC2148 Primer Kit, 2 nos. of EEPROM lines are controlled by I2C Enabled
drivers. I2C Lines serial clock SCL (P0.2), serial data SDA (P0.3) connected to the I2C based serial
EEPROM IC. The EEPROM read & write operations are done in LPC2148 Primer Kit by using these SDA &
SCL I2C lines.
32 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
32 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To down load and run this program: Refer General procedure given in Page No: 60
Result:
Thus, the program for interfacing I2C based EEPROM with ARM processor has been written and
executed successfully and the memory content is verified on Win x talk terminal.
Outcome:
Able to interface memory ICs with ARM controller and perform the read and write operations.



33 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications:
1. ROM used in toys,automobiles to store data when power is off
2. In calculators and peripheral devices
3. In laser printers
4. And also in embedded systems where program need not to be changed.


1. How does I2C protocol work?
2. What is EEPROM?
3. What is meant by master slave mode?
4. What is meant by non-volatile memory?
5. What is an interrupt?
6. How does an interrupt request works?
7. What is a nested interrupt?
8. What are the registers used for enabling an interrupt?
9. What is PROM?
10. What is EPROM?
11. What is mask ROM?
12. Which memory allows simultaneous read and write operations?
13. Which memory has the shortest access times?
14. Which interrupt has the highest priority?
15. What is non maskable interrupt?
16. Which is the first level of memory access by the microprocessor?
17. List the types of cache memories.
18. What is the use of an interrupt?
19. What is the use of converting an interrupt to threads in a microprocessor?
20. What are the bits used to control an external interrupts?


Viva-voce




34 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00










CYCLE 2 - EXPERIMENTS




35 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 8 IMPLEMENTATION OF MAILBOX FUNCTION
USING LPC2148
Aim:
To create a mailbox in Micro C/OS ? II using LPC2148 ARM Controller
Apparatus Required:
1. LPC2148 ARM development board
2. Interfacing cables
3. PC
Theory:
System or the user code can send a message by the core services. A typical mail message, also
known as the exchange of information, refers to a task or an ISR using a pointer variable, through the core
services to put a message (that is, a pointer) into the mailbox. Similarly, one or more tasks can receive this
message by the core services. The tasks sending and receiving the message promise that the content that
the pointer points to is just that piece of message.
The mailbox of CooCox CoOS is a typical message mailbox which is composed of two parts: one is
the information which expressed by a pointer of void; the other is the waiting list which composed of the
tasks waiting for this mailbox. The waiting list supports two kinds of sorting: FIFO and preemptive priority.
The sorting mode is determined by the user when creating the mailbox.
Procedure:
To Edit / Compile / generate Hex file: Refer General procedure in Page No: 58
To down load and run this program: Refer General procedure in Page No: 60
Result:
Thus, the mailbox was created in Micro C/OS ?II and implemented using LPC2148.
Outcome:
Able to understand the concept of mail box in embedded systems and its significance in real time
systems





36 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications:
1. Used in Acorn RISC PC700
2. Used in ZIPIT wireless messenger
3. Used in Meizu M6 MINI player


1. What is IPC?
2. Define Queue.
3. What are the different types of mail box functions?
4. What is half duplex mode?
5. How many synchronous and asynchronous modes are there in serial port?
6. List the bits used to generate serial port interrupt
7. What is branch prediction?
8. Mention any two features of ?C/OS ? II.
9. Write the function for creating task in ?C/OS ? II.
10. Mention any two support devices for ?C/OS ? II.
11. How many user tasks can be handled by ?C/OS ? II?



















Viva-voce




37 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 9 INTERRUPT PERFORMANCE
CHARACTERISTICSOF ARM AND FPGA

Aim:
To study the interrupt performance characteristics of ARM and FPGA by using ARM controller kit and
FPGA kit separately.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
External Interrupts:
An interrupt caused by an external source such as the computer operator, external sensor or
monitoring device, or another computer. Interrupts are special events that require immediate attention.
Interfacing External Interrupts with LPC2148:
When an external interrupt signal occurs in LPC2148 Primer Board, the message "LOW" will be
displayed on PC. The interrupt signal occurs using switches. When the switch is pressed to LOW, then the
external interrupt occurs. The Vectored Interrupt Controller (VIC) takes 32 interrupt request inputs and
programmable assigns them into 3 categories, FIQ, vectored IRQ, and non-vectored IRQ. The ARM7
LPC2148 Primer board has two numbers of External Interrupts, connected with I/O Port lines (P0.14 &
P0.15) as switches.







38 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00



Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60


39 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
39 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Result:
Thus the interrupt performance characteristics of ARM and FPGA are studied. On comparison, ARM
counts at slow speed because it consumes more instruction cycle and FPGA is more efficient for servicing
and processing external interrupt pulses.
Outcome:
Able to understand the performance characteristics of ARM and FPGA while dealing with
interrrupts
Applications:
1. Used in random logic and SPLDs
2. Used in cryptography and filtering
3. In medical imaging
4. In bioinformatics and voice recognition



1. When is an Interrupt Request received?
2. What is ISR?
3. How do you initialize interrupt?
4. What is Vectored Interrupt Controller?
5. What are the kinds of protection available for SRAMS ?
6. What is interrupt pipelining?
7. What is pipeline shutdown?
8. What is branch prediction?
9. What is the use of Neon Floating point engine?
10. What is the use of ?vectorize option?
11. What is PTM?
12. What is ITM?
13. What is ETM?
14. What is I2S interface?
15. What is the use of ?SWI? in ARM assembly?

Viva-voce




40 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 10 FLASHING OF LEDS
Aim:
To write and execute an embedded c program to display LEDs using LPC 2148 ARM controller
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
Theory:
LED (Light Emitting Diodes) is the most commonly used components, usually for displaying pins digital
states. Typical uses of LEDs include alarm devices, timers and confirmation of user input such as a mouse
click or keystroke. Interfacing LED with LPC2148 Flash a LED using LPC2148 Primer Board. It works by
turning ON a LED & then turning it OFF & then looping back to START. However the operating speed of
microcontroller is very high so the flashing frequency will also be very fast to be detected by human eye.
The ARM7 LPC2148 Primer board has eight numbers of point LEDs, connected with I/O Port lines (P1.16 ?
P1.23) to make port pins high.










41 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00



Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus program for flashing of LEDs is written and executed using ARM controller LPC2148.



42 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Outcome:
Able to interface LED lights via the input output port and control them
Applications:
1. In Illumination
2. As status indicators in equipments
3. Stadium displays and dynamic decorative displays



1. What is seven segment displays?
2. What are the different configurations of LED?
3. What is the function of GPIO?
4. What are the Pins which are used to connect LEDs?
5. How to identify 'Polarity' of LED?
6. Differentiate LED from LCD.
7. What is a use of Jumper?
8. How many numbers of LEDs present in Primer board?
9. Where LEDs are used?
10. What is the use of flash magic software?
11. Which port is used in ARM 7 processor kit?
12. Which diode suffers an avalanche breakdown?
13. What happens if the junction temperature of LED is increased?
14. What is an anti collision rate light?
15. What is fail-safe conditions






Viva-voce




43 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 11 STEPPER MOTOR INTERFACE WITH
ARM -7 LPC2148
Aim:
To write a program to interface stepper motor using ARM processor and control the movement of motor
in either directions.
Apparatus Required:
1. LPC2148 ARM development board
2. Stepper motor
3. Interfacing cables
4. PC
Theory:
A stepper motor can be viewed as a DC motor with number of poles (on both rotor and stator).
Additionally, soft magnetic material with many teeth on the rotor and stator cheaply multiplies the number of
poles (reluctance motor). Like an AC synchronous motor, it is ideally driven by sinusoidal current, allowing
a step less operation, but this puts some burden on the controller. When using an 8-bit digital controller,
256 micro steps per step are possible. As a digital-to-analog converter produces unwanted ohmic heat in
the controller, pulse-width modulation is used to regulate the mean current. Simpler models switch voltage
only for doing a step, thus needing an extra current limiter: for every step, they switch a single cable to the
motor.
The idea is to connect the output pins of the driver to 4 transistors. The transistor must be
grounded at the emitter and the driver pin must be connected to the base. Collector is connected to the coil
wire of the motor. Stepper motors are rated by the torque they produce. Synchronous electric motors using
soft magnetic materials (having a core) have the ability to provide position holding torque (called detent
torque, and sometimes included in the specifications) while not driven electrically. To achieve full rated
torque, the coils in a stepper motor must reach their full rated current during each step. The voltage rating
(if there is one) is almost meaningless. The motors also suffer from EMF, which means that once the coil is
turned off it starts to generate current because the motor is still rotating. There needs to be an explicit way
to handle this extra current in a circuit otherwise it can cause damage and affect performance of the motor.
44 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
44 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus stepper motor interface with ARM processor has been successfully implemented and the motor is
controlled in clockwise and anticlockwise direction.
Outcome:
Able to interface the stepper motor with ARM controller and thereby create some rotational
movements





45 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Applications:
3. Used for precise positioning with a motor
4. Used in hard disk drives, robotics
5. Used in telescopes and toys







1. Define GPIO.
2. What is the function of ULN2803?
3. How LPC2148 control stepper motor?
4. Which I/O port lines used to rotate stepper motor?
5. How stepper motor reacts for each pulse it receives?
6. What is serial communication?
7. What is parallel communication?
8. What is stepper motor & why it is named so?
9. How can be step angle is calculated?
10. What are the advantages and disadvantages of parallel communication?
11. What does instruction-pipelining mean?
12. What is the power supply required for ARM processor?
13. What is a unit for torque?
14. What is RPM rating for a DC motor?
15. What device that is used to obtain an accurate position control of rotating shafts in terms of steps?
Viva-voce

46 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
46 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Expt. No. 12 LM35 TEMPERATURE SENSOR INTERFACE
WITH ARM-7 LPC2148
Aim:
To write a program to interface of LM35 temperature sensor to on-chip ADC of ARM controller and
display the room temperature value on the screen.
Apparatus Required:
1. LPC2148 ARM development board
2. Temperature sensor
3. Interfacing cables
4. PC
Theory:
Temperature Sensor:
The LM35 series are precision integrated-circuit temperature sensors, whose output voltage is linearly
proportional to the Celsius (Centigrade) temperature. The output of the sensor is converted to digital output
that is easy to connect with microcontroller. Temperature sensor has three terminals and required
Maximum of 5.5 V supply. This type of sensor consists of a material that performs the operation according
to temperature to vary the resistance. This change of resistance is sensed by circuit and it calculates
temperature. When the voltage increases then the temperature also rises. We can see this operation by
using a diode.







47 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
47 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00


Circuit diagram:

48 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
48 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the program for interfacing temperature sensor with ARM controller is written and executed and
the temperature reading is seen on the monitor.
Outcome:
Able to interface different sensors with in-built ADC of the ARM processor and access the data
produced from them
Applications:
1. Used in Ovens, refrigerators
2. In HVAC environmental control
3. coolant or cylinder head temperatures
4. in the automotive industry to monitor air intake



1. What is LM35?
2. Define ISP.
3. How many Analog-to-Digital Converters available as an inner peripheral in LPC2148?
4. What is the main function of analog pin in LPC 2148?
5. What is the output voltage produced by LM35 for one degree temperature?
6. What is the difference between LM 34 and LM 35 sensors?
7. How many pins are available in LM35?
8. Why Vref is set of ADC0848 to 2.56 V if analog input is connected to the LM35?
9. What is operating the operating temperature range in LM35?
10. Why LM35 is used to Measure Temperature?
11. List the devices used to sense temperature.
12. What is the purpose of a thermocouple?
13. What is the output voltage of a thermocouple?
Viva-voce




49 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 13 IMPLEMENTATION OF WIRELESS
COMMUNICATION PROTOCOL
USING ZIGBEE WIRELESS MODULE
Aim:
To implement wireless communication protocol using zigbee wireless module with the help of ARM
processor
Apparatus required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. Zigbee module
5. PC
Theory:
ZigBee is a specification to suite high level communication protocols using small, low-power digital
radios based on an IEEE 802 standard for personal area networks. The ZigBee is the name of a wireless
protocol maintained by the IEEE 802.15 standard. This is a protocol specified for wireless Personal Area
Network (PAN) using low powered wireless transceivers. There are already wireless transmitter and
receiver modules which can do point to point communication. The Xbee is the brand name a wireless
transceiver device introduced by the Digi international which works on the ZigBee protocol and can form
PAN networks. They have an approximate range of 10 to 100 meters and are used in industries, scientific
fields, medical fields etc
Digi ZigBee:
The Digi Xbee 802.15.4 modules are the easiest to use, most reliable and cost-effective RF devices.
The 802.15.4 Xbee modules provide two friendly modes of communication - a simple serial method to
transmit/receive or a framed mode providing advanced features. These modules can communicate point to
point, from one point to a PC, or in a mesh network.



50 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
50 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Circuit diagram:


Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the wireless communication protocol using Zigbee wireless module is implemented using
LPC2148.
Outcome:
Able to form a wireless network using zigbee module and ARM controller




51 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications:
1. Used in traffic lights in non-urban areas
2. Used in building control systems
3. Used in asset tracking
4. Used in parking sensors




1. How many UART ports available in LPC2148?
2. What is the main function of voltage convertors in UART?
3. Why Zigbee based is preferred for wireless communication?
4. What is the IEEE standard for Zigbee protocol?
5. Write the two modes of communication are used in a ZigBee network.
6. What is the function of a scheduler?
7. Mention any two features of ?C/OS ? II.
8. Write the function for creating task in ?C/OS ? II.
9. Mention any two support devices for ?C/OS ? II.
10. How many user tasks can be handled by ?C/OS ? II?







Viva-voce




52 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

















ADDITIONAL EXPERIMENTS
53 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
53 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Expt. No. 14 BUZZER INTERFACE WITH ARM-7 LPC2148
Aim:
To write a program for buzzer interface with ARM processor and control its operation.
Apparatus required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
Theory:
Buzzer is an electronic device commonly used to produce sound. Light weight, simple construction and
low price make it usable in various applications like car/truck reversing indicator, computers, call bells etc.
Piezo buzzer is based on the inverse principle of piezo electricity discovered in 1880 by Jacques and Pierre
Curie. It is the phenomena of generating electricity when mechanical pressure is applied to certain
materials and the vice versa is also true. Such materials are called piezo electric materials. Piezo electric
materials are either naturally available or manmade. Piezo ceramic is class of manmade material, which
poses piezo electric effect and is widely used to make disc, the heart of piezo buzzer. When subjected to
an alternating electric field they stretch or compress, in accordance with the frequency of the signal thereby
producing sound.







54 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
54 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the program for interfacing buzzer with ARM processor is written and executed and output is
verified.
Outcome:
Able to interface devices such as buzzer, relay with ARM controller





55 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Applications:

1. In alarm devices and timers
2. In confirmation of user input such as mouse click or keystroke
3. Alarming Circuits
4. Communication equipments
5. Automobile electronics
6. Portable equipments, due to its compact size





1. Define Buzzer.
2. Which pin in ARM can be used to modulate Buzzer?
3. What is the function Flash magic software?
4. How the Buzzer can be disconnected in LPC2148?
5. How the volume of sound will be changed in Buzzer?
6. What is a buzzer
7. What are the applications of buzzer?
8. How buzzer is used in embedded system?
9. What is race round condition?
10. What is digital signal controller?
11. What are the features of buzzer circuit?
12. What is a semaphore?
13. What is mutexes?
14. What is the role of segment register?
15. What is watch dog timer?

Viva-voce

56 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
56 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Expt. No. 15 RELAY INTERFACE WITH ARM - 7
Aim:
To write a program to interface 2 relays with LPC 2148 ARM Controller and verify its working.
Apparatus required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
Theory:
A relay is an electrically operated switch. Many relays use an electromagnet to mechanically operate a
switch, but other operating principles are also used, such as solid-state relays. Relays are used where it is
necessary to control a circuit by a low-power signal (with complete electrical isolation between control and
controlled circuits), or where several circuits must be controlled by one signal. The first relays were used in
long distance telegraph circuits as amplifiers: they repeated the signal coming in from one circuit and re-
transmitted it on another circuit. Relays were used extensively in telephone exchanges and early
computers to perform logical operations.
57 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
57 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
The program for interfacing relays with ARM controller is done and its working is verified.
Outcome:
Able to interface devices such as relay with ARM controller and control them using programs.






58 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications:
1. Used in homes, even in streets.
2. In automatic garage door for its movement and direction.
3. And even in refrigerators
4. In industries to provide energy on machineries.
5. In electrical fuel pump



1. What is the function of relay?
2. What is the function of Opto-isolator?
3. What is the function of power transistor in LPC2148?
4. Which pin acts as an output port for relay?
5. What is a relay circuit
6. what are the applications of relay circuit
7. what are the advantages of relay circuit
8. How does combination of functions reduce memory requirements in embedded systems?
9. What is the need for DMAC in ES?
10. Mention how I/O devices are classified for embedded system?
11. Explain what is interrupt latency? How can you reduce it?
12. What does DMA address will deal with?
13. List out various uses of timers in embedded system?
14. List out some of the commonly found errors in Embedded Systems?
15. What is the difference between macro and line function.



Viva-voce




59 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Creating the New Project:
1. To create a new project, choose Project>Create New Project. The Create New Project dialog box
appears which lets you base your new project on a project template.
2. Make sure the Tool chain is set to ARM, and click OK.
3. Select the project template Empty project, and click ok button. Which simply creates an empty project
that uses default project setting?
4. In the standard Save As dialog box that appears, specify where you want to place your project file, that
is, in your newly created projects directory. Type your project name in the File name box, and click Save
to create the new project. Eg. LED.
The project will appear in the Workspace window.
To Creating your Application ?C? file, Choose FILE menu and select NEW > File.
Edit the application code in C Language. Eg. Led.c
To Save your ?C? file, Choose File >Save As. In the standard Save As dialog box that appears, specify
where you want to place your project file, that is, in your project directory. Type your filename in the
Filename box, and click Save to create the new project. Eg. Led.c
Adding Files to the Project:
1. In the Workspace window, select the destination to which you want to add a source file; a group or, as in
this case, directly to the project.
2. Choose Project>Add Files to open a standard browse dialog box. Locate the files led.c select them in
the file selection list, and click Open to add them to the project1 project.
To save your work space, Choose File>Save Workspace and specify where you want to place your
workspace file. In this tutorial, you should place it in your newly created project directory. Type LED in
the File name box, and click save button.
GENERAL PROCEDURE


60 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
60 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Setting Project Options:
Now you will set the project options. For application projects, options can be set on all levels of nodes.
First you will set the general options to suit the processor configuration in this tutorial. Because these
options must be the same for the whole build configuration, they must be set on the project node.
1. Select the project folder icon LED - Debug in the Workspace window and choose Project>Options. Then
select Output Converter in the Category list to display the linker option pages.
The Output options are used for specifying details about the output format and the level of debugging
information included in the output file.
Select ?option? on the popup menu.
After selecting popup menu window shows as given below.
Select output format as ?Intel Extended?, output file in the format of .hex format.
Select the linker file menu, linker configuration file available at project directory.
Choose Project>Rebuild ALL
If your project has no error Building completed and Hex file generated
For Creating the Hex file, we choose output file format as given below.
Select Linker file as given below.
To Compile this Project, Choose Project>Rebuild ALL
If there is no error, Message window shows like this. Now Hex file is created.
ISP Utility:
NXP Semiconductors produce a range of Microcontrollers that feature both on-chip Flash memory and
the ability to be reprogrammed using In-System Programming technology. Flash Magic is Windows
software that allows easy access to all the ISP features provided by the devices. These features include:
* Erasing the Flash memory (individual blocks or the whole device)
* Programming the Flash memory
* Modifying the Boot Vector and Status Byte
* Reading Flash memory
* Performing a blank check on a section of Flash memory
FirstRanker.com - FirstRanker's Choice
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00






?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING

VII SEMESTER - R 2013

EC6711 ? EMBEDDED LABORATORY






Name : _______________________________________
Register No : _______________________________________
Section : _______________________________________
LABORATORY MANUAL



2 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00




is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and
training.

? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different
levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on
heart and soul
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

To impart professional education integrated with human values to the younger generation, so as to
shape them as proficient and dedicated engineers, capable of providing comprehensive solutions to the
challenges in deploying technology for the service of humanity

? To educate the students with the state-of-art technologies to meet the growing challenges of the
electronics industry
? To carry out research through continuous interaction with research institutes and industry, on
advances in communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning,
innovation and ethical practices
VISION
VISION
MISSION
MISSION



3 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

PROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To provide students with a solid foundation in Mathematics, Science and fundamentals of
engineering, enabling them to apply, to find solutions for engineering problems and use this knowledge
to acquire higher education
2. Core Competence
To train the students in Electronics and Communication technologies so that they apply their
knowledge and training to compare, and to analyze various engineering industrial problems to find
solutions
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice which
enables them to find solutions for the real time problems in industry, and to design products
4. Professionalism
To inculcate professional and effective communication skills, leadership qualities and team spirit in
the students to make them multi-faceted personalities and develop their ability to relate engineering
issues to broader social context
5. Lifelong Learning/Ethics
To demonstrate and practice ethical and professional responsibilities in the industry and society in
the large, through commitment and lifelong learning needed for successful professional career


4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
PROGRAMME OUTCOMES (POs)
a) To demonstrate and apply knowledge of Mathematics, Science and engineering fundamentals in
Electronics and Communication Engineering field
b) To design a component, a system or a process to meet the specific needs within the realistic
constraints such as economics, environment, ethics, health, safety and manufacturability
c) To demonstrate the competency to use software tools for computation, simulation and testing of electronics
and communication engineering circuits
d) To identify, formulate and solve electronic and communication engineering problems
e) To demonstrate an ability to visualize and work on laboratory and multidisciplinary tasks
f) To function as a member or a leader in multidisciplinary activities
g) To communicate in verbal and written form with fellow engineers and society at large
h) To understand the impact of Electronics and Communication Engineering in the society and demonstrate
awareness of contemporary issues and commitment to give solutions exhibiting social responsibility
i) To demonstrate professional & ethical responsibilities
j) To exhibit confidence in self-education and ability for lifelong learning
k) To participate and succeed in competitive exams


5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
SYLLABUS

? Learn the working of ARM processor
? Understand the Building Blocks of Embedded Systems
? Learn the concept of memory map and memory interface
? Know the characteristics of Real Time Systems
? Write programs to interface memory, I/Os with processor
? Study the interrupt performance
LIST OF EXPERIMENTS:
1. Study of ARM evaluation system
2. Interfacing ADC and DAC
3. Interfacing LED and PWM
4. Interfacing real time clock and serial port
5. Interfacing keyboard and LCD
6. Interfacing EPROM and interrupt
7. Mailbox
8. Interrupt performance characteristics of ARM and FPGA
9. Flashing of LEDS
10. Interfacing stepper motor and temperature sensor
11. Implementing zigbee protocol with ARM



? Write programs in ARM for a specific Application
? Interface memory and Write programs related to memory operations
? Interface A/D and D/A convertors with ARM system
? Analyze the performance of interrupt
? Write programmes for interfacing keyboard, display, motor and sensor.
? Formulate a mini project using embedded system
COURSE OBJECTIVES
COURSE OUTCOMES
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
CONTENTS
Sl. No. Name of the Experiment Page No.
CYCLE 1 ? EXPERIMENTS
1
Study of ARM evaluation system 7
2
Analog to Digital Convertor interfacing 16
3
Generation of ramp and square wave using on-Chip DAC 19
4
LED dimming using PWM 22
5
Interfacing real time clock and serial port 25
6
Interfacing keypad and LCD 28
7
Interfacing EPROM and interrupt 31
CYCLE 2 ? EXPERIMENTS
8 Implementation of Mailbox Function using LPC 2148 35
9 Interrupt Performance Characteristics of Arm and FPGA 37
10 Flashing of LEDs 40
11 Stepper Motor Interface with ARM ? 7 LPC2148 43
12 LM35 Temperature Sensor Interface with ARM ? 7 LPC2148 47
13
Implementation of Wireless Communication Protocol using ZIGBEE Wireless
Module
50
ADDITIONAL EXPERIMENTS BEYOND THE SYYLABUS
14 Buzzer Interface with ARM ? 7 54
15 Relay interface with ARM? 7 57
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Expt. No. 1 STUDY OF ARM EVALUATION SYSTEM
Aim:
To study the building blocks of ARM7 system, its features, pin configuration and the components
required for functioning of ARM controller.
Architecture Overview:
A RISC-based computer design approach means ARM processors require significantly fewer transistors
than typical processors in average computers. This approach reduces cost, heat and power usage. These
are desirable traits for light, portable, battery-powered devices (smart phones, laptops, tablet and notepad
computers), and other embedded systems. A simpler design facilitates more efficient multi-core CPUs and
higher core counts at lower cost, providing higher processing power and improved energy efficiency for
servers and supercomputers.
In 2005, about 98% of all mobile phones sold used at least one ARM processor. The low power
consumption of ARM processors has made them very popular: 37 billion ARM processors have been
produced as of 2013, up from 10 billion in 2008. The ARM architecture (32-bit) is the most widely used
architecture in mobile devices, and most popular 32-bit one in embedded systems.
According to ARM Holdings, in 2010 alone, producers of chips based on ARM architectures
reported shipments of 6.1 billion ARM based processors, representing 95% of smart phones, 35% of digital
televisions and set-top boxes and 10% of mobile computers. It is the most widely used 32-bit instruction set
architecture in terms of quantity produced.
LPC 2148:
LPC2148 is the widely used IC from ARM-7 family. It is manufactured by Philips and it is pre-loaded
with many inbuilt peripherals making it more efficient and a reliable option for the beginners as well as high
end application developer.




8 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Features of LPC214x series controllers:
1. 8 to 40 kB of on-chip static RAM and 32 to 512 kB of on-chip flash program memory.128 bit wide
interface/accelerator enables high speed 60 MHz operation.
2. In-System/In-Application Programming (ISP/IAP) via on-chip boot-loader software. Single flash sector or
full chip erase in 400 ms and programming of 256 bytes in 1ms.
3. Embedded ICE RT and Embedded Trace interfaces offer real-time debugging with the on-chip Real
Monitor software and high speed tracing of instruction execution.
4. USB 2.0 Full Speed compliant Device Controller with 2 kB of endpoint RAM. In addition, the LPC2146/8
provides 8 kB of on-chip RAM accessible to USB by DMA.
5. One or two (LPC2141/2 vs. LPC2144/6/8) 10-bit A/D converters provide a total of 6/14analog inputs, with
conversion times as low as 2.44 us per channel.
6. Single 10-bit D/A converter provides variable analog output.
7. Two 32-bit timers/external event counters (with four capture and four compare channels each), PWM unit
(six outputs) and watchdog.
8. Low power real-time clock with independent power and dedicated 32 kHz clock input.
9. Multiple serial interfaces including two UARTs (16C550), two Fast I2C-bus (400 kbit/s), SPI and SSP with
buffering and variable data length capabilities.
10. Vectored interrupt controller with configurable priorities and vector addresses.
11. Up to 45 of 5 V tolerant fast general purpose I/O pins in a tiny LQFP64 package.
12. Up to nine edge or level sensitive external interrupt pins available.
13. On-chip integrated oscillator operates with an external crystal in range from 1 MHz to30 MHz and with
an external oscillator up to 50 MHz
14. Power saving modes include Idle and Power-down.
15. Individual enable/disable of peripheral functions as well as peripheral clock scaling for additional power
optimization.
16. Processor wake-up from Power-down mode via external interrupt, USB, Brown-Out Detect (BOD) or
Real-Time Clock (RTC).




9 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


First Step- Hardware Requirement:
Pin configuration of LPC 2148.

Hardware requirement of LPC2148:
1. LPC2148 need minimum below listed hardware to work properly
2. Power Supply
3. Crystal Oscillator
4. Reset Circuit
5. RTC crystal oscillator
6. UART
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Power Supply:
LPC2148 works on 3.3 V power supply. LM 117 can be used for generating 3.3 V supply. However,
basic peripherals like LCD, ULN 2003 (Motor Driver IC) etc. works on 5V. So AC mains supply is converted
into 5V using below mentioned circuit and after that LM 117 is used to convert 5V into 3.3V.
Block diagram of power Supply

Transformer: It is used to step down 230V AC to 9V AC supply and provides isolation between power grids
and circuit.
Rectifier: It is used to convert AC supply into DC.
Filter: It is used to reduce ripple factor of DC output available from rectifier end.
Regulator: It is used to regulate DC supply output.

11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Circuit Diagram:

Regulator IC 7805 is used to provide fix 5V dc supply.
LM 117 is used for generating 3.3V supply from 5V.

12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Calculations:

From the datasheet of LM117

Taking R 2= 240?, we get R 1=392?
Reset Circuit:
Reset button is essential in a system to avoid programming pitfalls and manually bring back the system
to the initialization mode. MCP 130T is a special IC used for providing stable RESET signal to LPC 2148.


13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Oscillator Circuit:

The value of capacitors C20 & C21 depends upon the frequency of crystal Y3. General circuit and
its equivalent circuit is as shown below.

14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Recommended values are as shown in table:

UART:
LPC 2148 has inbuilt ISP which means we can program it within the system using serial
communication on COM0. It has also COM1 for serial communication. MAX 232/233 IC must be used for
voltage logic conversion. Related connections are as given below.

Once the above listed circuit design is ready, we are ready to go further.



15 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Result:
ARM Evaluation system and the configuration of LPC2148 has been studied fully. The minimal setup
required for the functioning of the ARM processor is studied.
Outcomes:
1. Able to understand the ARM controller, its basic components inside and its features.
2. Able to know the components required for the working of ARM LPC2148

Applications:
ARM controller LPC2148 is used in no. of devices such as
1. Smart phones
2. Net books
3. E Readers
4. Digital TV
5. Home Gateways


1. What are the basic units of ARM 7?
2. What is the address system supported by ARM?
3. Define - RISC
4. What are the instructions used to access the memory in ARM?
5. What are the basic units of Microprocessor?
6. What is an Instruction?
7. What is clock cycle?
8. Define - Pipelining
9. What is cache miss?
10. What is meant by memory mapped I/O?
11. Define ? interrupt
12. What is meant by Exception?
13. What is meant by little ? endian mode?
14. What is meant by big ? endian mode?
15. What is the function of CPSR?
16. What is register - indirect addressing?
Viva-voce




16 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 2 ANALOG TO DIGITAL CONVERTOR
INTERFACING
Aim:
To write an embedded c program for interfacing an on chip ADC with LPC2148 ARM processor and
convert the given input voltage into corresponding decimal values.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. PC
Theory:
Analog to Digital converter (ADC) is a device that converts continuously varying analog signals from
instruments that monitor such conditions as movement, temperature, sound, etc., into binary code for the
computer. It may be either a single chip or can be one circuit within a chip. Analog to Digital conversion is
the process of changing continuously varying data, such as voltage, current, or shaft rotation, into discrete
digital quantities that represent the magnitude of the data compared to a standard or reference at the
moment the conversion is made. According to the method of conversion, ADCs can be classified into
Direct-Conversion ADCs, Successive Approximation ADCs, Integrating ADC and Sigma-Delta ADCs.
The LPC 2148 has 10-bit successive approximation analog to digital converter. Basic clocking for the
A/D converters is provided by the VPB clock. A programmable divider is included in each converter, to
scale this clock to the 4.5 MHz (max) clock needed by the successive approximation process. A fully
accurate conversion requires 11 of these clocks. The ADC cell can measure the voltage on any of the ADC
input signals. It is noted that these analog inputs are always connected to their pins, even if the Pin function
Select register assigns them to port pins. A simple self-test of the ADC can be done by driving these pins
as port outputs.



17 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Circuit diagram:




18 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus, an embedded c program for interfacing on-chip ADC with ARM processor is written and
executed. The decimal values of the converted voltage are seen in the WinXTalk screen.
Outcome:
Able to interface A/D convertors with ARM system and check its working by connecting an analog
quantity as input.
Applications:
1. ADC used in MODEM for converting analog signals to digital.
2. A fast video ADC in TV tuner cards
3. ADC used in digital storage oscilloscopes
4. Used in music reproduction technology.
5. Used in DSP if input is analog


1. What are the ADC operating modes in LPC2148?
2. What is meant by conversion time?
3. Why are internal ADCs preferred over external ADCs?
4. Why has 16-bit ADC more resolution than from 10-bit and 8-bit ADC?
5. What are ADC & its Resolution?
6. What is Burst conversion mode?
7. What is the function of A/D Control Register?
8. What is the function of A/D Global Data Register?
9. What is the function of A/D Status Register?
10. What is analog-to-digital (ADC) conversion error?
11. What is the function of Sample-and-hold circuits in analog-to digital converters?
12. What is the disadvantage of the flash analog-to digital converter?
Viva-voce




19 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 3 GENERATION OF RAMP AND SQUARE
WAVE USING ON-CHIP DAC
Aim:
To write and execute an embedded c program to generate ramp wave and square wave using on-chip
DAC of LPC2148 ARM controller.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
A digital-to-analog converter is a device for converting a digital signal into an analog signal (current or
voltage). Digital-to-Analog Converters are the interface between the abstract digital world and the analog
real world. Simple switches, a network of resistors, current sources or capacitors may be used to
implement this conversion. A DAC inputs a binary number and outputs an analog voltage or current signal.
The Microchip Technology Inc. MCP4921 is 2.7 ? 5.5V, low-power, 12-Bit Digital-to-Analog Converter
(DAC) with SPI interface. The MCP4921 DAC provides high accuracy and low noise performance for
industrial applications where calibration or compensation of signals is required. With an SPI connection
there is always one master device (usually a microcontroller) which controls the peripheral devices.
Typically there are three lines common to all the devices,
Master In Slave Out (MISO) ? The Slave line for sending data to the master,
Master Out Slave In (MOSI) ? The Master line for sending data to the peripherals,
Serial Clock (SCK) ? The clock pulses which synchronize data transmission generated by the
master and slave
Slave Select pin ? the pin on each device that the master can use to enable and disable specific
devices. When a device Slave Select pin is low, it communicates with the master. When it is high, it ignores
the master. In SPI, the clock signal is controlled by the master device LPC2148. All data is clocked in and
out using this pin. These lines need to be connected to the relevant pins on the LPC21xx processor. Any
unused GIO pin can be used for CS, instead pull this pin high. Conversion speed is the time it takes for the



20 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

DAC to provide an analog output when the digital input word is changed. The MCP4291 DAC ? SPI
connections with LPC21xx have four I/O lines (P0.4 ? P0.7) required. The analog output is generated by
using these four lines.
Circuit diagram:


Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the embedded c programs for generating ramp wave and square wave using ARM LPC2148 are
written and executed successfully and the waveforms are viewed in oscilloscope.
Outcome:
Able to program the DAC in-built inside the ARM controller and get the waveforms using it.




21 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications :
1. DAC used in Audio amplifier.
2. Video encoder
3. Display electronics
4. Data Acquistion systems
5. Motor control



1. What are the features of LPC2148 DAC?
2. What is the function of DAC register?
3. Which pin provides a voltage reference level for the D/A converter?
4. What are the applications of DAC in signal processing applications?
5. What is GIO?
6. What is the resolution of a digital-to-analog converter (DAC)?
7. What is the major advantage of the R/2R ladder digital-to-analog (DAC), as compared to a binary-
weighted digital-to-analog DAC converter?
8. What is the resolution of a 0?5 V 6-bit digital-to-analog converter (DAC) ?
9. What are DAC configurations?
10. What are the different types of DAC Circuits?
11. What are the Limitations of the Binary Weighted DAC?
12. What are the General DAC Characteristics?
13. Define reference voltage in DAC.
14. What is full scale voltage?
15. What is settling time?
VIVA-VOCE




22 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 4 LED DIMMING USING PWM

Aim:
To write an embedded c program for implementing PWM using ARM controller and verify the same by
dimming of LEDs.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
LPC2148 supports 2 types of PWM:
1) Single Edge PWM ? Pulse starts with new Period i.e pulse is always at the beginning
2) Double Edge PWM ? Pulse can be anywhere within the Period
A PWM block, like a Timer block , has a Timer Counter and an associated Pre-scale Register along
with Match Registers. These work exactly the same way as in the case of Timers. Match Registers 1 to 6
(except 0) are pinned on LPC214x i.e. the corresponding outputs are diverted to actual Pins on LPC214x
MCU. The PWM function must be selected for these Pins to get the PWM output.
The basic setup is to simply replace Servo by a LED and no external 5V source is needed. The
anode of LED is connected to P0.0 and cathode to ground. Pulse Widths corresponding to the switches
connected to P0.1/2/3/4 will be 2.5ms/5ms/7.5ms/10ms respectively. As the Pulse Width Increases LED
will keep on getting brighter and the reverse will happen if Pulse Width is decreased.



23 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus embedded c program for implementing Pulse Width Modulation is written and executed and
output has been verified in LED display.
Outcome:
Able to implement PWM using the ARM controller and verify the same in the form of dimming of
LEDS.



24 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Applications :
1. In Visual signals to covey a message
2. Illumination where light is reflected from objects
3. In Narrow band sensors



1. What factors determine the LED dimming performance?
2. What is meant by analog dimming?
3. What is flickering effect?
4. What is the factor determines dimming of the LED
5. Why Silicon is not suitable for fabrication of light-emitting diodes?
6. Why Silicon diode is less suited for low voltage rectifier operation?
7. What is the principle of zener diode?
8. What are the materials used to make LED?
9. What type of diodes is used in FM receivers?
10. Which diode suffers an avalanche breakdown?
11. What happens if the junction temperature of LED is increased?
12. How a transfer characteristic of a diode does is related?
13. What is the requirement of a clipping action of a diode?
14. What type of rectifier circuit requires four diodes?
15. Why are the pulse width modulated outputs required in most of the applications?
16. How do the variations in an average value get affected by PWM period?
17. Name the common formats available for LED display.
18. What are the types of seven segment display?
19. What is PWM?
20. What are the applications of PWM?

Viva-voce




25 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 5 INTERFACING REAL TIME CLOCK
AND SERIAL PORT
Aim:
To write and execute an embedded c program to interface DS1307 RTC using I2C protocol with ARM
controller
Apparatus Required:
1. LPC2148 ARM development board
2. Stepper motor
3. Interfacing cables
4. PC
Theory:
A clock, which is based on the interrupts at preset intervals, is Real Time Clock (RTC). An interrupt
service routine executes on each timeout (overflow) of this clock. This timing device once started never
resets or never reloaded with another value. Once it is set, it is not modified later. It is used in a system to
save the time and date.













26 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the program for interfacing real time clock with ARM controller is written and executed and the
date and time are verified on the screen.
Outcome:
Able to interface real time clock DS1307 with ARM controller and thereby display date and time
Applications :
1. I2C In ARM and PIC microcontrollers
2. Used as serial communication protocol with MASTER and SLAVE operation.

27 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
27 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00




1. What is I2C and how does it work?
2. What are the features of I2C in LPC2148 ARM7 microcontroller?
3. What is the function of I2C0CONSET register?
4. What is I2C0STAT?
5. What is the function of I2C0 Data Register?
6. What is RTC?
7. List the advantages of RTC
8. Through which port the date and time is displayed in RTC?
9. What is a serial port?
10. List the registers used to transfer data in serial port.
11. List the modes used for data transmission.
12. What is a simplex mode?
13. Which pin is used to transmit a character?
14. What is the baud rate of serial port?
15. What is the disadvantage of RS-232C?














Viva-voce




28 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 6 INTERFACING KEYPAD AND LCD

Aim:
To write an embedded c program to interface 4 x 4 matrix keypad with ARM processor and display the
pressed key in an LCD.
Apparatus Required:
1. LPC2148 ARM development board
2. Interfacing cables
3. PC
Theory:

In matrix keypad, keys are connected in rows and columns. When any switch is pressed, rows and
columns come into contact, which is that detected by controller to identify which key has been pressed. A
4?4 matrix keypad consists of 4 rows and 4 columns. There is a switch connecting each row and column.
So the combinations of rows and columns make up the 16 inputs.Initially all the switches are open (not
connected). When any one button is pressed, the switch is closed (connected),hence there is a connection
between the row and column. The first 4 pins are connected to the column as INPUT. The other 4 pins are
connected to the row as OUTPUT. Matrix keypad is a good substitution to normal push button.












29 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Circuit Diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus program for interfacing matrix keypad with ARM controller is written and executed and the key
pressed is seen in the LCD.



30 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Outcome:
Able to interface keypad with ARM controller and see the pressed key in the LCD display.
Applications :
1. Used in password based door locking system
2. Security system with user changeable
3. Used in laptops, computer games
4. Used in portable video games and cell phones



1. What is Matrix keypad?
2. What is the concept behind keypad interface?
3. What are the functions of pull- up resistors?
4. What is key de bouncing?
5. List the steps involved when the key in a 4 x 4 keyboard matrix is being pressed.
6. What is the value obtained if no key is pressed?
7. What kind of interrupt is generated if a key has to be operated in an interrupt mode?
8. How will you identify that the key is pressed?
9. What are the steps involved in Keyboard Interfacing?
10. List the registers used to store the keyboard, display modes and other operations programmed by
CPU.
11. Name the mode when a data is entered from the left side of the display unit.
12. How many rows and columns are present in a 16 x 2 alphanumeric LCD?
13. How many data lines are there in a 16 x 2 alphanumeric LCD?
14. Which pin of the LCD is used for adjusting its contrast?
15. Which command of an LCD is used to shift the entire display to the right?
16. Which command is used to select the 2 lines and 5 x 7 matrix of an LCD?
17. What changes are to be made to send data to an LCD?
18. For reading operation from an LCD what changes in the software are introduced?
19. Which instruction is used to select the first row first column of an LCD?
Viva-voce

31 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
31 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Expt. No. 7 INTERFACING EEPROM AND INTERRUPT

Aim:
To write a program to interface EEPROM using I2C protocol with ARM controller and retrieve the stored
messages inside EEPROM.
Apparatus Required:
1. LPC2148 ARM development board
2. Interfacing cables
3. PC
Theory:
I2C (Inter Integrated Circuit):
The I2C (Inter-IC) bus is a bi-directional two-wire serial bus that provides a communication link between
integrated circuits (ICs).I2C is a synchronous protocol that allows a master device to initiate communication
with a slave device. Data is exchanged between these devices.
EEPROM:
EEPROM (electrically erasable programmable read-only memory) is user-modifiable read-only
memory (ROM) that can be erased and reprogrammed (written to) repeatedly through the application of
higher than normal electrical voltage. It is a type of non-volatile memory used in computers and other
electronic devices to store small amounts of data that must be saved when power is removed, e.g.,
calibration tables or device configuration
Read, write and Erase EEPROM by using I2C in LPC2148 Primer Board. Wiring up an I2C based
EEPROM to the I2C port is relatively simple. The basic operation of the I2C based EEPROM's is to send a
command, such as WRITE, followed by an address and the data. In WRITE operation, the EEPROM is
used to store the data. In LPC2148 Primer Kit, 2 nos. of EEPROM lines are controlled by I2C Enabled
drivers. I2C Lines serial clock SCL (P0.2), serial data SDA (P0.3) connected to the I2C based serial
EEPROM IC. The EEPROM read & write operations are done in LPC2148 Primer Kit by using these SDA &
SCL I2C lines.
32 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
32 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To down load and run this program: Refer General procedure given in Page No: 60
Result:
Thus, the program for interfacing I2C based EEPROM with ARM processor has been written and
executed successfully and the memory content is verified on Win x talk terminal.
Outcome:
Able to interface memory ICs with ARM controller and perform the read and write operations.



33 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications:
1. ROM used in toys,automobiles to store data when power is off
2. In calculators and peripheral devices
3. In laser printers
4. And also in embedded systems where program need not to be changed.


1. How does I2C protocol work?
2. What is EEPROM?
3. What is meant by master slave mode?
4. What is meant by non-volatile memory?
5. What is an interrupt?
6. How does an interrupt request works?
7. What is a nested interrupt?
8. What are the registers used for enabling an interrupt?
9. What is PROM?
10. What is EPROM?
11. What is mask ROM?
12. Which memory allows simultaneous read and write operations?
13. Which memory has the shortest access times?
14. Which interrupt has the highest priority?
15. What is non maskable interrupt?
16. Which is the first level of memory access by the microprocessor?
17. List the types of cache memories.
18. What is the use of an interrupt?
19. What is the use of converting an interrupt to threads in a microprocessor?
20. What are the bits used to control an external interrupts?


Viva-voce




34 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00










CYCLE 2 - EXPERIMENTS




35 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 8 IMPLEMENTATION OF MAILBOX FUNCTION
USING LPC2148
Aim:
To create a mailbox in Micro C/OS ? II using LPC2148 ARM Controller
Apparatus Required:
1. LPC2148 ARM development board
2. Interfacing cables
3. PC
Theory:
System or the user code can send a message by the core services. A typical mail message, also
known as the exchange of information, refers to a task or an ISR using a pointer variable, through the core
services to put a message (that is, a pointer) into the mailbox. Similarly, one or more tasks can receive this
message by the core services. The tasks sending and receiving the message promise that the content that
the pointer points to is just that piece of message.
The mailbox of CooCox CoOS is a typical message mailbox which is composed of two parts: one is
the information which expressed by a pointer of void; the other is the waiting list which composed of the
tasks waiting for this mailbox. The waiting list supports two kinds of sorting: FIFO and preemptive priority.
The sorting mode is determined by the user when creating the mailbox.
Procedure:
To Edit / Compile / generate Hex file: Refer General procedure in Page No: 58
To down load and run this program: Refer General procedure in Page No: 60
Result:
Thus, the mailbox was created in Micro C/OS ?II and implemented using LPC2148.
Outcome:
Able to understand the concept of mail box in embedded systems and its significance in real time
systems





36 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications:
1. Used in Acorn RISC PC700
2. Used in ZIPIT wireless messenger
3. Used in Meizu M6 MINI player


1. What is IPC?
2. Define Queue.
3. What are the different types of mail box functions?
4. What is half duplex mode?
5. How many synchronous and asynchronous modes are there in serial port?
6. List the bits used to generate serial port interrupt
7. What is branch prediction?
8. Mention any two features of ?C/OS ? II.
9. Write the function for creating task in ?C/OS ? II.
10. Mention any two support devices for ?C/OS ? II.
11. How many user tasks can be handled by ?C/OS ? II?



















Viva-voce




37 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 9 INTERRUPT PERFORMANCE
CHARACTERISTICSOF ARM AND FPGA

Aim:
To study the interrupt performance characteristics of ARM and FPGA by using ARM controller kit and
FPGA kit separately.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
External Interrupts:
An interrupt caused by an external source such as the computer operator, external sensor or
monitoring device, or another computer. Interrupts are special events that require immediate attention.
Interfacing External Interrupts with LPC2148:
When an external interrupt signal occurs in LPC2148 Primer Board, the message "LOW" will be
displayed on PC. The interrupt signal occurs using switches. When the switch is pressed to LOW, then the
external interrupt occurs. The Vectored Interrupt Controller (VIC) takes 32 interrupt request inputs and
programmable assigns them into 3 categories, FIQ, vectored IRQ, and non-vectored IRQ. The ARM7
LPC2148 Primer board has two numbers of External Interrupts, connected with I/O Port lines (P0.14 &
P0.15) as switches.







38 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00



Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60


39 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
39 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Result:
Thus the interrupt performance characteristics of ARM and FPGA are studied. On comparison, ARM
counts at slow speed because it consumes more instruction cycle and FPGA is more efficient for servicing
and processing external interrupt pulses.
Outcome:
Able to understand the performance characteristics of ARM and FPGA while dealing with
interrrupts
Applications:
1. Used in random logic and SPLDs
2. Used in cryptography and filtering
3. In medical imaging
4. In bioinformatics and voice recognition



1. When is an Interrupt Request received?
2. What is ISR?
3. How do you initialize interrupt?
4. What is Vectored Interrupt Controller?
5. What are the kinds of protection available for SRAMS ?
6. What is interrupt pipelining?
7. What is pipeline shutdown?
8. What is branch prediction?
9. What is the use of Neon Floating point engine?
10. What is the use of ?vectorize option?
11. What is PTM?
12. What is ITM?
13. What is ETM?
14. What is I2S interface?
15. What is the use of ?SWI? in ARM assembly?

Viva-voce




40 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 10 FLASHING OF LEDS
Aim:
To write and execute an embedded c program to display LEDs using LPC 2148 ARM controller
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
Theory:
LED (Light Emitting Diodes) is the most commonly used components, usually for displaying pins digital
states. Typical uses of LEDs include alarm devices, timers and confirmation of user input such as a mouse
click or keystroke. Interfacing LED with LPC2148 Flash a LED using LPC2148 Primer Board. It works by
turning ON a LED & then turning it OFF & then looping back to START. However the operating speed of
microcontroller is very high so the flashing frequency will also be very fast to be detected by human eye.
The ARM7 LPC2148 Primer board has eight numbers of point LEDs, connected with I/O Port lines (P1.16 ?
P1.23) to make port pins high.










41 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00



Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus program for flashing of LEDs is written and executed using ARM controller LPC2148.



42 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Outcome:
Able to interface LED lights via the input output port and control them
Applications:
1. In Illumination
2. As status indicators in equipments
3. Stadium displays and dynamic decorative displays



1. What is seven segment displays?
2. What are the different configurations of LED?
3. What is the function of GPIO?
4. What are the Pins which are used to connect LEDs?
5. How to identify 'Polarity' of LED?
6. Differentiate LED from LCD.
7. What is a use of Jumper?
8. How many numbers of LEDs present in Primer board?
9. Where LEDs are used?
10. What is the use of flash magic software?
11. Which port is used in ARM 7 processor kit?
12. Which diode suffers an avalanche breakdown?
13. What happens if the junction temperature of LED is increased?
14. What is an anti collision rate light?
15. What is fail-safe conditions






Viva-voce




43 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 11 STEPPER MOTOR INTERFACE WITH
ARM -7 LPC2148
Aim:
To write a program to interface stepper motor using ARM processor and control the movement of motor
in either directions.
Apparatus Required:
1. LPC2148 ARM development board
2. Stepper motor
3. Interfacing cables
4. PC
Theory:
A stepper motor can be viewed as a DC motor with number of poles (on both rotor and stator).
Additionally, soft magnetic material with many teeth on the rotor and stator cheaply multiplies the number of
poles (reluctance motor). Like an AC synchronous motor, it is ideally driven by sinusoidal current, allowing
a step less operation, but this puts some burden on the controller. When using an 8-bit digital controller,
256 micro steps per step are possible. As a digital-to-analog converter produces unwanted ohmic heat in
the controller, pulse-width modulation is used to regulate the mean current. Simpler models switch voltage
only for doing a step, thus needing an extra current limiter: for every step, they switch a single cable to the
motor.
The idea is to connect the output pins of the driver to 4 transistors. The transistor must be
grounded at the emitter and the driver pin must be connected to the base. Collector is connected to the coil
wire of the motor. Stepper motors are rated by the torque they produce. Synchronous electric motors using
soft magnetic materials (having a core) have the ability to provide position holding torque (called detent
torque, and sometimes included in the specifications) while not driven electrically. To achieve full rated
torque, the coils in a stepper motor must reach their full rated current during each step. The voltage rating
(if there is one) is almost meaningless. The motors also suffer from EMF, which means that once the coil is
turned off it starts to generate current because the motor is still rotating. There needs to be an explicit way
to handle this extra current in a circuit otherwise it can cause damage and affect performance of the motor.
44 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
44 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus stepper motor interface with ARM processor has been successfully implemented and the motor is
controlled in clockwise and anticlockwise direction.
Outcome:
Able to interface the stepper motor with ARM controller and thereby create some rotational
movements





45 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Applications:
3. Used for precise positioning with a motor
4. Used in hard disk drives, robotics
5. Used in telescopes and toys







1. Define GPIO.
2. What is the function of ULN2803?
3. How LPC2148 control stepper motor?
4. Which I/O port lines used to rotate stepper motor?
5. How stepper motor reacts for each pulse it receives?
6. What is serial communication?
7. What is parallel communication?
8. What is stepper motor & why it is named so?
9. How can be step angle is calculated?
10. What are the advantages and disadvantages of parallel communication?
11. What does instruction-pipelining mean?
12. What is the power supply required for ARM processor?
13. What is a unit for torque?
14. What is RPM rating for a DC motor?
15. What device that is used to obtain an accurate position control of rotating shafts in terms of steps?
Viva-voce

46 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
46 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Expt. No. 12 LM35 TEMPERATURE SENSOR INTERFACE
WITH ARM-7 LPC2148
Aim:
To write a program to interface of LM35 temperature sensor to on-chip ADC of ARM controller and
display the room temperature value on the screen.
Apparatus Required:
1. LPC2148 ARM development board
2. Temperature sensor
3. Interfacing cables
4. PC
Theory:
Temperature Sensor:
The LM35 series are precision integrated-circuit temperature sensors, whose output voltage is linearly
proportional to the Celsius (Centigrade) temperature. The output of the sensor is converted to digital output
that is easy to connect with microcontroller. Temperature sensor has three terminals and required
Maximum of 5.5 V supply. This type of sensor consists of a material that performs the operation according
to temperature to vary the resistance. This change of resistance is sensed by circuit and it calculates
temperature. When the voltage increases then the temperature also rises. We can see this operation by
using a diode.







47 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
47 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00


Circuit diagram:

48 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
48 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the program for interfacing temperature sensor with ARM controller is written and executed and
the temperature reading is seen on the monitor.
Outcome:
Able to interface different sensors with in-built ADC of the ARM processor and access the data
produced from them
Applications:
1. Used in Ovens, refrigerators
2. In HVAC environmental control
3. coolant or cylinder head temperatures
4. in the automotive industry to monitor air intake



1. What is LM35?
2. Define ISP.
3. How many Analog-to-Digital Converters available as an inner peripheral in LPC2148?
4. What is the main function of analog pin in LPC 2148?
5. What is the output voltage produced by LM35 for one degree temperature?
6. What is the difference between LM 34 and LM 35 sensors?
7. How many pins are available in LM35?
8. Why Vref is set of ADC0848 to 2.56 V if analog input is connected to the LM35?
9. What is operating the operating temperature range in LM35?
10. Why LM35 is used to Measure Temperature?
11. List the devices used to sense temperature.
12. What is the purpose of a thermocouple?
13. What is the output voltage of a thermocouple?
Viva-voce




49 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 13 IMPLEMENTATION OF WIRELESS
COMMUNICATION PROTOCOL
USING ZIGBEE WIRELESS MODULE
Aim:
To implement wireless communication protocol using zigbee wireless module with the help of ARM
processor
Apparatus required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. Zigbee module
5. PC
Theory:
ZigBee is a specification to suite high level communication protocols using small, low-power digital
radios based on an IEEE 802 standard for personal area networks. The ZigBee is the name of a wireless
protocol maintained by the IEEE 802.15 standard. This is a protocol specified for wireless Personal Area
Network (PAN) using low powered wireless transceivers. There are already wireless transmitter and
receiver modules which can do point to point communication. The Xbee is the brand name a wireless
transceiver device introduced by the Digi international which works on the ZigBee protocol and can form
PAN networks. They have an approximate range of 10 to 100 meters and are used in industries, scientific
fields, medical fields etc
Digi ZigBee:
The Digi Xbee 802.15.4 modules are the easiest to use, most reliable and cost-effective RF devices.
The 802.15.4 Xbee modules provide two friendly modes of communication - a simple serial method to
transmit/receive or a framed mode providing advanced features. These modules can communicate point to
point, from one point to a PC, or in a mesh network.



50 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
50 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Circuit diagram:


Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the wireless communication protocol using Zigbee wireless module is implemented using
LPC2148.
Outcome:
Able to form a wireless network using zigbee module and ARM controller




51 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications:
1. Used in traffic lights in non-urban areas
2. Used in building control systems
3. Used in asset tracking
4. Used in parking sensors




1. How many UART ports available in LPC2148?
2. What is the main function of voltage convertors in UART?
3. Why Zigbee based is preferred for wireless communication?
4. What is the IEEE standard for Zigbee protocol?
5. Write the two modes of communication are used in a ZigBee network.
6. What is the function of a scheduler?
7. Mention any two features of ?C/OS ? II.
8. Write the function for creating task in ?C/OS ? II.
9. Mention any two support devices for ?C/OS ? II.
10. How many user tasks can be handled by ?C/OS ? II?







Viva-voce




52 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

















ADDITIONAL EXPERIMENTS
53 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
53 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Expt. No. 14 BUZZER INTERFACE WITH ARM-7 LPC2148
Aim:
To write a program for buzzer interface with ARM processor and control its operation.
Apparatus required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
Theory:
Buzzer is an electronic device commonly used to produce sound. Light weight, simple construction and
low price make it usable in various applications like car/truck reversing indicator, computers, call bells etc.
Piezo buzzer is based on the inverse principle of piezo electricity discovered in 1880 by Jacques and Pierre
Curie. It is the phenomena of generating electricity when mechanical pressure is applied to certain
materials and the vice versa is also true. Such materials are called piezo electric materials. Piezo electric
materials are either naturally available or manmade. Piezo ceramic is class of manmade material, which
poses piezo electric effect and is widely used to make disc, the heart of piezo buzzer. When subjected to
an alternating electric field they stretch or compress, in accordance with the frequency of the signal thereby
producing sound.







54 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
54 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the program for interfacing buzzer with ARM processor is written and executed and output is
verified.
Outcome:
Able to interface devices such as buzzer, relay with ARM controller





55 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Applications:

1. In alarm devices and timers
2. In confirmation of user input such as mouse click or keystroke
3. Alarming Circuits
4. Communication equipments
5. Automobile electronics
6. Portable equipments, due to its compact size





1. Define Buzzer.
2. Which pin in ARM can be used to modulate Buzzer?
3. What is the function Flash magic software?
4. How the Buzzer can be disconnected in LPC2148?
5. How the volume of sound will be changed in Buzzer?
6. What is a buzzer
7. What are the applications of buzzer?
8. How buzzer is used in embedded system?
9. What is race round condition?
10. What is digital signal controller?
11. What are the features of buzzer circuit?
12. What is a semaphore?
13. What is mutexes?
14. What is the role of segment register?
15. What is watch dog timer?

Viva-voce

56 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
56 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Expt. No. 15 RELAY INTERFACE WITH ARM - 7
Aim:
To write a program to interface 2 relays with LPC 2148 ARM Controller and verify its working.
Apparatus required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
Theory:
A relay is an electrically operated switch. Many relays use an electromagnet to mechanically operate a
switch, but other operating principles are also used, such as solid-state relays. Relays are used where it is
necessary to control a circuit by a low-power signal (with complete electrical isolation between control and
controlled circuits), or where several circuits must be controlled by one signal. The first relays were used in
long distance telegraph circuits as amplifiers: they repeated the signal coming in from one circuit and re-
transmitted it on another circuit. Relays were used extensively in telephone exchanges and early
computers to perform logical operations.
57 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
57 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
The program for interfacing relays with ARM controller is done and its working is verified.
Outcome:
Able to interface devices such as relay with ARM controller and control them using programs.






58 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications:
1. Used in homes, even in streets.
2. In automatic garage door for its movement and direction.
3. And even in refrigerators
4. In industries to provide energy on machineries.
5. In electrical fuel pump



1. What is the function of relay?
2. What is the function of Opto-isolator?
3. What is the function of power transistor in LPC2148?
4. Which pin acts as an output port for relay?
5. What is a relay circuit
6. what are the applications of relay circuit
7. what are the advantages of relay circuit
8. How does combination of functions reduce memory requirements in embedded systems?
9. What is the need for DMAC in ES?
10. Mention how I/O devices are classified for embedded system?
11. Explain what is interrupt latency? How can you reduce it?
12. What does DMA address will deal with?
13. List out various uses of timers in embedded system?
14. List out some of the commonly found errors in Embedded Systems?
15. What is the difference between macro and line function.



Viva-voce




59 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Creating the New Project:
1. To create a new project, choose Project>Create New Project. The Create New Project dialog box
appears which lets you base your new project on a project template.
2. Make sure the Tool chain is set to ARM, and click OK.
3. Select the project template Empty project, and click ok button. Which simply creates an empty project
that uses default project setting?
4. In the standard Save As dialog box that appears, specify where you want to place your project file, that
is, in your newly created projects directory. Type your project name in the File name box, and click Save
to create the new project. Eg. LED.
The project will appear in the Workspace window.
To Creating your Application ?C? file, Choose FILE menu and select NEW > File.
Edit the application code in C Language. Eg. Led.c
To Save your ?C? file, Choose File >Save As. In the standard Save As dialog box that appears, specify
where you want to place your project file, that is, in your project directory. Type your filename in the
Filename box, and click Save to create the new project. Eg. Led.c
Adding Files to the Project:
1. In the Workspace window, select the destination to which you want to add a source file; a group or, as in
this case, directly to the project.
2. Choose Project>Add Files to open a standard browse dialog box. Locate the files led.c select them in
the file selection list, and click Open to add them to the project1 project.
To save your work space, Choose File>Save Workspace and specify where you want to place your
workspace file. In this tutorial, you should place it in your newly created project directory. Type LED in
the File name box, and click save button.
GENERAL PROCEDURE


60 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
60 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Setting Project Options:
Now you will set the project options. For application projects, options can be set on all levels of nodes.
First you will set the general options to suit the processor configuration in this tutorial. Because these
options must be the same for the whole build configuration, they must be set on the project node.
1. Select the project folder icon LED - Debug in the Workspace window and choose Project>Options. Then
select Output Converter in the Category list to display the linker option pages.
The Output options are used for specifying details about the output format and the level of debugging
information included in the output file.
Select ?option? on the popup menu.
After selecting popup menu window shows as given below.
Select output format as ?Intel Extended?, output file in the format of .hex format.
Select the linker file menu, linker configuration file available at project directory.
Choose Project>Rebuild ALL
If your project has no error Building completed and Hex file generated
For Creating the Hex file, we choose output file format as given below.
Select Linker file as given below.
To Compile this Project, Choose Project>Rebuild ALL
If there is no error, Message window shows like this. Now Hex file is created.
ISP Utility:
NXP Semiconductors produce a range of Microcontrollers that feature both on-chip Flash memory and
the ability to be reprogrammed using In-System Programming technology. Flash Magic is Windows
software that allows easy access to all the ISP features provided by the devices. These features include:
* Erasing the Flash memory (individual blocks or the whole device)
* Programming the Flash memory
* Modifying the Boot Vector and Status Byte
* Reading Flash memory
* Performing a blank check on a section of Flash memory



61 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

* Reading the signature bytes
* Reading and writing the security bits
* Direct load of a new baud rate (high speed communications)
* Sending commands to place device in Boot loader mode
Under Windows, only one application may have access the COM Port at any one time, preventing
other applications from using the COM Port. Flash Magic only obtains access to the selected COM Port
when ISP operations are being performed. This means that other applications that need to use the COM
Port, such as debugging tools, may be used while Flash Magic is loaded. Note that in this manual third
party Compilers are listed alphabetically. No preferences are indicated or implied.
Procedure to down load and run this program:
1. Select the COM Port
2. Select the Baud Rate
3. Select Device ( Eg.LPC2148)
4. Interface ? None ISP
5. Select Osc. Frequency ? 12Mhz
6. Enable ? Erase Blocks used by Hex files?
7. Select the Hex File to be downloaded.


FirstRanker.com - FirstRanker's Choice
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00






?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING

VII SEMESTER - R 2013

EC6711 ? EMBEDDED LABORATORY






Name : _______________________________________
Register No : _______________________________________
Section : _______________________________________
LABORATORY MANUAL



2 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00




is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and
training.

? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different
levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on
heart and soul
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

To impart professional education integrated with human values to the younger generation, so as to
shape them as proficient and dedicated engineers, capable of providing comprehensive solutions to the
challenges in deploying technology for the service of humanity

? To educate the students with the state-of-art technologies to meet the growing challenges of the
electronics industry
? To carry out research through continuous interaction with research institutes and industry, on
advances in communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning,
innovation and ethical practices
VISION
VISION
MISSION
MISSION



3 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

PROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To provide students with a solid foundation in Mathematics, Science and fundamentals of
engineering, enabling them to apply, to find solutions for engineering problems and use this knowledge
to acquire higher education
2. Core Competence
To train the students in Electronics and Communication technologies so that they apply their
knowledge and training to compare, and to analyze various engineering industrial problems to find
solutions
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice which
enables them to find solutions for the real time problems in industry, and to design products
4. Professionalism
To inculcate professional and effective communication skills, leadership qualities and team spirit in
the students to make them multi-faceted personalities and develop their ability to relate engineering
issues to broader social context
5. Lifelong Learning/Ethics
To demonstrate and practice ethical and professional responsibilities in the industry and society in
the large, through commitment and lifelong learning needed for successful professional career


4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
PROGRAMME OUTCOMES (POs)
a) To demonstrate and apply knowledge of Mathematics, Science and engineering fundamentals in
Electronics and Communication Engineering field
b) To design a component, a system or a process to meet the specific needs within the realistic
constraints such as economics, environment, ethics, health, safety and manufacturability
c) To demonstrate the competency to use software tools for computation, simulation and testing of electronics
and communication engineering circuits
d) To identify, formulate and solve electronic and communication engineering problems
e) To demonstrate an ability to visualize and work on laboratory and multidisciplinary tasks
f) To function as a member or a leader in multidisciplinary activities
g) To communicate in verbal and written form with fellow engineers and society at large
h) To understand the impact of Electronics and Communication Engineering in the society and demonstrate
awareness of contemporary issues and commitment to give solutions exhibiting social responsibility
i) To demonstrate professional & ethical responsibilities
j) To exhibit confidence in self-education and ability for lifelong learning
k) To participate and succeed in competitive exams


5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
SYLLABUS

? Learn the working of ARM processor
? Understand the Building Blocks of Embedded Systems
? Learn the concept of memory map and memory interface
? Know the characteristics of Real Time Systems
? Write programs to interface memory, I/Os with processor
? Study the interrupt performance
LIST OF EXPERIMENTS:
1. Study of ARM evaluation system
2. Interfacing ADC and DAC
3. Interfacing LED and PWM
4. Interfacing real time clock and serial port
5. Interfacing keyboard and LCD
6. Interfacing EPROM and interrupt
7. Mailbox
8. Interrupt performance characteristics of ARM and FPGA
9. Flashing of LEDS
10. Interfacing stepper motor and temperature sensor
11. Implementing zigbee protocol with ARM



? Write programs in ARM for a specific Application
? Interface memory and Write programs related to memory operations
? Interface A/D and D/A convertors with ARM system
? Analyze the performance of interrupt
? Write programmes for interfacing keyboard, display, motor and sensor.
? Formulate a mini project using embedded system
COURSE OBJECTIVES
COURSE OUTCOMES
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
CONTENTS
Sl. No. Name of the Experiment Page No.
CYCLE 1 ? EXPERIMENTS
1
Study of ARM evaluation system 7
2
Analog to Digital Convertor interfacing 16
3
Generation of ramp and square wave using on-Chip DAC 19
4
LED dimming using PWM 22
5
Interfacing real time clock and serial port 25
6
Interfacing keypad and LCD 28
7
Interfacing EPROM and interrupt 31
CYCLE 2 ? EXPERIMENTS
8 Implementation of Mailbox Function using LPC 2148 35
9 Interrupt Performance Characteristics of Arm and FPGA 37
10 Flashing of LEDs 40
11 Stepper Motor Interface with ARM ? 7 LPC2148 43
12 LM35 Temperature Sensor Interface with ARM ? 7 LPC2148 47
13
Implementation of Wireless Communication Protocol using ZIGBEE Wireless
Module
50
ADDITIONAL EXPERIMENTS BEYOND THE SYYLABUS
14 Buzzer Interface with ARM ? 7 54
15 Relay interface with ARM? 7 57
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Expt. No. 1 STUDY OF ARM EVALUATION SYSTEM
Aim:
To study the building blocks of ARM7 system, its features, pin configuration and the components
required for functioning of ARM controller.
Architecture Overview:
A RISC-based computer design approach means ARM processors require significantly fewer transistors
than typical processors in average computers. This approach reduces cost, heat and power usage. These
are desirable traits for light, portable, battery-powered devices (smart phones, laptops, tablet and notepad
computers), and other embedded systems. A simpler design facilitates more efficient multi-core CPUs and
higher core counts at lower cost, providing higher processing power and improved energy efficiency for
servers and supercomputers.
In 2005, about 98% of all mobile phones sold used at least one ARM processor. The low power
consumption of ARM processors has made them very popular: 37 billion ARM processors have been
produced as of 2013, up from 10 billion in 2008. The ARM architecture (32-bit) is the most widely used
architecture in mobile devices, and most popular 32-bit one in embedded systems.
According to ARM Holdings, in 2010 alone, producers of chips based on ARM architectures
reported shipments of 6.1 billion ARM based processors, representing 95% of smart phones, 35% of digital
televisions and set-top boxes and 10% of mobile computers. It is the most widely used 32-bit instruction set
architecture in terms of quantity produced.
LPC 2148:
LPC2148 is the widely used IC from ARM-7 family. It is manufactured by Philips and it is pre-loaded
with many inbuilt peripherals making it more efficient and a reliable option for the beginners as well as high
end application developer.




8 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Features of LPC214x series controllers:
1. 8 to 40 kB of on-chip static RAM and 32 to 512 kB of on-chip flash program memory.128 bit wide
interface/accelerator enables high speed 60 MHz operation.
2. In-System/In-Application Programming (ISP/IAP) via on-chip boot-loader software. Single flash sector or
full chip erase in 400 ms and programming of 256 bytes in 1ms.
3. Embedded ICE RT and Embedded Trace interfaces offer real-time debugging with the on-chip Real
Monitor software and high speed tracing of instruction execution.
4. USB 2.0 Full Speed compliant Device Controller with 2 kB of endpoint RAM. In addition, the LPC2146/8
provides 8 kB of on-chip RAM accessible to USB by DMA.
5. One or two (LPC2141/2 vs. LPC2144/6/8) 10-bit A/D converters provide a total of 6/14analog inputs, with
conversion times as low as 2.44 us per channel.
6. Single 10-bit D/A converter provides variable analog output.
7. Two 32-bit timers/external event counters (with four capture and four compare channels each), PWM unit
(six outputs) and watchdog.
8. Low power real-time clock with independent power and dedicated 32 kHz clock input.
9. Multiple serial interfaces including two UARTs (16C550), two Fast I2C-bus (400 kbit/s), SPI and SSP with
buffering and variable data length capabilities.
10. Vectored interrupt controller with configurable priorities and vector addresses.
11. Up to 45 of 5 V tolerant fast general purpose I/O pins in a tiny LQFP64 package.
12. Up to nine edge or level sensitive external interrupt pins available.
13. On-chip integrated oscillator operates with an external crystal in range from 1 MHz to30 MHz and with
an external oscillator up to 50 MHz
14. Power saving modes include Idle and Power-down.
15. Individual enable/disable of peripheral functions as well as peripheral clock scaling for additional power
optimization.
16. Processor wake-up from Power-down mode via external interrupt, USB, Brown-Out Detect (BOD) or
Real-Time Clock (RTC).




9 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


First Step- Hardware Requirement:
Pin configuration of LPC 2148.

Hardware requirement of LPC2148:
1. LPC2148 need minimum below listed hardware to work properly
2. Power Supply
3. Crystal Oscillator
4. Reset Circuit
5. RTC crystal oscillator
6. UART
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Power Supply:
LPC2148 works on 3.3 V power supply. LM 117 can be used for generating 3.3 V supply. However,
basic peripherals like LCD, ULN 2003 (Motor Driver IC) etc. works on 5V. So AC mains supply is converted
into 5V using below mentioned circuit and after that LM 117 is used to convert 5V into 3.3V.
Block diagram of power Supply

Transformer: It is used to step down 230V AC to 9V AC supply and provides isolation between power grids
and circuit.
Rectifier: It is used to convert AC supply into DC.
Filter: It is used to reduce ripple factor of DC output available from rectifier end.
Regulator: It is used to regulate DC supply output.

11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Circuit Diagram:

Regulator IC 7805 is used to provide fix 5V dc supply.
LM 117 is used for generating 3.3V supply from 5V.

12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Calculations:

From the datasheet of LM117

Taking R 2= 240?, we get R 1=392?
Reset Circuit:
Reset button is essential in a system to avoid programming pitfalls and manually bring back the system
to the initialization mode. MCP 130T is a special IC used for providing stable RESET signal to LPC 2148.


13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Oscillator Circuit:

The value of capacitors C20 & C21 depends upon the frequency of crystal Y3. General circuit and
its equivalent circuit is as shown below.

14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Recommended values are as shown in table:

UART:
LPC 2148 has inbuilt ISP which means we can program it within the system using serial
communication on COM0. It has also COM1 for serial communication. MAX 232/233 IC must be used for
voltage logic conversion. Related connections are as given below.

Once the above listed circuit design is ready, we are ready to go further.



15 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Result:
ARM Evaluation system and the configuration of LPC2148 has been studied fully. The minimal setup
required for the functioning of the ARM processor is studied.
Outcomes:
1. Able to understand the ARM controller, its basic components inside and its features.
2. Able to know the components required for the working of ARM LPC2148

Applications:
ARM controller LPC2148 is used in no. of devices such as
1. Smart phones
2. Net books
3. E Readers
4. Digital TV
5. Home Gateways


1. What are the basic units of ARM 7?
2. What is the address system supported by ARM?
3. Define - RISC
4. What are the instructions used to access the memory in ARM?
5. What are the basic units of Microprocessor?
6. What is an Instruction?
7. What is clock cycle?
8. Define - Pipelining
9. What is cache miss?
10. What is meant by memory mapped I/O?
11. Define ? interrupt
12. What is meant by Exception?
13. What is meant by little ? endian mode?
14. What is meant by big ? endian mode?
15. What is the function of CPSR?
16. What is register - indirect addressing?
Viva-voce




16 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 2 ANALOG TO DIGITAL CONVERTOR
INTERFACING
Aim:
To write an embedded c program for interfacing an on chip ADC with LPC2148 ARM processor and
convert the given input voltage into corresponding decimal values.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. PC
Theory:
Analog to Digital converter (ADC) is a device that converts continuously varying analog signals from
instruments that monitor such conditions as movement, temperature, sound, etc., into binary code for the
computer. It may be either a single chip or can be one circuit within a chip. Analog to Digital conversion is
the process of changing continuously varying data, such as voltage, current, or shaft rotation, into discrete
digital quantities that represent the magnitude of the data compared to a standard or reference at the
moment the conversion is made. According to the method of conversion, ADCs can be classified into
Direct-Conversion ADCs, Successive Approximation ADCs, Integrating ADC and Sigma-Delta ADCs.
The LPC 2148 has 10-bit successive approximation analog to digital converter. Basic clocking for the
A/D converters is provided by the VPB clock. A programmable divider is included in each converter, to
scale this clock to the 4.5 MHz (max) clock needed by the successive approximation process. A fully
accurate conversion requires 11 of these clocks. The ADC cell can measure the voltage on any of the ADC
input signals. It is noted that these analog inputs are always connected to their pins, even if the Pin function
Select register assigns them to port pins. A simple self-test of the ADC can be done by driving these pins
as port outputs.



17 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Circuit diagram:




18 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus, an embedded c program for interfacing on-chip ADC with ARM processor is written and
executed. The decimal values of the converted voltage are seen in the WinXTalk screen.
Outcome:
Able to interface A/D convertors with ARM system and check its working by connecting an analog
quantity as input.
Applications:
1. ADC used in MODEM for converting analog signals to digital.
2. A fast video ADC in TV tuner cards
3. ADC used in digital storage oscilloscopes
4. Used in music reproduction technology.
5. Used in DSP if input is analog


1. What are the ADC operating modes in LPC2148?
2. What is meant by conversion time?
3. Why are internal ADCs preferred over external ADCs?
4. Why has 16-bit ADC more resolution than from 10-bit and 8-bit ADC?
5. What are ADC & its Resolution?
6. What is Burst conversion mode?
7. What is the function of A/D Control Register?
8. What is the function of A/D Global Data Register?
9. What is the function of A/D Status Register?
10. What is analog-to-digital (ADC) conversion error?
11. What is the function of Sample-and-hold circuits in analog-to digital converters?
12. What is the disadvantage of the flash analog-to digital converter?
Viva-voce




19 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 3 GENERATION OF RAMP AND SQUARE
WAVE USING ON-CHIP DAC
Aim:
To write and execute an embedded c program to generate ramp wave and square wave using on-chip
DAC of LPC2148 ARM controller.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
A digital-to-analog converter is a device for converting a digital signal into an analog signal (current or
voltage). Digital-to-Analog Converters are the interface between the abstract digital world and the analog
real world. Simple switches, a network of resistors, current sources or capacitors may be used to
implement this conversion. A DAC inputs a binary number and outputs an analog voltage or current signal.
The Microchip Technology Inc. MCP4921 is 2.7 ? 5.5V, low-power, 12-Bit Digital-to-Analog Converter
(DAC) with SPI interface. The MCP4921 DAC provides high accuracy and low noise performance for
industrial applications where calibration or compensation of signals is required. With an SPI connection
there is always one master device (usually a microcontroller) which controls the peripheral devices.
Typically there are three lines common to all the devices,
Master In Slave Out (MISO) ? The Slave line for sending data to the master,
Master Out Slave In (MOSI) ? The Master line for sending data to the peripherals,
Serial Clock (SCK) ? The clock pulses which synchronize data transmission generated by the
master and slave
Slave Select pin ? the pin on each device that the master can use to enable and disable specific
devices. When a device Slave Select pin is low, it communicates with the master. When it is high, it ignores
the master. In SPI, the clock signal is controlled by the master device LPC2148. All data is clocked in and
out using this pin. These lines need to be connected to the relevant pins on the LPC21xx processor. Any
unused GIO pin can be used for CS, instead pull this pin high. Conversion speed is the time it takes for the



20 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

DAC to provide an analog output when the digital input word is changed. The MCP4291 DAC ? SPI
connections with LPC21xx have four I/O lines (P0.4 ? P0.7) required. The analog output is generated by
using these four lines.
Circuit diagram:


Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the embedded c programs for generating ramp wave and square wave using ARM LPC2148 are
written and executed successfully and the waveforms are viewed in oscilloscope.
Outcome:
Able to program the DAC in-built inside the ARM controller and get the waveforms using it.




21 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications :
1. DAC used in Audio amplifier.
2. Video encoder
3. Display electronics
4. Data Acquistion systems
5. Motor control



1. What are the features of LPC2148 DAC?
2. What is the function of DAC register?
3. Which pin provides a voltage reference level for the D/A converter?
4. What are the applications of DAC in signal processing applications?
5. What is GIO?
6. What is the resolution of a digital-to-analog converter (DAC)?
7. What is the major advantage of the R/2R ladder digital-to-analog (DAC), as compared to a binary-
weighted digital-to-analog DAC converter?
8. What is the resolution of a 0?5 V 6-bit digital-to-analog converter (DAC) ?
9. What are DAC configurations?
10. What are the different types of DAC Circuits?
11. What are the Limitations of the Binary Weighted DAC?
12. What are the General DAC Characteristics?
13. Define reference voltage in DAC.
14. What is full scale voltage?
15. What is settling time?
VIVA-VOCE




22 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 4 LED DIMMING USING PWM

Aim:
To write an embedded c program for implementing PWM using ARM controller and verify the same by
dimming of LEDs.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
LPC2148 supports 2 types of PWM:
1) Single Edge PWM ? Pulse starts with new Period i.e pulse is always at the beginning
2) Double Edge PWM ? Pulse can be anywhere within the Period
A PWM block, like a Timer block , has a Timer Counter and an associated Pre-scale Register along
with Match Registers. These work exactly the same way as in the case of Timers. Match Registers 1 to 6
(except 0) are pinned on LPC214x i.e. the corresponding outputs are diverted to actual Pins on LPC214x
MCU. The PWM function must be selected for these Pins to get the PWM output.
The basic setup is to simply replace Servo by a LED and no external 5V source is needed. The
anode of LED is connected to P0.0 and cathode to ground. Pulse Widths corresponding to the switches
connected to P0.1/2/3/4 will be 2.5ms/5ms/7.5ms/10ms respectively. As the Pulse Width Increases LED
will keep on getting brighter and the reverse will happen if Pulse Width is decreased.



23 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus embedded c program for implementing Pulse Width Modulation is written and executed and
output has been verified in LED display.
Outcome:
Able to implement PWM using the ARM controller and verify the same in the form of dimming of
LEDS.



24 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Applications :
1. In Visual signals to covey a message
2. Illumination where light is reflected from objects
3. In Narrow band sensors



1. What factors determine the LED dimming performance?
2. What is meant by analog dimming?
3. What is flickering effect?
4. What is the factor determines dimming of the LED
5. Why Silicon is not suitable for fabrication of light-emitting diodes?
6. Why Silicon diode is less suited for low voltage rectifier operation?
7. What is the principle of zener diode?
8. What are the materials used to make LED?
9. What type of diodes is used in FM receivers?
10. Which diode suffers an avalanche breakdown?
11. What happens if the junction temperature of LED is increased?
12. How a transfer characteristic of a diode does is related?
13. What is the requirement of a clipping action of a diode?
14. What type of rectifier circuit requires four diodes?
15. Why are the pulse width modulated outputs required in most of the applications?
16. How do the variations in an average value get affected by PWM period?
17. Name the common formats available for LED display.
18. What are the types of seven segment display?
19. What is PWM?
20. What are the applications of PWM?

Viva-voce




25 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 5 INTERFACING REAL TIME CLOCK
AND SERIAL PORT
Aim:
To write and execute an embedded c program to interface DS1307 RTC using I2C protocol with ARM
controller
Apparatus Required:
1. LPC2148 ARM development board
2. Stepper motor
3. Interfacing cables
4. PC
Theory:
A clock, which is based on the interrupts at preset intervals, is Real Time Clock (RTC). An interrupt
service routine executes on each timeout (overflow) of this clock. This timing device once started never
resets or never reloaded with another value. Once it is set, it is not modified later. It is used in a system to
save the time and date.













26 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the program for interfacing real time clock with ARM controller is written and executed and the
date and time are verified on the screen.
Outcome:
Able to interface real time clock DS1307 with ARM controller and thereby display date and time
Applications :
1. I2C In ARM and PIC microcontrollers
2. Used as serial communication protocol with MASTER and SLAVE operation.

27 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
27 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00




1. What is I2C and how does it work?
2. What are the features of I2C in LPC2148 ARM7 microcontroller?
3. What is the function of I2C0CONSET register?
4. What is I2C0STAT?
5. What is the function of I2C0 Data Register?
6. What is RTC?
7. List the advantages of RTC
8. Through which port the date and time is displayed in RTC?
9. What is a serial port?
10. List the registers used to transfer data in serial port.
11. List the modes used for data transmission.
12. What is a simplex mode?
13. Which pin is used to transmit a character?
14. What is the baud rate of serial port?
15. What is the disadvantage of RS-232C?














Viva-voce




28 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 6 INTERFACING KEYPAD AND LCD

Aim:
To write an embedded c program to interface 4 x 4 matrix keypad with ARM processor and display the
pressed key in an LCD.
Apparatus Required:
1. LPC2148 ARM development board
2. Interfacing cables
3. PC
Theory:

In matrix keypad, keys are connected in rows and columns. When any switch is pressed, rows and
columns come into contact, which is that detected by controller to identify which key has been pressed. A
4?4 matrix keypad consists of 4 rows and 4 columns. There is a switch connecting each row and column.
So the combinations of rows and columns make up the 16 inputs.Initially all the switches are open (not
connected). When any one button is pressed, the switch is closed (connected),hence there is a connection
between the row and column. The first 4 pins are connected to the column as INPUT. The other 4 pins are
connected to the row as OUTPUT. Matrix keypad is a good substitution to normal push button.












29 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Circuit Diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus program for interfacing matrix keypad with ARM controller is written and executed and the key
pressed is seen in the LCD.



30 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Outcome:
Able to interface keypad with ARM controller and see the pressed key in the LCD display.
Applications :
1. Used in password based door locking system
2. Security system with user changeable
3. Used in laptops, computer games
4. Used in portable video games and cell phones



1. What is Matrix keypad?
2. What is the concept behind keypad interface?
3. What are the functions of pull- up resistors?
4. What is key de bouncing?
5. List the steps involved when the key in a 4 x 4 keyboard matrix is being pressed.
6. What is the value obtained if no key is pressed?
7. What kind of interrupt is generated if a key has to be operated in an interrupt mode?
8. How will you identify that the key is pressed?
9. What are the steps involved in Keyboard Interfacing?
10. List the registers used to store the keyboard, display modes and other operations programmed by
CPU.
11. Name the mode when a data is entered from the left side of the display unit.
12. How many rows and columns are present in a 16 x 2 alphanumeric LCD?
13. How many data lines are there in a 16 x 2 alphanumeric LCD?
14. Which pin of the LCD is used for adjusting its contrast?
15. Which command of an LCD is used to shift the entire display to the right?
16. Which command is used to select the 2 lines and 5 x 7 matrix of an LCD?
17. What changes are to be made to send data to an LCD?
18. For reading operation from an LCD what changes in the software are introduced?
19. Which instruction is used to select the first row first column of an LCD?
Viva-voce

31 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
31 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Expt. No. 7 INTERFACING EEPROM AND INTERRUPT

Aim:
To write a program to interface EEPROM using I2C protocol with ARM controller and retrieve the stored
messages inside EEPROM.
Apparatus Required:
1. LPC2148 ARM development board
2. Interfacing cables
3. PC
Theory:
I2C (Inter Integrated Circuit):
The I2C (Inter-IC) bus is a bi-directional two-wire serial bus that provides a communication link between
integrated circuits (ICs).I2C is a synchronous protocol that allows a master device to initiate communication
with a slave device. Data is exchanged between these devices.
EEPROM:
EEPROM (electrically erasable programmable read-only memory) is user-modifiable read-only
memory (ROM) that can be erased and reprogrammed (written to) repeatedly through the application of
higher than normal electrical voltage. It is a type of non-volatile memory used in computers and other
electronic devices to store small amounts of data that must be saved when power is removed, e.g.,
calibration tables or device configuration
Read, write and Erase EEPROM by using I2C in LPC2148 Primer Board. Wiring up an I2C based
EEPROM to the I2C port is relatively simple. The basic operation of the I2C based EEPROM's is to send a
command, such as WRITE, followed by an address and the data. In WRITE operation, the EEPROM is
used to store the data. In LPC2148 Primer Kit, 2 nos. of EEPROM lines are controlled by I2C Enabled
drivers. I2C Lines serial clock SCL (P0.2), serial data SDA (P0.3) connected to the I2C based serial
EEPROM IC. The EEPROM read & write operations are done in LPC2148 Primer Kit by using these SDA &
SCL I2C lines.
32 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
32 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To down load and run this program: Refer General procedure given in Page No: 60
Result:
Thus, the program for interfacing I2C based EEPROM with ARM processor has been written and
executed successfully and the memory content is verified on Win x talk terminal.
Outcome:
Able to interface memory ICs with ARM controller and perform the read and write operations.



33 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications:
1. ROM used in toys,automobiles to store data when power is off
2. In calculators and peripheral devices
3. In laser printers
4. And also in embedded systems where program need not to be changed.


1. How does I2C protocol work?
2. What is EEPROM?
3. What is meant by master slave mode?
4. What is meant by non-volatile memory?
5. What is an interrupt?
6. How does an interrupt request works?
7. What is a nested interrupt?
8. What are the registers used for enabling an interrupt?
9. What is PROM?
10. What is EPROM?
11. What is mask ROM?
12. Which memory allows simultaneous read and write operations?
13. Which memory has the shortest access times?
14. Which interrupt has the highest priority?
15. What is non maskable interrupt?
16. Which is the first level of memory access by the microprocessor?
17. List the types of cache memories.
18. What is the use of an interrupt?
19. What is the use of converting an interrupt to threads in a microprocessor?
20. What are the bits used to control an external interrupts?


Viva-voce




34 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00










CYCLE 2 - EXPERIMENTS




35 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 8 IMPLEMENTATION OF MAILBOX FUNCTION
USING LPC2148
Aim:
To create a mailbox in Micro C/OS ? II using LPC2148 ARM Controller
Apparatus Required:
1. LPC2148 ARM development board
2. Interfacing cables
3. PC
Theory:
System or the user code can send a message by the core services. A typical mail message, also
known as the exchange of information, refers to a task or an ISR using a pointer variable, through the core
services to put a message (that is, a pointer) into the mailbox. Similarly, one or more tasks can receive this
message by the core services. The tasks sending and receiving the message promise that the content that
the pointer points to is just that piece of message.
The mailbox of CooCox CoOS is a typical message mailbox which is composed of two parts: one is
the information which expressed by a pointer of void; the other is the waiting list which composed of the
tasks waiting for this mailbox. The waiting list supports two kinds of sorting: FIFO and preemptive priority.
The sorting mode is determined by the user when creating the mailbox.
Procedure:
To Edit / Compile / generate Hex file: Refer General procedure in Page No: 58
To down load and run this program: Refer General procedure in Page No: 60
Result:
Thus, the mailbox was created in Micro C/OS ?II and implemented using LPC2148.
Outcome:
Able to understand the concept of mail box in embedded systems and its significance in real time
systems





36 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications:
1. Used in Acorn RISC PC700
2. Used in ZIPIT wireless messenger
3. Used in Meizu M6 MINI player


1. What is IPC?
2. Define Queue.
3. What are the different types of mail box functions?
4. What is half duplex mode?
5. How many synchronous and asynchronous modes are there in serial port?
6. List the bits used to generate serial port interrupt
7. What is branch prediction?
8. Mention any two features of ?C/OS ? II.
9. Write the function for creating task in ?C/OS ? II.
10. Mention any two support devices for ?C/OS ? II.
11. How many user tasks can be handled by ?C/OS ? II?



















Viva-voce




37 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 9 INTERRUPT PERFORMANCE
CHARACTERISTICSOF ARM AND FPGA

Aim:
To study the interrupt performance characteristics of ARM and FPGA by using ARM controller kit and
FPGA kit separately.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
External Interrupts:
An interrupt caused by an external source such as the computer operator, external sensor or
monitoring device, or another computer. Interrupts are special events that require immediate attention.
Interfacing External Interrupts with LPC2148:
When an external interrupt signal occurs in LPC2148 Primer Board, the message "LOW" will be
displayed on PC. The interrupt signal occurs using switches. When the switch is pressed to LOW, then the
external interrupt occurs. The Vectored Interrupt Controller (VIC) takes 32 interrupt request inputs and
programmable assigns them into 3 categories, FIQ, vectored IRQ, and non-vectored IRQ. The ARM7
LPC2148 Primer board has two numbers of External Interrupts, connected with I/O Port lines (P0.14 &
P0.15) as switches.







38 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00



Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60


39 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
39 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Result:
Thus the interrupt performance characteristics of ARM and FPGA are studied. On comparison, ARM
counts at slow speed because it consumes more instruction cycle and FPGA is more efficient for servicing
and processing external interrupt pulses.
Outcome:
Able to understand the performance characteristics of ARM and FPGA while dealing with
interrrupts
Applications:
1. Used in random logic and SPLDs
2. Used in cryptography and filtering
3. In medical imaging
4. In bioinformatics and voice recognition



1. When is an Interrupt Request received?
2. What is ISR?
3. How do you initialize interrupt?
4. What is Vectored Interrupt Controller?
5. What are the kinds of protection available for SRAMS ?
6. What is interrupt pipelining?
7. What is pipeline shutdown?
8. What is branch prediction?
9. What is the use of Neon Floating point engine?
10. What is the use of ?vectorize option?
11. What is PTM?
12. What is ITM?
13. What is ETM?
14. What is I2S interface?
15. What is the use of ?SWI? in ARM assembly?

Viva-voce




40 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 10 FLASHING OF LEDS
Aim:
To write and execute an embedded c program to display LEDs using LPC 2148 ARM controller
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
Theory:
LED (Light Emitting Diodes) is the most commonly used components, usually for displaying pins digital
states. Typical uses of LEDs include alarm devices, timers and confirmation of user input such as a mouse
click or keystroke. Interfacing LED with LPC2148 Flash a LED using LPC2148 Primer Board. It works by
turning ON a LED & then turning it OFF & then looping back to START. However the operating speed of
microcontroller is very high so the flashing frequency will also be very fast to be detected by human eye.
The ARM7 LPC2148 Primer board has eight numbers of point LEDs, connected with I/O Port lines (P1.16 ?
P1.23) to make port pins high.










41 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00



Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus program for flashing of LEDs is written and executed using ARM controller LPC2148.



42 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Outcome:
Able to interface LED lights via the input output port and control them
Applications:
1. In Illumination
2. As status indicators in equipments
3. Stadium displays and dynamic decorative displays



1. What is seven segment displays?
2. What are the different configurations of LED?
3. What is the function of GPIO?
4. What are the Pins which are used to connect LEDs?
5. How to identify 'Polarity' of LED?
6. Differentiate LED from LCD.
7. What is a use of Jumper?
8. How many numbers of LEDs present in Primer board?
9. Where LEDs are used?
10. What is the use of flash magic software?
11. Which port is used in ARM 7 processor kit?
12. Which diode suffers an avalanche breakdown?
13. What happens if the junction temperature of LED is increased?
14. What is an anti collision rate light?
15. What is fail-safe conditions






Viva-voce




43 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 11 STEPPER MOTOR INTERFACE WITH
ARM -7 LPC2148
Aim:
To write a program to interface stepper motor using ARM processor and control the movement of motor
in either directions.
Apparatus Required:
1. LPC2148 ARM development board
2. Stepper motor
3. Interfacing cables
4. PC
Theory:
A stepper motor can be viewed as a DC motor with number of poles (on both rotor and stator).
Additionally, soft magnetic material with many teeth on the rotor and stator cheaply multiplies the number of
poles (reluctance motor). Like an AC synchronous motor, it is ideally driven by sinusoidal current, allowing
a step less operation, but this puts some burden on the controller. When using an 8-bit digital controller,
256 micro steps per step are possible. As a digital-to-analog converter produces unwanted ohmic heat in
the controller, pulse-width modulation is used to regulate the mean current. Simpler models switch voltage
only for doing a step, thus needing an extra current limiter: for every step, they switch a single cable to the
motor.
The idea is to connect the output pins of the driver to 4 transistors. The transistor must be
grounded at the emitter and the driver pin must be connected to the base. Collector is connected to the coil
wire of the motor. Stepper motors are rated by the torque they produce. Synchronous electric motors using
soft magnetic materials (having a core) have the ability to provide position holding torque (called detent
torque, and sometimes included in the specifications) while not driven electrically. To achieve full rated
torque, the coils in a stepper motor must reach their full rated current during each step. The voltage rating
(if there is one) is almost meaningless. The motors also suffer from EMF, which means that once the coil is
turned off it starts to generate current because the motor is still rotating. There needs to be an explicit way
to handle this extra current in a circuit otherwise it can cause damage and affect performance of the motor.
44 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
44 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus stepper motor interface with ARM processor has been successfully implemented and the motor is
controlled in clockwise and anticlockwise direction.
Outcome:
Able to interface the stepper motor with ARM controller and thereby create some rotational
movements





45 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Applications:
3. Used for precise positioning with a motor
4. Used in hard disk drives, robotics
5. Used in telescopes and toys







1. Define GPIO.
2. What is the function of ULN2803?
3. How LPC2148 control stepper motor?
4. Which I/O port lines used to rotate stepper motor?
5. How stepper motor reacts for each pulse it receives?
6. What is serial communication?
7. What is parallel communication?
8. What is stepper motor & why it is named so?
9. How can be step angle is calculated?
10. What are the advantages and disadvantages of parallel communication?
11. What does instruction-pipelining mean?
12. What is the power supply required for ARM processor?
13. What is a unit for torque?
14. What is RPM rating for a DC motor?
15. What device that is used to obtain an accurate position control of rotating shafts in terms of steps?
Viva-voce

46 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
46 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Expt. No. 12 LM35 TEMPERATURE SENSOR INTERFACE
WITH ARM-7 LPC2148
Aim:
To write a program to interface of LM35 temperature sensor to on-chip ADC of ARM controller and
display the room temperature value on the screen.
Apparatus Required:
1. LPC2148 ARM development board
2. Temperature sensor
3. Interfacing cables
4. PC
Theory:
Temperature Sensor:
The LM35 series are precision integrated-circuit temperature sensors, whose output voltage is linearly
proportional to the Celsius (Centigrade) temperature. The output of the sensor is converted to digital output
that is easy to connect with microcontroller. Temperature sensor has three terminals and required
Maximum of 5.5 V supply. This type of sensor consists of a material that performs the operation according
to temperature to vary the resistance. This change of resistance is sensed by circuit and it calculates
temperature. When the voltage increases then the temperature also rises. We can see this operation by
using a diode.







47 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
47 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00


Circuit diagram:

48 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
48 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the program for interfacing temperature sensor with ARM controller is written and executed and
the temperature reading is seen on the monitor.
Outcome:
Able to interface different sensors with in-built ADC of the ARM processor and access the data
produced from them
Applications:
1. Used in Ovens, refrigerators
2. In HVAC environmental control
3. coolant or cylinder head temperatures
4. in the automotive industry to monitor air intake



1. What is LM35?
2. Define ISP.
3. How many Analog-to-Digital Converters available as an inner peripheral in LPC2148?
4. What is the main function of analog pin in LPC 2148?
5. What is the output voltage produced by LM35 for one degree temperature?
6. What is the difference between LM 34 and LM 35 sensors?
7. How many pins are available in LM35?
8. Why Vref is set of ADC0848 to 2.56 V if analog input is connected to the LM35?
9. What is operating the operating temperature range in LM35?
10. Why LM35 is used to Measure Temperature?
11. List the devices used to sense temperature.
12. What is the purpose of a thermocouple?
13. What is the output voltage of a thermocouple?
Viva-voce




49 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 13 IMPLEMENTATION OF WIRELESS
COMMUNICATION PROTOCOL
USING ZIGBEE WIRELESS MODULE
Aim:
To implement wireless communication protocol using zigbee wireless module with the help of ARM
processor
Apparatus required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. Zigbee module
5. PC
Theory:
ZigBee is a specification to suite high level communication protocols using small, low-power digital
radios based on an IEEE 802 standard for personal area networks. The ZigBee is the name of a wireless
protocol maintained by the IEEE 802.15 standard. This is a protocol specified for wireless Personal Area
Network (PAN) using low powered wireless transceivers. There are already wireless transmitter and
receiver modules which can do point to point communication. The Xbee is the brand name a wireless
transceiver device introduced by the Digi international which works on the ZigBee protocol and can form
PAN networks. They have an approximate range of 10 to 100 meters and are used in industries, scientific
fields, medical fields etc
Digi ZigBee:
The Digi Xbee 802.15.4 modules are the easiest to use, most reliable and cost-effective RF devices.
The 802.15.4 Xbee modules provide two friendly modes of communication - a simple serial method to
transmit/receive or a framed mode providing advanced features. These modules can communicate point to
point, from one point to a PC, or in a mesh network.



50 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
50 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Circuit diagram:


Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the wireless communication protocol using Zigbee wireless module is implemented using
LPC2148.
Outcome:
Able to form a wireless network using zigbee module and ARM controller




51 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications:
1. Used in traffic lights in non-urban areas
2. Used in building control systems
3. Used in asset tracking
4. Used in parking sensors




1. How many UART ports available in LPC2148?
2. What is the main function of voltage convertors in UART?
3. Why Zigbee based is preferred for wireless communication?
4. What is the IEEE standard for Zigbee protocol?
5. Write the two modes of communication are used in a ZigBee network.
6. What is the function of a scheduler?
7. Mention any two features of ?C/OS ? II.
8. Write the function for creating task in ?C/OS ? II.
9. Mention any two support devices for ?C/OS ? II.
10. How many user tasks can be handled by ?C/OS ? II?







Viva-voce




52 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

















ADDITIONAL EXPERIMENTS
53 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
53 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Expt. No. 14 BUZZER INTERFACE WITH ARM-7 LPC2148
Aim:
To write a program for buzzer interface with ARM processor and control its operation.
Apparatus required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
Theory:
Buzzer is an electronic device commonly used to produce sound. Light weight, simple construction and
low price make it usable in various applications like car/truck reversing indicator, computers, call bells etc.
Piezo buzzer is based on the inverse principle of piezo electricity discovered in 1880 by Jacques and Pierre
Curie. It is the phenomena of generating electricity when mechanical pressure is applied to certain
materials and the vice versa is also true. Such materials are called piezo electric materials. Piezo electric
materials are either naturally available or manmade. Piezo ceramic is class of manmade material, which
poses piezo electric effect and is widely used to make disc, the heart of piezo buzzer. When subjected to
an alternating electric field they stretch or compress, in accordance with the frequency of the signal thereby
producing sound.







54 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
54 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the program for interfacing buzzer with ARM processor is written and executed and output is
verified.
Outcome:
Able to interface devices such as buzzer, relay with ARM controller





55 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Applications:

1. In alarm devices and timers
2. In confirmation of user input such as mouse click or keystroke
3. Alarming Circuits
4. Communication equipments
5. Automobile electronics
6. Portable equipments, due to its compact size





1. Define Buzzer.
2. Which pin in ARM can be used to modulate Buzzer?
3. What is the function Flash magic software?
4. How the Buzzer can be disconnected in LPC2148?
5. How the volume of sound will be changed in Buzzer?
6. What is a buzzer
7. What are the applications of buzzer?
8. How buzzer is used in embedded system?
9. What is race round condition?
10. What is digital signal controller?
11. What are the features of buzzer circuit?
12. What is a semaphore?
13. What is mutexes?
14. What is the role of segment register?
15. What is watch dog timer?

Viva-voce

56 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
56 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Expt. No. 15 RELAY INTERFACE WITH ARM - 7
Aim:
To write a program to interface 2 relays with LPC 2148 ARM Controller and verify its working.
Apparatus required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
Theory:
A relay is an electrically operated switch. Many relays use an electromagnet to mechanically operate a
switch, but other operating principles are also used, such as solid-state relays. Relays are used where it is
necessary to control a circuit by a low-power signal (with complete electrical isolation between control and
controlled circuits), or where several circuits must be controlled by one signal. The first relays were used in
long distance telegraph circuits as amplifiers: they repeated the signal coming in from one circuit and re-
transmitted it on another circuit. Relays were used extensively in telephone exchanges and early
computers to perform logical operations.
57 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
57 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
The program for interfacing relays with ARM controller is done and its working is verified.
Outcome:
Able to interface devices such as relay with ARM controller and control them using programs.






58 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications:
1. Used in homes, even in streets.
2. In automatic garage door for its movement and direction.
3. And even in refrigerators
4. In industries to provide energy on machineries.
5. In electrical fuel pump



1. What is the function of relay?
2. What is the function of Opto-isolator?
3. What is the function of power transistor in LPC2148?
4. Which pin acts as an output port for relay?
5. What is a relay circuit
6. what are the applications of relay circuit
7. what are the advantages of relay circuit
8. How does combination of functions reduce memory requirements in embedded systems?
9. What is the need for DMAC in ES?
10. Mention how I/O devices are classified for embedded system?
11. Explain what is interrupt latency? How can you reduce it?
12. What does DMA address will deal with?
13. List out various uses of timers in embedded system?
14. List out some of the commonly found errors in Embedded Systems?
15. What is the difference between macro and line function.



Viva-voce




59 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Creating the New Project:
1. To create a new project, choose Project>Create New Project. The Create New Project dialog box
appears which lets you base your new project on a project template.
2. Make sure the Tool chain is set to ARM, and click OK.
3. Select the project template Empty project, and click ok button. Which simply creates an empty project
that uses default project setting?
4. In the standard Save As dialog box that appears, specify where you want to place your project file, that
is, in your newly created projects directory. Type your project name in the File name box, and click Save
to create the new project. Eg. LED.
The project will appear in the Workspace window.
To Creating your Application ?C? file, Choose FILE menu and select NEW > File.
Edit the application code in C Language. Eg. Led.c
To Save your ?C? file, Choose File >Save As. In the standard Save As dialog box that appears, specify
where you want to place your project file, that is, in your project directory. Type your filename in the
Filename box, and click Save to create the new project. Eg. Led.c
Adding Files to the Project:
1. In the Workspace window, select the destination to which you want to add a source file; a group or, as in
this case, directly to the project.
2. Choose Project>Add Files to open a standard browse dialog box. Locate the files led.c select them in
the file selection list, and click Open to add them to the project1 project.
To save your work space, Choose File>Save Workspace and specify where you want to place your
workspace file. In this tutorial, you should place it in your newly created project directory. Type LED in
the File name box, and click save button.
GENERAL PROCEDURE


60 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
60 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Setting Project Options:
Now you will set the project options. For application projects, options can be set on all levels of nodes.
First you will set the general options to suit the processor configuration in this tutorial. Because these
options must be the same for the whole build configuration, they must be set on the project node.
1. Select the project folder icon LED - Debug in the Workspace window and choose Project>Options. Then
select Output Converter in the Category list to display the linker option pages.
The Output options are used for specifying details about the output format and the level of debugging
information included in the output file.
Select ?option? on the popup menu.
After selecting popup menu window shows as given below.
Select output format as ?Intel Extended?, output file in the format of .hex format.
Select the linker file menu, linker configuration file available at project directory.
Choose Project>Rebuild ALL
If your project has no error Building completed and Hex file generated
For Creating the Hex file, we choose output file format as given below.
Select Linker file as given below.
To Compile this Project, Choose Project>Rebuild ALL
If there is no error, Message window shows like this. Now Hex file is created.
ISP Utility:
NXP Semiconductors produce a range of Microcontrollers that feature both on-chip Flash memory and
the ability to be reprogrammed using In-System Programming technology. Flash Magic is Windows
software that allows easy access to all the ISP features provided by the devices. These features include:
* Erasing the Flash memory (individual blocks or the whole device)
* Programming the Flash memory
* Modifying the Boot Vector and Status Byte
* Reading Flash memory
* Performing a blank check on a section of Flash memory



61 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

* Reading the signature bytes
* Reading and writing the security bits
* Direct load of a new baud rate (high speed communications)
* Sending commands to place device in Boot loader mode
Under Windows, only one application may have access the COM Port at any one time, preventing
other applications from using the COM Port. Flash Magic only obtains access to the selected COM Port
when ISP operations are being performed. This means that other applications that need to use the COM
Port, such as debugging tools, may be used while Flash Magic is loaded. Note that in this manual third
party Compilers are listed alphabetically. No preferences are indicated or implied.
Procedure to down load and run this program:
1. Select the COM Port
2. Select the Baud Rate
3. Select Device ( Eg.LPC2148)
4. Interface ? None ISP
5. Select Osc. Frequency ? 12Mhz
6. Enable ? Erase Blocks used by Hex files?
7. Select the Hex File to be downloaded.




62 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00




Processing:
After completely downloaded, window shows














FirstRanker.com - FirstRanker's Choice
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00






?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING

VII SEMESTER - R 2013

EC6711 ? EMBEDDED LABORATORY






Name : _______________________________________
Register No : _______________________________________
Section : _______________________________________
LABORATORY MANUAL



2 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00




is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and
training.

? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different
levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on
heart and soul
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

To impart professional education integrated with human values to the younger generation, so as to
shape them as proficient and dedicated engineers, capable of providing comprehensive solutions to the
challenges in deploying technology for the service of humanity

? To educate the students with the state-of-art technologies to meet the growing challenges of the
electronics industry
? To carry out research through continuous interaction with research institutes and industry, on
advances in communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning,
innovation and ethical practices
VISION
VISION
MISSION
MISSION



3 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

PROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To provide students with a solid foundation in Mathematics, Science and fundamentals of
engineering, enabling them to apply, to find solutions for engineering problems and use this knowledge
to acquire higher education
2. Core Competence
To train the students in Electronics and Communication technologies so that they apply their
knowledge and training to compare, and to analyze various engineering industrial problems to find
solutions
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice which
enables them to find solutions for the real time problems in industry, and to design products
4. Professionalism
To inculcate professional and effective communication skills, leadership qualities and team spirit in
the students to make them multi-faceted personalities and develop their ability to relate engineering
issues to broader social context
5. Lifelong Learning/Ethics
To demonstrate and practice ethical and professional responsibilities in the industry and society in
the large, through commitment and lifelong learning needed for successful professional career


4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
PROGRAMME OUTCOMES (POs)
a) To demonstrate and apply knowledge of Mathematics, Science and engineering fundamentals in
Electronics and Communication Engineering field
b) To design a component, a system or a process to meet the specific needs within the realistic
constraints such as economics, environment, ethics, health, safety and manufacturability
c) To demonstrate the competency to use software tools for computation, simulation and testing of electronics
and communication engineering circuits
d) To identify, formulate and solve electronic and communication engineering problems
e) To demonstrate an ability to visualize and work on laboratory and multidisciplinary tasks
f) To function as a member or a leader in multidisciplinary activities
g) To communicate in verbal and written form with fellow engineers and society at large
h) To understand the impact of Electronics and Communication Engineering in the society and demonstrate
awareness of contemporary issues and commitment to give solutions exhibiting social responsibility
i) To demonstrate professional & ethical responsibilities
j) To exhibit confidence in self-education and ability for lifelong learning
k) To participate and succeed in competitive exams


5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
SYLLABUS

? Learn the working of ARM processor
? Understand the Building Blocks of Embedded Systems
? Learn the concept of memory map and memory interface
? Know the characteristics of Real Time Systems
? Write programs to interface memory, I/Os with processor
? Study the interrupt performance
LIST OF EXPERIMENTS:
1. Study of ARM evaluation system
2. Interfacing ADC and DAC
3. Interfacing LED and PWM
4. Interfacing real time clock and serial port
5. Interfacing keyboard and LCD
6. Interfacing EPROM and interrupt
7. Mailbox
8. Interrupt performance characteristics of ARM and FPGA
9. Flashing of LEDS
10. Interfacing stepper motor and temperature sensor
11. Implementing zigbee protocol with ARM



? Write programs in ARM for a specific Application
? Interface memory and Write programs related to memory operations
? Interface A/D and D/A convertors with ARM system
? Analyze the performance of interrupt
? Write programmes for interfacing keyboard, display, motor and sensor.
? Formulate a mini project using embedded system
COURSE OBJECTIVES
COURSE OUTCOMES
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
EC6711 ? EMBEDDED LABORATORY
CONTENTS
Sl. No. Name of the Experiment Page No.
CYCLE 1 ? EXPERIMENTS
1
Study of ARM evaluation system 7
2
Analog to Digital Convertor interfacing 16
3
Generation of ramp and square wave using on-Chip DAC 19
4
LED dimming using PWM 22
5
Interfacing real time clock and serial port 25
6
Interfacing keypad and LCD 28
7
Interfacing EPROM and interrupt 31
CYCLE 2 ? EXPERIMENTS
8 Implementation of Mailbox Function using LPC 2148 35
9 Interrupt Performance Characteristics of Arm and FPGA 37
10 Flashing of LEDs 40
11 Stepper Motor Interface with ARM ? 7 LPC2148 43
12 LM35 Temperature Sensor Interface with ARM ? 7 LPC2148 47
13
Implementation of Wireless Communication Protocol using ZIGBEE Wireless
Module
50
ADDITIONAL EXPERIMENTS BEYOND THE SYYLABUS
14 Buzzer Interface with ARM ? 7 54
15 Relay interface with ARM? 7 57
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Expt. No. 1 STUDY OF ARM EVALUATION SYSTEM
Aim:
To study the building blocks of ARM7 system, its features, pin configuration and the components
required for functioning of ARM controller.
Architecture Overview:
A RISC-based computer design approach means ARM processors require significantly fewer transistors
than typical processors in average computers. This approach reduces cost, heat and power usage. These
are desirable traits for light, portable, battery-powered devices (smart phones, laptops, tablet and notepad
computers), and other embedded systems. A simpler design facilitates more efficient multi-core CPUs and
higher core counts at lower cost, providing higher processing power and improved energy efficiency for
servers and supercomputers.
In 2005, about 98% of all mobile phones sold used at least one ARM processor. The low power
consumption of ARM processors has made them very popular: 37 billion ARM processors have been
produced as of 2013, up from 10 billion in 2008. The ARM architecture (32-bit) is the most widely used
architecture in mobile devices, and most popular 32-bit one in embedded systems.
According to ARM Holdings, in 2010 alone, producers of chips based on ARM architectures
reported shipments of 6.1 billion ARM based processors, representing 95% of smart phones, 35% of digital
televisions and set-top boxes and 10% of mobile computers. It is the most widely used 32-bit instruction set
architecture in terms of quantity produced.
LPC 2148:
LPC2148 is the widely used IC from ARM-7 family. It is manufactured by Philips and it is pre-loaded
with many inbuilt peripherals making it more efficient and a reliable option for the beginners as well as high
end application developer.




8 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Features of LPC214x series controllers:
1. 8 to 40 kB of on-chip static RAM and 32 to 512 kB of on-chip flash program memory.128 bit wide
interface/accelerator enables high speed 60 MHz operation.
2. In-System/In-Application Programming (ISP/IAP) via on-chip boot-loader software. Single flash sector or
full chip erase in 400 ms and programming of 256 bytes in 1ms.
3. Embedded ICE RT and Embedded Trace interfaces offer real-time debugging with the on-chip Real
Monitor software and high speed tracing of instruction execution.
4. USB 2.0 Full Speed compliant Device Controller with 2 kB of endpoint RAM. In addition, the LPC2146/8
provides 8 kB of on-chip RAM accessible to USB by DMA.
5. One or two (LPC2141/2 vs. LPC2144/6/8) 10-bit A/D converters provide a total of 6/14analog inputs, with
conversion times as low as 2.44 us per channel.
6. Single 10-bit D/A converter provides variable analog output.
7. Two 32-bit timers/external event counters (with four capture and four compare channels each), PWM unit
(six outputs) and watchdog.
8. Low power real-time clock with independent power and dedicated 32 kHz clock input.
9. Multiple serial interfaces including two UARTs (16C550), two Fast I2C-bus (400 kbit/s), SPI and SSP with
buffering and variable data length capabilities.
10. Vectored interrupt controller with configurable priorities and vector addresses.
11. Up to 45 of 5 V tolerant fast general purpose I/O pins in a tiny LQFP64 package.
12. Up to nine edge or level sensitive external interrupt pins available.
13. On-chip integrated oscillator operates with an external crystal in range from 1 MHz to30 MHz and with
an external oscillator up to 50 MHz
14. Power saving modes include Idle and Power-down.
15. Individual enable/disable of peripheral functions as well as peripheral clock scaling for additional power
optimization.
16. Processor wake-up from Power-down mode via external interrupt, USB, Brown-Out Detect (BOD) or
Real-Time Clock (RTC).




9 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


First Step- Hardware Requirement:
Pin configuration of LPC 2148.

Hardware requirement of LPC2148:
1. LPC2148 need minimum below listed hardware to work properly
2. Power Supply
3. Crystal Oscillator
4. Reset Circuit
5. RTC crystal oscillator
6. UART
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Power Supply:
LPC2148 works on 3.3 V power supply. LM 117 can be used for generating 3.3 V supply. However,
basic peripherals like LCD, ULN 2003 (Motor Driver IC) etc. works on 5V. So AC mains supply is converted
into 5V using below mentioned circuit and after that LM 117 is used to convert 5V into 3.3V.
Block diagram of power Supply

Transformer: It is used to step down 230V AC to 9V AC supply and provides isolation between power grids
and circuit.
Rectifier: It is used to convert AC supply into DC.
Filter: It is used to reduce ripple factor of DC output available from rectifier end.
Regulator: It is used to regulate DC supply output.

11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Circuit Diagram:

Regulator IC 7805 is used to provide fix 5V dc supply.
LM 117 is used for generating 3.3V supply from 5V.

12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Calculations:

From the datasheet of LM117

Taking R 2= 240?, we get R 1=392?
Reset Circuit:
Reset button is essential in a system to avoid programming pitfalls and manually bring back the system
to the initialization mode. MCP 130T is a special IC used for providing stable RESET signal to LPC 2148.


13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Oscillator Circuit:

The value of capacitors C20 & C21 depends upon the frequency of crystal Y3. General circuit and
its equivalent circuit is as shown below.

14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Recommended values are as shown in table:

UART:
LPC 2148 has inbuilt ISP which means we can program it within the system using serial
communication on COM0. It has also COM1 for serial communication. MAX 232/233 IC must be used for
voltage logic conversion. Related connections are as given below.

Once the above listed circuit design is ready, we are ready to go further.



15 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Result:
ARM Evaluation system and the configuration of LPC2148 has been studied fully. The minimal setup
required for the functioning of the ARM processor is studied.
Outcomes:
1. Able to understand the ARM controller, its basic components inside and its features.
2. Able to know the components required for the working of ARM LPC2148

Applications:
ARM controller LPC2148 is used in no. of devices such as
1. Smart phones
2. Net books
3. E Readers
4. Digital TV
5. Home Gateways


1. What are the basic units of ARM 7?
2. What is the address system supported by ARM?
3. Define - RISC
4. What are the instructions used to access the memory in ARM?
5. What are the basic units of Microprocessor?
6. What is an Instruction?
7. What is clock cycle?
8. Define - Pipelining
9. What is cache miss?
10. What is meant by memory mapped I/O?
11. Define ? interrupt
12. What is meant by Exception?
13. What is meant by little ? endian mode?
14. What is meant by big ? endian mode?
15. What is the function of CPSR?
16. What is register - indirect addressing?
Viva-voce




16 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 2 ANALOG TO DIGITAL CONVERTOR
INTERFACING
Aim:
To write an embedded c program for interfacing an on chip ADC with LPC2148 ARM processor and
convert the given input voltage into corresponding decimal values.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. PC
Theory:
Analog to Digital converter (ADC) is a device that converts continuously varying analog signals from
instruments that monitor such conditions as movement, temperature, sound, etc., into binary code for the
computer. It may be either a single chip or can be one circuit within a chip. Analog to Digital conversion is
the process of changing continuously varying data, such as voltage, current, or shaft rotation, into discrete
digital quantities that represent the magnitude of the data compared to a standard or reference at the
moment the conversion is made. According to the method of conversion, ADCs can be classified into
Direct-Conversion ADCs, Successive Approximation ADCs, Integrating ADC and Sigma-Delta ADCs.
The LPC 2148 has 10-bit successive approximation analog to digital converter. Basic clocking for the
A/D converters is provided by the VPB clock. A programmable divider is included in each converter, to
scale this clock to the 4.5 MHz (max) clock needed by the successive approximation process. A fully
accurate conversion requires 11 of these clocks. The ADC cell can measure the voltage on any of the ADC
input signals. It is noted that these analog inputs are always connected to their pins, even if the Pin function
Select register assigns them to port pins. A simple self-test of the ADC can be done by driving these pins
as port outputs.



17 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Circuit diagram:




18 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus, an embedded c program for interfacing on-chip ADC with ARM processor is written and
executed. The decimal values of the converted voltage are seen in the WinXTalk screen.
Outcome:
Able to interface A/D convertors with ARM system and check its working by connecting an analog
quantity as input.
Applications:
1. ADC used in MODEM for converting analog signals to digital.
2. A fast video ADC in TV tuner cards
3. ADC used in digital storage oscilloscopes
4. Used in music reproduction technology.
5. Used in DSP if input is analog


1. What are the ADC operating modes in LPC2148?
2. What is meant by conversion time?
3. Why are internal ADCs preferred over external ADCs?
4. Why has 16-bit ADC more resolution than from 10-bit and 8-bit ADC?
5. What are ADC & its Resolution?
6. What is Burst conversion mode?
7. What is the function of A/D Control Register?
8. What is the function of A/D Global Data Register?
9. What is the function of A/D Status Register?
10. What is analog-to-digital (ADC) conversion error?
11. What is the function of Sample-and-hold circuits in analog-to digital converters?
12. What is the disadvantage of the flash analog-to digital converter?
Viva-voce




19 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 3 GENERATION OF RAMP AND SQUARE
WAVE USING ON-CHIP DAC
Aim:
To write and execute an embedded c program to generate ramp wave and square wave using on-chip
DAC of LPC2148 ARM controller.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
A digital-to-analog converter is a device for converting a digital signal into an analog signal (current or
voltage). Digital-to-Analog Converters are the interface between the abstract digital world and the analog
real world. Simple switches, a network of resistors, current sources or capacitors may be used to
implement this conversion. A DAC inputs a binary number and outputs an analog voltage or current signal.
The Microchip Technology Inc. MCP4921 is 2.7 ? 5.5V, low-power, 12-Bit Digital-to-Analog Converter
(DAC) with SPI interface. The MCP4921 DAC provides high accuracy and low noise performance for
industrial applications where calibration or compensation of signals is required. With an SPI connection
there is always one master device (usually a microcontroller) which controls the peripheral devices.
Typically there are three lines common to all the devices,
Master In Slave Out (MISO) ? The Slave line for sending data to the master,
Master Out Slave In (MOSI) ? The Master line for sending data to the peripherals,
Serial Clock (SCK) ? The clock pulses which synchronize data transmission generated by the
master and slave
Slave Select pin ? the pin on each device that the master can use to enable and disable specific
devices. When a device Slave Select pin is low, it communicates with the master. When it is high, it ignores
the master. In SPI, the clock signal is controlled by the master device LPC2148. All data is clocked in and
out using this pin. These lines need to be connected to the relevant pins on the LPC21xx processor. Any
unused GIO pin can be used for CS, instead pull this pin high. Conversion speed is the time it takes for the



20 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

DAC to provide an analog output when the digital input word is changed. The MCP4291 DAC ? SPI
connections with LPC21xx have four I/O lines (P0.4 ? P0.7) required. The analog output is generated by
using these four lines.
Circuit diagram:


Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the embedded c programs for generating ramp wave and square wave using ARM LPC2148 are
written and executed successfully and the waveforms are viewed in oscilloscope.
Outcome:
Able to program the DAC in-built inside the ARM controller and get the waveforms using it.




21 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications :
1. DAC used in Audio amplifier.
2. Video encoder
3. Display electronics
4. Data Acquistion systems
5. Motor control



1. What are the features of LPC2148 DAC?
2. What is the function of DAC register?
3. Which pin provides a voltage reference level for the D/A converter?
4. What are the applications of DAC in signal processing applications?
5. What is GIO?
6. What is the resolution of a digital-to-analog converter (DAC)?
7. What is the major advantage of the R/2R ladder digital-to-analog (DAC), as compared to a binary-
weighted digital-to-analog DAC converter?
8. What is the resolution of a 0?5 V 6-bit digital-to-analog converter (DAC) ?
9. What are DAC configurations?
10. What are the different types of DAC Circuits?
11. What are the Limitations of the Binary Weighted DAC?
12. What are the General DAC Characteristics?
13. Define reference voltage in DAC.
14. What is full scale voltage?
15. What is settling time?
VIVA-VOCE




22 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 4 LED DIMMING USING PWM

Aim:
To write an embedded c program for implementing PWM using ARM controller and verify the same by
dimming of LEDs.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
LPC2148 supports 2 types of PWM:
1) Single Edge PWM ? Pulse starts with new Period i.e pulse is always at the beginning
2) Double Edge PWM ? Pulse can be anywhere within the Period
A PWM block, like a Timer block , has a Timer Counter and an associated Pre-scale Register along
with Match Registers. These work exactly the same way as in the case of Timers. Match Registers 1 to 6
(except 0) are pinned on LPC214x i.e. the corresponding outputs are diverted to actual Pins on LPC214x
MCU. The PWM function must be selected for these Pins to get the PWM output.
The basic setup is to simply replace Servo by a LED and no external 5V source is needed. The
anode of LED is connected to P0.0 and cathode to ground. Pulse Widths corresponding to the switches
connected to P0.1/2/3/4 will be 2.5ms/5ms/7.5ms/10ms respectively. As the Pulse Width Increases LED
will keep on getting brighter and the reverse will happen if Pulse Width is decreased.



23 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus embedded c program for implementing Pulse Width Modulation is written and executed and
output has been verified in LED display.
Outcome:
Able to implement PWM using the ARM controller and verify the same in the form of dimming of
LEDS.



24 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Applications :
1. In Visual signals to covey a message
2. Illumination where light is reflected from objects
3. In Narrow band sensors



1. What factors determine the LED dimming performance?
2. What is meant by analog dimming?
3. What is flickering effect?
4. What is the factor determines dimming of the LED
5. Why Silicon is not suitable for fabrication of light-emitting diodes?
6. Why Silicon diode is less suited for low voltage rectifier operation?
7. What is the principle of zener diode?
8. What are the materials used to make LED?
9. What type of diodes is used in FM receivers?
10. Which diode suffers an avalanche breakdown?
11. What happens if the junction temperature of LED is increased?
12. How a transfer characteristic of a diode does is related?
13. What is the requirement of a clipping action of a diode?
14. What type of rectifier circuit requires four diodes?
15. Why are the pulse width modulated outputs required in most of the applications?
16. How do the variations in an average value get affected by PWM period?
17. Name the common formats available for LED display.
18. What are the types of seven segment display?
19. What is PWM?
20. What are the applications of PWM?

Viva-voce




25 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 5 INTERFACING REAL TIME CLOCK
AND SERIAL PORT
Aim:
To write and execute an embedded c program to interface DS1307 RTC using I2C protocol with ARM
controller
Apparatus Required:
1. LPC2148 ARM development board
2. Stepper motor
3. Interfacing cables
4. PC
Theory:
A clock, which is based on the interrupts at preset intervals, is Real Time Clock (RTC). An interrupt
service routine executes on each timeout (overflow) of this clock. This timing device once started never
resets or never reloaded with another value. Once it is set, it is not modified later. It is used in a system to
save the time and date.













26 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the program for interfacing real time clock with ARM controller is written and executed and the
date and time are verified on the screen.
Outcome:
Able to interface real time clock DS1307 with ARM controller and thereby display date and time
Applications :
1. I2C In ARM and PIC microcontrollers
2. Used as serial communication protocol with MASTER and SLAVE operation.

27 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
27 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00




1. What is I2C and how does it work?
2. What are the features of I2C in LPC2148 ARM7 microcontroller?
3. What is the function of I2C0CONSET register?
4. What is I2C0STAT?
5. What is the function of I2C0 Data Register?
6. What is RTC?
7. List the advantages of RTC
8. Through which port the date and time is displayed in RTC?
9. What is a serial port?
10. List the registers used to transfer data in serial port.
11. List the modes used for data transmission.
12. What is a simplex mode?
13. Which pin is used to transmit a character?
14. What is the baud rate of serial port?
15. What is the disadvantage of RS-232C?














Viva-voce




28 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 6 INTERFACING KEYPAD AND LCD

Aim:
To write an embedded c program to interface 4 x 4 matrix keypad with ARM processor and display the
pressed key in an LCD.
Apparatus Required:
1. LPC2148 ARM development board
2. Interfacing cables
3. PC
Theory:

In matrix keypad, keys are connected in rows and columns. When any switch is pressed, rows and
columns come into contact, which is that detected by controller to identify which key has been pressed. A
4?4 matrix keypad consists of 4 rows and 4 columns. There is a switch connecting each row and column.
So the combinations of rows and columns make up the 16 inputs.Initially all the switches are open (not
connected). When any one button is pressed, the switch is closed (connected),hence there is a connection
between the row and column. The first 4 pins are connected to the column as INPUT. The other 4 pins are
connected to the row as OUTPUT. Matrix keypad is a good substitution to normal push button.












29 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Circuit Diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus program for interfacing matrix keypad with ARM controller is written and executed and the key
pressed is seen in the LCD.



30 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Outcome:
Able to interface keypad with ARM controller and see the pressed key in the LCD display.
Applications :
1. Used in password based door locking system
2. Security system with user changeable
3. Used in laptops, computer games
4. Used in portable video games and cell phones



1. What is Matrix keypad?
2. What is the concept behind keypad interface?
3. What are the functions of pull- up resistors?
4. What is key de bouncing?
5. List the steps involved when the key in a 4 x 4 keyboard matrix is being pressed.
6. What is the value obtained if no key is pressed?
7. What kind of interrupt is generated if a key has to be operated in an interrupt mode?
8. How will you identify that the key is pressed?
9. What are the steps involved in Keyboard Interfacing?
10. List the registers used to store the keyboard, display modes and other operations programmed by
CPU.
11. Name the mode when a data is entered from the left side of the display unit.
12. How many rows and columns are present in a 16 x 2 alphanumeric LCD?
13. How many data lines are there in a 16 x 2 alphanumeric LCD?
14. Which pin of the LCD is used for adjusting its contrast?
15. Which command of an LCD is used to shift the entire display to the right?
16. Which command is used to select the 2 lines and 5 x 7 matrix of an LCD?
17. What changes are to be made to send data to an LCD?
18. For reading operation from an LCD what changes in the software are introduced?
19. Which instruction is used to select the first row first column of an LCD?
Viva-voce

31 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
31 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Expt. No. 7 INTERFACING EEPROM AND INTERRUPT

Aim:
To write a program to interface EEPROM using I2C protocol with ARM controller and retrieve the stored
messages inside EEPROM.
Apparatus Required:
1. LPC2148 ARM development board
2. Interfacing cables
3. PC
Theory:
I2C (Inter Integrated Circuit):
The I2C (Inter-IC) bus is a bi-directional two-wire serial bus that provides a communication link between
integrated circuits (ICs).I2C is a synchronous protocol that allows a master device to initiate communication
with a slave device. Data is exchanged between these devices.
EEPROM:
EEPROM (electrically erasable programmable read-only memory) is user-modifiable read-only
memory (ROM) that can be erased and reprogrammed (written to) repeatedly through the application of
higher than normal electrical voltage. It is a type of non-volatile memory used in computers and other
electronic devices to store small amounts of data that must be saved when power is removed, e.g.,
calibration tables or device configuration
Read, write and Erase EEPROM by using I2C in LPC2148 Primer Board. Wiring up an I2C based
EEPROM to the I2C port is relatively simple. The basic operation of the I2C based EEPROM's is to send a
command, such as WRITE, followed by an address and the data. In WRITE operation, the EEPROM is
used to store the data. In LPC2148 Primer Kit, 2 nos. of EEPROM lines are controlled by I2C Enabled
drivers. I2C Lines serial clock SCL (P0.2), serial data SDA (P0.3) connected to the I2C based serial
EEPROM IC. The EEPROM read & write operations are done in LPC2148 Primer Kit by using these SDA &
SCL I2C lines.
32 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
32 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To down load and run this program: Refer General procedure given in Page No: 60
Result:
Thus, the program for interfacing I2C based EEPROM with ARM processor has been written and
executed successfully and the memory content is verified on Win x talk terminal.
Outcome:
Able to interface memory ICs with ARM controller and perform the read and write operations.



33 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications:
1. ROM used in toys,automobiles to store data when power is off
2. In calculators and peripheral devices
3. In laser printers
4. And also in embedded systems where program need not to be changed.


1. How does I2C protocol work?
2. What is EEPROM?
3. What is meant by master slave mode?
4. What is meant by non-volatile memory?
5. What is an interrupt?
6. How does an interrupt request works?
7. What is a nested interrupt?
8. What are the registers used for enabling an interrupt?
9. What is PROM?
10. What is EPROM?
11. What is mask ROM?
12. Which memory allows simultaneous read and write operations?
13. Which memory has the shortest access times?
14. Which interrupt has the highest priority?
15. What is non maskable interrupt?
16. Which is the first level of memory access by the microprocessor?
17. List the types of cache memories.
18. What is the use of an interrupt?
19. What is the use of converting an interrupt to threads in a microprocessor?
20. What are the bits used to control an external interrupts?


Viva-voce




34 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00










CYCLE 2 - EXPERIMENTS




35 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 8 IMPLEMENTATION OF MAILBOX FUNCTION
USING LPC2148
Aim:
To create a mailbox in Micro C/OS ? II using LPC2148 ARM Controller
Apparatus Required:
1. LPC2148 ARM development board
2. Interfacing cables
3. PC
Theory:
System or the user code can send a message by the core services. A typical mail message, also
known as the exchange of information, refers to a task or an ISR using a pointer variable, through the core
services to put a message (that is, a pointer) into the mailbox. Similarly, one or more tasks can receive this
message by the core services. The tasks sending and receiving the message promise that the content that
the pointer points to is just that piece of message.
The mailbox of CooCox CoOS is a typical message mailbox which is composed of two parts: one is
the information which expressed by a pointer of void; the other is the waiting list which composed of the
tasks waiting for this mailbox. The waiting list supports two kinds of sorting: FIFO and preemptive priority.
The sorting mode is determined by the user when creating the mailbox.
Procedure:
To Edit / Compile / generate Hex file: Refer General procedure in Page No: 58
To down load and run this program: Refer General procedure in Page No: 60
Result:
Thus, the mailbox was created in Micro C/OS ?II and implemented using LPC2148.
Outcome:
Able to understand the concept of mail box in embedded systems and its significance in real time
systems





36 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications:
1. Used in Acorn RISC PC700
2. Used in ZIPIT wireless messenger
3. Used in Meizu M6 MINI player


1. What is IPC?
2. Define Queue.
3. What are the different types of mail box functions?
4. What is half duplex mode?
5. How many synchronous and asynchronous modes are there in serial port?
6. List the bits used to generate serial port interrupt
7. What is branch prediction?
8. Mention any two features of ?C/OS ? II.
9. Write the function for creating task in ?C/OS ? II.
10. Mention any two support devices for ?C/OS ? II.
11. How many user tasks can be handled by ?C/OS ? II?



















Viva-voce




37 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 9 INTERRUPT PERFORMANCE
CHARACTERISTICSOF ARM AND FPGA

Aim:
To study the interrupt performance characteristics of ARM and FPGA by using ARM controller kit and
FPGA kit separately.
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. CRO
Theory:
External Interrupts:
An interrupt caused by an external source such as the computer operator, external sensor or
monitoring device, or another computer. Interrupts are special events that require immediate attention.
Interfacing External Interrupts with LPC2148:
When an external interrupt signal occurs in LPC2148 Primer Board, the message "LOW" will be
displayed on PC. The interrupt signal occurs using switches. When the switch is pressed to LOW, then the
external interrupt occurs. The Vectored Interrupt Controller (VIC) takes 32 interrupt request inputs and
programmable assigns them into 3 categories, FIQ, vectored IRQ, and non-vectored IRQ. The ARM7
LPC2148 Primer board has two numbers of External Interrupts, connected with I/O Port lines (P0.14 &
P0.15) as switches.







38 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00



Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60


39 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
39 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Result:
Thus the interrupt performance characteristics of ARM and FPGA are studied. On comparison, ARM
counts at slow speed because it consumes more instruction cycle and FPGA is more efficient for servicing
and processing external interrupt pulses.
Outcome:
Able to understand the performance characteristics of ARM and FPGA while dealing with
interrrupts
Applications:
1. Used in random logic and SPLDs
2. Used in cryptography and filtering
3. In medical imaging
4. In bioinformatics and voice recognition



1. When is an Interrupt Request received?
2. What is ISR?
3. How do you initialize interrupt?
4. What is Vectored Interrupt Controller?
5. What are the kinds of protection available for SRAMS ?
6. What is interrupt pipelining?
7. What is pipeline shutdown?
8. What is branch prediction?
9. What is the use of Neon Floating point engine?
10. What is the use of ?vectorize option?
11. What is PTM?
12. What is ITM?
13. What is ETM?
14. What is I2S interface?
15. What is the use of ?SWI? in ARM assembly?

Viva-voce




40 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 10 FLASHING OF LEDS
Aim:
To write and execute an embedded c program to display LEDs using LPC 2148 ARM controller
Apparatus Required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
Theory:
LED (Light Emitting Diodes) is the most commonly used components, usually for displaying pins digital
states. Typical uses of LEDs include alarm devices, timers and confirmation of user input such as a mouse
click or keystroke. Interfacing LED with LPC2148 Flash a LED using LPC2148 Primer Board. It works by
turning ON a LED & then turning it OFF & then looping back to START. However the operating speed of
microcontroller is very high so the flashing frequency will also be very fast to be detected by human eye.
The ARM7 LPC2148 Primer board has eight numbers of point LEDs, connected with I/O Port lines (P1.16 ?
P1.23) to make port pins high.










41 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00



Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus program for flashing of LEDs is written and executed using ARM controller LPC2148.



42 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Outcome:
Able to interface LED lights via the input output port and control them
Applications:
1. In Illumination
2. As status indicators in equipments
3. Stadium displays and dynamic decorative displays



1. What is seven segment displays?
2. What are the different configurations of LED?
3. What is the function of GPIO?
4. What are the Pins which are used to connect LEDs?
5. How to identify 'Polarity' of LED?
6. Differentiate LED from LCD.
7. What is a use of Jumper?
8. How many numbers of LEDs present in Primer board?
9. Where LEDs are used?
10. What is the use of flash magic software?
11. Which port is used in ARM 7 processor kit?
12. Which diode suffers an avalanche breakdown?
13. What happens if the junction temperature of LED is increased?
14. What is an anti collision rate light?
15. What is fail-safe conditions






Viva-voce




43 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Expt. No. 11 STEPPER MOTOR INTERFACE WITH
ARM -7 LPC2148
Aim:
To write a program to interface stepper motor using ARM processor and control the movement of motor
in either directions.
Apparatus Required:
1. LPC2148 ARM development board
2. Stepper motor
3. Interfacing cables
4. PC
Theory:
A stepper motor can be viewed as a DC motor with number of poles (on both rotor and stator).
Additionally, soft magnetic material with many teeth on the rotor and stator cheaply multiplies the number of
poles (reluctance motor). Like an AC synchronous motor, it is ideally driven by sinusoidal current, allowing
a step less operation, but this puts some burden on the controller. When using an 8-bit digital controller,
256 micro steps per step are possible. As a digital-to-analog converter produces unwanted ohmic heat in
the controller, pulse-width modulation is used to regulate the mean current. Simpler models switch voltage
only for doing a step, thus needing an extra current limiter: for every step, they switch a single cable to the
motor.
The idea is to connect the output pins of the driver to 4 transistors. The transistor must be
grounded at the emitter and the driver pin must be connected to the base. Collector is connected to the coil
wire of the motor. Stepper motors are rated by the torque they produce. Synchronous electric motors using
soft magnetic materials (having a core) have the ability to provide position holding torque (called detent
torque, and sometimes included in the specifications) while not driven electrically. To achieve full rated
torque, the coils in a stepper motor must reach their full rated current during each step. The voltage rating
(if there is one) is almost meaningless. The motors also suffer from EMF, which means that once the coil is
turned off it starts to generate current because the motor is still rotating. There needs to be an explicit way
to handle this extra current in a circuit otherwise it can cause damage and affect performance of the motor.
44 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
44 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus stepper motor interface with ARM processor has been successfully implemented and the motor is
controlled in clockwise and anticlockwise direction.
Outcome:
Able to interface the stepper motor with ARM controller and thereby create some rotational
movements





45 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Applications:
3. Used for precise positioning with a motor
4. Used in hard disk drives, robotics
5. Used in telescopes and toys







1. Define GPIO.
2. What is the function of ULN2803?
3. How LPC2148 control stepper motor?
4. Which I/O port lines used to rotate stepper motor?
5. How stepper motor reacts for each pulse it receives?
6. What is serial communication?
7. What is parallel communication?
8. What is stepper motor & why it is named so?
9. How can be step angle is calculated?
10. What are the advantages and disadvantages of parallel communication?
11. What does instruction-pipelining mean?
12. What is the power supply required for ARM processor?
13. What is a unit for torque?
14. What is RPM rating for a DC motor?
15. What device that is used to obtain an accurate position control of rotating shafts in terms of steps?
Viva-voce

46 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
46 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Expt. No. 12 LM35 TEMPERATURE SENSOR INTERFACE
WITH ARM-7 LPC2148
Aim:
To write a program to interface of LM35 temperature sensor to on-chip ADC of ARM controller and
display the room temperature value on the screen.
Apparatus Required:
1. LPC2148 ARM development board
2. Temperature sensor
3. Interfacing cables
4. PC
Theory:
Temperature Sensor:
The LM35 series are precision integrated-circuit temperature sensors, whose output voltage is linearly
proportional to the Celsius (Centigrade) temperature. The output of the sensor is converted to digital output
that is easy to connect with microcontroller. Temperature sensor has three terminals and required
Maximum of 5.5 V supply. This type of sensor consists of a material that performs the operation according
to temperature to vary the resistance. This change of resistance is sensed by circuit and it calculates
temperature. When the voltage increases then the temperature also rises. We can see this operation by
using a diode.







47 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
47 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00


Circuit diagram:

48 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
48 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the program for interfacing temperature sensor with ARM controller is written and executed and
the temperature reading is seen on the monitor.
Outcome:
Able to interface different sensors with in-built ADC of the ARM processor and access the data
produced from them
Applications:
1. Used in Ovens, refrigerators
2. In HVAC environmental control
3. coolant or cylinder head temperatures
4. in the automotive industry to monitor air intake



1. What is LM35?
2. Define ISP.
3. How many Analog-to-Digital Converters available as an inner peripheral in LPC2148?
4. What is the main function of analog pin in LPC 2148?
5. What is the output voltage produced by LM35 for one degree temperature?
6. What is the difference between LM 34 and LM 35 sensors?
7. How many pins are available in LM35?
8. Why Vref is set of ADC0848 to 2.56 V if analog input is connected to the LM35?
9. What is operating the operating temperature range in LM35?
10. Why LM35 is used to Measure Temperature?
11. List the devices used to sense temperature.
12. What is the purpose of a thermocouple?
13. What is the output voltage of a thermocouple?
Viva-voce




49 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Expt. No. 13 IMPLEMENTATION OF WIRELESS
COMMUNICATION PROTOCOL
USING ZIGBEE WIRELESS MODULE
Aim:
To implement wireless communication protocol using zigbee wireless module with the help of ARM
processor
Apparatus required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
4. Zigbee module
5. PC
Theory:
ZigBee is a specification to suite high level communication protocols using small, low-power digital
radios based on an IEEE 802 standard for personal area networks. The ZigBee is the name of a wireless
protocol maintained by the IEEE 802.15 standard. This is a protocol specified for wireless Personal Area
Network (PAN) using low powered wireless transceivers. There are already wireless transmitter and
receiver modules which can do point to point communication. The Xbee is the brand name a wireless
transceiver device introduced by the Digi international which works on the ZigBee protocol and can form
PAN networks. They have an approximate range of 10 to 100 meters and are used in industries, scientific
fields, medical fields etc
Digi ZigBee:
The Digi Xbee 802.15.4 modules are the easiest to use, most reliable and cost-effective RF devices.
The 802.15.4 Xbee modules provide two friendly modes of communication - a simple serial method to
transmit/receive or a framed mode providing advanced features. These modules can communicate point to
point, from one point to a PC, or in a mesh network.



50 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
50 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Circuit diagram:


Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the wireless communication protocol using Zigbee wireless module is implemented using
LPC2148.
Outcome:
Able to form a wireless network using zigbee module and ARM controller




51 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications:
1. Used in traffic lights in non-urban areas
2. Used in building control systems
3. Used in asset tracking
4. Used in parking sensors




1. How many UART ports available in LPC2148?
2. What is the main function of voltage convertors in UART?
3. Why Zigbee based is preferred for wireless communication?
4. What is the IEEE standard for Zigbee protocol?
5. Write the two modes of communication are used in a ZigBee network.
6. What is the function of a scheduler?
7. Mention any two features of ?C/OS ? II.
8. Write the function for creating task in ?C/OS ? II.
9. Mention any two support devices for ?C/OS ? II.
10. How many user tasks can be handled by ?C/OS ? II?







Viva-voce




52 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

















ADDITIONAL EXPERIMENTS
53 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
53 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Expt. No. 14 BUZZER INTERFACE WITH ARM-7 LPC2148
Aim:
To write a program for buzzer interface with ARM processor and control its operation.
Apparatus required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
Theory:
Buzzer is an electronic device commonly used to produce sound. Light weight, simple construction and
low price make it usable in various applications like car/truck reversing indicator, computers, call bells etc.
Piezo buzzer is based on the inverse principle of piezo electricity discovered in 1880 by Jacques and Pierre
Curie. It is the phenomena of generating electricity when mechanical pressure is applied to certain
materials and the vice versa is also true. Such materials are called piezo electric materials. Piezo electric
materials are either naturally available or manmade. Piezo ceramic is class of manmade material, which
poses piezo electric effect and is widely used to make disc, the heart of piezo buzzer. When subjected to
an alternating electric field they stretch or compress, in accordance with the frequency of the signal thereby
producing sound.







54 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
54 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
Thus the program for interfacing buzzer with ARM processor is written and executed and output is
verified.
Outcome:
Able to interface devices such as buzzer, relay with ARM controller





55 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Applications:

1. In alarm devices and timers
2. In confirmation of user input such as mouse click or keystroke
3. Alarming Circuits
4. Communication equipments
5. Automobile electronics
6. Portable equipments, due to its compact size





1. Define Buzzer.
2. Which pin in ARM can be used to modulate Buzzer?
3. What is the function Flash magic software?
4. How the Buzzer can be disconnected in LPC2148?
5. How the volume of sound will be changed in Buzzer?
6. What is a buzzer
7. What are the applications of buzzer?
8. How buzzer is used in embedded system?
9. What is race round condition?
10. What is digital signal controller?
11. What are the features of buzzer circuit?
12. What is a semaphore?
13. What is mutexes?
14. What is the role of segment register?
15. What is watch dog timer?

Viva-voce

56 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
56 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Expt. No. 15 RELAY INTERFACE WITH ARM - 7
Aim:
To write a program to interface 2 relays with LPC 2148 ARM Controller and verify its working.
Apparatus required:
1. LPC2148 ARM development board
2. Flash Magic software
3. Interfacing cables
Theory:
A relay is an electrically operated switch. Many relays use an electromagnet to mechanically operate a
switch, but other operating principles are also used, such as solid-state relays. Relays are used where it is
necessary to control a circuit by a low-power signal (with complete electrical isolation between control and
controlled circuits), or where several circuits must be controlled by one signal. The first relays were used in
long distance telegraph circuits as amplifiers: they repeated the signal coming in from one circuit and re-
transmitted it on another circuit. Relays were used extensively in telephone exchanges and early
computers to perform logical operations.
57 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
57 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00
Circuit diagram:

Procedure:
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 58
To Edit / Compile / generate Hex file: Refer General procedure given in Page No: 60
Result:
The program for interfacing relays with ARM controller is done and its working is verified.
Outcome:
Able to interface devices such as relay with ARM controller and control them using programs.






58 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

Applications:
1. Used in homes, even in streets.
2. In automatic garage door for its movement and direction.
3. And even in refrigerators
4. In industries to provide energy on machineries.
5. In electrical fuel pump



1. What is the function of relay?
2. What is the function of Opto-isolator?
3. What is the function of power transistor in LPC2148?
4. Which pin acts as an output port for relay?
5. What is a relay circuit
6. what are the applications of relay circuit
7. what are the advantages of relay circuit
8. How does combination of functions reduce memory requirements in embedded systems?
9. What is the need for DMAC in ES?
10. Mention how I/O devices are classified for embedded system?
11. Explain what is interrupt latency? How can you reduce it?
12. What does DMA address will deal with?
13. List out various uses of timers in embedded system?
14. List out some of the commonly found errors in Embedded Systems?
15. What is the difference between macro and line function.



Viva-voce




59 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00


Creating the New Project:
1. To create a new project, choose Project>Create New Project. The Create New Project dialog box
appears which lets you base your new project on a project template.
2. Make sure the Tool chain is set to ARM, and click OK.
3. Select the project template Empty project, and click ok button. Which simply creates an empty project
that uses default project setting?
4. In the standard Save As dialog box that appears, specify where you want to place your project file, that
is, in your newly created projects directory. Type your project name in the File name box, and click Save
to create the new project. Eg. LED.
The project will appear in the Workspace window.
To Creating your Application ?C? file, Choose FILE menu and select NEW > File.
Edit the application code in C Language. Eg. Led.c
To Save your ?C? file, Choose File >Save As. In the standard Save As dialog box that appears, specify
where you want to place your project file, that is, in your project directory. Type your filename in the
Filename box, and click Save to create the new project. Eg. Led.c
Adding Files to the Project:
1. In the Workspace window, select the destination to which you want to add a source file; a group or, as in
this case, directly to the project.
2. Choose Project>Add Files to open a standard browse dialog box. Locate the files led.c select them in
the file selection list, and click Open to add them to the project1 project.
To save your work space, Choose File>Save Workspace and specify where you want to place your
workspace file. In this tutorial, you should place it in your newly created project directory. Type LED in
the File name box, and click save button.
GENERAL PROCEDURE


60 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00
60 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revis ion: 00

Setting Project Options:
Now you will set the project options. For application projects, options can be set on all levels of nodes.
First you will set the general options to suit the processor configuration in this tutorial. Because these
options must be the same for the whole build configuration, they must be set on the project node.
1. Select the project folder icon LED - Debug in the Workspace window and choose Project>Options. Then
select Output Converter in the Category list to display the linker option pages.
The Output options are used for specifying details about the output format and the level of debugging
information included in the output file.
Select ?option? on the popup menu.
After selecting popup menu window shows as given below.
Select output format as ?Intel Extended?, output file in the format of .hex format.
Select the linker file menu, linker configuration file available at project directory.
Choose Project>Rebuild ALL
If your project has no error Building completed and Hex file generated
For Creating the Hex file, we choose output file format as given below.
Select Linker file as given below.
To Compile this Project, Choose Project>Rebuild ALL
If there is no error, Message window shows like this. Now Hex file is created.
ISP Utility:
NXP Semiconductors produce a range of Microcontrollers that feature both on-chip Flash memory and
the ability to be reprogrammed using In-System Programming technology. Flash Magic is Windows
software that allows easy access to all the ISP features provided by the devices. These features include:
* Erasing the Flash memory (individual blocks or the whole device)
* Programming the Flash memory
* Modifying the Boot Vector and Status Byte
* Reading Flash memory
* Performing a blank check on a section of Flash memory



61 Format No.: FirstRanker/Stud/LM/34/I ssue: 00/Revision: 00

* Reading the signature bytes
* Reading and writing the security bits
* Direct load of a new baud rate (high speed communications)
* Sending commands to place device in Boot loader mode
Under Windows, only one application may have access the COM Port at any one time, preventing
other applications from using the COM Port. Flash Magic only obtains access to the selected COM Port
when ISP operations are being performed. This means that other applications that need to use the COM
Port, such as debugging tools, may be used while Flash Magic is loaded. Note that in this manual third
party Compilers are listed alphabetically. No preferences are indicated or implied.
Procedure to down load and run this program:
1. Select the COM Port
2. Select the Baud Rate
3. Select Device ( Eg.LPC2148)
4. Interface ? None ISP
5. Select Osc. Frequency ? 12Mhz
6. Enable ? Erase Blocks used by Hex files?
7. Select the Hex File to be downloaded.




62 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00




Processing:
After completely downloaded, window shows
















63 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00



List of Projects

? ARM LPC2148 Processor based Station Recognition System
? ARM LPC2148 Processor based remote bank locker system
? ARM7 LPC2148 Processor based vending machine
? ARM7 LPC2148 Processor based flood intimation system
? ARM7 LPC2148 Processor based Green House Control system
? ARM7 LPC 2148 Processor based Industrial monitor and control
? ARM7 LPC 2148 Processor based Advance car protection
? ARM7 LPC 2148 Processor based Industrial Fault detection and announciator
? ARM7 LPC 2148 Processor based Cell Phone Controlled Two Axis robotics with AI
? ARM7 LPC 2148 Processor based Cell Phone Controlled Three Axis robotics with AI

FirstRanker.com - FirstRanker's Choice

This post was last modified on 13 December 2019