EC8711 Embedded Lab Manual Final
EC8711 Embedded Lab Manual Final
LAB MANUAL
Regulation : 2013
Regulation 2013
SYLLABUS
LIST OF EXPERIMENTS
Mailbox.
Interrupt performance characteristics of ARM and FPGA.
Flashing of LEDS.
TOTAL: 45 Periods
INDEX
S.no
Date
Page
Marks
Signature
no
1
7
Mailbox
Flashing of LEDS
10
temperature sensor
11
ARM
EC6711 - EMBEDDED SYSTEMS LABORATORY MANUAL
Ex. No: 1
STUDY OF ARM EVALUATION SYSTEM
Date:
AIM:
Single flash sector/full chip erase in 400 ms and programming of 256 bytes in 1 ms.USB
2.0 Full-speed compliant device controller with 2 kB of endpoint RAM. The LPC2146/48
provides 8 kB of on-chip RAM accessible to USB by DMA.
One or two (LPC2141/42 vs. 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 32 kHz clock input. Multiple
serial interfaces including two UARTs (16C550), two Fast I2C-bus (400 kbit/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 5 V tolerant fast general purpose I/O pins in a tiny LQFP64 package.Up to 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 1 MHz to 25
MHz.Power saving modes include Idle and Power-down.
9V Input
On-Board
JTAG
4 Nos I2C
8 Nos.
2x16 LCD
USB 2.0
DAC Output
Temperature
Relay/Motor
Sensor
I2C RTC
LPC 2148
4X4 Matrix
40Pin Expansion
128x64 GLCD
Connector
On-Board Analog
4-way Traffic
Inputs
Buzzer / PS/2
Two
8 Nos.
2x RS232
Power Supply:
The external power can be AC or DC, with a voltage between (9V/12V, 1A output) at 230V AC
input.The ARM board produces +5V using an LM7805 voltage regulator, which provides supply to
the peripherals.
LM1117 Fixed +3.3V positive regulator used for processor & processor related peripherals.
NXP (Philips)
Flash memory and the ability to be reprogrammed using In-System Programming technology.
VVIT Department of Electronics and Communication Engineering
EC6711 - EMBEDDED SYSTEMS LABORATORY MANUAL
On-board Peripherals:
8-Nos. of Point LED’s (Digital Outputs)
4 X 4 Matrix keypad
Serial EEPROM
Temperature Sensor
Buzzer(Alarm Interface)
Traffic Light Module(Optional)
RESULT:
Thus the study of ARM processor has been done and ensured its composition with internal
features specifically.
Ex. No:2
Date:
AIM:
To
develop and verify the interfacing ADC and DAC with LPC 2148 ARM
microcontroller.
APPARATUS REQUIRED:
S.No
Apparatus
Range
Quantity
1
LPC 2148
1
PROCEDURE:
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 9: A target is created and startup is added to your project target and 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 SAVE option from menu bar.
Step 13: Write the code of your project and save it.
target
give
right
click
on
Source
Group,
some
window
there
select
the
file and
to
our
target
and
it
shows
in
the
project
window.
Step 17: Select right click
on
target in
the project
window
and
select
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.
PROGRAM:
*/
Stop bit */
*/
void delay(int n)
for(j=0;j<0x5000;j++)
{;}
}}
void main(void)
PINSEL1
|=
//Enable ADC0.1
PINSEL1
|=
PINSEL1
|=
//PINSEL1 =
0x15000000;
//Enable
ADC0.1
ADC0.2 | ADC0.3
VPBDIV
0x02;
//Set
the
cclk
to
30 Mhz
AD0CR
0x00230602;
//ADC
10clks/9Bit | BURST=1 |
CLKDIV = 0x06
AD0CR
|=
0x01000000;
//IO0DIR
0x0FFF7030;
serial_init();
//serial
initialization
ADC_CH
1;
printf("%c[2J%c[H",ESC,ESC);
printf("%c[4m PS - Primer -
ARM
ARM
DEVELOPMENT
KIT
- ADC Demo
%c[m%cE%cE",ESC,ESC,ESC,ESC);/*
underline */
printf
("(c)
Pantech
Solutions
Pvt
Ltd.,\nwww.pantechsolutions.net\n");
printf("\n\nNotes:-\n-------\n\n>
ADC0.1
is
interfaced
with Temperature
Sensor.\n>
Select
JP4
for ADC0.2
||
Values ***\n\n\n");
while(1)
{
do
{
val[ADC_CH] = AD0GDR;
//
Read
while
((val[ADC_CH]
&
0x80000000)
== 0);
val[ADC_CH]
= ((val[ADC_CH]
>>
6)
&
0x03FF);
ADC_CH++;
delay(10);
AD0CR
PRESET | (1<<ADC_CH);
AD0CR
|=
START;
val[1]
val[3]
for (i=1;i<4;i++)
printf("[1;31m%4d", val[i]);
if (i==1)
printf ("\xF8\F")
putchar (0x1B);
printf ("[30m]
");
if (i<3)
{
printf(" :: ");
delay(1);
number
of channels used in
PS-ARMDPK*/)
{
ADC_CH
1;
AD0CR
PRESET | (1<<ADC_CH);
AD0CR
|=
START;
//printf ("\b\b");
U0THR
'\r';
} }
OUTPUT:
RESULT:
Thus the interfacing of ADC and DAC (In-built) with ARM processor has been verified and
observed the output successfully.
Ex. No:3
Date:
AIM:
To develop and verify the interfacing LED and PWM with ARM DEVELOPMENT
APPARATUS REQUIRED:
S.No
Apparatus
Range
Quantity
1
ARM Development
LPC 2148
Kit
2
PROCEDURE:
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 9: A target is created and startup is added to your project target and 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 SAVE option from menu bar.
Step 13: Write the code of your project and save it.
VVIT Department of Electronics and Communication Engineering
EC6711 - EMBEDDED SYSTEMS LABORATORY MANUAL
Step 14: To add our 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
and
it shows in
the
project
window.
Step
the
project window
and
select
Step 19: In the same window go to Linker option and choose Use Memory Layout from
Target Dialog by selecting the box, and click OK.
Step 20: Now to compile your project go to Project select Build Target
PROGRAM:
LED:
#include <LPC214x.h>
#include <stdio.h>
#define LED 16
#define Switch 24
void Delay(int);
int main(void)
- P1.31 as GPIO
- P1.31 as Input
P1.23 as Output
IO1PIN = 0;
while(1)
Status = 1;
while (~Status)
void Delay(int n)
int p,q;
for(p=0;p<n;p++)
for(q=0;q<0x9990;q++);
}}
PWM:
#include <LPC214x.H>
/* LPC21xx
definitions
*/
#include <stdio.h>
PWMIR
|= 0x00000001;
/* Clear match0
interrupt */
VICVectAddr
= 0x00000000;
VICVectAddr8 = (unsigned)PWM0_isr;
VICVectCntl8 = 0x00000028;
/* Set channel
*/
VICIntEnable = 0x00000100;
/* Enable the
interrupt */
PINSEL0 |= 0x00008008;
/* Enable P0.7
and P0.1
as PWM output */
PWMPR
= 0x00000000;
/* Load
prescaler
*/
PWMPCR = 0x00000C0C;
PWMMR0 = 0x400;
/* set cycle
*/
PWMMR1 = 0;
/* set rising
*/
PWMMR2 = 0x200;
/* set falling
*/
PWMMR3 = 0x100;
/* set rising
PWMLER = 0xF;
/* enable
PWMTCR = 0x00000002;
/* Reset
*/
PWMTCR = 0x00000009;
/* enable
for (j=0;j<700;j++);
init_PWM();
U1LCR
0x83;
U1DLL
0xC3;
U1LCR
0x03;
Conversion */
while (1)
{ /*
Loop forever */
do
if (val != oldval)
PWMMR2 = val;
PWMLER = 0xF;
oldval = val;
OUTPUT:
Delay =10
RESULT:
Thus the interfacing of LED and PWM with ARM DEVELOPMENT KIT was done
by using embedded C program.
Ex. No:4
Date:
AIM:
To develop and verify the interfacing of real time clock and serial port with ARM
APPARATUS REQUIRED:
S.No
Apparatus
Range
Quantity
1
LPC2148
1
PROCEDURE:
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
9:
A target
is
created
and
startup
is
added to
your
project
target
save
that
select
SAVE
Step
13:
To add
our
c to
target
give
right
click
on
Source
Group,
Step
select
theyou
have
to add
Step
and it
shows in
the
project
window.
Step 16: Now give a right click on target in the project window and select “Options for
Target”
Step 17: It will show some window, in that go to output option and choose Create Hex
option by selecting that box
Step 18: In the same window go to Linker option and choose Use Memory Layout from
Target Dialog by selecting the box, and click OK.
Step 19: Now to compile your project go to Project select Build Target option or press F7.
Step 20: Ensure the real time clock, displaying in output window.
PROGRAM:
RTC:
#include <LPC213x.h>
#include <stdio.h>
#include <ctype.h>
#include <stdlib.h>
#include "UART.h"
#define BUZZ
7
//Buzzer Connected to P0.7
void UART1_ISR(void)__irq;
char Key;
long
i,j;
}void Initialize(void)
{
PLLCFG
0x24;
CCLK = 60MHz
PLLFEED
0xAA;
// Feed Process
PLLFEED
0x55;
PLLCON
0x01;
PLLFEED
=
0xAA;
// Feed Process
PLLFEED
0x55;
PLLCON
0x03;
Microcontroller
PLLFEED
0xAA;
// Feed Process
0x55;
MAMCR
0x02;
Enabled
MAMTIM
0x04;
in duration
VPBDIV
=
0x02;
30MHz
char
i=0;
for(i=0;i<2;i++)
while(!isdigit(Key));
//Wait
till Key = 0 to 9
if (i==0)
{
TimE =
10 * atoi( &Key );
if (i==1)
TimE +=
atoi( &Key );
}
putchar(Key);
Key
0;
*Buff
TimE;
}
void Delay()
for(j=0;j<700;j++);
void Wait()
Delay();Delay();Delay();
void Alarm(void)
// unsigned char i;
//for(i=0;i<250;i++)
printf("[2M");
//}
void main(void)
U1IER
//PINSEL0
|=
(1 << 18);
IO0DIR
|=
(1<<7);
VICVectAddr0
(unsigned)UART1_ISR;
VICVectCntl0
0x20 | 7;
VICIntEnable
|=
(1 << 7);
VICVectAddr2
(unsigned)RTC_ISR;
VICVectCntl2
0x20 | 13;
VICIntEnable
|=
(1 << 13);
AMR =
0xFF;
alarm comparision
PREINT = 0x00000392;
PREFRAC = 0x00004380;//
CCR
=
0x01;
//CIIR
0x01;
UART1_PutS("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n");
UART1_PutS("
-\n\n\n");
UART1_PutS(">
Press
to
Set
Time\n");
UART1_PutS(">
Press
to
Set
Alarm\n");
printf("CTC
: %d\t",CTC);
printf(">>
TIME: %02d:%02d:%02d
\r",HOUR,MIN,SEC); //
DelayMs(100);
if (Key == '*')
{
Key =
0;
UART1_PutS(">>
Set Time:
");
RTC_Setup(&HOUR);
UART1_PutC(':');
RTC_Setup (&MIN);
UART1_PutC (':');
RTC_Setup (&SEC);
//printf("\r\tTIME: %02d:%02d:%02d
\r",HOUR,MIN,SEC);
//printf("^[2J");
U1THR
0x1B;
//Escape
UART1_PutS("[2J\0");
// Clear Screen
if (Key == '!')
UART1_PutC(':');
RTC_Setup(&ALMIN);
UART1_PutC(':');
RTC_Setup(&ALSEC)
ALHOUR = HOUR + 1;
else
ALMIN = MIN + 5;
Key = 0;
Flag = 0;
if (Key == '.')
{
Key = 0;
Flag = 0;
if (Flag == 1)
void UART1_ISR(void)__irq
char Msg;
Recieve Interrupt
//Recieve Data
Key = U1RBR;
default : break;
Flag = 1;
UART1_PutS("\nALARM\n");
SERIAL PORT:
#define CR 0x0D
two
init_serial() while(1)
while (*Ptr)
putchar(*Ptr++);
putchar(getchar()); //Echo
terminal
Interface */
*/
if (ch ==
'\n')
while (!(U0LSR
& 0x20));
U0THR =
CR;
/* output CR */
Serial Port */
OUTPUT:
RESULT:
Thus the real time clock and serial port interfacing with ARM DEVELOPMENT KIT
processor has been executed successfully.
Ex. No:5
Date:
AIM:
To develop and verify the interfacing of keyboard and LCD with ARM DEVELOPMENT
KIT ARM microcontroller using embedded C program.
APPARATUS REQUIRED:
S.No
Apparatus
Range
Quantity
1
ARM
1
DEVELOPMENT KIT
2
PROCEDURE:
Step
1:
Give
icon
on
the
desk
top,
it will
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
name
of
6:
After
Step
8:
After
then
it
will
display
some
window
9:
target
is created
and
startup
is
added
to
your
project
target
menu bar.
Step
11:
It
will
display
some
text editor,
to
save
that
select
SAVE
Step 13: Write the code of your project and save it.
VVIT Department of Electronics and Communication Engineering
Step
14:
To add our c to
target
give
right
click
on
Source
Group,
15:It
will displays
some
window
there
select
the
you
have
to
add
16:
It will be
added
to our
target
and
it shows in
the
project
window.
Step
17:
project
window
and
select
Step
18:
go
to
output
option
and
choose
Create Hex
19:
and choose
Use
Memory
Layout from Target Dialog by selecting the box, and click OK.
Step
20:
go
to
Project
select
Build
Target
option or press F7.
Step 21: Ensure the output of keyboard and display as by pressing the keys simultaneously
PROGRAM:
KEYBOARD:
'4','5','6','7',
'8','9','A','B',
'C','D','E','F'
};void Delay(void)
for(j=0;j<1234;j++);
void main(void)
UART0_PutC (0xB8);
while (1)
Delay();
Delay();
}
}
LCD:
#include <LPC214x.H>
#define RS
0x10000
#define
RW
0x20000
#define
EN
0x40000
void lcd_cmd
(unsigned char);
for(j=0;j<12000;j++)
{;}
LCD4_Convert(data);
void lcd_initialize(void)
int i;
for(i=0;i<4;i++)
delay(15);
IOSET0
|=
RS;
//0x1000;
//RS
IOCLR0
|=
RW;
//0x2000;
//RW
LCD4_Convert(data);
}
void lcd_display (void)
char i;
i=0;
while(msg[i]!='\0')
delay(15);
while(msg1[i]!='\0')
delay(15);
1
<< 20; else IOCLR0 = 1 << 20;
IOSET0
= EN;
IOCLR0
= EN;
//0x4000; //EN
=
1
IOSET0
= EN;
//0x4000;
//EN
delay(8);
IOCLR0
= EN;
//0x4000;
//EN
}
void main()
PINSEL1
0;
IODIR0
//Configure Pins
lcd_initialize();
//Initialize LCD!
lcd_display();
OUTPUT:
RESULT:
Thus the interfacing of keyboard and LCD with ARM DEVELOPMENT KIT
microcontroller using embedded C program has been verified successfully.
VVIT Department of Electronics and Communication Engineering
EC6711 - EMBEDDED SYSTEMS LABORATORY MANUAL
Ex. No:6
Date:
AIM:
To verify the interfacing of EPROM and interrupt with ARM DEVELOPMENT KIT
processor using embedded C program.
APPARATUS REQUIRED:
S.No
Apparatus
Range
Quantity
1
ARM
LPC2148
DEVELOPMENT KIT
2
1
PROCEDURE:
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.
project executable
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 window asking to add
STARTUP . Select YES.
Step 9: A target
your
project
target
Step 10: To write your project code select a new from menu bar.
that
select
SAVE
to
target give a
right
click
on
Source
Group,
window there
select
the
you
have
to add
and
it
shows
in
the
project
window.
Step 17: Now give a 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 19: In the same window go to Linker option and choose Use Memory Layout from
Target Dialog by selecting the box, and click OK.
Step 20: Now to compile your project go to Project select Build Target option or press F7.
Step 21: Check the memory (EPROM) status with the help of interrupt execution and
verify the operation.
PROGRAM:
EPROM:
#include <string.h>
#include "UART.h"
#define SW3
1<<24
#define SW4
1<<25
#define SW5
1<<26
#define SW6
1<<27
#define SW7
1<<28
#define MAX
12
#define
AA
#define
SI
#define
STO
#define
STA
#define
I2EN 6
void I2C_ISR(void)__irq;
void Wait
(unsigned
int);
int I2C_Write
char ReLoad[MAX]
0x00/*Address
char
Buff[MAX]
{0x00/*Address Low
Bits*/,0x00/*Address Low
Bits*/,'A','R','M','7','P','R','I',
'M',
'E', 'R'};
unsigned
char
Rec[MAX]
{"NO-DATA!"};
unsigned
char
index
0;
while(Delay--);
I2C1CONCLR
<<
STO;
I2C1CONSET
<<
AA;
int main()
unsigned int i;
VPBDIV
0x02;
PINSEL0
0x30C00005;// P0.11-PINSEL2&=0xFFFFFFF3;
IO1DIR
IO1DIR
|=
UART0_Init (9600);
VICIntSelect
0<<19;
VICVectCntl0
0x020 | 19 ;
VICVectAddr0
(unsigned long)I2C_ISR;
VICIntEnable
1<<19;
I2C_Init();
UART0_PutS("****
***\n\n\r");
UART0_PutS(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n\n\r");
IO1CLR=0xFF << 16;
while (1)
ii = 0;
IOCLR1
0xFF
<< 16;
IOSET1
1 <<
16;
UART0_PutC ('\n');
Wait
(1000);
Ready
'F';
IOCLR1
IOSET1
1 << 18;
ii = 2;
Erase
1;
while (ii
< MAX)
{
Buff[ii]
0xFF;
//Load 0xFF to
EEPROM
ii++;
flag =
'W';
I2C_Start
(0x70);
for (i=0;i<30;i++)
Wait(10000);
I2C1CONCLR
=
1 << SI;
(5000);
I2C1CONCLR
<<
STO;
I2C1CONCLR
=
1
<<
I2C1DAT
I2C1CONCLR
<<
SI;
I2C1DAT
I2C_Start (0xA1);
I2C1CONCLR
1
<<
SI;
index
0;
break;
I2C1DAT
=
0xA0;
//Slave Addr + W
1010 p2 p1 p0 w
I2C1CONCLR
<<
STA;
I2C1CONCLR
<<
STO;
I2C1DAT
0xA1;//Slave Addr + R
1010 p2 p1 p0
I2C1CONCLR
=
1
<<
SI;
I2C1CONCLR
0x20;
if (Erase
== 1)
Erase = 0;
else
I2C1CONCLR
<<
STA;
I2C1CONCLR
<<
SI;
break;
case (0x30): /*.Data byte in I2DAT has been transmitted; */
I2C1CONCLR = 0x20; //Clear START Bit
I2C1CONSET
0x20;
break;
case (0x40)
I2C1CONSET
1 << AA;
I2C1CONCLR
=
<< STA;
I2C1CONCLR
<< SI;
break;
returned ....*/
Rec [index]
I2C1DAT;
index++;
break;
INTERRUPT:
#include <lpc214x.h>
#include <stdio.h>
0;
0;
void ExtInt_Serve1(void)__irq;
void ExtInt_Serve2(void)__irq;
/*----------------------------------<
INT2
Initialization
>------------------------------*/
void ExtInt_Init2(void)
{
EXTMODE
|= 4;
void ExtInt_Init1(void)
EXTMODE
|= 2;
EXTPOLAR
= 0;
PINSEL0
|= 0x20000000;
VICIntEnable |= 1<<15;
//Enable EINT1
void Serial_Init(void)
{
PINSEL0 |=
0X00000005;
U0LCR
0x00000083;
void main(void)
Serial_Init();
void ExtInt_Serve2(void)__irq
++EINT2; EXTINT |= 4;
VICVectAddr = 0;
OUTPUT:
RESULT:
Thus the circuit is designed and programmed to develop and verify Embedded C program
for EPROM and interrupt Interfacing using ARM DEVELOPMENT KIT
Ex. No:7
MAILBOX
Date:
AIM:
KIT microcontroller.
APPARATUS REQUIRED:
S.No
Apparatus
Range
Quantity
LPC2148
1
2
1
PROCEDURE:
Step
it will
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
Step 8: After selecting chip click on OK then it will display some window
9:
target
is created and
startup is
added to
your
project
target
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
Step 13: Write the code of your project and save it.
click
on
Source
Group,
Step15:Itwill
displays
some
window
there
select
thefile
added to
our
target and
it shows
in
the
project
window.
Step 17: Now give a 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 19: In the same window go to Linker option and choose Use Memory Layout from
Target Dialog by selecting the box, and click OK.
Step 20: Compile your project go to Project select Build Target option or press F7.
PROGRAM:
#define CR
0x0D
#include <LPC21xx.H>
int main(void)
init_serial();
while(1)
while (*Ptr)
putchar(*Ptr++);
PINSEL0
= 0x00000005; //
U0LCR
= 0x00000083; //8
if (ch == '\n')
OUTPUT:
RESULT:
Thus the concept of Mailbox with ARM DEVELOPMENT KIT processor using
embedded C program was done and verified the message successfully.
VVIT Department of Electronics and Communication Engineering
EC6711 - EMBEDDED SYSTEMS LABORATORY MANUAL
Ex. No:8
INTERRUPT CHARACTERISTICS OF ARM &FPGA
Date:
AIM:
To verify the Interrupt performance characteristics of ARM and FPGA by using embedded
C program.
APPARATUS REQUIRED:
S.No
Apparatus
Range
Quantity
1
LPC2148
PROCEDURE:
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.
project executable
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
9: A
target
is created and
startup is
added to
your
project
target
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
click
on
Source
Group,
Step15:Itwill
display
somewindow
there
select
thefile
added to
it shows
in
the
project
window.
Step 17: Now give a right click on target in the project window and select “Options for
Target”
Step 18: Find a window and go to output option and choose Create Hex option by selecting
that box.
Step 19: In the same window go to Linker option and choose Use Memory Layout from
Target Dialog by selecting the box, and click OK.
Step 20: Compile the project and select Build Target option .
PROGRAM:
int
volatile
EINT1
0;
int
volatile
EINT2
0;
++EINT1; EXTINT |= 2;
VICVectAddr = 1;
void ExtInt_Serve2(void)__irq
{
++EINT2;
EXTINT |= 4;
VICVectAddr = 0;
void main(void)
Serial_Init();
putchar(0x0C);
DelayMs(100);
DelayMs(100);
while(1)
{
DelayMs(500);
DelayMs(500);
}}
void ExtInt_Init2(void)
EXTMODE
|= 4;
EINT2
EXTPOLAR
= 0;
PINSEL0 |=
0x80000000; //Enable
EINT2 on P0.15
VICVectCntl1
ExtInt_Serve2;
VICIntEnable |= 1<<16;
//Enable EINT2
void ExtInt_Init1(void)
{
EXTMODE
|= 2;
EXTPOLAR
= 0;
PINSEL0 |= 0x20000000;
VICIntEnable |= 1<<15;
//Enable EINT1
{
void Serial_Init(void)
PINSEL0
|=
U0LCR
U0DLL =
for(i=0;i<count;i++)
for(j=0;j<1000;j++);
}}
OUTPUT:
RESULT:
Thus the Interrupt performance characteristics of ARM processor and FPGA has been done
using embedded C program.
VVIT Department of Electronics and Communication Engineering
EC6711 - EMBEDDED SYSTEMS LABORATORY MANUAL
Ex. No:9
FLASHING OF LEDS
Date:
AIM:
APPARATUS REQUIRED:
S.No
Apparatus
Range
Quantity
ARM
LPC2148
DEVELOPMENT KIT
2
PROCEDURE:
Step
1:
Open
the
µvision
icon
on
the
desk
top,
it
will
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
give
a name of
your project
executable
Step 8: After selecting chip click on OK then it will display some window
9: A
target
is
created and
startup
is added
to
your
project
target
menu bar.
Step 11: It will
that
select
SAVE
Step 13: Write the code of your project and save it.
VVIT Department of Electronics and Communication Engineering
EC6711 - EMBEDDED SYSTEMS LABORATORY MANUAL
target
give a
right
click on
Source
Group,
window
there
select
the
you
have
to add
and
it shows
in
the
project
window.
target
in
the
project
window
and
select
Step 18: It will show some window, in that go to output option and choose Create Hex
option by selecting that box
Step
to
Linker option
and
choose
Memory
Layout from Target Dialog by selecting the box, and click OK.
Step
to Project
select
Build
Target
PROGRAM:
LEDs OFF
for(delay=0; delay<500000; delay++); // delay
OUTPUT:
Delay =2
RESULT:
Thus the Flashing of LEDS using ARM DEVELOPMENT KIT board was
Ex. No:10
Date:
SENSOR
AIM:
To interface and verify the stepper motor and temperature sensor with ARM
DEVELOPMENT KIT microcontroller using embedded C program.
APPARATUS REQUIRED:
S.No
Apparatus
Range
Quantity
ARM
LPC2148
DEVELOPMENT KIT
2
PROCEDURE:
Step1:Openaµvision4icononthedesk
top,
itwill
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.
project
executable
Step 6: After saving it will show some window there you select your
Step 8: After selecting chip click on OK then it will display some window asking to add
STARTUP. Select YES.
Step
9: A
target
is created and
startup is
added to
your
project
target
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
Step 13: Write the code of your project and save it.
a right
click on
Source
Group,
Step
15:
It
will
display
some
window
there
select
file
and it
shows
in the
project
window.
Step 17: Now give a 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 19: In the same window go to Linker option and choose Use Memory Layout from
Target Dialog by selecting the box, and click OK.
Step 20: Compile your project go to Project select Build Target option or press F7.
PROGRAM:
STEPPERMOTOR:
#include <lpc21xx.h>
#include <stdio.h>
#define SW1
24
//SW1 (P1.24)
#define
SW2 25
//SW2 (P1.25)
#define
SW3
26
//SW3 (P1.26)
int i,j;
for(i=0;i<n;i++)
for(j=0;j<0x3FF0;j++)
{;}
}}
//<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< counter-clockwise
rotate function
void motor_ccw(void)
i++;
}}
Funciton
void motor_cw(void)
int i = 3;
while (i >= 0)
}}
void main(void)
unsigned char i = 0;
as GPIO
as Output Pins
while(1) // Loop
forever..............
ON/OFF
clockwise */
particular angle */
i++;
} }
else
i = 0; } }
TEMPERATURESENSOR:
for (i=0;i<50;i++)
printf ("--------------------\n\r");
printf("******\n\r");
printf("***************\n\n\r");
void Serial_Init ()
PINSEL0|=
U1LCR
0x83;
U1DLL
195;
U1LCR
=
0x03;
void main ()
AD0CR
PRESET
| 0x02;
//ADC Config:
10bit/9Clock |
AD0CR
|=
START;
//Start
Conversion NOW
while (1)
{ do
Conversion is DONE
}
}
OUTPUT:
TEMPERATURE SENSOR:
RESULT:
Thus, the interfacing of stepper motor and temperature sensor with ARM DEVELOPMENT
KIT processor has been done and executed the temperature value.
Ex. No:11
IMPLEMENTING ZIG BEE PROTOCOL WITH ARM
Date:
AIM:
To implement the ZigBee protocol with ARM DEVELOPMENT KIT microcontroller and
perform the communication process.
APPARATUS REQUIRED:
S.No
Apparatus
Range
Quantity
ARM
LPC2148
DEVELOPMENT KIT
2
PROCEDURE:
Step1:Opentheµvision4icononthe
desktop,
itwill
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.
your project
executable
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
9: A
target
is created and
startup is
added to
your
project
target
Step
11:
It will
display some
text editor,
to save
that
select
SAVE
Step 13: Write the code of your project and save it.
target give a
right
click
on
Source
Group,
window there
select
the
you
have
to add
and
it
shows
in
the
project
window.
Step 17: Now give a 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 19: In the same window go to Linker option and choose Use Memory Layout from
Target Dialog by selecting the box, and click OK.
Step 20: Compile your project go to Project select Build Target option or press F7.
PROGRAM:
TX code:
PINSEL1=0;
lcdcmd(0x01);
while(1)
txdata('r');
delay(100);
Detector Sensor
txdata('g');
delay(100);
else
txdata('n');
delay(100);
IO0CLR=1<<25; // Rain
Indicator:
}}}}
RX code:
PINSEL1=0;
while(1)
rxdata();
RESULT: