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.