ARM Manual Docu
ARM Manual Docu
Website : www.raana.in
Contact : 8220355225
ARM 7-LPC2148
DEVELOPMENT BOARD
USER MANUAL
EC6711 EMBEDDED LABORATORY USER MANUAL
CONTENTS
2
EC6711 EMBEDDED LABORATORY USER MANUAL
ARM makes 32-bit and 64-bit RISC multi-core processors. RISC processors are designed
to perform a smaller number of types of computer instructions so that they can operate at a
higher speed, performing more millions of instructions per second (MIPS). By stripping out
unneeded instructions and optimizing pathways, RISC processors provide outstanding
performance at a fraction of the power demand of CISC (complex instruction set computing)
devices.
ARM processors are extensively used in consumer electronic devices such as smartphones,
tablets, multimedia players and other mobile devices, such as wearables. Because of their
reduced instruction set, they require fewer transistors, which enable a smaller die size for the
integrated circuitry (IC). The ARM processors smaller size reduced complexity and lower power
consumption makes them suitable for increasingly miniaturized devices.
Load/store architecture.
3
EC6711 EMBEDDED LABORATORY USER MANUAL
1. SPECIFICATIONS
PROCESSOR:
SPECIAL FEATURES :
4
EC6711 EMBEDDED LABORATORY USER MANUAL
5
EC6711 EMBEDDED LABORATORY USER MANUAL
o Two 32-bit timers/external event counters (with four capture and four compare
channels each), PWM unit (six outputs) and watchdog.
o 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.
o 60MHz maximum CPU clock available from programmable on-chip PLL with
settling time of 100μs.
o Processor wake-up from Power-down mode via external interrupt or BOD. Single
power supply chip with POR and BOD circuits:
6
EC6711 EMBEDDED LABORATORY USER MANUAL
7
EC6711 EMBEDDED LABORATORY USER MANUAL
One of the important part in making an embedded system is loading the software/program we
develop into the microcontroller. Usually it is called “burning software” into the controller.
Before “burning a program” into a controller, we must do certain prerequisite operations with the
program. This includes writing the program in assembly language or C language, compiling the
program in a compiler and finally generating the hex code and bin code from the compiled
program.
Keil MicroVision is free software which solves many of the pain points for an embedded
program developer. This software is an integrated development environment (IDE), which
integrated a text editor to write programs, a compiler and it will convert your source code to hex
files too.
Here is simple guide to start working with Keil uVision which can be used for
8
EC6711 EMBEDDED LABORATORY USER MANUAL
9
EC6711 EMBEDDED LABORATORY USER MANUAL
STEP 1:
Create new folder in the name of FLASHING LED, and copy lcd.c and lcd.h from
From CD Embedded lab experiment code FLASHING LED code
STEP 2:
Click for KEIL µVISION4 Icon . Which appearing after Installing KEIL µVISION4
After opening Keil uV4, go to Project tab and Create new uVision project
10
EC6711 EMBEDDED LABORATORY USER MANUAL
Create the project in FLASHING LED folder created in Step1 and give save.
11
EC6711 EMBEDDED LABORATORY USER MANUAL
STEP 3:
12
EC6711 EMBEDDED LABORATORY USER MANUAL
STEP 4:
Then click ok, you will see following window click yes
13
EC6711 EMBEDDED LABORATORY USER MANUAL
STEP 5:
14
EC6711 EMBEDDED LABORATORY USER MANUAL
STEP 6:
Now you see Startups is already added which is necessary for running code for Keil.
The startup-code executes immediately upon reset of the target system and performs the
following operations:
15
EC6711 EMBEDDED LABORATORY USER MANUAL
Write Code for FLASHING LED in C and save it as FileName.c here FLASHING LED.c
16
EC6711 EMBEDDED LABORATORY USER MANUAL
PROGRAM:
#include <LPC21xx.H>
#include "lcd.h"
void delay(unsigned int a);
int main(void)
{
int i;
PINSEL0=0x00000000;
IODIR0=0x000000FF;
lcd_init();
lcd_write_control(0x01); // Clear Display (Clear Display,Set DD RAM Address=0)
goto_cursor(0x00); // Set Cursor Line-1
lcd_print(" RAANA FLASHING "); // Display LCD Line-1
goto_cursor(0x40); // Set Cursor = Line-2
lcd_print(" LED DEMO ");
while(1)
{
for(i=0;i<=10;i++)
{
IOSET0=0x000000FF;
delay(70);
IOCLR0=0x000000FF;
delay(70);
}
for(i=0;i<=7;i++)
{
IOSET0=0x00000001<< i ;
delay(30);
}
for(i=0;i<=7;i++)
{
IOCLR0=0x00000080>> i ;
delay(30);
}
for(i=0;i<=10;i++)
{
IOCLR0=0x00000055;
IOSET0=0x000000AA;
delay(70);
17
EC6711 EMBEDDED LABORATORY USER MANUAL
IOCLR0=0x000000AA;
IOSET0=0x00000055;
delay(70);
}
for(i=0;i<=7;i++)
{
IOSET0=0x00000001<< i;
delay(30);
IOCLR0=0x000000FF;
delay(30);
}
for(i=0;i<=7;i++)
{
IOSET0=0x00000080>> i;
delay(30);
IOCLR0=0x000000FF;
delay(30);
}
}
{ int i,j;
for(i=0;i<a;i++)
{ for(j=0;j<20000;j++);
18
EC6711 EMBEDDED LABORATORY USER MANUAL
STEP 8:
Once the code is written it has to be added to the project to do that right click on source
group and select “ADD FILES TO SOURCE GROUP” option AND add FILES FLASHING
LED.c, lcd.c.
OR
19
EC6711 EMBEDDED LABORATORY USER MANUAL
Now add FLASHING LED.c , lcd.c, to source group from FLASHING LED FOLDER
Copy flashing led .c and lcd.c from Embedded lab experiment code
20
EC6711 EMBEDDED LABORATORY USER MANUAL
21
EC6711 EMBEDDED LABORATORY USER MANUAL
22
EC6711 EMBEDDED LABORATORY USER MANUAL
23
EC6711 EMBEDDED LABORATORY USER MANUAL
Hex file and bin files are not created unless we follow particular steps.
Steps to be followed for creating hex file and bin files are mentioned below
REATING HEXFILE
The Intel hex (ihex) generally known as hex file, is a format used to store machine
language code in hexadecimal form. It is widely used format to store programs to be transferred
to microcontrollers, ROM and EEPROM. The compilers convert the programs written in
assembly, C etc into corresponding hex files, which are dumped into the controllers using
burners/programmers.
STEP 1:
24
EC6711 EMBEDDED LABORATORY USER MANUAL
STEP 2:
Go to output Tab
25
EC6711 EMBEDDED LABORATORY USER MANUAL
STEP 3:
26
EC6711 EMBEDDED LABORATORY USER MANUAL
STEP 4:
27
EC6711 EMBEDDED LABORATORY USER MANUAL
STEP 5:
Once the project is build result can be seen at the bottom. If any errors are present list of errors
will be displayed or if project has no errors build is said to be successful.
STEP 6:
Now you see 0 Error(s), 0 Warning (s). Then Hex File will create in Specific Folder. Now to
download it for you target hardware
28
EC6711 EMBEDDED LABORATORY USER MANUAL
STEP 1:
Go to options tab
29
EC6711 EMBEDDED LABORATORY USER MANUAL
STEP 2:
30
EC6711 EMBEDDED LABORATORY USER MANUAL
STEP 3:
In USER TAB, run command1 , give Project name ie Here FLASHING LED to axf file as
created in STEP1 (Page N0:12) Bin file name can vary i.e. need not to be same, Bin file will be
created in this name.
31
EC6711 EMBEDDED LABORATORY USER MANUAL
STEP 4:
IN ASM define NO_CRP which means user flash can be read or written
32
EC6711 EMBEDDED LABORATORY USER MANUAL
STEP 5:
33
EC6711 EMBEDDED LABORATORY USER MANUAL
Connect UART0 in the ARM kit to the system via serial cable.
34
EC6711 EMBEDDED LABORATORY USER MANUAL
STEP 2:
Go to programs and search for launch lpc 210x_isp.exe and click on it.
35
EC6711 EMBEDDED LABORATORY USER MANUAL
STEP 3:
36
EC6711 EMBEDDED LABORATORY USER MANUAL
STEP 4:
37
EC6711 EMBEDDED LABORATORY USER MANUAL
STEP 5:
To check USB enumeration status Right Click on “My Computer” icon and select Manage.
38
EC6711 EMBEDDED LABORATORY USER MANUAL
STEP 6:
A “Computer Management” window opens. In this select Device Manager and select the port
as shown below:
39
EC6711 EMBEDDED LABORATORY USER MANUAL
STEP 7:
40
EC6711 EMBEDDED LABORATORY USER MANUAL
Step 8:
Select the Com port where you download hex file in to flash and select the baud rate.
41
EC6711 EMBEDDED LABORATORY USER MANUAL
STEP 9:
Reset key can be identified in arm kit, let us assume another key as A
42
EC6711 EMBEDDED LABORATORY USER MANUAL
STEP 10:
Now click on read device button to detect the Target, If detected, the Part ID and Boot
loader ID will be displayed in their relative Textboxes And also a message will be displayed at
the bottom “Read Part ID Successfully”
43
EC6711 EMBEDDED LABORATORY USER MANUAL
STEP11:
To program the flash select the file to be loaded in to flash, Once the hex file is loaded, click
on Upload to Flash button. Once clicked the programming starts. The programming progress is
indicated by the progress bar.
44
EC6711 EMBEDDED LABORATORY USER MANUAL
45
EC6711 EMBEDDED LABORATORY USER MANUAL
STEP 12:
Press and hold SW3, PRESS the RESET &release the RESET, then release SW3
46
EC6711 EMBEDDED LABORATORY USER MANUAL
47
EC6711 EMBEDDED LABORATORY USER MANUAL
After connecting USB to the system switch on the kit by sliding the switch from off to on
48
EC6711 EMBEDDED LABORATORY USER MANUAL
STEP 2:
49
EC6711 EMBEDDED LABORATORY USER MANUAL
STEP 3:
50
EC6711 EMBEDDED LABORATORY USER MANUAL
STEP 4:
BOOT LOADER
A Boot loader is a small piece of code that runs before the operating system starts running. In
our case the boot loader is the code that runs before the device firmware starts up. Typically a
boot loader is used because the system memory is too small to contain the entire program, and so
the boot loader uses a set of routines to call the program from a different part of memory.
The USB in Board might not get enumerated if it does not find the appropriate driver for it.
To check USB enumeration status Right Click on “My Computer” icon and select Manage.
51
EC6711 EMBEDDED LABORATORY USER MANUAL
STEP 5 :
A “Computer Management” window opens. In this select Device Manager and select the port
as shown below:
52
EC6711 EMBEDDED LABORATORY USER MANUAL
53
EC6711 EMBEDDED LABORATORY USER MANUAL
STEP 6:
Open Philips flash utility and select baud rate and set the com port to COM2, in Philips
software we can select com from 1 to 5 only
54
EC6711 EMBEDDED LABORATORY USER MANUAL
STEP 7:
55
EC6711 EMBEDDED LABORATORY USER MANUAL
STEP 8:
Browse the file to upload the code and select upload to flash Button as shown
56
EC6711 EMBEDDED LABORATORY USER MANUAL
57
EC6711 EMBEDDED LABORATORY USER MANUAL
STEP 9:
58
EC6711 EMBEDDED LABORATORY USER MANUAL
Now connect the USB cable between the development board and PC and press reset on
the development board.
Your PC should detect LPC2148 development board as a mass storage device. Let
windows install generic drivers for mass storage device class
After successful installation of drivers a disk drive will be created in the My Computer as
shown in fig. below. As there is no user code loaded in to the microcontroller, the
bootloader firmware will enter directly in to bootloader mode. Once the user code is
loaded in to the microcontroller, pressing reset button will execute user code rather than
bootloader code and no disk drive will be created in My Computer
Double click on this drive to view its contents. It will contain a single file labeled as
“Firmware.bin” which is the image of internal flash of the microcontroller
59
EC6711 EMBEDDED LABORATORY USER MANUAL
60
EC6711 EMBEDDED LABORATORY USER MANUAL
STEP 12:
Now copy the “FLASHINGLED.bin” file that was created earlier using Keil to this drive using
drag and drop with mouse or copy and paste with keyboard..
61
EC6711 EMBEDDED LABORATORY USER MANUAL
On successful copying the file. Keep SW3 pressed and then press and release RESET button
then release SW3.
62
EC6711 EMBEDDED LABORATORY USER MANUAL
STEP 13:
63
EC6711 EMBEDDED LABORATORY USER MANUAL
Basic clocking for the A/D converters is provided by the VPB clock. Supports maximum
clock of 4.5MHz . Each ADC is of 10 bit resolution, using Successive approximation conversion
technique.
SPECIFICATION
ADC 8 bit Resolution Data.
1 Ch 8 bit data.
Data, Control signals are connected through Burg stick.
350 MHz Analog Bandwidth.
1 V p-p Analog Input Range.
Internal 2.5 V Reference and
T/H Low Power: 500 Mw
5 V Single Supply Operation
SPECIFICATION
64
EC6711 EMBEDDED LABORATORY USER MANUAL
Operation
Bits 19:18 of the PINSEL1 register, control whether the DAC is enabled and controlling the
state of pin P0.25/AD0.4/AOUT. When these bits are 10, the DAC is powered on and active.
The settling times noted in the description of the BIAS bit are valid for a capacitance load on
the AOUT pin not exceeding 100pF. A load impedance value greater than that value will cause
settling time longer than the specified time.
WORKING PROCEDURE
Create new folder in the name of ADC_DAC and copy lcd.c, dac.c.,config.h,dac.h,lcd.h.
Follow steps from STEP2 TO STEP6 under Screen Shot For Experimental
Demonstration
Follow step 7
65
EC6711 EMBEDDED LABORATORY USER MANUAL
#include "lcd.h"
#include "dac.h"
char lcd_buf[30];
void ADC_Init(void);
void Delay () {
for (i=0;i<50;i++)
for (j=0;j<500;j++); }
int main()
int dac_data;
dac_data=1024/2;
lcd_init();
goto_cursor(0x00); // Set
Cursor Line-1
ADC_Init();
66
EC6711 EMBEDDED LABORATORY USER MANUAL
IOPIN1&=~(0xFFFF0000);
Delay();
while(1)
adc_data = Read_ADC
goto_cursor(0x40);
// Set Cursor = Line-2
lcd_print(lcd_buf);
if ((sw2) == 0 )
IOCLR0 = 0x00000040;
else
dac_data++;
if(dac_data>1024)
dac_data=1024;
DacOut(dac_data);
if ((sw3) == 0 )
67
EC6711 EMBEDDED LABORATORY USER MANUAL
else
dac_data--;
if(dac_data<=1)
dac_data=1;
DacOut(dac_data);
void ADC_Init(void)
AD0CR = 0x00200F02;
/*
CLKDIV = 0x0F
CLKS and BURST = 0x0 means that 11 Intruction Cycles used,resulting in 10-Bit
Data
*/
68
EC6711 EMBEDDED LABORATORY USER MANUAL
//Delay(100000);
do
adc_data = AD0DR1;
adc_data = adc_data>>6;
Return (adc_data);
Once the code is written it has to be added to the project to do that right click on source
group and select “ADD FILES TO SOURCE GROUP” option .Now you add ADC_DAC.c
,but lcd.c, dac.c must be added from the ADC_DAC FOLDER
0R
Now add ADC_DAC.c ,lcd.c, dac.c to source group from ADC_DAC FOLDER
69
EC6711 EMBEDDED LABORATORY USER MANUAL
Light Emitting Diodes (LEDs) are the most commonly used components, usually for
displaying pin‟s digital states.
70
EC6711 EMBEDDED LABORATORY USER MANUAL
Pulse width modulation (PWM) is a powerful technique for controlling analog circuits with a
processor's digital outputs. PWM is employed in a wide variety of applications, ranging from
measurement and communications to power control and conversion.
Create new folder in the name of INTERFACING LED AND PWM and copy, lcd.c,lcd.h
From
Follow steps from STEP2 TO STEP6 under Screen Shot For Experimental Demonstration
#include <LPC21xx.H>
#include "lcd.h"
#include <stdio.h>
char lcd_buff[16];
void delay(void);
71
EC6711 EMBEDDED LABORATORY USER MANUAL
VICVectAddr = 0x00000000;
unsigned int k;
int main(void)
PINSEL0 |= 0x00000000;
IODIR0 |= 0x000000FF;
init_PWM();
lcd_init();
duty = 50;
lcd_print(lcd_buff);
PWMMR2 = duty1;
PWMLER = 0xF;
oldval = duty1;
while (1)
if ((sw2) == 0 )
72
EC6711 EMBEDDED LABORATORY USER MANUAL
IOCLR0 = 0x00000040;
else
duty++;
duty = 100;
goto_cursor(0x40);
// Set Cursor = Line-2
lcd_print(lcd_buff);
PWMMR2 = duty1;
PWMLER = 0xF;
oldval = duty1;
IOSET0 = 0x00000040;
if ((sw3) == 0)
IOCLR0 = 0x00000020;
else
duty--;
73
EC6711 EMBEDDED LABORATORY USER MANUAL
if (duty <= 1)
duty = 1;
goto_cursor(0x40);
// Set Cursor = Line-2
lcd_print(lcd_buff);
PWMMR2 = duty1;
PWMLER = 0xF;
oldval = duty1;
IOSET0 = 0x00000020;
int i;
74
EC6711 EMBEDDED LABORATORY USER MANUAL
Once the code is written it has to be added to the project to do that right click on source
group and select “ADD FILES TO SOURCE GROUP” option .Now you add pwm.c but
,lcd.c must be copied from INTERFACING LED AND PWM.
OR
Add pwm.c & lcd.c to source group from INTERFACING LED AND PWM folder
A real-time clock (RTC) is a computer clock (most often in the form of an integrated circuit)
that keeps track of the current time. On the LPC2148, the RTC is clocked by 32.768 KHz
oscillator, or by a programmable prescale divider based on the VPB clock. Also, the RTC is
powered by its own power supply pin, VBAT, which can be connected to a battery or to the same
3.3 V supply used by the rest of the device.
WORKING PROCEDURE
Create new folder in the name of INTERFACING REALTIME CLOCK AND SERIAL
PORT and copy lcd.c,serial.c,main.c,Retarget.c, ,lcd.h,serial.h from
Follow steps from STEP2 TO STEP7 under Screen Shot For Experimental Demonstration
We are going to add c file in two ways
76
EC6711 EMBEDDED LABORATORY USER MANUAL
****1111
Function Name : delay()
Output : void
Note :
************************************************************************
*******
*/
__irq void RTC_ISR(void)
{
flag = 1;
ILR = 0x01; //Clear the RTC Interrupt Flag
VICVectAddr = 0x00;
}
/***************************************/
void delay(int count)
{
int j=0,i=0;
for(j=0;j<count;j++)
{
77
EC6711 EMBEDDED LABORATORY USER MANUAL
/****************/
/* main program */
/****************/
int pcclk_cali;
int main (void) { /* execution starts here */
unsigned char Hour,Minute,Second,Last_Second; // RTC Buffer
Data
lcd_init();
lcd_write_control(0x01); // Clear
Display (Clear Display,Set DD RAM Address=0)
goto_cursor(0x00); // Set
Cursor Line-1
lcd_print(" RAANA RTC DEMO "); //
Display LCD Line-1
uart1_init(); // Initialize UART1
// Initial Internal RTC Function
// Initial RTC Function
HOUR = 7;//0x07;
MIN = 33;//0x03;
SEC = 0;//0x03;
RTC_Init();
// CCR = 0x00000002;
// CIIR = 0x00000000;
// AMR = 0x000000FF;
// ILR = 0x00000003;
// CCR = 0x00000011;
Last_Second = 0x00;
78
EC6711 EMBEDDED LABORATORY USER MANUAL
do
// Repeat Get Second until Second Change
{
Hour = (CTIME0 & MASKHR)>>16;
// Read Hour
Minute = (CTIME0 & MASKMIN)>>8;
// Read Minute
Second = CTIME0 & MASKSEC;
// Read Second
}
while(Last_Second == Second); //
Repeat if Second Not Change
Last_Second = Second;
// Update Current Second
}
}
/**********Function Definition**********/
void RTC_Init(void)
{
// DOY = 23; //Enter Date
// MONTH = 50; //MONTH
// YEAR = 2013; //Year
HOUR =11; //Hour)
MIN = 15; //Min
SEC = 0; //Sec
79
EC6711 EMBEDDED LABORATORY USER MANUAL
OR
METHOD 2: COPY RTC_SERIAL.C FROM CD Embedded lab experiment code
INTERFACING REALTIME CLOCK AND SERIAL PORT code to
INTERFACING REALTIME CLOCK AND SERIAL PORT folder
Add RTC_SERIAL.C, serial.c. lcd.c ,main.c,retarget.c,RTC_SERIAL.c to source group
from INTERFACING REALTIME CLOCK AND SERIAL PORT folder
80
EC6711 EMBEDDED LABORATORY USER MANUAL
The ARM214X Kit, have 2x16 character LCD. 7 pins are required to create 4-bit interface; 4
data bits (P1.18 – P1.21, D4-D7), address bit (RS-P1.16), and control signal (E-P1.17). The LCD
controller is a standard KS0070B or equivalent, which is a very well-known interface for smaller
character based LCDs and also facility to adjust contrast through trim pot.
Figure below illustrate the LCD part of the design and which pins are used for the interface.
The LCD is powered from the 5V power supply
SPECIFICATION
81
EC6711 EMBEDDED LABORATORY USER MANUAL
Switch is the most widely used input device. When a switch is pressed either low or high
signal is given to controller depending upon the circuit designing. This approach requires one pin
for a single switch. With increasing requirement of input devices, more numbers of controller
pins are required which may not be available all the time. For example, to enter value from 0 to
15, we need 16 pins of controller to be interfaced with switches. To reduce number of required
pins, we can arrange keys in matrix form
82
EC6711 EMBEDDED LABORATORY USER MANUAL
SPECIFICATION
SW3 P0.30
WORKING PROCEDURE
Create new folder in the name of INTERFACING KEYBOARD AND LCD and copy
lcd.c&lcd.h from CD Embedded lab experiment code INTERFACING
KEYBOARD AND code
SUBFILE: lcd.c,lcd.h
Follow steps from STEP2 TO STEP6 under Screen Shot For Experimental Demonstration
83
EC6711 EMBEDDED LABORATORY USER MANUAL
#include <LPC21xx.H>
#include "lcd.h"
#include <stdio.h>
char lcd_buff[16];
void delay(void);
unsigned int k;
int main(void)
PINSEL0 |= 0x00000000;
IODIR0 |= 0x000000FF;
lcd_init();
while (1)
if ((sw2) == 0 )
IOCLR0 = 0x00000040;
goto_cursor(0x40);
lcd_print(" ");
84
EC6711 EMBEDDED LABORATORY USER MANUAL
else
IOSET0 = 0x00000040;
goto_cursor(0x40);
lcd_print("SW3 PRESSED");
if ((sw3) == 0)
IOCLR0 = 0x00000020;
goto_cursor(0x40);
lcd_print(" ");
else
IOSET0 = 0x00000020;
goto_cursor(0x40);
lcd_print("SW2 PRESSED");
int i;
85
EC6711 EMBEDDED LABORATORY USER MANUAL
Once the code is written it has to be added to the project to do that right click on source
group and select “ADD FILES TO SOURCE GROUP” option .Now you add lcd.c &
KP_LCD.c
OR
86
EC6711 EMBEDDED LABORATORY USER MANUAL
Features of AT24Cxx:
Internally Organized 128 x 8 (1K), 256 x 8 (2K), 512 x 8 (4K)
2-wire Serial Interface
Bi-directional Data Transfer Protocol
100 kHz (1.8V, 2.5V, 2.7V) and 400 kHz (5V)
Compatibility Write Protect Pin for Hardware Data
Protection
byte Page (1K, 2K), 16-byte Page (4K, 8K, 16K) Write Modes
Data Retention: 100 Years.
SCHEMATIC DIAGRAM
87
EC6711 EMBEDDED LABORATORY USER MANUAL
INTERRUPTS
An interrupt is a signal sent to the CPU which indicates that a system event has a occurred
which needs immediate attention
Interrupts in LPC214x are handled by Vectored Interrupt Controller (VIC) and are classified
into 3 types based on the priority levels.(Though Interrupts can classified in many different ways
as well)
1. Fast Interrupt Request i.e FIQ : which has highest priority
2. Vectored Interrupt Request i.e Vectored IRQ : which has „middle‟ or priority between
FIQ and Non-Vectored IRQ.
3. Non-Vectored IRQ : which has the lowest priority.
WORKING PROCEDURE
Create new folder in the name of INTERFACING EEPROM AND INTERRUTS and
copy lcd.c, serial.c,lcd.h&serial.h.
Follow steps from STEP2 TO STEP7 under Screen Shot For Experimental Demonstration
#include <LPC214x.h>
#include <stdio.h>
88
EC6711 EMBEDDED LABORATORY USER MANUAL
#include <string.h>
#include"lcd.h"
#define MAX 18
#define AA 2
#define SI 3
#define STO 4
#define STA 5
#define I2EN 6
char c_rx_data[];
void I2C_ISR(void)__irq;
void Delay(void);
char lcd_buff[50];
char uart1_buf[];
89
EC6711 EMBEDDED LABORATORY USER MANUAL
void read_eep();
void I2C_ISR(void)__irq
switch (I2C0STAT)
case (0x08):
if (flag == 'W')
I2C0DAT = 0xA0;
I2C0DAT = 0xA0;
I2C_Start (0xA1);
index = 0;
break;
case (0x10):
90
EC6711 EMBEDDED LABORATORY USER MANUAL
if (flag == 'W')
I2C0DAT = 0xA0;
I2C0DAT = 0xA1;
index = 0;
break;
case (0x18):
I2C0CONCLR = 0x20;
I2C0CONCLR = 0x38;
I2C0DAT = Buff[index];
index++;
break;
case (0x20):
I2C0CONCLR = 0x20;
I2C0CONCLR = 0x38;
I2C0DAT = Buff[index];
index++;
break;
case (0x28):
91
EC6711 EMBEDDED LABORATORY USER MANUAL
if (flag == 'W')
I2C0DAT = Buff[index];
I2C0CONCLR = 0x20;
I2C0CONCLR = 0x38;
I2C0CONCLR = 0x18;
else
I2C0DAT = Buff[index];
I2C0CONCLR = 0x20;
I2C0CONCLR = 0x38;
index++;
else
index = 0;
flag = 'R';
92
EC6711 EMBEDDED LABORATORY USER MANUAL
if (Erase == 1)
Erase = 0;
else
break;
case (0x30):
I2C0CONCLR = 0x20;
if (flag == 'W')
I2C0DAT = Buff[index];
index++;
else
index = 0;
93
EC6711 EMBEDDED LABORATORY USER MANUAL
flag = 0;
I2C0CONSET = 0x10;
break;
case (0x38):
I2C0CONSET = 0x20;
break;
case (0x40):
break;
case (0x48):
break;
case (0x50):
index++;
else
94
EC6711 EMBEDDED LABORATORY USER MANUAL
index = 0;
Ready = 'T';
break;
case (0x58):
break;
VICVectAddr = 0x00;
char uart_rx;
int main()
unsigned int i;
//VPBDIV = 0x02;
95
EC6711 EMBEDDED LABORATORY USER MANUAL
IODIR0 = 0x000000FF;
lcd_init();
uart1_init();
uart1_puts(uart1_buf);
lcd_write_control(0x01); // Clear
Display (Clear Display,Set DD RAM Address=0)
goto_cursor(0x00); // Set
Cursor Line-1
VICVectCntl0 = 0x20 | 9; // Assigning Highest Priority Slot to I2C0 and enabling this
slot
VICIntEnable = (1<<9);
I2C_Init();
ii = 0;
read_eep();
while(1)
uart_rx = uart1_getkey();
if(uart_rx == '+')
rx_true=1;
ii=2;
while( rx_true)
uart_rx = uart1_getkey();
if(uart_rx == 0x0d)
uart1_putc(0x0A);
rx_true=0;
else
uart1_putc(uart_rx);
Buff [ii]=uart_rx;
ii++;
while(ii<MAX)
ii++;
97
EC6711 EMBEDDED LABORATORY USER MANUAL
IOSET0 = 0x00000040;
Wait (5000);
uart1_puts(uart1_buf);
flag = 'W';
I2C_Start (0x70);
Delay();
uart1_puts(uart1_buf);
Delay();
Delay();
Delay();
98
EC6711 EMBEDDED LABORATORY USER MANUAL
uart1_puts(uart1_buf);
read_eep();
uart1_puts(uart1_buf);
uart1_puts(uart1_buf);
ii=2;
while(ii<MAX)
ii++;
IOSET0 = 0x00000040;
Wait (5000);
flag = 'W';
I2C_Start (0x70);
99
EC6711 EMBEDDED LABORATORY USER MANUAL
Delay();
uart1_puts(uart1_buf);
Delay();
uart1_puts(uart1_buf);
read_eep();
uart1_puts(uart1_buf);
void Delay(void)
for(i=0;i<150;i++)
for(j=0;j<900;j++);
100
EC6711 EMBEDDED LABORATORY USER MANUAL
while(Delay--);
I2C0SCLL = 150;
return 0;
while(Count--)
I2C0DAT = *Buff++;
return 0;
101
EC6711 EMBEDDED LABORATORY USER MANUAL
void read_eep()
unsigned int i;
goto_cursor(0x40);
// Set Cursor = Line-2
flag = 'R';
I2C_Start (0x70);
if (Ready == 'T')
ii=0;
while (ii<MAX)
Wait (1000);
sprintf(lcd_buff,"%c",Rec[ii]);
lcd_print(lcd_buff);
Wait (1000);
Wait (1000);
Wait (1000);
102
EC6711 EMBEDDED LABORATORY USER MANUAL
ii++;
Wait (1000);
Ready = 'F';
Once the code is written it has to be added to the project to do that right click on source
group and select “ADD FILES TO SOURCE GROUP” option Now you add
EEP_INT.c,lcd.c,serial.c
OR
103
EC6711 EMBEDDED LABORATORY USER MANUAL
EXPERIMENT NO : 7 MAILBOX
Mailbox was a freeware email management application for iOS and Android, developed by
Orchestra, Inc. It drew the attention of numerous technology blogs for its usability and
innovative features, such as swipe-based email sorting, snoozing and filtering.[1][2] Weeks before
its launch, a pre-registration period resulted in a waiting list of over 380,000
reservations.[3][4] Upon its iOS launch on February 7, 2013, Mailbox became the second-most-
downloaded free app in the App Store that day.[5]
In March 2013, Orchestra was acquired by Drop box.[6][7][8] The rollout of Mailbox was sped
up and the pre-registration period ended in April.[9] In April 2014, Drop box released Mailbox
for Android and announced a public beta version for OS X,[10][11] which was released in
August.[12]
In December 2015, Drop box announced the discontinuation of Mailbox, saying that they
were not able to "fundamentally fix email" with it and that they rather focus on "[streamlining]
the workflows that generate so much email".[13] It was ultimately discontinued on February 26,
2016, as announced earlier.
WORKING PROCEDURE
Create new folder in the name of Mailbox and copy blinky.c,lcd.c,
,RTX_config.c &lcd.h FROM
Follow steps from STEP2 TO STEP7 under Screen Shot For Experimental
Demonstration
#include <stdio.h>
104
EC6711 EMBEDDED LABORATORY USER MANUAL
#include "lcd.h"
} T_MEAS;
/*----------------------------------------------------------------------------
*---------------------------------------------------------------------------*/
T_MEAS *mptr;
105
EC6711 EMBEDDED LABORATORY USER MANUAL
for (;;) {
mptr->counter = 1;
IOSET0 = 0x00000010;
IOCLR0 = 0x00000020;
IOCLR0 = 0x00000040;
os_dly_wait (300);
mptr->counter = 2;
IOSET0 = 0x00000020;
IOCLR0 = 0x00000010;
IOCLR0 = 0x00000040;
os_dly_wait (300);
mptr->counter = 3;
IOSET0 = 0x00000040;
IOCLR0 = 0x00000010;
IOCLR0 = 0x00000020;
os_dly_wait (300);
106
EC6711 EMBEDDED LABORATORY USER MANUAL
T_MEAS *rptr;
for (;;) {
IOSET0 = 0x00000080;
goto_cursor(0x40);
// Set Cursor Line-1
os_dly_wait (50);
IOCLR0 = 0x00000080;
goto_cursor(0x40);
// Set Cursor = Line-2
IODIR0 = 0x000000FF;
lcd_init();
107
EC6711 EMBEDDED LABORATORY USER MANUAL
lcd_write_control(0x01); // Clear
Display (Clear Display,Set DD RAM Address=0)
goto_cursor(0x00); // Set
Cursor Line-1
Once the code is written it has to be added to the project to do that right click on source
group and select “ADD FILES TO SOURCE GROUP” option .Now you add,mailbox.c,
blinky.c,lcd.c & ,RTX_config.c FROM MAILBOX FOLDER
108
EC6711 EMBEDDED LABORATORY USER MANUAL
ARM
An ARM processor is one of a family of CPUs based on the RISC (reduced instruction set
computer) architecture developed by Advanced RISC Machines (ARM).ARM makes 32-bit
and 64-bit RISC multi-core processors. RISC processors are designed to perform a smaller
number of types of computer instructions so that they can operate at a higher speed, performing
more millions of instructions per second (MIPS). By stripping out unneeded instructions and
optimizing pathways, RISC processors provide outstanding performance at a fraction of the
power demand of CISC (complex instruction set computing) devices.ARM processors are
extensively used in consumer electronic devices such as smartphones, tablets, multimedia
players and other mobile devices, such as wearables. Because of their reduced instruction set,
they require fewer transistors, which enables a smaller die size for the integrated circuitry (IC).
The ARM processor‟s smaller size, reduced complexity and lower power consumption makes
them suitable for increasingly miniaturized devices.ARM processor features include:
Load/store architecture.
The simplified design of ARM processors enables more efficient multi-core processing and
easier coding for developers. While they don't have the same raw compute throughput as the
products of x86 market leader Intel, ARM processors sometimes exceed the performance of Intel
processors for applications that exist on both architectures.The head-to-head competition
between the vendors is increasing as ARM is finding its way into full size notebooks. Microsoft,
for example, offers ARM-based versions of Surface computers. The cleaner code base
of Windows RT versus x86 versions may be also partially responsible -- Windows RT is more
streamlined because it doesn‟t have to support a number of legacy hardware.ARM is also
moving into the server market, a move that represents a large change in direction and a hedging
of bets on performance-per-watt over raw compute power. AMD offers 8-core versions of ARM
processors for its Opteron series of processors. ARM serversrepresent an important shift in
server-based computing. A traditional x86-class server with 12, 16, 24 or more cores increases
performance by scaling up the speed and sophistication of each processor, using brute force
speed and power to handle demanding computing workloads.In comparison, an ARM server uses
109
EC6711 EMBEDDED LABORATORY USER MANUAL
perhaps hundreds of smaller, less sophisticated, low-power processors that share processing tasks
among that large number instead of just a few higher-capacity processors. This approach is
sometimes referred to as “scaling out,” in contrast with the “scaling up” of x86-based
servers.The ARM architecture was originally developed by Acorn Computers in the 1980s.
110
EC6711 EMBEDDED LABORATORY USER MANUAL
STEPPER MOTOR
SPECIFICATION
7 Darlington Arrays in 16-Pin DIP Package part : ULN 2003
Current & voltage rating of L293D: 500mA and up to 50V respectively.
Four-Phase Motor Has A Step Angle Of 7.5 Degrees And Requires 12 Vdc
For Operation.
111
EC6711 EMBEDDED LABORATORY USER MANUAL
TEMPERATURE SENSOR-LM35
The LM35 series are precision integrated-circuit temperature sensors, whose output voltage
is linearly proportional to the Celsius (Centigrade) temperature. The LM35 thus has an advantage
over linear temperature sensors calibrated in ° Kelvin, as the user is not required to subtract a
large constant voltage from its output to obtain convenient Centigrade scaling.
The LM35 does not require any external calibration or trimming to provide typical accuracies
of ±¼°C at room temperature and ±¾°Cover a full -55 to +150°C temperature range. Low cost is
assured by trimming and calibration at the wafer level. It can be used with single power supplies,
or with plus and minus supplies. The LM35 is rated to operate over a -55° to +150°C
temperature range, while the LM35C is rated for a -40° to +110°C range (-10° with improved
accuracy).
SPECIFICATION
Lm 35 Interfaced PCB Board Module With 3 Burg Pin Connectors.
Sensitivity: 10mv Per Degree.
Celsius Functional Range: -40 Degree Celsius To 150 Degree Celsius.
Linear + 10.0 mv/˚C Scale Factor N 0.5˚C Accuracy.
Operates From 4 To 30 Volts.
Less Than 60 µa Current Drain.
Low Self-Heating, 0.08˚C in Still Air.
Nonlinearity Only ±1⁄4˚C Typical.
Low Impedance Output, 0.1 Ω For 1 Ma Load.
ARM2148 Kit
In LPC2148, LM35 Temp sensor connected at P0.28 (AD0.1)
112
EC6711 EMBEDDED LABORATORY USER MANUAL
WORKING PROCEDURE
MAIN FILE:steppermot.c,temp.c
Follow steps from STEP2 TO STEP7 under Screen Shot For Experimental Demonstration
#include <LPC21xx.H>
#include "lcd.h"
#include <stdio.h>
//unsigned char STEP[] = {0x09, 0x08, 0x0C, 0x04, 0x06, 0x02, 0x03, 0x01};
113
EC6711 EMBEDDED LABORATORY USER MANUAL
unsigned char STEP[] = {0x06, 0x04, 0x0C, 0x08, 0x09, 0x01, 0x03, 0x02};
char lcd_buff[16];
void delay(void);
void motor_cw(void) ;
void motor_ccw(void);
unsigned int k;
int cw =1;
int main(void)
PINSEL0 = 0x000F8000;
IODIR0 = 0x000F8000;
PINSEL1 = 0x00F80000;
IODIR1 = 0x00F80000;
// PINSEL0 |= 0x00000000;
// IODIR0 |= 0x000000FF;
lcd_init();
114
EC6711 EMBEDDED LABORATORY USER MANUAL
lcd_write_control(0x01); // Clear
Display (Clear Display,Set DD RAM Address=0)
goto_cursor(0x00); // Set
Cursor Line-1
lcd_print("RAANA STEP.MOTOR"); //
Display LCD Line-1
goto_cursor(0x40);
lcd_print(" CW ");
while (1)
if ((sw2) == 0 )
else
goto_cursor(0x40);
cw=0;
if ((sw3) == 0)
else
115
EC6711 EMBEDDED LABORATORY USER MANUAL
goto_cursor(0x40);
lcd_print(" CW ");
cw=1;
if(cw == 1)
motor_cw();
else
motor_ccw();
int i;
void delay2(int n)
int i,j;
for(i=0;i<n;i++)
for(j=0;j<0x3FF0;j++)
116
EC6711 EMBEDDED LABORATORY USER MANUAL
void motor_cw(void)
int i = 7;
while (i >= 0)
delay2(10);
delay2(10);
i--; }}
void motor_ccw(void)
delay2(10);
delay2(10);
i++; }
117
EC6711 EMBEDDED LABORATORY USER MANUAL
#include "lcd.h"
//#include "dac.h"
char lcd_buf[30];
void ADC_Init(void);
int avg_count,avg_adc_data;
void Delay () {
for (i=0;i<50;i++)
for (j=0;j<500;j++); }
int main()
int dac_data;
dac_data=1024/2;
lcd_init();
lcd_write_control(0x01); // Clear
Display (Clear Display,Set DD RAM Address=0)
goto_cursor(0x00); // Set
Cursor Line-1
118
EC6711 EMBEDDED LABORATORY USER MANUAL
ADC_Init();
IOPIN1&=~(0xFFFF0000);
Delay();
avg_count=0;
while(1)
adc_data += Read_ADC();
avg_count++;
if(avg_count>10)
avg_count=0;
avg_adc_data= adc_data/10;
avg_adc_data *=.283;
goto_cursor(0x40);
// Set Cursor = Line-2
lcd_print(lcd_buf);
adc_data=0;
119
EC6711 EMBEDDED LABORATORY USER MANUAL
if ((sw2) == 0 )
IOCLR0 = 0x00000040;
else
dac_data++;
if(dac_data>1024)
dac_data=1024;
// DacOut(dac_data);
if ((sw3) == 0 )
else
dac_data--;
if(dac_data<=1)
dac_data=1;
// DacOut(dac_data);
120
EC6711 EMBEDDED LABORATORY USER MANUAL
void ADC_Init(void)
AD0CR = 0x00200F02;
/*
CLKDIV = 0x0F
CLKS and BURST = 0x0 means that 11 Intruction Cycles used,resulting in 10-Bit
Data
*/
//Delay(100000);
do
adc_data = AD0DR1;
121
EC6711 EMBEDDED LABORATORY USER MANUAL
adc_data = adc_data>>6;
return (adc_data);
Once the code is written it has to be added to the project to do that right click on source
group and select “ADD FILES TO SOURCE GROUP” option .Now you add
lcd.c,stepper_mot.c , dac.c.lcd.c&temp.c
OR
122
EC6711 EMBEDDED LABORATORY USER MANUAL
WORKING PROCEDURE
ZIGBEE
ZigBee is a wireless networking standard that is aimed at remote control and sensor
applications which is suitable for operation in harsh radio environments and in isolated locations.
SPECIFICATION
Range Up To 20 Ft.
Transmit Power Output 2mw (+3dbm),
Boost Mode Enabled 1.25mw (+1dbm),
Boost Mode Disabled 63mw (+18 Dbm) 10mw.
Baud Rate 250,000 Bps 250,000 Bps Serial Interface.
Receiver Sensitivity: -96 Dbm,
Boost Mode Enabled: -95 Dbm, Boost Mode Disabled.
RS232 3.3volts 232 Converter Based.
Onboard Regulated Power Supply.
WORKING PROCEDURE
Create new folder in the name of INTERFACING ZIGBEE PROTOCAL WITH ARM
and copy serial.c,rtc_serial.c,retarget.c,main.c,lcd.c,lcd.h&serial.h from
Follow steps from STEP2 TO STEP7 under Screen Shot For Experimental Demonstration
123
EC6711 EMBEDDED LABORATORY USER MANUAL
#include "Serial.h"
#include "lcd.h"
char uart1_buf[];
/**
************************************************************************
**
****1111
124
EC6711 EMBEDDED LABORATORY USER MANUAL
Output : void
Note :
************************************************************************
*******
*/
int j=0,i=0;
for(j=0;j<count;j++)
delay of 10 us */
for(i=0;i<35;i++);
/****************/
/* main program */
/****************/
lcd_init();
lcd_write_control(0x01); // Clear
Display (Clear Display,Set DD RAM Address=0)
goto_cursor(0x00); // Set
Cursor Line-1
uart1_puts(uart1_buf);
delay(30000);
delay(30000);
delay(30000);
Once the code is written it has to be added to the project to do that right click on source
group and select “ADD FILES TO SOURCE GROUP” option .Now you add
xbee.c,serial.c,rtc_serial.c,retarget.c,main.c,lcd.c
Or
126
EC6711 EMBEDDED LABORATORY USER MANUAL
Contact :
Raana Semiconductors Pvt Ltd
Tank Street,
Contact: 8220355225.
127