0% found this document useful (0 votes)
382 views

EE3408 Embedded Processor Lab Manual

Uploaded by

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

EE3408 Embedded Processor Lab Manual

Uploaded by

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

GNANAMANI COLLEGE OF

TECHNOLOGY
Accredited by NBA & NAAC “A” Grade
Affiliated to Anna University, Chennai
NAMAKKAL

DEPARTMENT OF ELECTRICAL AND


ELECTRONICS ENGINEERING

Lab Manual

Name :

Branch :

Semester :

Subject Code : EE3018

Subject : EE3018 –EMBEDDED PROCESSOR LABORATORY

Prepared by: Verified by:

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.

Program Educational Objectives(PEOs)

Have strong foundation in mathematics, science, and engineering fundamentals and


PEO1 advanced concepts towards their successful career in industries, research and
entrepreneur.

Analyze, design and implement various electrical, electronics and interdisciplinary


PEO2
projects, addressing the industrial and social needs.

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.

PROGRAM SPECIFIC OUTCOMES (PSOs)


Graduates of the program will be able to
PSO-1: Attain in-depth knowledge and design skills in Electrical Power Systems, Electrical drives,
Power Electronics and Control, Electronics and Digital Electronics.
PSO-2: Acquire specialized skills in Solar Power Applications, High Voltage Engineering and
competency for competitive examinations

.
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:

S.No Apparatus Range Quantity


1 ARM Development Kit LPC 2148 1

2 Keil µVision3 IDE - 1

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 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
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:

S.No Apparatus Range Quantity


1 ARM Development Kit LPC 2148 1

2 Keil µVision3 IDE - 1

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 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
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>

irq void PWM_ISR (void)


{
if ( PWMIR & 0x0001 ) /* If interrupt due to PWM0 */
{
PWMIR = 0x0001; /* Clear PWM0 interrupt */
}

if ( PWMIR & 0x0002 ) /* If interrupt due to PWM1 */


{
PWMIR = 0x0002; /* Clear PWM1 interrupt */
}

if ( PWMIR & 0x0004 ) /* If interrupt due to PWM2 */


{
PWMIR = 0x0004; /* Clear PWM2 interrupt */
}

if ( PWMIR & 0x0008 ) /* If interrupt due to PWM3 */


{
PWMIR = 0x0008; /* Clear PWM3 interrupt */
}
VICVectAddr = 0x00000000;
}

int main (void)


{
VPBDIV = 0x00000002;
PINSEL0 = PINSEL0 | 0x00008008; /* Configure P0.1 and P0.7 as PWM3 and PWM2 respectively */
VICVectAddr0 = (unsigned) PWM_ISR; /* PWM ISR Address */
VICVectCntl0 = (0x00000020 | 8); /* Enable PWM IRQ slot */
VICIntEnable = VICIntEnable | 0x00000100; /* Enable PWM interrupt */
VICIntSelect = VICIntSelect | 0x00000000; /* PWM configured as IRQ */

// For PWM3 double edge


PWMTCR = 0x02; /* Reset and disable counter for PWM */
PWMPR = 0x1D; /* Prescale value for 1usec, Pclk=30MHz*/
PWMMR0 = 100000; /* Time period of PWM wave, 100msec */
PWMMR2 = 40000; /* Rising edge of double edge controlled PWM */
PWMMR3 = 80000; /* Falling edge of double edge controlled PWM
*/
PWMMCR = 0x00000243; /* Reset and interrupt on MR0 match, interrupt on MR2 and MR3
match */
PWMLER = 0x0D; /* Latch enable for PWM3, PWM2 and PWM0 */
PWMPCR = 0x0C08; /* Enable PWM3, PWM2 and PWM0, double edge controlled PWM on PWM3
*/
PWMTCR = 0x09; /* Enable PWM and counter */

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:

S.No Apparatus Range Quantity


1 ARM Development Kit LPC 2148 1

2 Keil µVision3 IDE - 1

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 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
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:

S.No Apparatus Range Quantity


1 ARM Development Kit LPC 2148 1

2 Keil µVision3 IDE - 1

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 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
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(!(PLL0STAT & 0x00000400)); //is locked?

PLL0CON = 0x03; //Connect PLL after PLL is locked


PLL0FEED = 0xAA; //Feed sequence
PLL0FEED = 0x55;
VPBDIV = 0x01; // PCLK is same as CCLK i.e.60 MHz
}
void Send_String(char* StringPtr){

while(*StringPtr != 0x00){
U0Write(*StringPtr);
StringPtr++;}
}

Output:

RESULT:

Thus the R T C interfacing of serial communication (UART) ARM


processor has beenverified and observed the output successful
Ex. No:5 Interfacing stepper motor control
Date:

AIM:
To develop and verify the interfacing of stepper motor control with LPC 2148
ARM Microcontroller.

APPARATUS REQUIRED:

S.No Apparatus Range Quantity


1 ARM Development Kit LPC 2148 1

2 Keil µVision3 IDE - 1

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 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
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> // Define LPC2148 Header File


#include <stdio.h>
#define COIL_A 16
void motor_ccw(void);
void delay(int);
unsigned char STEP[] = {0x09, 0x08, 0x0C, 0x04, 0x06,
0x02, 0x03, 0x01};
void main(void)
{
unsigned char i = 0;
PINSEL2 &= 0xFFFFFFF3; // P1.16 - P1.31 as GPIO
IODIR1 = 0x000F0000; // P1.16 - P1.19 as Output
while(1)
{
IOCLR0 = 0xFF << COIL_A;
motor_ccw(); // Stepper Motor counter clockwise
}
}
void delay(int n)
{
int i,j;
for(i=0;i<n;i++)
{
for(j=0;j<0x3FF0;j++) {;}
}
}
void motor_ccw(void)
{
unsigned int i=0;
while (STEP[i] != '\0')
{
IOSET1 = STEP[i] << COIL_A;
delay(1);
IOCLR1 = STEP[i] << COIL_A;
delay(1);
i++;
}
}

RESULT:
Thus, the interfacing of stepper motor with ARM DEVELOPMENT KIT
processor has been done and executed successful
.

You might also like