EE3408 Embedded Processor Lab Manual
EE3408 Embedded Processor Lab Manual
TECHNOLOGY
Accredited by NBA & NAAC “A” Grade
Affiliated to Anna University, Chennai
NAMAKKAL
Lab Manual
Name :
Branch :
Semester :
Mrs.P.Pushparani Dr.J.Chandramohan
Assistant Professor HOD/EEE
Signature
Ex. Date Experiment Page. Marks of the
No No staff
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
INSTITUTION
Vision
Emerging as a technical institution of high standard and excellence to produce quality Engineers,
Researchers, Administrators and Entrepreneurs with ethical and moral values to contribute the
sustainable development of the society
Mission
We facilitate our students
MI1: To have in-depth domain knowledge with analytical and practical skills in cutting
edge technologies by imparting quality technical education.
MI2: To be industry ready and multi-skilled personalities to transfer technology to
industries and rural areas by creating interests among students in Research and
Development and Entrepreneurship.
DEPARTMENT
Vision
Providing quality education for the sustainable development in the field of Electrical and
Electronics Engineering to meet the global standards and to produce socially responsible engineers
with ethical and moral values.
Mission
MD1: Imparting quality technical education through state of the art infrastructure and
modern tools.
MD2: Making the student as professionals with ethical values, economical, ecological
and social upliftment.
MD3: Extending the sustainable knowledge through research and entrepreneurship for
the benefits of humanities.
PEO3 Have effective communication and leadership skills with ethical values.
PROGRAM OUTCOMES (POs)
1. Engineering knowledge: Apply the knowledge of mathematics, science, engineering fundamentals
and an engineering specialization 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 problems: 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. Environment 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.
11. Project management 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.
.
Ex. No:1 INTERFACING DAC (PROGRAMMING WITH IDE-ARM
Date: MICROCONTROLLER)
AIM:
To develop and verify the interfacing DAC with LPC 2148 ARM
microcontroller.
APPARATUS REQUIRED:
PROCEDURE:
Step 1: Give a double click on µvision 4 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 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
executableand save it.
Step 6: After saving it will show some window there you select your
microcontroller company i.e. NXP from Phillips
Step 7: Select your chip as ARM DEVELOPMENT KIT
Step 8: After selecting chip click on OK then it will display some
windowasking to add STARTUP. Select YES.
Step 9: A target is created and startup is added to your project
targetand is shown below.
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
SAVEoption from menu bar.
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
andclick on ADD option.
Step 16: It will be added to our target and it shows in
the projectwindow.
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
chooseCreate Hex option by selecting that box.
Step 20: Now to compile your project go to Project select Build
Targetoption or press F7.
Step 21: Check the concern block of output and observe the results.
Program:
#include<LPC214x.h>
void delay()
{
int i;
for(i=0;i<2000;i++);
}
void main()
{
int i,j;
PINSEL1=1<<19; // Enable DAC by selecting P0.25 as
AOUT DACR=0; // initial Digital value is 0
while(1)
{
for(i=0;i<1024;i++) // increments output from 0 to 1023
{
DACR=i<<6;
delay();
}
for(i=1023;i>=0;i--) // decrements output from 1023 to 0
{
DACR=i<<6;
delay();
}
}
}
Output
RESULT:
Thus the interfacing of DAC (In-built) with ARM processor has been
verified and observed the output successfully
Ex. No:2 Interfacing PWM Generator
Date:
AIM:
To develop and verify the interfacing PWM generator with LPC 2148 ARM
Microcontroller.
APPARATUS REQUIRED:
PROCEDURE:
Step 1: Give a double click on µvision 4 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 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
executableand save it.
Step 6: After saving it will show some window there you select your
microcontroller company i.e. NXP from Phillips
Step 7: Select your chip as ARM DEVELOPMENT KIT
Step 8: After selecting chip click on OK then it will display some
windowasking to add STARTUP. Select YES.
Step 9: A target is created and startup is added to your project
targetand is shown below.
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
SAVEoption from menu bar.
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
andclick on ADD option.
Step 16: It will be added to our target and it shows in
the projectwindow.
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
chooseCreate Hex option by selecting that box.
Step 20: Now to compile your project go to Project select Build
Targetoption or press F7.
Step 21: Check the concern block of output and observe the results.
Program:
#include <lpc214x.h>
while (1);
}
Out put:
RESULT:
Thus the interfacing of PWM generator with ARM processor (LPC2148) was done by
using embedded program.
Ex. No:3 Interfacing Timer
Date:
AIM:
To develop and verify the interfacing Timer with LPC 2148 ARM
Microcontroller.
APPARATUS REQUIRED:
PROCEDURE:
Step 1: Give a double click on µvision 4 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 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
executableand save it.
Step 6: After saving it will show some window there you select your
microcontroller company i.e. NXP from Phillips
Step 7: Select your chip as ARM DEVELOPMENT KIT
Step 8: After selecting chip click on OK then it will display some
windowasking to add STARTUP. Select YES.
Step 9: A target is created and startup is added to your project
targetand is shown below.
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
SAVEoption from menu bar.
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
andclick on ADD option.
Step 16: It will be added to our target and it shows in
the projectwindow.
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
chooseCreate Hex option by selecting that box.
Step 20: Now to compile your project go to Project select Build
Targetoption or press F7.
Step 21: Check the concern block of output and observe the results.
Program
#include<lpc214x.h>
void pll() //Fosc=12Mhz,CCLK=60Mhz,PCLK=60MHz
{
PLL0CON=0X01;
PLL0CFG=0X24;
PLL0FEED=0XAA;
PLL0FEED=0X55;
while((PLL0STAT&(1<<10))==0);
PLL0CON=0X03;
PLL0FEED=0XAA;
PLL0FEED=0X55;
VPBDIV=0X01;
}
void wait()
{
T1CTCR=0X0000; //Timer Mode
T1PR=59999; //Prescaler Value
T1MR0=1000; //Match Register Value
T1MCR=0x00000004; //TC and PC will be stopped and TCR[0] will be set to 0 if MR0 matches the
TC. T1TCR=0X02; //Reset Timer
T1TCR=0X01; //Timer ON
while(T1TC!=T1MR0);
T1TC=0; //Timer OFF
}
int main(void)
{
IO0DIR=0xffffffff;
pll(); //Fosc=12Mhz,CCLK=60Mhz,PCLK=60MHz
while(1) {
IO0SET=0xffffffff;
wait();
IO0CLR=0xffffffff;
wait();
}
}
Output
RESULT:
Thus the interfacing of Timer (In-built) with ARM processor has been
verified and observed the output successfull
Ex. No:4 RTC Interfacing with ARM using serial communication program
Date: (UART).
AIM:
To develop and verify the interfacing with ARM using serial communication
program (UART) with LPC 2148
APPARATUS REQUIRED:
PROCEDURE:
Step 1: Give a double click on µvision 4 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 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
executableand save it.
Step 6: After saving it will show some window there you select your
microcontroller company i.e. NXP from Phillips
Step 7: Select your chip as ARM DEVELOPMENT KIT
Step 8: After selecting chip click on OK then it will display some
windowasking to add STARTUP. Select YES.
Step 9: A target is created and startup is added to your project
targetand is shown below.
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
SAVEoption from menu bar.
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
andclick on ADD option.
Step 16: It will be added to our target and it shows in
the projectwindow.
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
chooseCreate Hex option by selecting that box.
Step 20: Now to compile your project go to Project select Build
Targetoption or press F7.
Step 21: Check the concern block of output and observe the results.
Program:
#include <lpc214x.h>
void initClocks(void);
void initUART0(void);
void U0Write(char data);
void Send_String(char* StringPtr);
char String[]="Hello from EEE !!! \n\r\n";
unsigned int delay;
int main(void)
{
initClocks(); // Set CCLK=60Mhz and
PCLK=60Mhz initUART0();
while(1)
{
Send_String(String); //Pass the string to the USART_putstring function and sends it over the
serial for(delay=0; delay<500000; delay++); // delay
}
}
void initUART0(void)
{
PINSEL0 = 0x5; /* Select TxD for P0.0 and RxD for P0.1 */
U0LCR = 0x83; /* 8 bits, no Parity, 1 Stop bit | DLAB set to 1 */
U0DLL = 110;
U0DLM = 1;
U0FDR = 0xF1; /* MULVAL=15(bits - 7:4) , DIVADDVAL=0(bits - 3:0)*/
U0LCR &= 0x0F; // Set DLAB=0 to lock MULVAL and DIVADDVAL
//BaudRate is now ~9600 and we are ready for UART communication!
}
void U0Write(char data)
{
while (!(U0LSR & (1<<5))); // wait till the THR is empty
// now we can write to the Tx FIFO
U0THR = data;
}
void initClocks(void)
{
PLL0CON = 0x01; //Enable PLL
PLL0CFG = 0x24; //Multiplier and divider setup
PLL0FEED = 0xAA; //Feed sequence
PLL0FEED = 0x55;
while(*StringPtr != 0x00){
U0Write(*StringPtr);
StringPtr++;}
}
Output:
RESULT:
AIM:
To develop and verify the interfacing of stepper motor control with LPC 2148
ARM Microcontroller.
APPARATUS REQUIRED:
PROCEDURE:
Step 1: Give a double click on µvision 4 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 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
executableand save it.
Step 6: After saving it will show some window there you select your
microcontroller company i.e. NXP from Phillips
Step 7: Select your chip as ARM DEVELOPMENT KIT
Step 8: After selecting chip click on OK then it will display some
windowasking to add STARTUP. Select YES.
Step 9: A target is created and startup is added to your project
targetand is shown below.
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
SAVEoption from menu bar.
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 andclick on ADD option.
Step 16: It will be added to our target and it shows in
the projectwindow.
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 chooseCreate Hex option by selecting that box.
Step 20: Now to compile your project go to Project select
Build Targetoption or press F7.
Step 21: Check the concern block of output and observe the results.
Program:
RESULT:
Thus, the interfacing of stepper motor with ARM DEVELOPMENT KIT
processor has been done and executed successful
.