Ec6711 Embedded Lab Manual
Ec6711 Embedded Lab Manual
Ec6711 Embedded Lab Manual
ENGINEERING
LAB MANUAL
EC6711EMBEDDED LABORATORY
SEMESTER VII /YEAR-IV
(R-2013)
2
PROGRAM OUTCOMES (PO’s)
Engineering Graduates will be able to:
1. Engineering knowledge: Apply the knowledge of mathematics, science, engineering
fundamentals, and an engineering specia lization to the solution of complex engineering problems.
2. Problem analysis: Identify, formulate, review research literature, and analyze complex engineering
problems reaching substantiated conclusions using first principles of mathematics, natural sciences,
and engineering sciences.
3. Design/development of solutions: Design solutions for complex engineering problems and design
system components or processes that meet the specified needs with appropriate consideration for the
public health and safety, and the cultural, societal, and environmental considerations.
4. Conduct investigations of complex proble ms: Use research-based knowledge and research
methods including design of experiments, analysis and interpretation of data, and synthesis of the
information to provide valid conclusions.
5. Modern tool usage: Create, select, and apply appropriate techniques, resources, and modern
engineering and IT tools including prediction and modeling to complex engineering activities with an
understanding of the limitations.
6. The engineer and society: Apply reasoning informed by the contextual knowledge to assess
societal, health, safety, legal and cultural issues and the consequent responsibilities relevant to the
professional engineering practice.
7. Environme nt and sustainability: Understand the impact of the professional engineering solutions
in societal and environmental contexts, and demonstrate the knowledge of, and need for sustainable
development.
8. Ethics: Apply ethical principles and commit to professional ethics and responsibilities and norms of
the engineering practice.
9. Individual and team work: Function effectively as an individual, and as a member or leader in
diverse teams, and in multidisciplinary settings.
10. Communication: Communicate effectively on complex engineering activities with the
engineering community and with society at large, such as, being able to comprehend and write effective
reports and design documentation, make effective presentations, and give and receive clear instructions.
3
11. Project manage ment and finance: Demonstrate knowledge and understanding of the engineering
and management principles and apply these to one‟s own work, as a member and leader in a team, to
manage projects and in multidisciplinary environments.
12. Life-long learning: Recognize the need for, and have the preparation and ability to engage in
independent and life-long learning in the broadest context of technological change.
PSO 1: Develop Innovative Ideas for an existing / Novel problem through Information and
Communication technologies.
PSO 2: Apply the Analog and Digital system Design Principles and practices for Developing Quality
products.
4
EC6711 EMBEDDED LABOR ATORY L TP C
0032
OBJECTIVES:
The student s hould be made to:
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
5
OUTCOMES:
At the end of the course, the student should be able to:
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 programs for interfacing keyboard, display, motor and sensor.
Formulate a mini project using embedded system.
6
COURSE OUTCOMES
COURSE COURSE
EC6711 Embedded Laboratory SEM 7
CODE NAME
On completion of the course, the students will be able to
7
8
TABLE OF CONTENTS
S. No PARTICULARS PAGE
No
I INTRODUCTION - KEIL µVISION5 08
CYCLE – I EXPERIMENTS
CYCLE – II EXPERIMENTS
7 Implementation of Mailbox Functions 37
9 Flashing of LEDs 43
9
INTRODUCTION - KEIL µVISION5
About “Project”:
What is a project?
A project is a file in which Keil uVision5 stores all information related to an
application. E.g. it storesthe name of „C‟ and/or Assembler source file, memory size to
be used and other options for compiler,assembler and linker.
Opening a project:
To open an existing project file, select Project / Open Project from the menu.
Creating a new project:
To create a new project, select Project / New µVision Project from the menu.
Closing project settings:
To close the project, select Project / Close Project from the menu.
Quick starts to create ‘C’ language applications:
1. Start the KeilµVision5 program (i.e. the Integrated Development Environment)
fromstart\Programs\KeilµVision5.
2. From Project menu, select Close project (if any project is open).
3. From Project menu, select New Project. The Open dialog window will be displayed.
Select thedesired path where you wish to create this new project. (For example, C:\SPJ).
CAUTION: Thepath and filename must not contain space or other special characters such
as tab, comma, semicolon, etc. In the “File name” field, type the name of the project,
without any extension. For example, youmay type “PROG1”. Then click on the “Open”
button.
4. The action in the previous step will display the “Select device for Target „Target 1‟ ”
dialogwindow. Here you have to select the micro-controller you are going to use. The
target microcontroller(must be a member of ARM family) is known, You have to load
“Legacy DeviceDatabase (RTE)” and then select the device you may select the
appropriate Manufacturer from thelist; and then select the appropriate micro -controller
8
from the device list. If the target microcontrolleris not known or if you cannot find it in the
list, then you may simply search “LPC2148”or select “NXP” as the manufacturer and
“LPC2148” as the micro-controller.
5. Then a dialog box will appear asking for adding Startup.s file in to the project. Click
on the “Yes” toit.
6. Click on “Source Group 1” to display that part of the dialog window. This window
will indicatethat IDE has automatically added 1 files in this new project: STARTUP.S The
STARTUP.s file isautomatically created by the IDE and is required for all C projects. Now
add the file select “File /New” then a dialog box will appear, give name to your file with
extension ( E.g. PROG1.c ) Thenadd files in this project, then right click on the “Source
Group 1” Folder,click on “Add existingFiles to Group „Source Group1‟ ” select the desired
filename and then click on “Add” button. Now the Project Settings dialog will indicate
that selected file has been added into the project. When
all necessary files have been added to the project, click “OK” button to create this new
project.
7. Now create the “Target” for the completion of the project, right c lick on the “Target 1”
folder in theproject explorer window. then click on “options for Target „Target 1‟ ”
,Then a dialog appearshaving 10 parts first is Device and last Utilities. Now select Output
and Checked the options“Create Hex File”. then go to “Linker” and check the option “Use
memory layout from targetdialog.”
8. From the Target menu, select Build. This will invoke the Compiler to compile the file
PROG1.C;and further (assuming no errors) invoke the linker to create the .HEX file. If
there are any errors orwarnings during the process of compiling, assembling or linking,
then those will be displayed in theoutput window (below the editor window). If there
are errors, then you may correct those by makingappropriate changes to the program;
select Save from File menu to save the changes and then againselect Build from Compile
menu. Repeat this until there are no errors.
9
9. You may inspect contents of the folder where your project files reside. When there are
no errors andbuild has completed successfully and then you will see a file name with
same name as the projectname and extension .HEX (in above example, PROG1.HEX).
This is the file that you will need touse to program your micro - controller.
10
11
12
8. Write the code in the editor window and save as shown below:
13
11. The hex file will be created in the specified folder” i.e. Blink” process such as
shown in the output window.
12. hex file will be created successfully in the destination folder.
14
INTRODUCTION - FLASH MAGIC
15
16
Exp.: 01 STUDY OFARM EVALUATION SYSTEM
Aim: To study of ARM process or system and describe the features of architecture.
ARCHITECTURE OF ARM PROCESSOR :
12.1. Features of ARM DEVELOPMENT KIT Processor:
16-bit/32-bit ARM 7 TDMI-S microcontroller in a tiny LQFP64 package. 8Kb to 40kB of
on-chip static RAM and 32kB to 512kB of on-chip flash memory. 128- bit wide
interface/accelerator enables high-speed 60 MHz operation. In- System/In-Application
Programming (ISP/IAP) via on-chip boot loader software.
Single flash sector/full chip erase in 400ms and programming of 256 bytes in1 ms.USB2.0
Full-speed compliant device controller with 2kB of end point RAM. The LPC2146/48
provides 8kB of on-chip RAM accessible to USB by DMA.
One or two (LPC2141/42vs.LPC2144/46/48)10-bit ADCs provide a total of 6/14 analog
inputs, with conversion times as low as 2.44µs per channel. Single 10-bit DAC provides
variable analog output (LPC2142/44/46/48 only). Two 32-bit timers/external event
counters (with four capture and four compare channels each), PWM unit (six outputs) and
watchdog.
Low power Real- Time Clock (RTC) with independent power and 32kHz clock input.
Multiple serial interfaces including two UARTs (16C550), two Fast I2C- bus (400kbit/s),
SPI and SSP with buffering and variable data length capabilities.
Vectored Interrupt Controller (VIC) with configurable priorities and vector addresses.
Up to 45 of 5V tolerant fast general purpose I/O pins in a tiny LQ FP64 package. Upto 21
external interrupt pins available.
• 60MHz maximum CPU clock available from programmable on-chip PLL with settling
time of 100µs. On-chip integrated oscillator operates with an external crystal from 1MHz
to25MHz. Power saving modes includes Idle and Power- down.
• Individual enable/disable of peripheral functions as well as peripheral clock scaling for
additional power optimization. Processor wake- up from Power-down mode via external
interruptor BOD. Single power supply chip with POR and BOD circuits: CPU operating
voltage range of 3.0V to3.6V (3.3V±10%) with 5V tolerant I/O pads.
17
12.2. GeneralBlockDiagram:
18
1.5. PinConfiguration:
RESULT:
Thus the study of ARM processor has been done and ensured its composition with internal features
specifica lly.
19
Viva-voce
20
Exp.: 02 INTERFACING OF ADC AND DAC
AIM:
To develop and verify the interfacing ADC and DAC with LPC 2148 ARM
microcontroller.
APPARATUS REQUIRED:
S.No Apparatus Range Quantity
PROCEDURE:
Step 1: Give a double click on µvision5 icon on the desk top, it will
generate a window as shown below
Step 2: To create new project go to project select new micro vision project.
Step 3: select a drive where you would like to create your project.
Step 4: Create a new folder and name it with your project name.
Step 5: Open that project folder and give a name of your project executable and
save it.
Step 6: After saving it will show some window there you select your
microcontroller company i.e. NXP from Phillips
Step 8: After selecting chip click on OK then it will display some window
asking to add STARTUP. Select YES.
Step 10: To write your project code select a new from menu bar.
Step 11: It will display some text editor, to save that select SAVE
option from menu bar.
21
Step 12: By giving a name with extension .c and save it.
Step 13: Write the code of your project and save it.
Step 14: To add the c to target give a right click on Source Group,
choose “ADD s to Group” option.
Step 15: It will display some window there select the file and
click on ADD option.
Step 16: It will be added to our target and it shows in the project
window.
Step 17: Select right click on target in the project window and select
“Options for Target.”
Step 18: It will show some window, in that go to output option and choose
Create Hex option by selecting that box.
Step 20: Now to compile your project go to Project select Build Target
option or press F7.
Step 21: Check the concern block of output and observe the results.
InterfacingADC:
Connections:
To give analog input from Potentiometer R15 present in Analog Input region on
ADTV1.1. Analog input range is from 0 to 1023.
22
Interfacing DAC:
Conne ctions:
Connect one pin of oscilloscope to TP2/DAC and another to GND.
VIVA-VOCE
1. What are the ADC operating modes in LPC2148?
2. What is meant by conversion time?
3. Why are internal ADCspreferred over external ADCs?
4. Why 16-bit ADC has more resolution than from 10-bit and 8-bit ADC?
5. What are ADC & its Resolution?
6. What is ADC operating frequency range?
7. What is Burst conversion mode?
8. What is the function of A/D Control Register?
9. What is the function of A/D Global Data Register?
10. What is the function of A/D Status Register?
11. What is analog-to-digital (ADC) conversion error?
12. What is the function of Sample-and-hold circuits in analog-to digital converters?
13. What is meant by flash analog-to-digital converter?
14. What is the disadvantage of the flash analog-to digital converter?
15. What is the data rate available for use on USB?
RESULT:
Thus the interfacing of ADC and DAC (In-built) with ARM processor has been
verified and observed the output successfully.
23
Exp.: 03 INTERFACING LED AND PWM
AIM:
To develop and verify the interfac ing LED and PWM with ARM DEVELOPMENT
KIT microcontroller using embedded C program.
APPARATUS REQUIRED:
S.No Apparatus Range Quantity
PROCEDURE:
Step 1: Give a double click on µvision5 icon on the desk top, it will
generate a window as shown below.
Step 2: To create new project go to project select new micro vision project.
Step 3: select a drive where you would like to create your project.
Step 4: Create a new folder and name it with your project name.
Step 5: Open that project folder and give a name of your project executable and
save it.
Step 6: After saving it will show some window there you select your
microcontroller company i.e. NXP from Phillips
Step 8: After selecting chip click on OK then it will display some window
asking to add STARTUP. Select YES.
Step 10: To write your project code select a new from menu bar.
Step 11: It will display some text editor, to save that select SAVE
option from menu bar.
24
Step 12: By giving a name with extension .c and save it.
Step 13: Write the code of your project and save it.
Step 14: To add the c to target give a right click on Source Group,
choose “ADD s to Group” option.
Step 15: It will display some window there select the file and
click on ADD option.
Step 16: It will be added to our target and it shows in the project
window.
Step 17: Select right click on target in the project window and select
“Options for Target.”
Step 18: It will show some window, in that go to output option and choose
Create Hex option by selecting that box.
Step 20: Now to compile your project go to Project select Build Target
option or press F7.
Step 21: Check the concern block of output and observe the results.
Connections:
Keep S4.3 switch in ON position.
RESULT:
Thus the interfacing of LED AND PWM (In-built) with ARM processor has been
verified and observed the output successfully.
25
VIVA-VOCE
26
Exp.: 04 INTERFACING REAL TIME CLOCK AND SERIAL PORT
AIM: To develop and verify the interfacing Real Time Clock and Serial Port with ARM
DEVELOPMENT KIT microcontroller using embedded c program.
APPARATUS REQUIRED:
S.No Apparatus Range Quantity
PROCEDURE:
Step 1: Give a double click on µvision 5 icon on the desk top, it will
generate a window as shown below
Step 2: To create new project go to project select new micro vision project.
Step 3: select a drive where you would like to create your project.
Step 4: Create a new folder and name it with your project name.
Step 5: Open that project folder and give a name of your project executable and
save it.
Step 6: After saving it will show some window there you select your
microcontroller company i.e. NXP from Phillips
Step 8: After selecting chip click on OK then it will display some window
asking to add STARTUP. Select YES.
Step 10: To write your project code select a new from menu bar.
Step 11: It will display some text editor, to save that select SAVE
option from menu bar.
27
Step 13: Write the code of your project and save it.
Step 14: To add the c to target give a right click on Source Group,
choose “ADD s to Group” option.
Step 15: It will display some window there select the file and
click on ADD option.
Step 16: It will be added to our target and it shows in the project
window.
Step 17: Select right click on target in the project window and select
“Options for Target.”
Step 18: It will show some window, in that go to output option and choose
Create Hex option by selecting that box.
Step 20: Now to compile your project go to Project select Build Target
option or press F7.
Step 21: Check the concern block of output and observe the results.
RESULT:
Thus the Real time Clock on serial UART interfacing with ARM processor has been
verified and observed the output successfully.
28
VIVA-VOCE
1) What is I2Cand how does it work?
2) What are the features of I2Cin 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?
29
Exp.: 05 INTERFACING KEYBOARD AND LCD
Aim:
To develop and verify the interfacing of Keyboard and LCD with ARM
DEVELOPMENT KIT microcontroller using embedded c program.
APPARATUS REQUIRED:
S.No Apparatus Range Quantity
PROCEDURE:
Step 1: Give a double click on µvision 5 icon on the desk top, it will
generate a window as shown below
Step 2: To create new project go to project select new micro vision project.
Step 3: select a drive where you would like to create your project.
Step 4: Create a new folder and name it with your project name.
Step 5: Open that project folder and give a name of your project executable and
save it.
Step 6: After saving it will show some window there you select your
microcontroller company i.e. NXP from Phillips
Step 8: After selecting chip click on OK then it will display some window
asking to add STARTUP. Select YES.
Step 10: To write your project code select a new from menu bar.
Step 11: It will display some text editor, to save that select SAVE
option from menu bar.
30
Step 13: Write the code of your project and save it.
Step 14: To add the c to target give a right click on Source Group,
choose “ADD s to Group” option.
Step 15: It will display some window there select the file and click
on ADD option.
Step 16: It will be added to our target and it shows in the project
window.
Step 17: Select right click on target in the project window and select
“Options for Target.”
Step 18: It will show some window, in that go to output option and choose
Create Hex option by selecting that box.
Step 20: Now to compile your project go to Project select Build Target
option or press F7.
Step 21: Check the concern block of output and observe the results.
Conne ctions:
16 Keys (SW2 to SW17) present in 4x4 Matrix Keypad region on ADT are connected to
P0.16 to P0.23.
RESULT:
Thus the interfacing of keyboard and LCD with ARM processor has been verified and
observed the output successfully.
31
VIVA-VOCE
32
Exp.: 06 INTERFACING EPROM AND INTERRUPT
AIM:
To develop and verify the interfacing EPROM and Interrupt with ARM
DEVELOPMENT KIT microcontroller using embedded c program.
APPARATUS REQUIRED:
S.No Apparatus Range Quantity
PROCEDURE:
Step 1: Give a double click on µvision 5 icon on the desk top, it will
generate a window as shown below
Step 2: To create new project go to project select new micro vision project.
Step 3: select a drive where you would like to create your project.
Step 4: Create a new folder and name it with your project name.
Step 5: Open that project folder and give a name of your project executable and
save it.
Step 6: After saving it will show some window there you select your
microcontroller company i.e. NXP from Phillips
Step 8: After selecting chip click on OK then it will display some window
asking to add STARTUP. Select YES.
Step 10: To write your project code select a new from menu bar.
Step 11: It will display some text editor, to save that select SAVE
option from menu bar.
33
Step 13: Write the code of your project and save it.
Step 14: To add the c to target give a right click on Source Group,
choose “ADD s to Group” option.
Step 15: It will display some window there select the file and click
on ADD option.
Step 16: It will be added to our target and it shows in the project
window.
Step 17: Select right click on target in the project window and select
“Options for Target.”
Step 18: It will show some window, in that go to output option and choose
Create Hex option by selecting that box.
Step 20: Now to compile your project go to Project select Build Target
option or press F7.
Step 21: Check the concern block of output and observe the results.
EPROM Interface:
Connections: Output:
34
Interrupt Interface:
Connections:
To connect SW19.2 switch to EINT1 of LPC2148, keep it in ON position.
Output:
EINT1 is configured as Low-active, Level Sensitive. Therefore if SW18 switch is
pressed then D11 LED will glow for that much of time only.
RESULT:
Thus the interfacing EPROM and Interrupt with ARM processor has been verified and
observed the output successfully.
35
VIVA-VOCE
36
Exp.: 07 IMPLEMENTATION OF MAILBOX FUNCTIONS
APPARATUS REQUIRED:
S.No Apparatus Range Quantity
PROCEDURE:
Step 1: Give a double click on µvision 5 icon on the desk top, it will
generate a window as shown below
Step 2: To create new project go to project select new micro vision project.
Step 3: select a drive where you would like to create your project.
Step 4: Create a new folder and name it with your project name.
Step 5: Open that project folder and give a name of your project executable and
save it.
Step 6: After saving it will show some window there you select your
microcontroller company i.e. NXP from Phillips
Step 8: After selecting chip click on OK then it will display some window
asking to add STARTUP. Select YES.
Step 10: To write your project code select a new from menu bar.
Step 11: It will display some text editor, to save that select SAVE
option from menu bar.
Step 14: To add the c to target give a right click on Source Group,
choose “ADD s to Group” option.
Step 15: It will display some window there select the file and
click on ADD option.
Step 16: It will be added to our target and it shows in the project
window.
Step 17: Select right click on target in the project window and select
“Options for Target.”
Step 18: It will show some window, in that go to output option and choose
Create Hex option by selecting that box.
Step 20: Now to compile your project go to Project select Build Target
option or press F7.
Step 21: Check the concern block of output and observe the results.
BLOCK DIAGRAM:
RESULT:
Thus the interfacing of keyboard and LCD with ARM processor has been verified and
observed the output successfully.
38
VIVA-VOCE
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?
39
Exp.: 08 INTERRUP T P ERFORMANCE CHARACTERISTICS OF ARM AND FPGA
AIM:To develop and verify the Interrupt Performance Characteristics of ARM with
FPGA with ARM DEVELOPMENT KIT microcontroller using embedded C program.
APPARATUS REQUIRED:
S.No Apparatus Range Quantity
PROCEDURE:
Step 1: Give a double click on µvision 5 icon on the desk top, it will
generate a window as shown below
Step 2: To create new project go to project select new micro vision project.
Step 3: select a drive where you would like to create your project.
Step 4: Create a new folder and name it with your project name.
Step 5: Open that project folder and give a name of your project executable and
save it.
Step 6: After saving it will show some window there you select your
microcontroller company i.e. NXP from Phillips
Step 8: After selecting chip click on OK then it will display some window
asking to add STARTUP. Select YES.
Step 10: To write your project code select a new from menu bar.
Step 11: It will display some text editor, to save that select SAVE
option from menu bar.
40
Step 12: By giving a name with extension .c and save it.
Step 13: Write the code of your project and save it.
Step 14: To add the c to target give a right click on Source Group,
choose “ADD s to Group” option.
Step 15: It will display some window there select the file and
click on ADD option.
Step 16: It will be added to our target and it shows in the project
window.
Step 17: Select right click on target in the project window and select
“Options for Target.”
Step 18: It will show some window, in that go to output option and choose
Create Hex option by selecting that box.
Step 20: Now to compile your project go to Project select Build Target
option or press F7.
Step 21: Check the concern block of output and observe the results.
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 servicingand processing external interrupt pulses.
41
VIVA-VOCE
42
Exp.: 09 FLASHING OF LEDs
AIM:To develop and verify the Flashing of LEDs with ARM DEVELOPMENT KIT
microcontroller using embedded c program.
APPARATUS REQUIRED:
S.No Apparatus Range Quantity
PROCEDURE:
Step 1: Give a double click on µvision 5 icon on the desk top, it will
generate a window as shown below
Step 2: To create new project go to project select new micro vision project.
Step 3: select a drive where you would like to create your project.
Step 4: Create a new folder and name it with your project name.
Step 5: Open that project folder and give a name of your project executable and
save it.
Step 6: After saving it will show some window there you select your
microcontroller company i.e. NXP from Phillips
Step 8: After selecting chip click on OK then it will display some window
asking to add STARTUP. Select YES.
Step 10: To write your project code select a new from menu bar.
Step 11: It will display some text editor, to save that select SAVE
option from menu bar.
43
Step 12: By giving a name with extension .c and save it.
Step 13: Write the code of your project and save it.
Step 14: To add the c to target give a right click on Source Group,
choose “ADD s to Group” option.
Step 15: It will display some window there select the file and
click on ADD option.
Step 16: It will be added to our target and it shows in the project
window.
Step 17: Select right click on target in the project window and select
“Options for Target.”
Step 18: It will show some window, in that go to output option and choose
Create Hex option by selecting that box.
Step 20: Now to compile your project go to Project select Build Target
option or press F7.
Step 21: Check the concern block of output and observe the results.
Connections:
44
RESULT:
Thus the Flashing of LEDs with ARM processor has been verified and observed the
output successfully.
45
VIVA-VOCE
46
Exp.: 10 INTERFACING OF STEPPER MOTOR
AIM:To develop and verify the Interfacing of Stepper Motor with ARM
DEVELOPMENT KIT microcontroller using embedded c program.
APPARATUS REQUIRED:
S.No Apparatus Range Quantity
PROCEDURE:
Step 1: Give a double click on µvision 5 icon on the desk top, it will
generate a window as shown below
Step 2: To create new project go to project select new micro vision project.
Step 3: select a drive where you would like to create your project.
Step 4: Create a new folder and name it with your project name.
Step 5: Open that project folder and give a name of your project executable and
save it.
Step 6: After saving it will show some window there you select your
microcontroller company i.e. NXP from Phillips
Step 8: After selecting chip click on OK then it will display some window
asking to add STARTUP. Select YES.
Step 10: To write your project code select a new from menu bar.
Step 11: It will display some text editor, to save that select SAVE
option from menu bar.
Step 14: To add the c to target give a right click on Source Group,
choose “ADD s to Group” option.
Step 15: It will display some window there select the file and
click on ADD option.
Step 16: It will be added to our target and it shows in the project
window.
Step 17: Select right click on target in the project window and select
“Options for Target.”
Step 18: It will show some window, in that go to output option and choose
Create Hex option by selecting that box.
Step 20: Now to compile your project go to Project select Build Target
option or press F7.
Step 21: Check the concern block of output and observe the results.
Connections:
No Switches are there to Stepper Motor is connected to P0.28, P0.29, P0.30 and P0.31
through LEDs D7 to D10.
Connect the Stepper motor at connector X3.
48
VIVA-VOCE
1) Define GPIO.
2) What is the function of ULN2803?
3) How LPC2148 control stepper motor?
4) Which I/O port lines used to rotate stepper motor?
5) How stepper motor reacts for each pulse it receives?
6) What is serial communication?
7) What is parallel communication?
8) What is stepper motor & why it is named so?
9) How can be step angle is calculated?
10) What are the advantages and disadvantages of parallel communication?
11) What does instruction-pipelining mean?
12) What is the power supply required for ARM processor?
13) What is a unit for torque?
14) What is RPM rating for a DC motor?
15) What device that is used to obtain an accurate position control of rotating shafts in
terms of steps?
RESULT:
Thus the Interfacing of Stepper Motor with ARM processor has been verified and
observed the output successfully.
49
Exp.: 11 INTERFACING OF LM35 TEMPERATURE SENSOR
AIM:To develop and verify the Interfacing of Temperature Sensor (LM35) with ARM
DEVELOPMENT KIT microcontroller using embedded c program.
APPARATUS REQUIRED:
S.No Apparatus Range Quantity
PROCEDURE:
Step 1: Give a double click on µvision 5 icon on the desk top, it will
generate a window as shown below
Step 2: To create new project go to project select new micro vision project.
Step 3: select a drive where you would like to create your project.
Step 4: Create a new folder and name it with your project name.
Step 5: Open that project folder and give a name of your project executable and
save it.
Step 6: After saving it will show some window there you select your
microcontroller company i.e. NXP from Phillips
Step 8: After selecting chip click on OK then it will display some window
asking to add STARTUP. Select YES.
Step 10: To write your project code select a new from menu bar.
Step 11: It will display some text editor, to save that select SAVE
option from menu bar.
Step 14: To add the c to target give a right click on Source Group,
choose “ADD s to Group” option.
Step 15: It will display some window there select the file and
click on ADD option.
Step 16: It will be added to our target and it shows in the project
window.
Step 17: Select right click on target in the project wind ow and select
“Options for Target.”
Step 18: It will show some window, in that go to output option and choose
Create Hex option by selecting that box.
Step 20: Now to compile your project go to Project select Build Target
option or press F7.
Step 21: Check the concern block of output and observe the results.
Connections:
TointerfaceLM35(presentinAna logInputregiononADTBoard)withP0.5
51
VIVA-VOCE
1) What is LM35?
2) Define ISP.
3) How many Analog-to-Digital Converters available as an inner peripheral in
LPC2148?
4) What is the main function of analog pin in LPC2148?
5) What is the output voltage produced by LM35for one degree temperature?
6) What is the difference between LM34 and LM35 sensors?
7) How many pins are available in LM35?
8) Why Vref is set of ADC 0848 to 2.56 V if analog input is connected to the LM35?
9) What is signal conditioning?
10) What is operating the operating temperature range inLM35?
11) Why LM35 is used to Measure Temperature?
12) What Does an LM35 Do?
13) List the devices used to sense temperature.
14) What is the purpose of a thermocouple?
15) What is the output voltage of a thermocouple?
RESULT:
Thus the Interfacing of Temperature Sensor (LM35) with ARM processor has been
verified and observed the output successfully.
52
Exp.: 12 IMPLEMENTING ZIGBEE PROTOCOL WITH ARM
AIM:To develop and verify the Implementation of Zigbee Protocol with ARM
DEVELOPMENT KIT microcontroller using embedded c program.
APPARATUS REQUIRED:
S.No Apparatus Range Quantity
PROCEDURE:
Step 1: Give a double click on µvision 5 icon on the desk top, it will
generate a window as shown below
Step 2: To create new project go to project select new micro vision project.
Step 3: select a drive where you would like to create your project.
Step 4: Create a new folder and name it with your project name.
Step 5: Open that project folder and give a name of your project executable and
save it.
Step 6: After saving it will show some window there you select your
microcontroller company i.e. NXP from Phillips
Step 8: After selecting chip click on OK then it will display some window
asking to add STARTUP. Select YES.
Step 10: To write your project code select a new from menu bar.
Step 11: It will display some text editor, to save that select SAVE
option from menu bar.
53
Step 12: By giving a name with extension .c and save it.
Step 13: Write the code of your project and save it.
Step 14: To add the c to target give a right click on Source Group,
choose “ADD s to Group” option.
Step 15: It will display some window there select the file and
click on ADD option.
Step 16: It will be added to our target and it shows in the project
window.
Step 17: Select right click on target in the project window and select
“Options for Target.”
Step 18: It will show some window, in that go to output option and choose
Create Hex option by selecting that box.
Step 20: Now to compile your project go to Project select Build Target
option or press F7.
Step 21: Check the concern block of output and observe the results.
Connections:
Mount Xigbee on Xigbee socket/U3 .Switch ON S4.1 and S4.2(for UART1) Cxx
Indicates Co-OrdinatorXigbee.
You should use two different xigbees(Rxx and Cxx)(Ex. R1 and C1) on two different
ADT boards.
54
VIVA-VOCE
RESULT:
Thus the Implementation of Zigbee Protocol with ARM processor has been verified
and observed the output successfully.
55
CONTENT BEYOND THE
56
Exp.: 01 INTERFACING BLUETOOTH MODULE
AIM : To write an embedded C code for interfacing Bluetooth Module with ARM
CORTEX M3- LPC 2148.
CIRCUIT DIAGRAM:
PROCEDURE:
Give +3.3V power supply to LPC 2148 Primer Board; connect the 5V adapter
with Bluetooth module which is connected wit h the LPC 2148 Primer Board. There
are two Bluetooth modules are required. One is connected with LPC 2148 Primer
Board; other one is connect ed with PC. First connect the serial cable between LPC
2148 Primer board & PC. Then open t he Hyper Terminal screen, select which port
you are using and set the default sett ings. Now the screen should show some text
messages. If the messages are correctly displayed in Hyper Terminal, then only
connect the Bluetooth modules in LPC 2148 Primer Board UART0 & PC. If you
are no treading any data from UART0, then
57
you just check the jumper connections & just check the serial cable is working.
Otherwise you just check the code with debugging mode in Keil.
PROGRAM:
#defineCR0x0D
#include< LPC21xx.H>void
init_serial(vo id);
intputchar(intch);
intgetchar( void);
unsignedchar test;
intmain( vo id)
{
char*Ptr="***UART0Demo***\n\n\rType Characters to be echoed!!
\n\n\r"; VPBDIV=0x02;//Divide Pc lk by two
init_ser ial();
while(1)
{
while(*Ptr){putchar( *Ptr++);
}putchar(getchar()); //Echoterminal
}
}
voidinit_serial(vo id)
{
PINSEL0=0x00000005;//Enab leRxD0andTxD0
U0LCR=0x00000083;//8bits,noParity,1Stopbit
U0DLL=0x000000C3;//9600BaudRate@30MHzVPBClock
U0LCR=0x00000003;
}
intputchar(intch)
58
{
if(ch=='\n')
{
while(!(U0LSR&0x20));
U0THR=CR;
}
while(!(U0LSR&0x20));
return(U0THR=ch);
}
intgetchar( void)
{
while(!(U0LSR&0x01));
return( U0RBR);
}
RESULT:
Thus, interfacing of GSM module with ARM CORTEX M3-LPC 2148 using embedded
C code was executed and verified successfully.
59
Exp.: 02 INTERFACING GSM MODULE
AIM : To write an embedded C code for interfacing GSM Module with ARM
CORTEX M3- LPC 2148.
CIRCUIT DIAGRAM:
Procedure:
Give +3.3V power supply to LPC 2148 Primer Board; connect the +5V adapter
with GSM module which is connected with LPC 2148 Primer Board through UART0.
Open the Hyper Terminal screen, select which port you are using and set the default
settings. Now the screen should show some text messages.
The following Commands and sequence of events performed for sending text
message to a mobile phone through GSM Modem interfaced with microcontroller:
First select t he text mode for SMS by sending the follo wing AT Command
to GSM Modem : AT+CMGF = 1 . This command configures the GSM
modem in t ext mode.
Send the following AT Command for sending SMS message in t ext mode
along with mobile number to the GSM Modem : AT+CMGS
60
=+923005281046 . This command sends the mobile number of the
recipient mobile to the GSM modem.
Send the text message string ("hello!") to the GSM Modem This is a
test message from UART".
Send ASCII code for CTRL+Z i.e., 0x1A to GSM Modem to transmit the
message to mobile phone. After message string has been sent to the
modem, send CTRL+Z to the micro-controller, which is equivalent to
0x1A (ASCII value).
If you not reading any text from UART0, then you just check the jumper
connections & just check the serial cable is working. O therwise you just check the
code with debugging mode in Keil. If you want to see more details about debugging
just see the videos in below link.
Program:
#define CR 0x0D
#include < LPC21xx.H>
#include <stdio.h>
void getstring( unsigned char *);
int getchar (void) /* Read character from Serial Port */
void stat us_ok(void);
void Ser ial_Init( void);
void delay( unsigned int n);
void main( void)
{
unsigned int cnt=0x80,m;
char xx; Serial_Init ();
delay( 50);
while(1)
{
printf("AT\r"); // AT COMMAND FOR INITIALING status_ok();
printf("AT+IPR=9600\r"); // AT COMMAND FOR BAUD RATE
status_ok(); printf("AT+CMGR=2\r"); // Reading the message detail
// at Index 1 with phone number, data and time status_ok();
61
delay(250); printf("ATD9790550124; \r");// AT COMMAND FOR
CALL DIALING delay( 250); stat us_ok();
delay( 500);
delay( 500);
delay( 500);
delay( 500);
delay( 500);
delay( 500);
printf("ATH\r"); // AT COMMAND FOR CALL DISCONNECTING
delay( 250);
stat us_ok();
delay( 500);
delay( 500);
printf("ATDL\r"); // AT COMMAND FOR REDIALING delay(250);
status_ok();
delay( 500);
delay( 500);
printf("ATH\r"); // AT COMMAND FOR ANSWERING THE CALL
delay( 250);
stat us_ok();
delay( 500);
delay( 500);
}
}
void getstring( unsigned char *array)
{
unsigned char temp=0, i=0;
do { temp = getchar();
*array++ = temp;
}
while((temp != '\r') && (temp !=
'\n'));
*array = '\0';
}
int getchar (void) /* Read character from Serial Port */
{
62
while (!(U0LSR & 0x01));
return ( U0RBR);
}
void stat us_ok(void)
{ getstring( y);
while(!(strstr(y,"OK")))
getstring( y);
pointr = strstr( y,"OK");
lcd_cmd( 0xc0);
lcd_dat a(*po intr++);
lcd_data(*po intr);
delay( 500);
lcd_cmd( 0x01);
}
void Ser ial_Init( void)
{
PINSEL0 |= 0X00000005; // Enable Txd0 and Rxd0
U0LCR = 0x00000083; //8-bit data, no parity, 1-stop bit
U0DLL = 0x00000061; //for Baud rate=9600, DLL=82
U0LCR = 0x00000003; //DLAB = 0;
}
void delay( unsigned int n)
{
unsigned int i,j;
for(i= 0;i<n;i++)
{
for(j= 0;j<12000;j++)
{;
} }}
Result:
Thus, interfacing of GSM module with ARM CORTEX M3- LPC 2148 using
embedded C code was executed and verified successfully
63
Exp.: 03 INTERFACING GPS MODULE
AIM : To write an embedded C code for interfacing GPS Module with ARM CORTEX
M3- LPC 2148.
CIRCUIT DIAGRAM:
Give +3.3V power supply to LPC 2148 Primer Board; connect +5V adapter with
GPS module is connected with the LPC 2148 Primer Board. Open the Hyper
Terminal screen, select which port you are using and set the default settings. Now
the screen should show some text messages.
If you are no treading any data from UART0, then you just check the jumper
connections & just check the serial cab le is working. Otherwise you just check the
code with debugging mode in Keil. If you want to see more details about debugging
just see the videos in belo w link.
64
Program:
#defineCR0x0D
#include< LPC21xx.H>void
init_serial(vo id);
intputchar(intch);
intgetchar( void);
unsignedchartest;
intmain( void)
{
char*Ptr="***UART0Demo***\n\n\rTypeCharacterstobeechoed!!\n\n
\r"; VPBDIV=0x02;//DividePclkbytwoinit_serial();
while(1)
{
while(*Ptr)
{
putchar( *Ptr++);
}
putchar(getchar()); //Echoter minal
}
}
voidinit_serial( void)
{
PINSEL0=0x00000005;//Enab leRxD0andTxD0
U0LCR=0x00000083;//8bits,noParity,1Stopbit
U0DLL=0x000000C3;/ /9600BaudRate@30MHzVPBClock
U0LCR=0x00000003;
}
intputchar(intch)
{
if(ch=='\n')
{
while(!(U0LSR&0x20));
U0THR=CR;
}
65
while(!(U0LSR&0x20));
return(U0THR=ch);
}
intgetchar( void)
{
while(!(U0LSR&0x01));
return(U0RBR);
}
Result:
66