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

embedded processors lab

The document outlines the Embedded Processors Laboratory course at Prince Shri Venkateshwara Padmavathy Engineering College for the academic year 2023-2024, detailing the course objectives, experiments, and expected outcomes. It includes a bonafide certificate section, a list of experiments related to ARM processors, and the department's vision and mission. Additionally, it maps course outcomes to program outcomes and specific outcomes, emphasizing practical skills in embedded systems and engineering principles.

Uploaded by

bk9940584023
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views

embedded processors lab

The document outlines the Embedded Processors Laboratory course at Prince Shri Venkateshwara Padmavathy Engineering College for the academic year 2023-2024, detailing the course objectives, experiments, and expected outcomes. It includes a bonafide certificate section, a list of experiments related to ARM processors, and the department's vision and mission. Additionally, it maps course outcomes to program outcomes and specific outcomes, emphasizing practical skills in embedded systems and engineering principles.

Uploaded by

bk9940584023
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 85

PRINCE SHRI VENKATESHWARA PADMAVATHY

ENGINEERING COLLEGE
(An Autonomous Institution)

Mambakkam - Medavakkam Main Road,


Ponmar, Chennai- 600127

DEPARTMENT OF ELECRTICAL AND ELECTRONICS ENGINEERING

EE3018- EMBEDDED PROCESSORS LABORATORY


OBSERVATION AND RECORD

Academic Year: 2023– 2024

Name of the Student :

Register Number :

Year / Semester :

1
PRINCE SHRI VENKATESHWARA
PADMAVATHY ENGINEERING COLLEGE
(An Autonomous Institution)

BONAFIDE CERTIFICATE

Signature of Faculty In-Charge Signature of Principal

Submitted for Practical Examination held on ……………………….

Internal Examiner External Examiner


2
TABLE OF CONTENTS

S.NO DATE TITLE OF EXPERIMENTS PAGE MARKS SIGN


. NO.

01. STUDY OF ARM EVALUATION SYSTEM

INTERFACING OF ADC
02.

INTERFACING LED AND PWM


03.

04. INTERFACING REAL TIME CLOCK

05. INTERFACING KEYBOARD AND LCD

06. INTERFACING EEPROM AND INTERRUPT

FLASHING OF LEDS
07.

08. INTERFACING OF DAC

09. INTERFACING OF TEMPERATURE SENSOR

10. INTERFACING OF STEPPER MOTOR

11 INTERFACING OF ZIGBEE

12 INTERFACING OF LCD

13 MAIL BOX

TOPIC BEYOND THE SYLLABUS

01. INTERFACING OF SEVEN SEGMENT DISPLAY

02. INTERFACING OF BUZZER

3
DEPARTMENT OF ELECTRICAL AND ELECTRONICS ENGINEERING
DEPARTMENT VISION:
To be a model of excellence in technical education and research by producing
world-class Graduates, prepared for life-long engagement in the rapidly changing fields of
electrical and Related fields.

DEPARTMENT MISSION:
M1. To provide a dynamic and scholarly environment wherein students learn
independently and In collaboration with others to develop a disciplined as well as
innovative approach to their Careers as professional engineers, researchers or teachers.

M2. Ensure that every student is aware of the role and responsibilities of the engineer in
society Through the appropriate exposure to ethics, equity, public and worker safety and
health Considerations, together with the concepts of sustainable development and
environmental Stewardship.

EE3018 EMBEDDED PROCESSORS LABORATORY

COURSE OBJECTIVES:

The student should be made to:


To introduce the archit
ecture of the ARM processor.
To train students in ARM programming.
To discuss memory management, append location development with an ARM processor.
To involve Discussions/ Practice/Exercise in revising & familiarizing the concepts
To impart the knowledge on single board embedded processors.

LIST OF EXPERIMENTS
1.Study of ARM evaluation system
2. Interfacing ADC and DAC.
3. Interfacing LED and PWM.
4. Interfacing real time clock and serial port.
5. Interfacing keyboard and LCD.
6. Interfacing EPROM and interrupt.
7. Mailbox.
8. Interrupt performance characteristics of ARM and FPGA.
9. Flashing of LEDS.
10. Interfacing stepper motor and temperature sensor.
11. Implementing zigbee protocol with ARM.

COURSE OUTCOMES:

Upon completion of this course, student will be able to

CO1: Interpret the basics and functionality of processor functional


blocks. CO2: Observe the specialty of RISC processor Architecture.
CO3: Incorporate the I/O hardware interface of processor with peripherals.
4
CO4: Emphasis the communication features of the processor.
CO5: Improved Employability and entrepreneurship capacity due to knowledge up
gradation on recent trends in commercial embedded processors.

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

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

PROGRAMME EDUCATIONAL OBJECTIVE:

PEO 1: Find employment in Core Electrical and Electronics Engineering and service sectors.

PEO 2: Get elevated to technical lead position and lead the organization competitively.

PEO 3: Enter into higher studies leading to post-graduate and research degrees. Become
consultant and provide solutions to the practical problems of core organization.

PROGRAMME SPECIFIC OUTCOMES:

PSO1 To design and develop systems for real time problems in the areas related to electronics
andcommunication engineering using latest Embedded Systems, Embedded Processors and
VLSI.

PSO2 To develop innovative eco-friendly solutions and products in the field of electronics
andcommunication engineering using cutting-edge hardware and software tools along with
analytical skills.

Mapping of Course Outcomes with the PO’s and PSO’


s

CO PO1 PO2 PO3 PO4 PO5 PO6 PO7 PO8 PO9 PO10 PO11 PO12 PSO1 PSO2
/PO
CO1 3 3 3 2 2 3 1 2
CO2 3 3 3 2 2 2 1 1 2 2 3
CO3 3 2 2 2 2 2 2 2 2 2
CO4
3 3 3 2 2 2 2 1 1 3
CO5
3 2 3 2 1 2 2 1
1- Low, 2-Medium, 3-High, ’-‘No correlation

6
Ex.No:01 STUDY OF ARM EVALUATION SYSTEM
Date:

AIM:
To learn about the evolution, core features, general characteristics and applications of ARM
processors

THEORY:
The LPC2148 microcontrollers are based on a 32/16 bit ARM7TDMI-S CPU with
real-time emulation and embedded trace support, that combines the microcontroller with
embedded high speed flash memory ranging from 32 kB to 512 kB. A 128-bit wide memory
interface and unique accelerator architecture enable 32-bit code execution at the maximum
clock rate. For critical code size applications, the alternative 16-bit Thumb mode reduces
code by more than 30 % with minimal performance penalty.

Due to their tiny size and low power consumption, LPC2148 are ideal for applications
where miniaturization is a key requirement, such as access control and point of-sale. A blend
of serial communications interfaces ranging from a USB 2.0 Full Speed device, multiple
UARTS, SPI, SSP to I2Cs and on-chip SRAM of 8 kB up to 40 kB, make these devices very well
suited for communication gateways and protocol converters, soft modems, voice recognition
and low end imaging, providing both large buffer size and high processing power. Various
32-bit timers, single or dual 10-bit ADC(s), 10-bit DAC, PWM channels and 45 fast GPIO lines
with up to nine edge or level sensitive external interrupt pins make these microcontrollers
particularly suitable for industrial control and medical systems.

FEATURES:
• 16/32-bit ARM7TDMI-S microcontroller in a tiny LQFP64 package.
• 8 to 40 kB of on-chip static RAM and 32 to 512 kB of on-chip flash program memory.
• -System/In-
Application programming (ISP/IAP) via on-chip boot-loader software.
• Single flash sector or full chip erase in 400 ms and programming of 256 bytes in 1 ms.
• Embedded ICE RT and Embedded Trace interfaces offer real-time debugging with the
on- chip Real Monitor software and high speed tracing of instruction execution.
• USB 2.0 Full Speed compliant Device Controller with 2 kB of endpoint RAM. In addition,
the LPC2146/8 provides 8 kB of on-chip RAM accessible to USB by DMA.
• One or two (LPC2141/2 vs. LPC2144/6/8) 10-bit A/D converters provide a total of
6/14 analog inputs, with conversion times as low as 2.44 s per channel.
• Single 10-bit D/A converter provide variable analog output.
• 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 with independent power and dedicated 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.

1

5 V tolerant fast general purpose I/O pins in a tiny LQFP64 package.


CPU clock available from programmable on-chip PLL with settling time of
100s
• On-chip integrated oscillator operates with an external crystal in range from 1 MHz to
30 MHz and with an external oscillator up to 50 MHz
• Power saving modes include idle and Power-down.
• Individual enable/disable of peripheral functions as well as peripheral clock scaling
for additional power optimization.
• Processor wake-up from Power-down mode via external interrupt, USB, Brown Out
Detect (BOD) or Real-Time Clock (RTC).
• Single power supply chip with Power-On Reset (POR) and BOD circuits:
CPU operating voltage range of 3.0 V to 3.6 V (3.3 V 10 %) with 5 V tolerant I/O .
ARCHITECTURE OVERVIEW:
The LPC2148 consists of an ARM7TDMI-S CPU with emulation support, the ARM7
Local Bus for interface to on-chip memory controllers, the AMBA Advanced
High-performance Bus AHB for interface to the interrupt controller, and the VLSI Peripheral
Bus (A compatible superset of ARM’s AMBA Advanced Peripheral Bus) for connection to
on-chip peripheral functions.
The LPC2148 configures the ARM7TDMI-S processor in little-endian byte order. AHB
peripherals are allocated a 2 megabyte range of addresses at the very top of the 4 gigabyte
ARM memory space. Each AHB peripheral is allocated a 16 kB address space within the AHB
address space. LPC2148 peripheral functions are connected to the VPB bus. The AHB to
VPB Bridge interfaces the VPB bus to the AHB bus. VPB peripherals are also allocated a 2
megabyte range of addresses, beginning at the 3.5 gigabyte address point. Each VPB
peripheral is allocated a 16 kB address space within the VPB address space. The connection
of on-chip peripherals to device pins is controlled by a Pin Connect Block. This must be
configured by software to fit specific application requirements for the use of peripheral
functions and pins.

ARM7TDMI PROCESSOR:

The ARM7TDMI-S is a general purpose 32-bit microprocessor, which offers high


performance and very low power consumption. The ARM architecture is based on Reduced
Instruction Set Computer (RISC) principles, and the instruction set and related decode
mechanism are much simpler than those of micro programmed Complex Instruction Set
Computers. This simplicity results in a high instruction throughput and impressive real-time
interrupt response from a small and cost-effective processor core. Pipeline techniques are
employed so that all parts of the processing and memory systems can operate continuously.
Typically, while one instruction is being executed, its successor is being decoded, and a third
instruction is being fetched from memory. The ARM7TDMI-S processor also employs a
unique architectural strategy known as THUMB, which makes it ideally suited to high-volume
applications with memory restrictions, or applications where code density is an issue. The
key idea behind THUMB is that of a super-reduced instruction set. Essentially, the ARM7TDMI-
S processor has two instruction sets:
2
■ The standard 32-bit ARM instruction set.
■ A 16-bit THUMB instruction set.

3
The THUMB set’s 16-bit instruction length allows it to approach twice the density of
standard ARM code while retaining most of the ARM’s performance advantage over a
traditional 16-bit processor using 16-bit registers. This is possible because THUMB code
operates on the same 32-bit register set as ARM code. THUMB code is able to provide up to
65% of the code size of ARM, and 160% of the performance of an equivalent ARM processor
connected to a 16-bit memory system.

BLOCK DIAGRAM:

Viva Questions:
4
Viva-Voce Questions

1. What is an embedded system?

2. Mention the difference between microprocessor and microcontroller.

3. Enumerate the terms object oriented and object based language

4. Define Pipelining.

5. List the basic units of Microprocessor

5
Aim & Program Output(5) Viva voce(5) Total(20) Relevance
Algorithm(5) execution(5 to
) POs/PSOs

RESULT:

6
Ex.No:02
Date: INTERFACING ADC

AIM:
To develop a C-Language program for reading an on-chip ADC, convert into decimal and
to display it in PC.

APPARATUS & SOFTWARE REQUIRED:


LPC2148 syllabus board.
IAR IDE software.
Flash Magic.

THEORY:
The LPC 2148 has 10-bit successive approximation analog to digital converter. Basic
clocking for the A/D converters is provided by the VPB clock.The ADC cell can
measurethe voltage on any of the ADC input signals.VSK-2148 has one potentiometer for
working with A/D Converter. Potentiometer outputs are in the range of 0V to 3.3V. Short
the J4 jumper for reading the Potentiometer value by ADC.

PROCEDURE:
Create a New project
Type the below code and save it with the name adc.c
Compile & Debug the code in IAR.
Connect the RS232 cable /USB cable provided to the PC / Laptop and
theVSK- 2148 labus Board, and Power on the Board.
To view the output in real-time, select the PROG mode, reset the
board and download the code in VSK-2148 board using Flash Magic
through UART0.
Change the Mode-Selection-Switch to EXEC position and reset the board.
Open Win X – Talk and select the COM port and the Desired Baud rate as
9600 and observe the output.

7
PROGRAM:

#include<stdio.h>
#define PCLKFREQ 12000000
voidserial_init(unsigned long baud_rate)
{ unsignedint BAUDRATEDIVISOR;
PINSEL0 |= 0x00000005;// TO SELCET THE UART0 TX AND RX PIN
VPBDIV=0X01;// TO SET THE PERIPHERAL CLOCK AS SAME AS THE
PROCESSOR CLOCK BAUDRATEDIVISOR=(PCLKFREQ/(baud_rate*16));
U0LCR=0X80;// TO SET THE DLAB BIT FOR ACCESSING THE DIVISOR
LATCH REGISTER
U0DLL = BAUDRATEDIVISOR & 0x00ff; U0DLM = (BAUDRATEDIVISOR >>
8) & 0x00ff;
U0LCR=0X03;// TO SET THE WORD LENGTH AS 8 BIT

intputchar(int a)

if(a=='\n')

while((U0LSR&0X20)!=0X20);// FOR CHEKING THE TRANSMITTER BUFFER


// REGISTER IS EMPTY OR NOT
U0THR=0X0D;

if(a=='\t')

while((U0LSR&0X20)!=0X20);// FOR CHEKING THE TRANSMITTER BUFFER


// REGISTER IS EMPTY OR NOT
U0THR=0X20;

while((U0LSR&0X20)!=0X20);// FOR CHEKING THE TRANSMITTER BUFFER


// REGISTER IS EMPTY OR NOT
return(U0THR=a); //TO TRANSMIT THE CHARACTER

void main(void)

8
unsignedintval=0,volt;
PINSEL1_bit.P0_28=1
;
serial_init(19200); PINSEL1=0X01000000;
//ADC0.1
AD0CR_bit.CLKDIV =0x02; // VPB clock (PCLK) is divided by 2
AD0CR_bit.BURST=1; //To prevent the repeated conversion
AD0CR_bit.CLKS=0; //clk indicate 11 clocks / 10 bits
AD0CR_bit.PDN=1;
//A/D converter is operational AD0CR_bit.SEL = 0x02;
while(1)
{while(AD0DR_bit.DONE==0); // Start A/D
Conversion val=AD0DR1_bit.RESULT;;
volt=((val/3)*10);
printf("ADC value = %d \t Volt= %d mv \n",val,volt);

9
VIVA QUESTIONS:

List the types of ADC and DAC

Define resolution.

Summarize the features of Conversion time in ADC.

4.. What is the function of Sample-and-hold circuits in analog-to digital converters?

Why are internal ADCs preferred over external ADCs?

10
Aim & Program Output(5) viva(5) Total(20) Relevance
Algorithm(5) execution(5 to
) POs/PSOs

RESULT:

11
Ex.No:03
Date:
INTERFACING LED AND PWM

AIM:
To write a C program to generate a PWM and to vary the brightness of the
LED depending on the duty cycle.

APPARATUS & SOFTWARE REQUIRED:


LPC2148 syllabus board.
IAR IDE software.
Flash Magic.
CRO
LED board Setup

THEORY:
The PWM is based on the standard timer block and inherits all of its features, although
only the PWM function is pinned out on the LPC2148. The timer is designed to count
cycles of the peripheral clock (PCLK) and optionally generate interrupts or perform
otheractions when specified timer values occur, based on seven match registers. The
PWM function is also based on match register events. VLEDD-02 board conned to
VSK-2148 using port P4,P5.

PROCEDURE:
Create a New project
Type the below code and save it with the name pwm.c
Compile & Debug the code in IAR.
Connect the RS232 cable /USB cable provided to the PC / Laptop and
theVSK- 2148 labus Board, and Power on the Board.
To view the output in real-time, select the PROG mode, reset the board and download
the code on to the board using Flash Magic through UART0/USB and change the Mode-
Selection-Switch to EXEC position and reset the board.
Press the Switch and we can observe the variation in the intensity of the LEDs
depending on the duty cycle of the PWM .

12
PROGRAM:
#include<nxp\iolpc2148.h>
#define sw IO0PIN_bit.P0_30int
x;
void delay()

for(inti=0;i<=1500;i++);

voidpwm(int x)

PINSEL0 = 0X00088005; // To select Port pin P0.7 and also p0.9 as pwm4 and
pwm6 PWMPR = 0X00000000; // To set Prescaler register value to one
PWMPCR = 0X00004400; // choose the pwm2,pwm6
PWMMCR = 0X00000002; // To Reset pwm timer counter when matches
occurPWMMR0 = 12000 ; // To set total time period of pwm output
PWMMR2 = x;
PWMMR6 = x;
PWMTCR = 0X00000002; // To reset pwm timer PWMTCR
= 0X00000009; //counter and PWM enable

void main()

while(1)

For(inti=0;i<=12000;i++)
{

pwm(x);
delay();

{
x=0;

}}}

13
VIVA QUESTIONS:

How do the variations in an average value get affected by PWM period?

Name the common formats available for LED display

Why are the pulse width modulated outputs required in most of the applications?

How do you determine the duty cycle of the waveform ?

What is the function of GPIO?

14
Relevance to
Aim & Algorithm(5) Program Execution(5) Output(5) Viva-voce(5) Total(20) Pos/PSOs

RESULT:

15
Ex.No:04
Date:
INTERFACING REAL TIME CLOCK

AIM:
To develop a C-Language program for reading the RTC, convert into decimal and to display it.

APPARATUS & SOFTWARE REQUIRED:


LPC2148 syllabus board.
IAR IDE software.
Flash Magic.

THEORY:
The Real Time Clock (RTC) is a set of counters for measuring time when system poweris
on, and optionally when it is off. It uses little power in Power-down mode. On the
LPC2141/2/4/6/8, the RTC can be clocked by a separate 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
Vsupply used by the rest of thedevice.

PROCEDURE:
Create a New project
Type the below code and save it with the name rtc.c
Compile & Debug the code in IAR.
Connect the RS232 cable /USB cable provided to the PC / Laptop and
theVSK- 2148 labus Board, and Power on the Board.
To view the output in real-time, select the PROG mode, reset the board and download
the code in the board using Flash Magic through UART0.
Change the Mode-Selection-Switch to EXEC position and reset the board.
Open Win X- Talk, Select COM port and Baud rate as 9600.Now observe the output
data in the PC, it should display the digital clock running with Hr., Min., & Sec. Digits
following format: “HH:MM:SS“along with the Day as “DD:MM:YYYY”

16
PROGRAM:

#include<stdio.h>
#include<string.h>
#include "uart.h"
/* - - - - - Real Time Clock Initialization */
voidRTC_Init()

ILR = 3; // Disable 32'768 interrupt


CCR = 0x11; // Clock enable + 32'767Hz quartz
enable CIIR = 0x01; // Interupt every second
PREINT = 0x0000016D; //the integer portion of the prescale
value PREFRAC = 0x00001B00; //fractional portion of the
prescale value YEAR = 2016; // Year
MONTH = 8; // Month DOM
= 17; // Day of
month DOY = 58;// Day of year
DOW = 04; // Day of week
HOUR = 10; // Hours
MIN = 21; // Minutes
SEC = 00; // Seconds

/* - - - - - Start the Clock */


voidRTCStart( void )

CCR |= 0x01; //CTC Reset


ILR = 0x01; //Interrupt location Register

/* - - - - - Read Clock */
voidRead_rtc( void )

printf("TIME->%d:%d:%d\t",HOUR,MIN,SEC);

17
OUTPUT:

18
/* - - - - - main function starts */
void main()
{baudrate_settings(); // call function baudrate_settings
RTC_Init(); //call function RTC_Init
RTCStart(); //call function RTCStart
while(1)
{Read_rtc(); //call function Read_rtc
}

19
VIVA QUESTIONS:

What is I2C and how does it work?

Summarize the features of I2C in LPC2148 ARM7 microcontroller.

Through which port the date and time is displayed in RTC?

What is a serial port?

List the registers used to transfer data in serial port

20
Relevance to
Aim & Algorithm(5) Program Execution(5) Output(5) Viva-voce(5) Total(20) Pos/PSOs

RESULT:

21
Ex.No:05
Date: INTERFACING KEYBOARD AND LCD

AIM:
To develop a C-Language program for displaying the Key pressed in the Keypad in the
LCD module.

APPARATUS & SOFTWARE REQUIRED:


LPC2148 syllabus board.
IAR IDE software.
Flash Magic.

THEORY:
KEYPAD:
The Matrix keyboard is used to minimize the number of I/O lines. Normally it is
possible to connect only one key or switch with an I/O line. If the number of keys in the
system exceeds the more I/O lines are required. To reduce the number of I/O lines the
keys are connected in the matrix circuit.Each key acts like a switch. When a key is
pressed a column wire makes contact with row wire and completes a circuit.
LCD
Liquid crystals are a phase of matter whose order is intermediate between that of a liquid
and that of a crystal. The molecules are typically rod-shaped organic matters about 25
Angstroms in length and their ordering is a function of temperature. The molecular
orientation can be controlled with applied electric fields.

PROCEDURE:
Create a New project
Type the below code and save it with the name keypad.c
Compile&Debug the code in IAR.Connect the RS232 cable / USB cable provided tothe PC
/ Laptop and the VSK -2148 Boards, and Power on the Board.
To view the output in real-time, select the PROG mode, reset the board and
downloadthe code in VSK-2148 board using Flash Magic through UART0.
Change the Mode-Selection-Switch to EXEC position and reset the board.Observe
theLCD output, it should display the Alphabets & Numbers.
First line (upper line) should display the Alphabets Press any Key and the Second
line(lower line) should display the corresponding data as the Key is Pressed.

22
PROGRAM:

#include<stdio.h>
# include "lcd.h"
#include "key.h"
/* - - - - - main function starts here */
void main()

PINSEL2 = 0x00000000; //P0.16 TO P0.23 Configured as


GPIO. IO0DIR = 0X00F00F05; //P0.20 TO P0.23 (O/P), P0.16 TO
P0.19(I/P)
//Serial initialization
IO1DIR=0x00FF0000; // LCD data pins as output
comm(command); // function to call LCD commands
data1("Press any Key"); // call the function to display the data in LCD
while(1)

scomm(0xC0); //function to write single datas in LCD location


CO key(); //call the keypad function
}}

23
VIVA QUESTIONS:

Outline the operations involved when the key in a 4 x 4 keyboard matrix is being pressed.

List the registers used to store the keyboard, display modes and other
operations programmed by CPU.

What is switch bouncing ? How to prevent it using de-bounce circuit?

How to adjust the contrast of the LCD?

Which command of an LCD is used to shift the entire display to the right?

24
Relavance
Aim & Program Output(5) Viva-voce(5) Total(20) to
Algorithm(5) Execution(5) Pos/PSOs

RESULT:

25
Ex No: 06
Date: INTERFACING EEPROM AND INTERRUPT

AIM:
To develop a C-Language program to write and read a data in EEPROM and
alsoto analyze its performance with the interrupt

APPARATUS & SOFTWARE REQUIRED:


LPC2148 syllabus board.
IAR IDE software.
Flash Magic.

THEORY:
Serial-interface EEPROM‟s are used in a broad spectrum of consumer,
automotive,telecommunication, medical, industrial and PC related markets. Primarily
used to store personal preference data and configuration/setup data, Serial EEPROM‟s
are the most flexible type of nonvolatile memory utilized today. Compared to other NVM
solutions,Serial EEPROM devices offer a lower pin count, smaller packages, lower
voltages, as well as lower power consumption.

PROCEDURE:
Create a New project
Type the below code and save it with the name eeprom.c
Compile& Debug the code in IAR.Connect the RS232 cable / USB cable provided tothe PC
/ Laptop and the VSK -2148 Boards, and Power on the Board.
To view the output in real-time, select the PROG mode, reset the board and download
the code in VSK-2148 board using Flash Magic through UART0 and change the Mode-
Selection-Switch to EXEC position and reset the board.
Open Win X – Talk and select the COM port and the Desired Baud rate as 9600.
The main function will execute continuously. The Timer Interrupt function will execute
for every 1 second. For every 1 second the Interrupt data will be printed in the PC.

26
PROGRAM:

#include<stdio.h>
#include "intrinsics.h"
#include "interrupt.h"
void main()

PINSEL0=0X0000000
5;
IO0DIR=0X00003000;
VPBDIV=0X01;
U0LCR=0X83;
U0DLL=0X4E;
U0DLM=0X00;
U0LCR=0X03;
T0IR=0XFF;

T0PR=0;
T0MR0=0X00225510
0; T0MCR=3;
T0TCR=1;

T1TC=0;
T1PR=0;
T1MR0=0X00225510
0; T1MCR=3;
T1TCR=1;
i2c_config();
i2c_write();
timerenable();
while(1)

printf(" Welcome \n");


}}

27
OUTPUT:

28
VIVA QUESTIONS:

What will be the initial values in all the cells of an EPROM?

What are the contents of the IE register, when the interrupt of the memory location
0x00 is caused?

Why normally LJMP instructions are the topmost lines of the ISR?

Enumerate the features of nested interrupt.

Illustrate the Master Slave mode

29
Relevance
to
Aim & Algorithm (5) Program Execution (5) Output (5) Viva-voce(5) Total (20) Pos/PSOs

RESULT:

30
Ex No: 07
Date: FLASHING OF LEDS

AIM:
To develop a „C‟ program to make the LED blink (including delay routine).

APPARATUS & SOFTWARE REQUIRED:


LPC2148 syllabus board.
IAR IDE software.
Flash Magic.

THEORY:
LEDs are based on the semiconductor diode. When the diode is forward biased
(switched on), electrons are able to recombine with holes and energy is released in the
form of light. This effect is called electroluminescence and the color of the light is
determined by the energy gap of the semiconductor. VSK-2148 has 12 LEDs that are
connected to the P4,P5Port .

PROCEDURE:
Create a New project
Type the below code and save it with the
name led.c 3.Compile, Debug & Simulate the
above code in IAR.
To view the output in real-time, select the PROG mode, reset the board and
downloadthe code in board using Flash Magic through UART0.
Change the Mode-Selection-Switch to EXEC position and reset the board.
Run/Execute the program on the VSK – 2148 board and observe the LED blink
duration (on/off).

31
PROGRAM:

delay()

for(inti=0x00;i<=0xff;i++)
for(int j=0x00;j<=0xff;j++);

void main()
{ PINSEL2=0X00000000;
IO1DIR=0XFF000000;
while(1)
{ IO1SET=0XFF000000;
delay();

delay();

32
VIVA QUESTIONS:

What is the function of GPIO?

What are the Pins which are used to connect LEDs?

How to identify 'Polarity' of LED?

What is a use of Jumper?

Which port is used in ARM 7 processor kit

33
Relevance
to
Aim & Algorithm (5) Program Execution (5) Output (5) Viva-voce (5) Total (20) Pos/PSOs

RESULT:

34
35
Ex No: 08
Date: INTERFACING OF DAC

AIM:
To develop a C-Language program for convert into decimal and to DAC and to generate a
square wave.

APPARATUS REQUIRED:
LPC2148 syllabus board.
IAR IDE software.
Flash Magic.
CRO
USB cable.

THEORY:
The two 10-bit buffered DAC channels can be used to convert digital signals into analog
voltage signal outputs. The features of the DAC in LPC2148 are 10 bit digital to analog
converter, Resistor string architecture, Buffered output, Power-down mode, Selectable
speed vs power.

PROCEDURE:
Create a New project
Type the below code and save it with the name
dac.c 3.Compile, Debug & Simulate the above
code in IAR.
Connect the RS232 cable/USB cable provided to the PC/Laptop and
theVSK- 2148 Board, and Power on the Board.
To view the output in real-time, select the PROG mode, reset the board and
download the code on to the board using Flash Magic through UART0/USB.
6.Change the Mode- Selection-Switch to EXEC position and reset the board.
7.Connectthe +ve terminal of the CRO probe to Aout and -ve terminal to AGND
pins on the board to see the variation in the pulse.

36
PROGRAM:
#include<nxp\iolpc2148.h>
#define DAC_BIAS
0x00010000void
delay(unsigned int x)
{ for(inti=0;i<=x;i++);

void main()
{ PINSEL1=0X00080000;
while(1)

DACR = (1023 << 6) | DAC_BIAS;

DACR = (0 << 6) | DAC_BIAS;

37
VIVA QUESTIONS:

Name the essential parts of a DAC?

What are the features of DAC?

Which pin provides a voltage reference level for the D/A converter?

What are the types of DAC?

What is meant by conversion time in DAC?

38
Relevance
to
Aim & Algorithm (5) Program Execution (5) Output (5) Viva-voce (5) Total (20) Pos/PSOs

RESULT:

39
40
Ex. No: 09
Date: INTERFACING OF TEMPERATURE SENSOR

AIM:
To develop a C program for Temperature Sensor and to display the temperature in PC.

APPARATUS & SOFTWARE REQUIRED:


LPC2148 syllabus board.
IAR IDE software.
Flash Magic.

THEORY:
Temperature Sensor measure the amount of heat energy or even coldness that is
generated by an object or system.It is used to detect any physical change to that
temperature.The temperature rises whenever the voltage increases.The Sensor records
thevoltage drop.

PROCEDURE:
Create a New project.
Type the below code and save it with the name temp.c
Compile & Debug the code in IAR.
Connect the RS232 cable / USB cable provided to the PC / Laptop and
theVSK- 2148 Board, and Power on the Board.
To view the output in real-time, select the PROG mode, reset the board and
downloadthe code in VSK-2148 board using Flash Magic through UART0.
Open Win X- Talk and select the COM port and the desired baud rate as 9600.
The variations in the temperature is displayed in the PC

41
PROGRAM:

#include<stdio.h>
#include "uart.h"
#include "adc.h"

main(void)
{ PINSEL1_bit.P0_28=1;
init();
uart_inital()
; adc();
PINSEL1=0x01000000;
while(1)

while(AD0DR_bit.DONE==0);
val=AD0DR1_bit.RESULT; volt=val/3.07;
printf(“temperature=%d degree Celsius \r \n”,volt);

42
OUTPUT:

43
VIVA QUESTIONS:

Why LM35 is used to Measure Temperature?

Compare the difference between LM 34 and LM 35 sensors?

What is the operating temperature range in LM35?

How many pins are available in LM35?

What is the main function of analog pin in LPC 2148?

44
Relevance
Algorithm (5) Program Execution (5) Output (5) Viva-voce (5) Total (20) to Pos/PSOs

RESULT:

45
Ex: No: 10
Date: INTERFACING OF STEPPER MOTOR

AIM:
To write C Programs for running stepper motor either in clock-wise or counterclockwise.

APPARATUS & SOFTWARE REQUIRED:


LPC2148 syllabus board.
IAR IDE software.
Flash Magic.
Stepper motor

THEORY:
Stepper motors, effectively have multiple "toothed" electromagnets arranged around a
central metal gear. To make the motor shaft turn, first one electromagnet is given
power,which makes the gear's teeth magnetically attracted to the electromagnet's teeth.
Whenthe gear's teeth are thus aligned to the first electromagnet, they are slightly offset
from the next electromagnet.So when the next electromagnet is turned on and the first
will turn off, the gear rotates slightly to align with the next one and from there the
processis repeated. Each of thoselight rotations is called a "step".There are two basic
arrangements for the electromagnetic coils: bipolar and unipolar.

PROCEDURE:
Create a New project.
Type the below code and save it with the name step.c
Compile & Debug the code in IAR. Connect the RS232 cable / USB cable provided tothePC
/ Laptop and the VSK- 2148 Board, and Power on the Board.
connect/interface the stepper motor at the motor port available in the VSK -
2148 Board with proper polarity and change the Mode-Selection-Switch to
EXECposition and reset the board.
The stepper motor will rotate in the forward and reverse direction.

46
PROGRAM:

delay()
{inti; for(i=0;i<5000;i++);

voidfwd()

IO0PIN = 0X90;
delay();
IO0PIN = 0X50;
delay();
IO0PIN = 0X60;
delay();
IO0PIN = 0XA0;
delay();}
void rev()

IO0PIN = 0XA0;
delay();
IO0PIN = 0X60;
delay();
IO0PIN = 0X50;
delay();
IO0PIN = 0X90;
delay();}
void main()
{ IO0DIR=0xF0;
for(inti=0;i<=50;i++)

fwd();

for(inti=0;i<=50;i++)

rev();
}}

47
VIVA QUESTIONS:

What is stepper motor interfacing?

How stepper motor can be typically interfaced with microcontroller?

What is the need for driver circuit in a stepper motor?

What are the commonly used stepper motor driver IC’s?

How can stepper motor speed and direction be controller?

48
Relavance
Aim & Program Output(5) Viva-voce(5) Total(20) to
Algorithm(5) Execution(5) Pos/PSOs

RESULT:

49
Ex: No: 11
Date: INTERFACING OF ZIGBEE

AIM:
To develop a C-program for wireless protocol(Zig-bee).

APPARATUS AND SOFTWARE REQUIRED:


LPC2148 syllabus board.
IAR IDE software.
Flash Magic.
Xbee modules

THEORY:
The X Bee/X Bee-PRO ZNet 2.5 (formerly known as Series 2 and Series 2 PRO) RF
Modules were directed to operate within the ZigBee protocol. The modules provide
reliable delivery of data between remote devices. Zigbee is the communication
protocollike wifi and Bluetooth.
Xbee is the module using Zigbee protocol.

PROCEDURE:
Create a New project.
Type the below code and save it with the name
xbee.c 3.Compile, Debug & Simulate the above code
in IAR.
Connect the RS232 cable / USB cable provided to the PC / Laptop and the
VSK -2148 Boards, and Power on the Board.
To view the output in real-time, select the PROG mode, reset the
board and download the code in VSK-2148 board using Flash Magic
through UART0.
Connect 1 Xbee module with the board and load the transmitter program and repeat
thesame for receiver.
Change the Mode-Selection-Switch to EXEC position.
The keys that are pressed in the transmitter board will be displayed in the receiver.

50
PROGRAM:
TRANSMITTER:
#include<nxp\iolpc2148.h>
#include<stdio.h>
void timer0_conf()

VPBDIV = 0X01; //12MHZ


T0TCR = 0X00; //STOP TIMER
T0PR = 0X12000; //load prescasle or timer
value T0TCR = 0X02; //reset timer0

void delay(unsigned intms)

T0TC = 0x00; //reset the timer0


counter T0TCR = 0X02;
//reset timer0
T0TCR = 0X01; //start timer0
while(T0TC<=ms); //wait for matching timer
counter T0TCR = 0x00; //stop timer0

void uart0_conf()

PINSEL0 = 0X05;
VPBDIV = 0X01;
U0LCR = 0X83; // 8bit data,divisior
latch U0DLL = 0X4E; //9600 baudrate
U0DLM
= 0X00; //msb
U0LCR = 0X03; //8bit data

intputchar(intdat)

U0THR = dat; //tx holding reg


while(!(U0LSR & 0x20)); //wait for tx holding reg
empty returndat;

void main()

PINSEL1 = 0X00000000;
IO0DIR = 0X00F00005; //P0.20 t0 P0.23 as o/p or P0.16 t0 P0.20 as i/P

51
timer0_conf()
; uart0_conf();
while(1)

IO0PIN=0x00E00000; // First Scan Line


if(( IO0PIN & 0x000F0000 )!= 0x000F0000) //Check if any key is pressed in 4th row//

switch(IO0PIN & 0x000F0000) //Check which one of the key is pressed

case 0x00070000 :
printf("F");
break;
case 0x000B0000 :
printf("B");
break;
case 0x000D0000 :
printf("7");
break;
case 0x000E0000 :
printf("3");
break;

IO0PIN=0x00D00000; //Move second data to scan line


if(( IO0PIN & 0x000F0000 )!= 0x000F0000) //Check if any key is pressed in 3rd row//

switch(IO0PIN & 0x000F0000) //check which one of the key is pressed

case 0x00070000 :
printf("E");
break;
case 0x000B0000 :
printf("A");
break;
case 0x000D0000 :
printf("6");
break;
case 0x000E0000 :
printf("2");

52
break;

IO0PIN=0x00B00000; //Move 3rd scan data to port line


if(( IO0PIN & 0x000F0000 )!= 0x0F000000)//Scan any key is pressed in 2nd row//

switch(IO0PIN & 0x000F0000) //Check which one of the key is pressed in 2nd row//

case
0x00070000 :
printf("D"); break;
case 0x000B0000 :
printf("9");
break;
case 0x000D0000 :
printf("5");
break;
case 0x000E0000 :
printf("1");
break;

IO0PIN=0x00700000; //Move 4th scan data to port line


if(( IO0PIN & 0x000F0000 )!= 0x000F0000) //Check any key is pressed in 1st row

switch(IO0PIN & 0x000F0000) //Check which one of the key is pressed in 1st row

case 0x00070000 :
printf("C");
break;
case 0x000B0000 :
printf("8");
break;
case 0x000D0000 :
printf("4");
break;
case 0x000E0000 :
printf("0");
break;
}}
}}

53
RECEIVER:

uart0_conf()

VPBDIV = 0X01; //12Mhz


clk U0LCR = 0X83; //8bit data,
U0DLL = 0X4E; //9600 baudrate LSB
U0DLM = 0X00; //MSB
U0LCR = 0X03; //8bit data

void main()

PINSEL0 = 0X00000005; //uart0 enable


PINSEL2 = 0X00000000; //port 1
configura
IO1DIR = 0XFF000000; //pin conf the output p0.31 to
p0.24 uart0_conf();
while(1)

char t =U0RBR; //USART0 Rx Buffer


if(t==0x30)

IO1CLR = 0xff000000;
IO1SET = 0x11000000;

if(t==0x31)

IO1CLR = 0xff000000;
IO1SET = 0x11000000;

if(t==0x32)

IO1CLR = 0xff000000;
IO1SET = 0x22000000;

if(t==0x33)

IO1CLR = 0xff000000;
IO1SET = 0x33000000;

54
if(t==0x34)

IO1CLR = 0xff000000;
IO1SET = 0x44000000;

if(t==0x35)

IO1CLR = 0xff000000;
IO1SET = 0x55000000;

if(t==0x36)

IO1CLR = 0xff000000;
IO1SET = 0x66000000;

if(t==0x37)

IO1CLR = 0xff000000;
IO1SET = 0x77000000;

if(t==0x38)

IO1CLR = 0xff000000;
IO1SET = 0x88000000;

if(t==0x39)

IO1CLR = 0xff000000;
IO1SET = 0x99000000;

if(t==0x41)

IO1CLR = 0xff000000;
IO1SET = 0xaa000000;

if(t==0x42)

IO1CLR = 0xff000000;
IO1SET = 0xbb000000;

55
if(t==0x43)

IO1CLR = 0xff000000;
IO1SET = 0xcc000000;

if((t==0x44))

IO1CLR = 0xff000000;
IO1SET = 0xdd000000;

if(t==0x45)

IO1CLR = 0xff000000;
IO1SET = 0xee000000;

if(t==0x46)

IO1CLR = 0xff000000;
IO1SET = 0xff000000;

56
VIVA QUESTIONS:

How to verify the communication between Transmitter and Receiver?

Which module is using Zigbee protocol?

How many UART ports available in LPC2148?

Write the two modes of communication are used in a ZigBee network.

Mention the transmission range for Zigbee protocol.

57
Relevance
to
Aim & Algorithm (5) Program Execution (5) Output (5) Viva-voce (5) Total (20) Pos/PSOs

RESULT:

58
59
Ex: No: 12
Date: INTERFACING OF LCD

AIM:
To develop a C-Language program for displaying the Key pressed in the keypad in the
LCD Module.

APPARATUS AND SOFTWARE REQUIRED:


LPC2148 syllabus board.
IAR IDE software.
Flash Magic.

THEORY:
Liquid crystals are a phase of matter whose order is intermediate between that of a liquid
and that of a crystal. The molecules are typically rod-shaped organic matters about 25
Angstroms in length and their ordering is a function of temperature. The molecular
orientation can be controlled with applied electric fields.

PROCEDURE:
Create a New project.
Type the below code and save it with the name
LCD.c 3.Compile&Debug the code in IAR.
Connect the RS232 cable / USB cable provided to the PC / Laptop and the
VSK -2148 Boards, and Power on the Board.
To view the output in real-time, select the PROG mode, reset the
board and download the code in VSK-2148 board using Flash Magic
through UART0.
Change the Mode-Selection-Switch to EXEC position and reset the board. Observe
theLCD output

60
PROGRAM:
#include<nxp\iolpc2148.h>
#define rs IO0PIN_bit.P0_8
#define en IO0PIN_bit.P0_11
unsigned char
commandarray[5]={0x38,0x01,0x06,0x0c,0x80};void
delay(double x)

unsignedinti;

void command()

inti;

for(i=0;i<5;i++)

en=1;

en=0;

voidsinglecommandmove(unsigned char command1)

IO1PIN=command1<<1
6; rs=0;
en=1;

61
en=0;

voidmovedata(unsigned char dataarray[])

inti;

for(i=0;dataarray[i]!='\0';i++)

IO1PIN=dataarray[i]<<16;
rs=1;
en=1;

en=0;

void main()

IO0DIR_bit.P0_8=1; IO0DIR_bit.
P0_11=1;
IO1DIR=0x00FF0000;
command();
while(1)

singlecommandmove(0x80);
movedata("ARM7 STARTER KIT");
singlecommandmove(0xc0);
movedata(" VSK-2148 ");

62
VIVA QUESTIONS:

What are the features of LCD?

Draw the pin diagram of LCD?

What is common anode and common cathode?

How to adjust the contrast of the LCD?

Which command of an LCD is used to shift the entire display to the right?

63
Relevance
Aim & Algorithm(5) Program Execution (5) Output (5) Viva-voce (5) Total (20) to
Pos/PSOs

RESULT:

64
Ex: No: 13
Date: MAILBOX

AIM:
To develop a C-program code to create a mailbox and to understand the RTOS functions.

APPARATUS & SOFTWARE REQUIRED:


LPC2148 syllabus board.
IAR IDE software.
Flash Magic.

THEORY:
Real-time and embedded systems operate in constrained environments in which
computer memory and processing power are limited.The "kernel" of a real-time operating
system ("RTOS") provides an "abstraction layer" that hides from application software the
hardware details of the processor (or set of processors) upon which the
applicationsoftware will run.The most basic category of kernel services is Task
Management. This set of services allows application software developers to design their
software as a number of separate "chunks" of software.Each separate "chunk" of
software is called a "task." The main RTOS service in this category is the scheduling of
tasks as the embedded system is in operation.The second category of kernel services is
Intertask Communication and Synchronization. These services make it possible for tasks
to pass information from one to another, without danger of that information ever being
damaged. They also make it possible for tasks to coordinate, so that they can
productively cooperate with one another. Without the help of these RTOS services, tasks
might well communicate corrupted information or otherwise interfere with each other.

PROCEDURE:
Compile, Debug & Simulate the above code in IAR.
Connect the RS232 cable /USB cable provided to the PC / Laptop and the
VSK-2148labus Board, and Power on the Board.
To view the output in real-time, select the PROG mode, reset the
board and download the code in VSK-2148 board using Flash Magic
through UART0.
Change the Mode-Selection-Switch to EXEC position and reset the board.
Open Win X – Talk and select the COM port and the Desired Baud rate as 9600.
The tasks will run alternatively. The first task will post a data whereas the second
taskwill receive the data and display it in PC.

65
PROGRAM:

#include <includes.h>
#define TASK_STK_SIZE 128
OS_STK AppStk_send[TASK_STK_SIZE];
OS_STK AppStk_recv[TASK_STK_SIZE]; static
void App_send(void *p_arg);
static void App_recv(void *p_arg);void
uart0_init()

VPBDIV = 0x01; //PCLK=CCLK


U0LCR = 0x83; //DLAB=1,8-data
bits U0DLL = 0x4E;
U0DLM = 0x00; //Set Baudrate as
9600bps U0LCR = 0x03;
PINSEL0_bit.P0_0=1;
PINSEL0_bit.P0_1=1;

OS_EVENT *pmailbox;
void main(intargc, char *argv[])

uart0_init();
BSP_IntDisAll();
BSP_Init();
OSInit();
OSTaskCreate(App_send,NULL,(OS_STK*)&AppStk_send[TASK_STK_SIZE-
1],(INT8U)10);

1],(INT8U)11);
OSStart(); /* Start multitasking
*/ printf("\n\r Never Arrives here");
/****************** NEVER ARRIVES HERE*********************/

voidApp_send(void *p_arg)

INT8U i,err, *buffer[6];


buffer[0] = "test01";
buffer[1] = "test02";
buffer[2] = "test03";

66
buffer[3] = "test04";
buffer[4] = "test05";
buffer[5] = "test06";
buffer[6] = "test07";
p_arg = p_arg;

(i=0;i<=6;)

if((err=OSMboxPost(pmailbox,buffer[i]))==OS_NO_ERR)

printf(" This is sender \r\n\t post data to Mailbox,data is: %s\r\n",buffer[i]);i++;

else
if(err==OS_MBOX_FULL)
printf(" This is sender \r\n\t the Mailbox has data,data
is: %s\r\n", pmailbox->OSEventPtr);
else
printf(" Other err\r\n");
OSTimeDlyHMSM(0, 0, 5, 0);

OSTimeDlyHMSM(0, 0, 5, 0);
OSMboxDel (pmailbox,OS_DEL_NO_PEND, &err);
if(err==OS_ERR_TASK_WAITING)
printf(" Some task wait for this Mailbox\r\n");

voidApp_recv(void *p_arg)

INT8U err;
INT16U
timeout=100; INT8U
*buffer;
p_arg = p_arg;
for (;;)

OSTimeDly(200);
if(err==OS_NO_ERR)
printf(" This is receiver \r\n\t get data from Mailbox data is: %s\r\n",buffer);else

67
if(err==OS_TIMEOUT)
printf(" Timeout\r\n");
else
if(err==OS_ERR_EVENT_TYPE)

printf(" This is receiver \r\n\t err is


OS_ERR_EVENT_TYPE\r\n"); break;

else
break
;
printf("\r\n");
OSTimeDlyHMSM(0, 0, 6, 0);

68
OUTPUT:

69
REGISTER NUMBER:

VIVA QUESTIONS:

1. Mention the operations that can be performed on a mailbox.

2. When does the mailbox will get deleted?

3. Illustrate the operation of reading operation from a mailbox.

4. How to configure the mailbox?

5. What is branch prediction?

EC3018 - EMBEDDED PROCE SSORS LABORATORY


REGISTER NUMBER:

Relevance to
Aim & Algorithm(5) Program Execution(5) Output(5) Viva-voce(5) Total(20) Pos/PSOs

RESULT:

EC3018 - EMBEDDED PROCE SSORS LABORATORY


REGISTER NUMBER:

CONTENT BEYOND SYLLABUS

EC3018 - EMBEDDED PROCE SSORS LABORATORY


REGISTER NUMBER:

Ex.No:01
Date: INTERFACING OF 7 - SEGMENT DISPLAY

AIM:
To develop a C-program code to interface 7-segement display and to understand the RTOS functions.

APPARATUS & SOFTWARE REQUIRED:


1.LPC2148 syllabus board.
2.IAR IDE software.
Flash Magic.

THEORY:
The , also written as “seven segment display”, consists of seven LEDs (hence
its name) arranged in a rectangular fashion as shown. Each of the seven LEDs is called a segment
because when illuminated the segment forms part of a numerical digit (both Decimal and Hex) to be
displayed.

An additional 8th LED is sometimes used within the same package thus allowing the indication
of a decimal point, (DP) when two or more 7-segment displays are connected together to display
numbers greater than ten. Each one of the seven LEDs in the display is given a positional segment with
one of its connection pins being brought straight out of the rectangular plastic package. These
individually LED pins are labelled from a through to g representing each individual LED. The other LED
pins are connected together and wired to form a common pin. So by forward biasing the appropriate
pins of the LED segments in a particular order, some segments will be light and others will be dark
allowing the desired character pattern of the number to be generated on the display. This then allows us
to display each of the ten decimal digits 0 through to 9 on the same 7-segment display.

The displays common pin is generally used to identify which type of 7-segment display it is. As
each LED has two connecting pins, one called the “Anode” and the other called the “Cathode”, there are
therefore two types of LED 7-segment display called: Common Cathode (CC) and Common Anode (CA).

The difference between the two displays, as their name suggests, is that the common cathode
has all the cathodes of the 7-segments connected directly together and the common anode has all the
anodes of the 7- segments connected together and is illuminated as follows.

1. The Common Cathode (CC) – In the common cathode display, all the cathode connections of the
LED segments are joined together to logic “0” or ground. The individual segments are illuminated by
application of a “HIGH”, or logic “1” signal via a current limiting resistor to forward bias the individual
Anode terminals (a-g).

2. The Common Anode (CA) – In the common anode display, all the anode connections of the LED
segments are joined together to logic “1”. The individual segments are illuminated by applying a ground,
logic “0” or “LOW” signal via a suitable current limiting resistor to the Cathode of the particular segment
(a-g).

EC3018 - EMBEDDED PROCE SSORS LABORATORY


REGISTER NUMBER:

PROGRAM:

delay (50);
}

void counter()
{
unsigned char
data[10]={0x3F,0x06,0x5B,0x4F,0x66,0x6D,0x7D,0x07,0x7F,0x6F}; unsigned
char s=0;
int cnt;

for(s=0;s<10;s++) // loop to run the counter


{

i2c_write(0x40,data[s]); // writing data to 1st digit (LSB)


i2c_write(0x42,data[s]); // writing data to 2nd digit
i2c_write(0x44,data[s]); // writing data to 3rd digit
i2c_write(0x46,data[s]); // writing data to 4th digit (MSB)
i2c_write(0x48,data[s]);
i2c_write(0x4A,data[s]);
delay(counter_delay); // Counter Delay ( 1 second approx. )
}

}
void main(void)
{
unsigned char i,address[6]={0x40,0x42, 0x44, 0x46, 0x48,

0x4A}; i2c_config(); // confugring I2C for 7 segment driver .

for(i=0;i<6;i++) {i2c_write(address[i],0x00);} // making all 7 segment blank.


while(1)
{
counter();
}
}

EC3018 - EMBEDDED PROCE SSORS LABORATORY


REGISTER NUMBER:

VIVA QUESTIONS:

What is meant by 7- Segment Display?

What are the Pins of 7-Segment Display IC?

What is meant by Common Cathode?

What is meant by Common Anode?

What is meant by IOSET?

What is meant by ?

EC3018 - EMBEDDED PROCE SSORS LABORATORY


REGISTER NUMBER:

Program Relevance to
Aim & Algorithm(5) Execution (5) Output(5) Viva-voce(5) Total (20) Pos/PSOs

RESULT:

EC3018 - EMBEDDED PROCE SSORS LABORATORY


REGISTER NUMBER:

Ex.No:02
Date: INTERFACING OF BUZZER

AIM:
To develop a C-program code to interface buzzer and to understand the RTOS functions

APPARATUS & SOFTWARE REQUIRED:

1.LPC2148 syllabus board.


2.IAR IDE software.
Flash Magic.

THEORY:
An audio signaling device like a beeper or buzzer may be electromechanical or piezoelectric or
mechanical type. The main function of this is to convert the signal from audio to sound. Generally, it is powered
through DC voltage and used in timers, alarm devices, printers, alarms, computers, etc. Based on the various
designs, it can generate different sounds like alarm, music, bell & siren.

PROGRAM:

#include<nxp\iolpc2148.
h> void delay(double x)
{
double i;
for(i=0;i<x;i++);
}
void main(void)
{
PINSEL0_bit.P0_15=0;
IO0DIR_bit.P0_15=1;
while(1)
{
IO0PIN_bit.P0_15=1;
delay(5000);
IO0PIN_bit.P0_15=0;
delay(5000);
}
}

EC3018 - EMBEDDED PROCE SSORS LABORATORY


REGISTER NUMBER:

VIVA QUESTIONS:

What will be the initial values in all the cells of an EPROM?

What are the contents of the IE register, when the interrupt of the memory location 0x00 is caused?

Why normally LJMP instructions are the topmost lines of the ISR?

Enumerate the features of nested interrupt.

Illustrate the Master Slave mode.

EC3018 - EMBEDDED PROCE SSORS LABORATORY


REGISTER NUMBER:

Program Relevance to
Aim & Algorithm (5) Execution (5) Output (5) Viva-voce (5) Total (20) Pos/PSOs

RESULT:

EC3018 - EMBEDDED PROCE SSORS LABORATORY

You might also like