Sunteți pe pagina 1din 85

SRI MANAKULA VINAYAGAR ENGINEERING COLLEGE

(Approved by AICTE, New Delhi, Affiliated to Pondicherry University,


Accredited by NBA-AICTE, New Delhi & ISO 9001:2000 Certified Institution)
(Accredited by NAAC with ‘A’ grade)
Madagadipet, Puducherry -605107

DEPARTMENT OF INSTRUMENTATION AND CONTROL


ENGINEERING

Embedded System Design


LAB OBSERVATION
III Year / VI Semester

NAME:

REGISTER NUMBER:
Exp. Date Name of the experiments Mark Sign
No.
SYLLABUS

EMBEDDED SYSTEM DESIGN LAB

1. Parallel Port Interfacing Using MCS51.

2. Design of Real Time Clock using MCS 51 using segment displays.

3. Design of PC interface Hardware with MCS51.

4. Interfacing LCD Display using MCS51

5. Design of Single Channel Data Acquisition System Using MCS51.

6. Implementation of GPIO and Timer using ARM LPC2148.

7. Implementation of UART, ADC and DAC features of ARM LPC2148.

9. Interfacing SD card and Graphical LCD using LPC2148.

10. Implementation of USB communication using LPC2148.

11. Implementation of FFT Using TMS320C5401 DSP.

12. Design of Digital filters using TMS320C6745 DSP.


FIRST CYCLE EXPERIMENTS

EXP.N0. NAME OF THE EXPERIMENT

1 Parallel Port Interfacing Using MCS51

2 Design of Real Time Clock using MCS 51 using segment


displays
3 Design of PC interface Hardware with MCS51

4 Interfacing LCD Display using MCS51

5 Design of Single Channel Data Acquisition System Using


MCS51.
SECOND CYCLE EXPERIMENTS

EXP.N0. NAME OF THE EXPERIMENT

6 Implementation of FFT Using TMS320C5401 DSP

7 Design of Digital filters using TMS320C6745 DSP

8 Implementation of GPIO and Timer using ARM LPC2148

9 Implementation of UART, ADC and DAC features of ARM


LPC2148
10 Interfacing Graphical LCD using LPC2148

Embedded ‘C’ programs for interfacing experiments


INTRODUCTION
Introduction to KEIL SOFTWARE
Ex.No.1(a) Parallel port interface of 8051 Date :

OBJECTIVE:
a) Construct hardware design to interface switches and LEDs with parallel port of 8051
b) Write an assembly language program to interface switches and LEDs with parallel port of 8051

PROGRAM LOGIC:

 Make port2 as input port and connect 8 switches in 8 pins of port2( P2.0 to P2.7)
 Make port1 as output and 8 LEDs in 8 pins of port1 (P1.0 to P1.7)
 Check status of individual switches by comparing values 01,02,04,08,10,20,40,80 in port2
 If first switch is ON, then port 2 value is 01. Make first led to grow by sending value 01 in port1
 Above step is repeated for all switch conditions and corresponding LED are made to grow.

PROGRAM CODE:

ORG 00H
MOV P2,#0FFH ;Input port to connect switches
MOV P1,#00H ;output port to connect LEDS
AGAIN: MOV A,P2
CJNE A,#01H, LOOP1 ;check first switch
MOV P1,#01H ;LED1 ON
LOOP1: CJNE A,#02H,LOOP2 ;check second switch
MOV P1,#02H ;LED2 ON
LOOP2: CJNE A,#04H,LOOP3 ;check third switch
MOV P1,#04H ;LED3 ON
LOOP3: CJNE A,#08H,LOOP4 ;check fourth switch
MOV P1,#08H ;LED4 ON
SJMP AGAIN
LOOP4: CJNE A,#10H,LOOP5 ;check FIFTH switch
MOV P1,#10H ;LED5 ON
SJMP AGAIN
LOOP5: CJNE A,#20H,LOOP6 ;check SIXTH switch
MOV P1,#20H ;LED6 ON
SJMP AGAIN
LOOP6: CJNE A,#40H,LOOP7 ;check SEVENTH switch
MOV P1,#40H ;LED7 ON
SJMP AGAIN
LOOP7: CJNE A,#80H,LOOP8 ;check EIGHTH switch
MOV P1,#80H ;LED8 ON
LOOP8: SJMP AGAIN
END

CIRCUIT DIAGRAM

RESULT:
Thus the hardware and software design are done for interfacing switches and LEDs with parallel port of 8051.
Ex.No.2 REAL TIME CLOCK USING SEGMENT DISPLAY Date :

OBJECTIVE:
a) Construct hardware design to display minute and second of real time clock through 7 segment display using
8051

b) Write an ALP to display minute and second information of real time clock in the 7 segment which is
interfaced with 8051

PROGRAM LOGIC:

 Hex codes corresponds to numerical value 0 to 9 are stored in internal memory of 8051 as look up
table.

 Program loop is created to show the count value from 0 to 9 in low digit 7segment display by sending
Data from LOOK UP table to port 2 of 8051

 After 9th count, high digit 7 segment display count ( 0 to 5) is activated by sending corresponding data
from look up table to port 3 of 8051.

 Data are taken from look up table for every 1 second delay and it is send to port s of 8051 in which 7
segment displays are connected.

PROGRAM CODE

Label Program code Comment


ORG 0000H Starting at 00 location
BEGIN MOV P3,#00 Clear PORT 3
MOV R5,#00 Clear R5
START MOV DPTR,#TABLE Initialize DPTR with starting value of look up
table
MOV R1,#10 Initialize R1 with 10 for ten count

AGAIN CLR A Clear ACC content


MOVC A,@A+DPTR Get data from look up table, transfer to ACC
MOV P2,A Transfer ACC content to PORT 2
ACALL DELAY Call delay program
INC DPTR Go to next location in the look up table
DJNZ R1, AGAIN Decrement loop counter, if not zero, continue
this AGAIN
MOV DPTR,#TABLE If counting of low digit 7 segment is completed
(0 to 9), counting of high digit is started.
I INC R5 Increment R5
MOV A,R5 Transfer R5 content into ACC
MOVC A,@A+DPTR Get data from location pointed by (DPTR +A)
into ACC
MOV P3,A Transfer ACC content into PORT 3
MOV P2,#00 Clear PORT2
CJNE R5,#06,START Compare high digit counter value with 06,
If not equal, go to loop START.
SJMP BEGIN Go to loop BEGIN
THERE SJMP THERE Stay in this location
ORG 300 Starting at 300 location
TABLE DB 3FH,06H,5BH,4FH,66H,6DH, Fill lookup table value for numerical digit from 0
7DH,07H,7FH,67H to 9 in hexadecimal value
DELAY MOV R2,#16
HERE3 MOV R3,#255
HERE2 MOV R4,#255
Delay program
HERE1 DJNZ R4,HERE1
DJNZ R3,HERE2
DJNZ R2,HERE3
RET
END Halt

LOOK UP TABLE

DIGIT HEX
CODE
0 3F
1 06
2 5B
3 4F
4 66
5 6D
6 7D
7 07
8 7F
9 67
7 SEGMENT DISPLAY
CIRCUIT DIAGRAM

RESULT:
Thus the hardware and software design are done for generating real time clock through 7 segment display using
8051.
Ex.No.3 8051 INTERFACE WITH PERSONAL COMPUTER Date :

OBJECTIVE:

a) Construct hardware design to interface 8051 with personal computer


b) Write an ALP to send ASCII character from 8051 to personal computer.

PROGRAM LOGIC:
 Timer is set for the baud rate of 9600 bit/sec .
 Timer 1 is selected in auto reload mode by TMOD register by loading value of 20h.
 Serial communication mode1 is selected as (8 bit, 1 stop bit, 1 start bit, REN enable) by SCON register.
 ACC content is loaded with 00h value. Its value is incremented by one for predefined delay and it is send to
transmitter buffer.
 Transmitted data are sends to COM port of PC through Max232 and RS232 connecting cable.

PROGRAM CODE
Label Program code Comment
ORG 0000H Starting at 00H location
MOV TMOD,#20H Select timer 1 in auto reload mode by
putting value 20H in TMOD
MOV TH1,#0FDH Select baut rate of 9600 bit/s by putting
value of FD in TH1 reg
MOV SCON,#50H Select UART in mode 1 by putting value of
50H in SCON reg
SETB TR1 Start timer1
MOV DPTR,#MYDATA Initialize DPTR with starting address of
string of characters
LOOP CLR A Clear ACC
MOVC A,@A+DPTR Get a character from location pointed by (
DPTR + A), put it into ACC
ACALL SEND Call subroutine SEND
INC DPTR Move to next location of string
JZ HERE
SJMP LOOP Continue LOOP
HERE SJMP HERE Stay in This loop HERE

SEND: MOV SBUF,A ACC content is transferred to serial buffer.

WAIT JNB TI, WAIT Wait for transmission flag to raise for
checking completion of transmission
CLR TI Clear TI
RET Return from subroutine

MYDATA DB “EMBEDDEDLAB",0 Look up table for string is initialize with


message “EMBEDDEDLAB",0
END HALT

CIRCUIT DIAGRAM
RS232 connection with microcontroller

PIN DIAGRAM

RESULT:
Thus the hardware and software designs are done to interface 8051 microcontroller with PC
Ex.No.4 LCD INTERFACE USING 8051 Date :

AIM:
a) Construct hardware design for interfacing LC D display with 8051
b) Write an ALP program to get input from port of 8051 and send to LCD which shows ASCII
equivalent character of input value.

PROGRAM LOGIC:
 LCD display is configured for following characteristics i) LCD 2 lines, 5x7 matrix ii) Right
shift ( iii) Starting from first line.
 Configuration of LCD is done by sending command word from 8051 to LCD
 String to be displayed is stored in internal memory of 8051
 Program loop is created to get input string stores in internal memory of 8051 and send it to LCD.
 Strings of characters are treated as data word sent by 8051 to LCD.

Label Program code Comment


ORG 00H Starting at 00 location
MOV A,#38H Command word for setting LCD as 2line, 5x7
matrix display
ACALL COMNWRT Calling Subroutine for Writing command word to
LCD
MOV A,# 0EH Command word for setting LCD ON, cursor ON.
ACALL COMNWRT Calling Subroutine for Writing command word to
LCD
MOV A,#0C0H Command word for cursor in position 0 of line 2 in
LCD
ACALL COMNWRT Calling Subroutine for Writing command word to
LCD
MOV DPTR,#MYDATA Initialize DPTR with starting address of string to
be displayed
LOOP CLR A Clear ACC
MOVC A,@A+DPTR Bring a character of string from array into ACC
ACALL DATAWRT Call subroutine to Write character data to LCD
INC DPTR Go to next location of string
JZ HERE If last location of string is reached, come out of
loop. otherwise continue loop
SJMP LOOP

HERE SJMP HERE Stay in this loop HERE


COMNWRT MOV P1,A Transfer command word to port 1 in which LCD
is connected with 8051
CLR P0.4 RS=0 for command word

CLR P0.5 RW=0 for writing data to LCD


SETB P0.6 Producing HIGH to LOW transition pulse to
ACALL DELAY enable LCD.
CLR P0.6
RET Return from subroutine
DATAWRT MOV P1,A Transfer data word to port 1 in which LCD is
connected with 8051
SETB P0.4 RS=1 for data word
CLR P0.5 RW=0 for writing data to LCD
SETB P0.6 Producing HIGH to LOW transition pulse to
ACALL DELAY enable LCD.
CLR P0.6
RET Return from subroutine
DELAY MOV R3,#50
HERE2 MOV R4,#255
DJNZ R4,HERE Delay program
HERE
DJNZ R3,HERE2
Return from subroutine
RET
MYDATA Look up table for string of message as
DB EMBEDDEDLAB,0 “EMBEDDED LAB”
END halt
CIRCUIT DIAGRAM:
CODE COMMAND TO LCD INSTRUCTION REGISTER
(HEX)
01 CLEAR DISPLAY SCREEN
02 RETURN HOME
04 DECREMENT CURSOR(SHIFT CURSOR TO LEFT)
06 INCREMENT CURSOR(SHIFT CURSOR TO RIGHT)
05 SHIFT DISPLAY RIGHT
07 SHIFT DISPLAY LEFT
08 DISPLAY OFF,CURSOR OFF
0A DISPLAY OFF,CURSOR ON
0C DISPLAY ON,CURSOR OFF
0E DISPLAY ON CURSOR BLINKING
0F DISPLAY ON CURSOR BLINKING
10 SHIFT CURSOR POSITION TO LEFT
14 SHIFT CURSOR POSITION TO RIGHT
18 SHIFT THE ENTIRE DISPLAY TO THE LEFT
1C SHIFT THE ENTIRE DISPLAY TO THE RIGHT
ST
80 FORCE CURSOR TO BEGINNING OF 1 LINE
ND
C0 FORCE CURSOR TO BEGINNING OF 2 LINE
38 2 LINES AND 5x7 MATRIX

Liquid crystal display – Pin diagram

Result:
Thus the hardware and software designs are done for interfacing LCD with 8051.
Ex.No.5 SINGLE CHANNEL DATA ACQUISITION SYSTEM USING 8051 Date :

OBJECTIVE:
a) Construct hardware design to interface analog to digital converter with 8051
b) Write an ALP to develop single channel data acquisition system in which input from sensor must be
converted into digital value. Output of sensor must be seen as LED grow which is connected in the port
of 8051

PROGRAM LOGIC:

 Start of conversion signal is given to ADC through 8051.


 8051 made to wait for digital conversion to end.
 If end of conversion signal is acknowledged from ADC, digital data is transfer from ADC to 8051.
 Then digital output is transferred to port 1 of 8051 where LED is connected in each pin.
 LED grow patterns are taken as output information.

PROGRAM CODE

Label Program code Comment


ORG 00
SJMP START
START MOV P2,#0FFH make port 2 as input port
AGAIN SETB P3.2 disable read operation
CLR P3.3 Low to high signal for start of conversion
SETB P3.3
WAIT JB P3.4,WAIT wait for conversion to end
CLR P3.2 enable read operation
ACALL DELAY Call delay program
MOV A,P2 Transfer digital data into ACC
MOV P1,A Transfer data from ACC to LEDs
SJMP AGAIN
DELAY MOV R3,#50 delay program

HERE2 MOV R4,#255

HERE DJNZ R4,HERE


DJNZ R3,HERE2
Return from subroutine
RET
Halt
END
CIRCUIT DIAGRAM
PIN DIAGRAM

Result:
Thus the hardware and software designs are done for developing single channel data acquisition system using
8051.
Ex.No.6 FIR HIGH PASS FILTER USING TMS320C6745 DSP Date :
Aim
To Implement the FIR High pass filter using TMS320C6745 KIT

Requirements

CCS v4
TMS320C6745 KIT
USB Cable
5V Adapter

Algorithm
1.First include the stdio.h file,math.h file,c6745.h file.spiadc.h file and spidac.h file.

2.Define the analog to digital converter function.

3.Declare the spi write function.

4.Declare the local variables and global variables.

5.Define the highpass co-efficent values to the arrays.

6.Initialize the c6745 function,spiadc function,spidac function.

7.set the commands for the read the adc values.

8.Multiply the co-efficent values and adc values and store to the temp variables.

9.Then we add temp plus sum and move to the sum variables.

10.Then add the DC offset value(1625) with sum variable.

11.set they delay function (xval[i+1]=xval[i]).

12.Finally adc values sent to spi write function and recover the original signal from dac.
Flowchart
START

Include Header files

Stdio.h,math.h,c6745.h,spiadc.h and spi dac.h

Define the DAC chip select lines function

Declare the spi write function

Declare the global variables

Declare the high-pass filter co-efficient


values

A
Procedure
1. Open Code Composer Studio v4 .
2. In WorkSpace Launcher.
a. BROWSE  Select the project location and make one new folder, MAKE NEW FOLDER Type
the Workspace name, OK  OK.
3. FILE  NEW  CCS PROJECT
a. Project name: Type your project name.
b. Tick use default location. NEXT
c. Project type: C6000.
d. Tick Debug And Release. NEXT  NEXT.
e. Output type: Executable.
f. Device Variant : generic C67XX Device.
g. Device Endianness : little
h. Code Generation Tools: TI v6.1.12.
i. Run time support library: automatic.
j. Tick Treat as an Assembly-only project.
k. Target content: none. FINISH
4. FILE  NEW  SOURCE FILE
a. Source file: Type your add.asm( .asm extension is must ).
b. Type the program.
c. FILE  SAVE.
5. Paste the following board library files in workspace location.
a. Common folder (contains header files)
b. Gel folder (contains gel file)
c. Library folder(contains library files)
6. Paste the asm linker file and vectors.asm in the project location.(asm linker file and
vectors.asm is available in cd)
Note: Those folders and linker file are availble at cd.
7. PROJECT  PROPERTIES  C/C++ BUILD  BASIC OPTION
a. Target processor version(--silicon version, -mv) : 6400+
b. IN C/C++ BUILD,  INCLUDE OPTIONS (Add dir to #include search path(--include_path,-I))
select this add icon and add the following three path by indivdually
 "${Diag}../../common/header"
 "${XDAIS_CG_ROOT}/packages/ti/xdais"
 "${C6000_CSL_CG_ROOT}/include"
8. FILE  NEW  TARGET CONFIGURATION FILE
a. file name: projectname. ccxml (.ccxml extension is must)
b. Connection: Texas Instrument XDS100 v1 USB Emulator.
c. Device: TMS320C6745.  SAVE  TARTGET CONFIGURATION C674X_0 BROWSE,
browse the workspace location, open the gel folder and select the GEL file.  OPEN SAVE.
9. In C/C++ Project window, Right click the project REBUILD PROJECT.
10. Connections :
a. Connect the usb cable, in between PC to KIT.
b. Connect the 5v adapter and Power on the kit.
11. TARGET  DEBUG ACTIVE PROJECT.(Then see out at corresponding place after run)
12.paste the following header file in the project location.
a.spiadc.h
b.spidac.h
13.Set the sine wave at 3v from function generator.
14.Connect the FG output to ADC connector(jp1).
15. Connect the DSO at DAC connector(j2).
16. TARGET  RUN.
17. Output is displayed at DSO.
18. TARGET  HALT.
FDA tool for filter co-efficient generation:

Click Matlab --- Type fdatool

Response type --- Highpass


Design method --- Fir --- Equiripple
Specify order --- 50
Density factor --- 20
Frequency specifications
Units ---HZ
FS --- 6000
Fpass --- 400
Fstop --- 200

Magnitude specification
Wpass --- 1
Wstop --- 1
Generate c Header:
Targets --- Generate c Header

ingle precision floating point

 Generate ----- save(any name)

 Open the saved folter.

 Copy the filter co-efficient and paste (float h[51]) in the program.

Program
#include <stdio.h>
#include <math.h>
#include "c6745.h"
#include "spiadc.h"
#include "spidac.h"

#define DAC_CS_LOW(); SPI0_SPIPC3 = 0x0; //(CS=Low:Enable)


#define DAC_CS_HIGH(); SPI0_SPIPC3 = 0x1; //(CS=High:Disable)

void SPI_Write(unsigned short Data);

unsigned short i,j=0,High,Value=0;


signed int adc_value;

//High Pass sf=6khz sbf=200 pbf=400

float h[51] ={
-0.01060591545,-0.004117832519,-0.004079894163,-0.003353076056,-0.001853102469,
0.0004065925605, 0.003321184311, 0.006660183426, 0.01010407601, 0.01322921738,
0.01557052694, 0.01663137041, 0.01597031951, 0.01320868172, 0.008123514242,
0.000646590197, -0.0090885479, -0.02072319016, -0.03375224397, -0.04746999219,
-0.06107512116, -0.07372291386, -0.08458722383, -0.09293565154, -0.09818658978,
0.900020659, -0.09818658978, -0.09293565154, -0.08458722383, -0.07372291386,
-0.06107512116, -0.04746999219, -0.03375224397, -0.02072319016, -0.0090885479,
0.000646590197, 0.008123514242, 0.01320868172, 0.01597031951, 0.01663137041,
0.01557052694, 0.01322921738, 0.01010407601, 0.006660183426, 0.003321184311,
0.0004065925605,-0.001853102469,-0.003353076056,-0.004079894163,-0.004117832519,
-0.01060591545
};
void main( void )
{
Uint8 spiadcbuf[3];
int i,xval[120],k;
float temp,sum;

C6745_init();
spiadc_init();
spidac_init();

for(i=0;i<52;i++)
{
xval[i]=0;
}

while(1)
{
spiadcbuf[0] = 0x01; // setup command
spiadcbuf[1] = 0xBF;
spiadcbuf[2] = 0x00;

spiadc_cycle(spiadcbuf, 3); // Execute spiadc read cycle


adc_value = ((spiadcbuf[1]&0x0f) << 8)| spiadcbuf[2];

xval[0] = adc_value;

sum = 0;
for(k=0;k<51;k++)
{
temp = (xval[k])*(h[k]);
sum = sum + temp;
}

SPI_Write(sum+1625);

for(i=50;i>=0;i--)
{

xval[i+1] = xval[i];
}
}
}

/****************************/
/* GLCD SPI Sent Data 8 bit */
/****************************/
void SPI_Write(unsigned short Data)
{
unsigned short receive;

DAC_CS_LOW();
Data = ( 0x3000 | Data );

/* Clear any old data */


receive = SPI0_SPIBUF;

// Wait for transmit ready


while( SPI0_SPIBUF & 0x10000000 );

/* Write 1 byte */
SPI0_SPIDAT0 = Data;
while((SPI0_SPIBUF & 0x20000000)==1);
/* Read 1 byte */
receive = SPI0_SPIBUF;

for(i=0;i<10;i++);
DAC_CS_HIGH();
}

Input

Output
Result

Thus, the FIR High pass filter was implemented and displayed the results in console window.
Ex.No.7 FFT 8 POINT DIT USING TMW320C6745 DSP Date :
Aim
To perform the 8 point FFT using DIT process from a given discrete sequence in TMS320C6745 KIT.

Requirements

CCS v 4
TMS320C6745 KIT
USB Cable
5V Adapter

ALGORITHM

1.First initialize all the inputs and ouputs arrays.

2.Delare the twiddle factor values.

3.Delare the address value of inputs and outputs.(Real value & imaginary).

4.Load the input values to the input array t[8].

5.Take the bit reversal process.

6.First stage computation with 2-point dft.

7.second stage computation with 4-point dft.

8.Third stage computation with 8-point dft.


Flowchart
START

Include math.h file

Define PI 3.14159

Declare the global variables and assign the values

Declare the local variables in main function

Declare the input,output,real and imaginary


address

Clear the memory operation

Take the bit reversal process

A
PROCEDURE

1. Open Code Composer Studio v4 .


2. In WorkSpace Launcher.
a. BROWSE  Select the project location and make one new folder, MAKE NEW FOLDER Type
the Workspace name, OK  OK.
3. FILE  NEW  CCS PROJECT
a. Project name: Type your project name.
b. Tick use default location. NEXT
c. Project type: C6000.
d. Tick Debug And Release. NEXT  NEXT.
e. Output type: Executable.
f. Device Variant : generic C67XX Device.
g. Device Endianness : little
h. Code Generation Tools: TI v6.1.12.
i. Run time support library: automatic.
j. Tick Treat as an Assembly-only project.
k. Target content: none. FINISH
4. FILE  NEW  SOURCE FILE
a. Source file: Type your add.asm( .asm extension is must ).
b. Type the program.
c. FILE  SAVE.
5. Paste the following board library files in workspace location.
a. Common folder (contains header files)
b. Gel folder (contains gel file)
c. Library folder(contains library files)
6. Paste the asm linker file and vectors.asm in the project location.(asm linker file and
vectors.asm is available in cd)
Note: Those folders and linker file are availble at cd.
7. PROJECT  PROPERTIES  C/C++ BUILD  BASIC OPTION
a. Target processor version(--silicon version, -mv) : 6400+
b. IN C/C++ BUILD,  INCLUDE OPTIONS (Add dir to #include search path(--include_path,-I))
select this add icon and add the following three path by indivdually
 "${Diag}../../common/header"
 "${XDAIS_CG_ROOT}/packages/ti/xdais"
 "${C6000_CSL_CG_ROOT}/include"
8. FILE  NEW  TARGET CONFIGURATION FILE
a. file name: projectname. ccxml (.ccxml extension is must)
b. Connection: Texas Instrument XDS100 v1 USB Emulator.
c. Device: TMS320C6745.  SAVE  TARTGET CONFIGURATION C674X_0 BROWSE,
browse the workspace location, open the gel folder and select the GEL file.  OPEN SAVE.
9. In C/C++ Project window, Right click the project REBUILD PROJECT.
10. Connections :
a. Connect the usb cable, in between PC to KIT.
b. Connect the 5v adapter and Power on the kit.
11. TARGET  DEBUG ACTIVE PROJECT.(Then see out at corresponding place after run)
12. VIEW  MEMORY
13. In right side, memory window will open. Type the adrress and give the input at particular
location.
Give the input as follow:
a. Enter An Address:0xC0001000  Enter.(Input)
X(n)
0xC0001000 – 00000001
0xC0001004 – 00000002
0xC0001008 – 00000003
0xC000100C – 00000004
0xC0001010 – 00000004
0xC0001014 – 00000003
0xC0001018 – 00000002
0xC000101C – 00000001
14. View  Watch window  watch1.
b. Type the following array variable.
 Xr( real part output)
 Xi( imaginary part output)
15.TARGET  RUN.
16.TARGET  HALT.

See the Output at Particular location:


Example :
a.Enter An Address:0xC0001030  Enter.(Real part output)

0xC0001030 – 00000014
0xC0001034 – FFFFFFFB
0xC0001038 – 00000000
0xC000103C – 00000000
0xC0001040 – 00000000
0xC0001044 – 00000000
0xC0001048 – 00000000
0xC000104C – FFFFFFFB

b.Enter An Address:0xC0001050  Enter.(Imaginary part output)


0xC0001050 – 00000000
0xC0001054 – FFFFFFFFF
0xC0001058 – 0000000C
0xC000105C – 00000000
0xC0001060 – 00000000
0xC0001064 – 00000000
0xC0001068 – 00000000
0xC000106C - 00000002

17. Or see the ouput at watch window.


Note: watch window will show exact decimal values, processor memory location will show a
hexadecimal values.

PROGRAM

#include <math.h>

#define PI 3.14159

float x[8],t[8],s1[8],s2r[8],s2i[8],Xr[8],Xi[8],Yr[8],Yi[8];

const float W0r = 1,

W0i = 0,

W1r = 0.707,

W1i = -0.707,

W2r = 0,

W2i = -1,
W3r = -0.707,

W3i = -0.707;

void main()

int *Input,*Real_out,*Imag_out;

int i=0,j=0;

Input = (int *)0xC0001000;

Real_out = (int *)0xC0001030;

Imag_out = (int *)0xC0001050;

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

t[i] = 0;

t[i] = *(Input + i);

// Bit reversal process

x[0] = t[0];

x[1] = t[4];

x[2] = t[2];

x[3] = t[6];

x[4] = t[1];

x[5] = t[5];

x[6] = t[3];

x[7] = t[7];

// stage one process

s1[0] = (int)(x[0] + (x[1] * W0r));


s1[1] = (int)(x[0] - (x[1] * W0r));

s1[2] = (int)(x[2] + (x[3] * W0r));

s1[3] = (int)(x[2] - (x[3] * W0r));

s1[4] = (int)(x[4] + (x[5] * W0r));

s1[5] = (int)(x[4] - (x[5] * W0r));

s1[6] = (int)(x[6] + (x[7] * W0r));

s1[7] = (int)(x[6] - (x[7] * W0r));

// stage two process

s2r[0] = (s1[0] + (s1[2] * W0r));

s2i[0] = 0;

s2r[1] = s1[1];

s2i[1] = (s1[3] * W2i);

s2r[2] = (s1[0] - (s1[2] * W0r));

s2i[2] = 0;

s2r[3] = s1[1];

s2i[3] = - (s1[3] * W2i);

s2r[4] = (s1[4] + (s1[6] * W0r));

s2i[4] = 0;

s2r[5] = s1[5];

s2i[5] = (s1[7] * W2i);

s2r[6] = (s1[4] - (s1[6] * W0r));

s2i[6] = 0;

s2r[7] = s1[5];

s2i[7] = -(s1[7] * W2i);


// output

// complex multiplication for B * Wn

Yr[0] = (s2r[4] * W0r) - (s2i[4] * W0i);

Yi[0] = (s2r[4] * W0i) + (s2i[4] * W0r);

Yr[1] = (s2r[5] * W1r) - (s2i[5] * W1i);

Yi[1] = (s2r[5] * W1i) + (s2i[5] * W1r);

Yr[2] = (s2r[6] * W2r) - (s2i[6] * W2i);

Yi[2] = (s2r[6] * W2i) + (s2i[6] * W2r);

Yr[3] = (s2r[7] * W3r) - (s2i[7] * W3i);

Yi[3] = (s2r[7] * W3i) + (s2i[7] * W3r);

Yr[4] = (s2r[4] * W0r) - (s2i[4] * W0i);

Yi[4] = (s2r[4] * W0i) + (s2i[4] * W0r);

Yr[5] = (s2r[5] * W1r) - (s2i[5] * W1i);

Yi[5] = (s2r[5] * W1i) + (s2i[5] * W1r);

Yr[6] = (s2r[6] * W2r) - (s2i[6] * W2i);

Yi[6] = (s2r[6] * W2i) + (s2i[6] * W2r);

Yr[7] = (s2r[7] * W3r) - (s2i[7] * W3i);

Yi[7] = (s2r[7] * W3i) + (s2i[7] * W3r);

// complex addition for A + BWn

j=0;

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

Xr[i] = s2r[j] + Yr[i];

Xi[i] = s2i[j] + Yi[i];

j++;

}
// complex subtraction for A - BWn

j=0;

for(i=4;i<8;i++)

Xr[i] = s2r[j] - Yr[i];

Xi[i] = s2i[j] - Yi[i];

j++;

// sending output array to memory location


for(i=0;i<8;i++)
{
*Real_out ++= Xr[i];
*Imag_out ++= Xi[i];
}
for(;;);
}

Result
Thus, the 8 point FFT of given discrete sequence has performed and the result is stored at
memory location (0xC0001030 and 0xC0001050).
Ex.No.8(a) SWITCHES AND LED INTERFACE WITH ARM7 Date :

OBJECTIVE:

a) Construct hardware design to interface switches and LEDs with ARM7

b) Write a ‘C’ language program to interface switches and LEDs with ARM7

PROGRAMLOGIC:
 Select 8 pins of port1 from P1.24 to P1.31 as input pins by sending value ‘0’ to these pins
 Connect 8 switches in the input pins.
 Configure 8 pins of port1 from P1.16 to P1.23as output pins by writing value ‘1’ to these pins
 Connect 8 LEDS in output pins.
 Read status of the switches. If switch 1 is on , make LED1 ON else OFF
 Repeat the above step for all switches and do corresponding changes in LED.

THEORY
GENERAL PURPOSE I/O
LPC2148 processor has two I/O ports, port0 and port1
Port 0 – P0.31 – P0.0 – 32 I/O lines
Port 1 – P1.31 – P1.16 – 16 I/O lines
Each pin out of the Microcontroller has several functions, maximum of 4 functions. In order to use the physical
pin out for a specific function, the pin is to be configured for that function. In order to Configure, it needs 2
bits (to carry out any one of 4 functions). For this purpose, there is a register called
PINSEL register.
PINSEL0, 32 bit register is used to configure Pin outs for P0.0 to P0.15 (16 pins), since each pin needs 2 bits.
PINSEL1 register is used to configure Pin outs for P0.16 to P0.31
PINSEL2 register is used to configure Pin outs for P1 Port, P1.16 to P1.31
After, configuring the pin as I/O line, next it is to be designated as input pin or output pin. It is done by another
register namely
IODIR.
IODIR0, 32 bit register is used to designate each I/O line in Port 0. Against the particular bit, if 1 is written,
then that bit in the Port 0 is designated as Output pin. If 0 is written in the particular bit position, then that I/O
pin will act as input pin.
Similarly, IODIR1, the bits 16 to 31 is used to designate the Port1 pins either as output or as input
If the pin is configured as output pin, in order to write 1 level in that pin, IOSET register is used. In
order to write 0 level in that pin, IOCLR register is used. It is to be noted that using single register IOSET
register, it is not possible to clear the bit.
IOSET0, 32 bit register is used to write 1 in any one of the output pin of Port0
IOCLR0, 32 bit register is used to write 0 in any one of the output pin of Port0
IOSET1, 32 bit register is used to write 1 in any one of the output pin of Port1
IOCLR1, 32 bit register is used to write 1 in any one of the output pin of Port1
If the pin is configured as input pin, in order to read the data from that pin, IOPIN register is used.
IOPIN0, 32 bit register is used to read the data from any one of the I/O pins of Port0.
IOPIN1, 32 bit register is used to read the data from any one of the I/O pins of Port1.

PROGRAM CODE
#include<lpc214x.h>
#define LED0 (1<<16)
#define LED1 (1<<17)
#define LED2 (1<<18)
#define LED3 (1<<19)
#define LED4 (1<<20)
#define LED5 (1<<21)
#define LED6 (1<<22)
#define LED7 (1<<23)
unsignedint SW_RD;
int main()
{
IODIR1 |= 0x00FF0000; // GPIO pins 16 to 23 configured as output
IODIR1 &= ~(0xFF000000); //All the other remaining GPIO pins configured as input

while(1)
{
SW_RD = ((IOPIN1 & 0xFF000000)>>24 & 0xFF);

if(SW_RD&0x01) IOSET1 = LED0; else IOCLR1 = LED0;


if(SW_RD&0x02) IOSET1 = LED1; else IOCLR1 = LED1;
if(SW_RD&0x04) IOSET1 = LED2; else IOCLR1 = LED2;
if(SW_RD&0x08) IOSET1 = LED3; else IOCLR1 = LED3;
if(SW_RD&0x10) IOSET1 = LED4; else IOCLR1 = LED4;
if(SW_RD&0x20) IOSET1 = LED5; else IOCLR1 = LED5;
if(SW_RD&0x40) IOSET1 = LED6; else IOCLR1 = LED6;
if(SW_RD&0x80) IOSET1 = LED7; else IOCLR1 = LED7;
}
}
CIRCUIT DIAGRAM

RESULT:
Thus the hardware and software design are done for interfacing switches and LEDs with ARM7 processor.
Ex.No.8(b) LED INTERFACE WITH ARM7 PROCESSOR THROUGH Date :
TIMER CONTROL

OBJECTIVE:
a) Construct hardware design to interface LEDs with ARM7
b) Write a ‘C’ language program to interface LEDs with ARM7 through timer control.

PROGRAMLOGIC:
 Configure 8 pins of port1 from P1.16 to P1.23as output pins by writing value ‘1’ to these pins
 Connect 8 LEDS in output pins.
 Timer 0 of ARM7 is configure to produce delay of 0.5 Second
 Program loop is created to toggle LEDs connected in PORT1 for every 0.5 sec.

THEORY
TIMERS (Timer0 and Timer1) & SFR Regosters:
There are 2 nos. of 32 bit timers in this Microcontroller. Timer is basically a counter. For timer, internal clock
is given as input. Internally, PCLK, Peripheral clock is given as the input pulses.
Timer0 registers
TC0 – Timer Counter Register (32 bit register). For every clock pulse, this register is incremented.Before the
clock pulse is given to TCO, the clock pulses are given to the Prescale Counter namely

PC0 – 32 bit register. Along with PC0, there is another register namely Prescale Register PR0 – 32 bit register.
The PC0 gives one output pulse for each prescale register value. For example, if the PR0 has the value of
decimal 10, then the PC0 gives one output pulse for every 10 input clock pulses. The Prescale Counter output
is given as the clock pulse to Timer Counter register TC0. In this way, 32 bit Prescale divider is included in the
timer operation.
TCR0 – Timer Control Register. This register is used to reset the counter and disable/enable the Timer
Counter Register TC0.
T0MR0 – Match0 Register. It is a 32 bit register. The 32 bit content entered is compared with the content of
Timer/Counter Register TC0 continuously. When the match occurs, the following functions can be actuated.
1. If the interrupt enable bit is made 1, interrupt flag bit for MR0 is made 1 in T0IR register.
2. The Timer/Counter register can be made to reset.
3. The Timer/Counter register can be disabled.
4. In the corresponding pin MAT0.0 for MR0, output can be generated.
The first 3 functions can be actuated by writing control bits in MCR register – Match Control Register.
Similar to T0MR0, there are T0MR1, T0MR2, T0MR3 match registers. They can be also used for
comparing with the contents of Timer/Counter (TC) register. On match, the above functions for the
corresponding match register can be actuated.
T0IR – It is an 8 bit interrupt register. For every match, corresponding bit in this interrupt register is set. On
writing again the same bit in the Interrupt Service Routine, the corresponding bit will be cleared. Similar to
match registers, there are 4 capture registers namely T0CR0, T0CR1, T0CR2 and
T0CR3. The content of Timer/Counter (TC) register value is loaded into T0CR0, when an event on
physical pin CAP0.0, one particular physical input.
T0CCR is a 32 bit register which controls which edges of the capture inputs are used to load the Capture
registers and whether or not an interrupt is generated when a capture takes place. In order to use the timer as
counter, T0CTCR register is used. It is used to change to counter modeand to determine in which pin, physical
count input pulses is given.

PROGRAM CODE

#include <LPC214x.h>
#define DELAY_MS 1000 //0.5 Second(s) Delay
#define PRESCALE 60000 //60000 PCLK clock cycles to increment TC by 1

void Timer0_Init(void);
void Timer0_Run(void);

int main(void)
{
VPBDIV = 0x01; //PCLK=60Mhz
IO1DIR = 0x00FF0000; //P1.16 to P1.23 are output
Timer0_Init(); //Initialize Timer0
while(1)
{
Timer0_Run();
}
}

void Timer0_Init(void)
{
/*Assuming that PLL0 has been setup with CCLK = 60Mhz and PCLK also = 60Mhz.*/
T0CTCR = 0x0;
T0PR = PRESCALE-1; //(Value in Decimal!) - Increment T0TC at every
60000 clock cycles
//Count begins from zero hence subtracting 1
//60000 clock cycles @60Mhz = 1 mS

T0MR0 = DELAY_MS-1; //(Value in Decimal!) Zero Indexed Count - hence


subtracting 1
T0MCR = 3; //Set bit0 & bit1 to High
which is to : Interrupt & Reset TC on MR0
T0TCR = 0x02; //Reset Timer
T0TCR = 0x01; //Enable timer
}

void Timer0_Run(void)
{
unsigned char regVal;
if(T0IR) //Polling the Interrupt Flag
{
regVal = T0IR; //R ead current IR value
IO1PIN ^= 0x00FF0000; // Toggle LED pins in Port 1
T0IR = regVal; // Write back to IR to clear Interrupt Flag
}
}

CIRCUIT DIAGRAM

RESULT:
Thus the hardware and software design are done for interfacing LEDs with ARM7 processor through timer
control.
Ex.No.9(a) UART INTERFACE WITH ARM7 Date :

OBJECTIVE:
a) Construct hardware design to interface PC with ARM7 through UART
b) Write a ‘C’ language program to display given string in PC through UART of ARM7.

PROGRAMLOGIC:
 Configure UART of ARM7 in 9600 baut rate.
 Program loop is created to send given string serially through transmitter pin of UART.
 Hyper terminal of PC is configured in 9600 baut rate in COM port 1
 Data transmitted through UART is received by receiver pin of COM port1 of PC.
 Received string is displayed in hyper terminal’s editor.

THEORY
UART – Universal Asynchronous Receiver Transmitter (UART0 and UART1)
UART0 has lines TXD, RXD and Gnd lines for interfacing simple serial port.
UART1 has lines apart from the above, control lines for interfacing Modem also. Now, we are going to see
only the registers available in UART0
UART0 is used to send the byte of data serially and receive the byte of the data serially.
At the time of receiving, it receives the bits serially and assembles as parallel 8 bit data and it places in the
receiver buffer register U0RBR. It is the content of the top of the FIFO buffer registers.At the time of
transmitting, the user is supposed to place the 8 bit data in Transmit Hold Register Namely U0THR.

In serial communication, the serial data is sent in the same rate at which the receiving system also receives.
This is called baud rate (bits per second). For example, 9600 baud means 9600 bits per second.The internal
clock is divided by 16 bit no. to arrive at the required baud rate.
The Most Significant 8 bits of the divider value are stored is called U0DLM. The Least Significant 8 bits of
the divider value are stored in the register called U0DLL. At the time of writing in these registers only, DLAB
bit in the U0LCR register (Line Control Register) is to be made 1. Whenever, the U0THR register is empty, the
next byte of data can be sent to send it out serially. Similarly, whenever, a byte of data is received, it is placed
in U0RBR. As soon as it happen, interrupt may be raised to inform the user. But interrupts are to be enabled
before the use. There is an interrupt enable register namely U0IER. By writing proper bits in the register, the
above events will raise the interrupt.

There is another register U0IIR, which is used to find what are all the interrupts pending.The register FIFO
control register U0FCR is used to reset TX FIFO (Transmit First In First Out register set) and RX FIFO
(Receive First In First Out) and to enable them.
The register U0LCR, line control register is used to write serial protocol parameters namely, the word
length of the data, no. of stop bits, parity enable, parity select, Break control. The 7th bit in this register
namely DLAB is used to enter the 16 bit divisor data. Line Status register U0LSR is the status register to know
whether data has been received, data can be sent for transmission, to find out errors.There is another register
U0TER which is used to enable the serial transmitter

PROGRAM CODE

#include <LPC214x.H>

#define PCLK 30000000 // PCLK for configuration baudrate

void UART0_Init(unsigned intbaudrate);


void UART0_PutC(char c);
void UART0_PutS(char *p);
unsignedintgetchar (void);

int main(void)
{
VPBDIV = 0x02; //Divide Pclk by two
UART0_Init(9600);

while(1)
{
UART0_PutS("\f*** Embedded Design LAB ***\n\n\r");
}
}

unsignedintgetchar (void) /* Read character from Serial Port */


{
while (!(U0LSR & 0x01));
return (U0RBR);
}

void UART0_Init(unsigned intbaudrate)


{
unsigned short BAUD_REG;
BAUD_REG = PCLK/(16*baudrate); // Calculate for U0DL value
PINSEL0 |= 0x00000005; // Enable rx,tx
U0LCR = 0x00000083; // 8 bit data,1 stop bit,no parity bit
U0DLL = BAUD_REG & 0xFF; // U0DL for low byte
U0DLM = (BAUD_REG>>8); // U0DL for high byte
U0LCR = 0x00000003; // DLAB =0
}

void UART0_PutC(char c)
{
while(!(U0LSR & 0x20)); // Wait until UART0 ready to send character
U0THR = c; // Send character
}

void UART0_PutS(char *p)


{
while(*p) // Point to character
{
UART0_PutC(*p++); // Send character then point to next character
}
}
CIRCUIT DIAGRAM

RESULT:
Thus the hardware and software design are done for interfacing PC with ARM7 processor through UART.
Ex.No.9(b) DAC INTERFACE WITH ARM7 Date :

OBJECTIVE:
a) Construct hardware design to interface DAC with ARM7.
b) Write a ‘C’ language program to generate sine wave through DAC of ARM7.

PROGRAMLOGIC:
 Equation for generating sine wave is created.
 Program loop is created to send Sine wave value (0 to 360 radian ) to DAC
 DAC convert digital equivalent value of sine wave into analog signal
 CRO is connected in DAC output pin (P0.25) to display sine wave.

PROGRAM CODE
/* Program to Generate Sine wave using on chip DAC */

#include <lpc214x.h>
#include <stdio.h>
#include <math.h>

#define Rad 0.0174532925

intteta,DAC_In;
floatsine_val;

int main()

{
PINSEL1 = 0X00080000;

while(1)
{
for(teta=0;teta<360;teta++)
{
sine_val = (1.65 * sin(teta*Rad));
DAC_In = ((sine_val * 1024 /3.3)+512);
DACR = (DAC_In<<6);
}
}
}
CIRCUIT DIAGRAM

RESULT:
Thus the hardware and software design are done to generate sine wave through DAC of ARM7 processor.
Ex.No.9(c) ADC INTERFACE WITH ARM7 Date :

OBJECTIVE:
a) Construct hardware design to convert analog signal of sensor into digital value using ADC of ARM7.
b) Write a ‘C’ language program to convert analog signal of sensor into digital value in LED connected in port 1

PROGRAMLOGIC:
 Configure 8 pins of port1 from P1.16 to P1.23 as output pins by writing value ‘1’ to these pins
 Connect 8 LEDS in output pins.
 Configure P0.30 as ADC In line.
 Start analog to digital conversion and wait for conversion to end.
 8 bit digital output of ADC is send into port1 (P1.16 to P1.23) where LEDS are connected.
 LED grow patterns are observed as ADC result.

THEORY
Ato D Converter
There are 2 units of A/D Converters in this controller AD0 and AD1. There are 6 channels in AD0 unit and 8
channels in AD1 unit. It is a 10 bit ADC. The maximum analog voltage that can be given as input is 3.3V. It
uses Successive Approximation techniques to convert analog input to corresponding 10 bit digital output. It
requires clock which will be less than 4 MHz.
AD0CR register is a control register in which the details of the channel to be used, clock speed divider,
switching on the ADC Section and finally start signal to start the converter.
AD0GDR is the global data register. The done bit for the latest conversion and the 10 bit digital data are
available in this register.
AD0STAT is the A/D Status register. This register contains Done and error bits for all the channels for AD0
unit.
ADGSR is the global start register. It is used to start conversion in both A/D Converters AD0 and AD1
simultaneously.
AD0INTEN is A/D Interrupt Enable register. This register contain enable bits that allow the DONE flag of
each A/D Channel to raise common A/D interrupt.
PROGRAMCODE:
#include <lpc214x.h>

#define DONE (1<<31)


#define START (1<<24)

unsignedint ADC_OUT;

voidADC_LED_Init()
{
VPBDIV = 0x02; // clk division 60/2 = 30 Mhz
IODIR1 = 0x00FF0000; // P1.16 to P1.23 lines are Output LEDs
PINSEL1 |= (1<<28); // P0.30 config as ADC In line
AD0CR=0x00250608; // Cofig ADC Control Register
}

unsignedintADC_Convert()
{
AD0CR|=START; // ADC Start of Conversion

do
{
ADC_OUT = AD0GDR; // Read ADC value to variable
}
while ((ADC_OUT & DONE) == 0); // Wait for conversion Done
ADC_OUT = ADC_OUT<<8;
return ADC_OUT; // return the result
}

int main(void)
{
ADC_LED_Init();
while(1)
{
IO1PIN = ADC_Convert();
}
}
CIRCUIT DIAGRAM

RESULT:
Thus the hardware and software design are done to interface sensor with ADC of ARM7 processor.
Ex.No.10 GRAPHICAL LCD INTERFACE WITH ARM7 Date :

OBJECTIVE:
a) Construct hardware design to interface GLCD with ARM7.
b) Write a ‘C’ language program to display given picture in GLCD of ARM7.

Theory

The graphical LCD used in this experiment is Winstar’s WDG0151-TMI module, which is a 128×64 pixel
monochromatic display. It uses two Neotic display controller chips: NT7108C and NT7107C, which are
compatible with Samsung KS0108B and KS0107B controllers. The KS0108B (or NT7108C) is a dot matrix
LCD segment driver with 64 channel output, and therefore, the WDG0151 module contains two sets of it to
drive 128 segments. On the other hand, the KS0107B (or NT7107C) is a 64-channel common driver which
generates the timing signal to control the two KS0108B segment drivers. The KS0108B and KS0107B are very
popular controllers and have made their way into many graphical LCDs. The internal block diagram of the
WDG0151 GLCD module is shown below.

The NT1707C drives the 64 display lines, COM1 – COM64. The first NT7108C drives the left half segments
(SEG1 to SEG64) and the second one drives the right half segments (SEG65 to SEG128) of the display. The
two halves of the display can be individually accessed through the chip select pins (CS1 and CS2) of the two
NT7108C drivers. Each half consists of 8 horizontal pages (0-7) which are 8 bits (1 byte) high. This is
illustrated in the drawing below.
GLCD pages

Starting from page 0 on the left half (/CS1 = 0) if you transmit one data byte, it will appear on the first column
of page 0. If you repeat this 64 times, then switch to the second half, and repeat until 128th position is reached,
the first 8 display lines will be plotted. The next 8 lines can be plotted similarly by switching to page address 1.
The total amount of bytes needed for a complete display frame (128×64 pixels) is, therefore, 2 * 64 pixels * 8
bits = 1024 bytes.
PROGRAM CODE
#include <LPC214X.H>

#define CS2 0
#define CS1 1
#define RS 4
#define RW 5
#define EN 6
#define RST 7
extern const char PAN_LOGO[];
unsigned char D0;
unsigned char CMD[] = {0x3e,0xc0,0xb8,0x40,0x3f};
unsigned char i;

voidGLCD_Init(unsigned long *, unsigned char);

voidGLCD_Page(unsigned char);
voidGLCD_Cmd (unsigned long *, unsigned char, unsigned char);
voidGLCD_Data (unsigned long *, unsigned char, unsigned char);
voidGLCD_Draw (unsigned long *GLCDPort, unsigned char Datt, const char *Base);
void Delay();

// ------------------------------------------------------
// GLCD Picture name: phone.bmp
// GLCD Model: KS0108 128x64
// ------------------------------------------------------

const char PAN_LOGO[1024] = {


0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 8, 24, 24, 24, 56, 48,112,112,240,240,224,224,224,224,
192,192,192,192,128,128,128,128, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 3, 7,
7, 15, 15, 31, 31, 63,127,127,255,254,254,254,252,252,252,248,
240,240,240,224,224,192,192,192,128,128, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 3, 7, 7, 15, 15,
31, 63, 63,127,255,255,255,255,255,255,255,255,254,254,252,252,
248,248,240,240,224,192,192,192,192,128,128,128, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 1, 3, 3, 7, 15, 15, 31, 63,127,127,
255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
255,254,254,252,252,252,252,248,248,248,240,240,240,240,240,240,
240,240,224,224,224,224,224,224,192,192,192,192,192,192,192,192,
192,192,192,192,192,192,160,224,224,160,240,208,208,248,248,248,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 1, 3, 3, 7, 15, 31, 63,127,127,255,255,255,255,255,255,
255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
255,255,255,255,255,255,255,255,255,255,255,255,255,255,253,255,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 3, 7, 15, 31,
63,127,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
255,255,255,255,255,255,255,255,255,255,255,255,255,255,191,255,
255,255,255,255,251,127,127,127,255,255,255,255,255,255,255,255,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 1, 3, 7, 15, 31, 63,127,255,255,255,255,255,255,
255,255,255,255,255,255,255,255,255,255,255,255,255,254,252,253,
255,255,247,255,255,255,255,255,255,255,255,255,255,255,255,255,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 3, 7, 15, 31,
127,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255
};

int main()
{
PINSEL0 = 0;
PINSEL1 = 0;
IODIR0 = 0x0000FFFF;

GLCD_Init (&IO0PIN, 8);

while(1)
{
Delay(10);Delay(10);Delay(10);Delay(10);
GLCD_Draw(&IO0PIN, 8,PAN_LOGO);
}

voidGLCD_Init(unsigned long *GLCDPort, unsigned char Datt)


{
D0 = Datt;
IOPIN0 = 0;

IOSET0 = 1 << RST;


Delay();
IOCLR0 = 1 << RST;
Delay();
IOSET0 = 1 << RST;

GLCD_Page(1);

for(i=0;i<5;i++)
{
GLCD_Cmd(GLCDPort, D0, CMD[i]);
}

GLCD_Page(0);

for(i=0;i<5;i++)
{
GLCD_Cmd(GLCDPort, D0, CMD[i]);
}

voidGLCD_Page(unsigned char PagE)


{
if (PagE)
{
IOCLR0 = 1 << CS1;
IOSET0 = 1 << CS2;
}
else
{
IOCLR0 = 1 << CS2;
IOSET0 = 1 << CS1;
}
}

voidGLCD_Cmd (unsigned long *GLCDPort, unsigned char Datt, unsigned char c)


{

D0 = Datt;

if(c & 0x80) IOSET0 = 1 << (D0+7); else IOCLR0 = 1 << (D0+7);
if(c & 0x40) IOSET0 = 1 << (D0+6); else IOCLR0 = 1 << (D0+6);
if(c & 0x20) IOSET0 = 1 << (D0+5); else IOCLR0 = 1 << (D0+5);
if(c & 0x10) IOSET0 = 1 << (D0+4); else IOCLR0 = 1 << (D0+4);

if(c & 0x08) IOSET0 = 1 << (D0+3); else IOCLR0 = 1 << (D0+3);
if(c & 0x04) IOSET0 = 1 << (D0+2); else IOCLR0 = 1 << (D0+2);
if(c & 0x02) IOSET0 = 1 << (D0+1); else IOCLR0 = 1 << (D0+1);
if(c & 0x01) IOSET0 = 1 << (D0); else IOCLR0 = 1 << (D0);

IOCLR0 = 1 << RS;


IOCLR0 = 1 << RW;
IOSET0 = 1 << EN;
Delay();
IOCLR0 = 1 << EN;
}

voidGLCD_Data (unsigned long *GLCDPort, unsigned char Datt, unsigned char c)


{
D0 = Datt;

if(c & 0x80) IOSET0 = 1 << (D0+7); else IOCLR0 = 1 << (D0+7);
if(c & 0x40) IOSET0 = 1 << (D0+6); else IOCLR0 = 1 << (D0+6);
if(c & 0x20) IOSET0 = 1 << (D0+5); else IOCLR0 = 1 << (D0+5);
if(c & 0x10) IOSET0 = 1 << (D0+4); else IOCLR0 = 1 << (D0+4);

if(c & 0x08) IOSET0 = 1 << (D0+3); else IOCLR0 = 1 << (D0+3);
if(c & 0x04) IOSET0 = 1 << (D0+2); else IOCLR0 = 1 << (D0+2);
if(c & 0x02) IOSET0 = 1 << (D0+1); else IOCLR0 = 1 << (D0+1);
if(c & 0x01) IOSET0 = 1 << (D0); else IOCLR0 = 1 << (D0);

IOSET0 = 1 << RS;


IOCLR0 = 1 << RW;
IOSET0 = 1 << EN;
Delay();
IOCLR0 = 1 << EN;
}

voidGLCD_Draw (unsigned long *GLCDPort, unsigned char Datt, const char *Base)
{
int Page, Column;

D0 = Datt;

for (Page = 0; Page < 8 ; Page++)


{
GLCD_Page(1);
GLCD_Cmd (GLCDPort, D0, (0xB8 | Page));
GLCD_Cmd (GLCDPort, D0, 0x40);

for (Column = 0; Column < 128; Column++)


{
if (Column == 64)
{
GLCD_Page (0);
GLCD_Cmd (GLCDPort, D0, (0xB8 | Page));
GLCD_Cmd (GLCDPort, D0, 0x40);
}
GLCD_Data (GLCDPort, D0, *Base++);
Delay();

}
}
}
void Delay()
{
unsignedinti,j;
for(i=0;i<25;i++)
for(j=0;j<200;j++);
}
CIRCUIT DIAGRAM

RESULT:
Thus the hardware and software design are done to display picture in GLCD of ARM7 processor.
EMBEDDED ‘C’ PROGRAM FOR INTERFACING EXPERIMENTS
LCD interface program
#include <reg51.h> /* define 8051 registers */
#include <stdio.h>
#include <string.h>
sbit rs = P0^4;
sbit rw = P0^5;
sbit en = P0^6;
void lcdcmd(unsigned char);
void MSDelay(unsigned int);
void lcddata(unsigned char);
void main(void)
{
unsigned char message[]="hello";
unsigned char z;
unsigned char x;
lcdcmd(0x38);
MSDelay(250);
lcdcmd(0x0E);
MSDelay(250);
lcdcmd(0x06);
MSDelay(250);
lcdcmd(0x84);
MSDelay(250);
while(1)
{
for(z=0;z<6;z++)
{
x = message[z];
lcddata(x);
}
}
}
void lcdcmd(unsigned char value)
{
P1 = value;
rs=0;
rw=0;
en=1;
MSDelay(1);
en=0;
return;
}
void lcddata(unsigned char value)
{
P1 = value;
rs=1;
rw=0;
en=1;
MSDelay(1);
en=0;
return;
}
void MSdelay(unsigned int itime)
{
unsigned int i,j;
for(i=0;i<itime;i++)
for(j=0;j<1275;j++);
return; }
REAL TIME CLOCK PROGRAM
#include <reg51.h> /* define 8051 registers */
#include <stdio.h>
#include <string.h>
void main(void)
{ unsigned char message[]= "Àù¤°™’‚ø€˜";
while(1)
{
unsigned int z;
unsigned char y;
unsigned char i;
P2=0xC0;
for(i=1;i<=6;i++)
{ for(y=0;y<10;y++)
{
P1 =message[y];
for(z=0;z<50000;z++);
}
P2=message[i];
}
}
}
PARALLEL PORT INTERFACE
#include<reg51.h>
#include<absacc.h>
void MSDelay(unsigned int itime);
void main()
{ unsigned char a;
XBYTE[0x4003]=0x90;
while(1)
{
a = XBYTE[0x4000];
MSDelay(100);
XBYTE[0x4001]= a;
MSDelay(100);
a=~a;
XBYTE[0x4002]=a;
MSDelay(100);
}
}
void MSDelay(unsigned int itime)
{
unsigned int i,j;
for(i=0;i<itime; i++)
for(j=0;j<1275;j++);
}
Single channel data acquisition system using 8051
#include <reg51.h> /* define 8051 registers */
#include <stdio.h>
sbit rd = P3^2;
sbit wr = P3^3;
sbit EOC =P3^4;

void MSDelay(unsigned int);


void main(void)
{ unsigned char x;
P2 =0xFF;
while(1)
{
rd=1;
wr=0;
wr=1;
while(EOC==1);
rd=0;
MSDelay(100);
x=P2;
P1=x;
}
}
void MSDelay(unsigned int itime)
{
unsigned int i,j;
for(i=0;i<itime; i++)
for(j=0;j<1275;j++);
}
General Procedure to work C6745:

12. Open Code Composer Studio v4 .

13. In WorkSpace Launcher.

a. BROWSE  Select the project location and make one new folder, MAKE NEW FOLDER

Type the Workspace name, OK  OK.

14. FILE  NEW  CCS PROJECT

a. Project name: Type your project name.

b. Tick use default location. NEXT

c. Project type: C6000.

d. Tick Debug And Release. NEXT  NEXT.

e. Output type: Executable.

f. Device Variant : generic C67XX Device.

g. Device Endianness : little

h. Code Generation Tools: TI v6.1.12.

i. Run time support library: automatic.

j. Tick Treat as an Assembly-only project.

k. Target content: none. FINISH

15. FILE  NEW  SOURCE FILE

a. Source file: Type your add.asm( .asm extension is must ).

b. Type the program.

c. FILE  SAVE.

16. Paste the following board library files in workspace location.

a. Common folder (contains header files)

b. Gel folder (contains gel file)


c. Library folder(contains library files)
17. Paste the asm linker file and vectors.asm in the project location.(asm linker file and
vectors.asm is available in cd)
Note: Those folders and linker file are availble at cd.
18. PROJECT  PROPERTIES  C/C++ BUILD  BASIC OPTION
a. Target processor version(--silicon version, -mv) : 6400+
b. IN C/C++ BUILD,  INCLUDE OPTIONS (Add dir to #include search path(--include_path,-

I)) select this add icon and add the following three path by indivdually
 "${Diag}../../common/header"
 "${XDAIS_CG_ROOT}/packages/ti/xdais"
 "${C6000_CSL_CG_ROOT}/include"
19. FILE  NEW  TARGET CONFIGURATION FILE
a. file name: projectname. ccxml (.ccxml extension is must)
b. Connection: Texas Instrument XDS100 v1 USB Emulator.
c. Device: TMS320C6745.  SAVE  TARTGET CONFIGURATION C674X_0 BROWSE,
browse the workspace location, open the gel folder and select the GEL file.  OPEN
SAVE.
20. In C/C++ Project window, Right click the project REBUILD PROJECT.
21. Connections :
a. Connect the usb cable, in between PC to KIT.
b. Connect the 5v adapter and Power on the kit.
22. TARGET  DEBUG ACTIVE PROJECT.(Then see out at corresponding place after run)
23. VIEW  MEMORY
24. In right side, memory window will open. Type the output adrress 0xC0001000
25. TARGET  RUN.
26. TARGET  HALT.
See the Output at Particular location:
0xC0000000 – 99CE4C0B........
8051 and ARM Based VIVA Questions

1.How many pins does 8051 have?

8051 is a 40 pin IC.

2.What is size of 8051 Address Bus?


8051 has a 16-bit address

3.8051 Data Bus and ALU?

8051 has an 8-bit data bus and an 8-bit ALU. This means it can transfer 8-bits in one cycle and also
operate on 8 bits in 1 cycle. Therefore 8051 is called an 8-bit microcontroller

4.Explain PC of 8051?
PC – Program Counter, is a 16-bit register. It contains address of the next instruction. It gets
incremented as soon as an instruction is fetched.

5.Explain SP and Stack of 8051?


SP – Stack Pointer, is an 8-bit register. It contains address of the top of stack. Stack is a data structure
present in the Internal RAM. It operates in LIFO manner. During a Push, SP gets incremented and
during a Pop, SP gets decremented. Default Value of SP is 07H. On the first push, Sp will be come 08H,
and then data will be stored. Hence Bank1 will not be affected!

6.What is the difference between a μP and a microcontroller ?


A μP is just a processor. It needs external RAM, ROM, I/O etc.
A μC is self sufficient. It has an internal Processor, RAM, ROM, I/O ports, Timers etc. It’s basically a
one chip computer, hence gives a compact ckt.

7.How many general purpose registers does 8051 have?


8051 has 32 GPRs. They are divided into 4 banks, each having 8 registers, R0… R7.

8.Which is the default register bank? How do you change banks?


Bank 0 is the default register bank.
We can change banks using RS1 and RS0 of PSW register.

10.What is the use of RxD and TxD?


Used for Serial Communication (Bit by Bit).
Serial communication is slow but is cheaper so is preferred for long distance communication.

11.What is the crystal frequency of 8051?


8051 is connected with a crystal of 12 MHz.
For Serial communication applications, we use a crystal of 11.0592 MHz to produce the standard baud
rates.

12.Explain Power on Reset Signal?


Power on Reset is used to activate the reset signal when 8051 is powered ON. On reset, PC becomes
0000H, That’s the reset vector address. From here the BIOS program is executed!
13.How many I/O ports does 8051 have?
8051 has 4, 8-bit I/O ports: P0, P1, P2, P3.

14.Explain multiplexing in 8051?


Multiplexing is done to reduce the number of lines.
A0-A7 and D0-D7 are multiplexed, to form AD0-AD7.
ALE is used to identify whether the bus carries address or data.
If ALE = 1, bus carries address else data.

15.What are the alternate functions of the ports?


P0: Multiplexed address/ Data Bus (AD7-AD0).
P1: None – Used only as a port.
P2: Higher order address bus (A15-A8).
P3: Serial Port (RxD and TxD), Interrupts (INT0#, INT1#), Timer Clk inputs (T0,T1) and control
Signals (WR# and RD#)

16.What is the role of EA


It decides whether the first 4 KB of program memory space
(0000H… 0FFFH) will be assigned to internal ROM or External ROM.
If EA = 0, the External ROM begins from 0000H.
In this case the Internal ROM is discarded.
8051 now uses only External ROM.
If EA = 1, the External ROM begins from 1000H.
In this case the Internal ROM is used.

17.What is the role of PSEN


8051 has a 16-bit address bus (A15 – A0).
This should allow 8051 to access 64 KB of external Memory as 216 = 64 KB.
But, 8051 can access 64 KB of External ROM and 64 KB of External RAM, making a total of 128
KB.Both have the same address range 0000H to FFFFH.
There are separate control signals for External RAM and External ROM.
RD and WR are control signals for External RAM.
PSEN is the READ signal for External ROM.

18.8051 is based on Harvard Model… explain


If we use a common memory space for programs and data that’s called Von Neuman Model. E.g.::
8086. It can access 1 MB of memory. That’s a combination of programs and data.
In Harvard model, we use separate memory spaces for programs and data. 8051 is based on Harvard
Model.
There is is 64 KB Program Memory implemented using ROM, and 64KB data Memory implemented
using RAM.

19.What is the use of timers?


Timers are used to produce delay by the method of counting. Hence timers are also called counters.
20.Compare hardware and software Delay
A Delay is a time gap between two events.
If we produce the delay using a dummy loop (usually NOP), then it is called a software delay.
If we use a Timer to produce it, then it is called a Hardware delay.
Software delays are cheaper as a timer is not needed.
Hardware delays are more efficient as they keep the processor free during the delay. The counting is
done by the timer, so the processor is free to perform other operations.

21.Describe timers of 8051 in brief?


A Timer counts at a fixed freq using the internal clock (fosc÷ 12).
It is used to produce a delay as the counting period is predictable.
A counter counts at a external frequency applied at To and T1 pins.

22.Explain all memories of 8051


Internal RAM: size 128 bytes. Address range: 00H… 7FH
Internal ROM: size 4KB. Address range: 0000H… FFFFH
Extrenal RAM: size 64KB (max). Address range: 0000H… FFFFH
External ROM: If EA# = 0: size 64KB (max). Address range: 0000H… FFFFH
External ROM: If EA# = 1: size 60KB (max). Address range: 1000H… FFFFH

23.How RAM can 8051 access, max?


128 bytes of internal Ram PLUS 64 KB of external RAM

24.How many SFRs does 8051 have? Name ALL!


21. All 8 bit registers.
A,B: for programming.
PSW: Flag Register
SP: Stack Pointer
DPH and DPL: Data pointer
P0, P1, P2, P3: Port Latches
TCON, TMOD: For Timer Programming
TL0, TH0: Count for Timer 0
TL1, TH1: Count for Timer 1
SCON, SBUF: for serial port
IE, IP: for Interrupts
PCON: for Power Saving

24.What is the difference between MOV, MOVX and MOVC?


MOV if for Internal RAM.
MOVX is for External RAM.
MOVC is for ROM.
If the address if 1000H and more, it is for External ROM.
IF the address is less than 1000H, then depends on EA#
If EA# is 0, it is for External ROM, If EA# is 1, it is for Internal ROM
25.Where is the stack present and why?
In 8051 the stack is present in the Internal RAM. That’s because SP is an 8-bit register. It can only give
an 8-bit address. Internal RAM is the only memory of 8051 with an 8-bit address. Hence stack is present
in the Internal RAM.

26.How many interrupts does 8051 have?


5 interrupts .
2 external interrupts, INT0# and INT1#
2 Timer overflow interrupts: Timer0 and Timer1
A common serial interrupt caused due to Ri or Ti.

27.What are Vectored and Non Vectored interrupts?


Interrupts that have a Fixed ISR Address, it is called Vectored.
All interrupts of 8051 are vectored.
A non vectored interrupt does not have a fixed ISR address., like INTR of 8086.

28.What are their vector address?


INT 0: 0003H.
Timer 0: 000BH.
INT 1: 0013H.
Timer 1: 001BH.
Serial Port: 0023H.

29.What is the use of “org” Directive?


It is called Origin. It gives the starting address from where, the subsequent info will be loaded into
memory.

30.What .ASM file?


It is an Assembly language file
The Assembler converts into .OBJ file, which is in machine language.
The Linker converts it into a .EXE file that can be executed..

31.What is the difference between RET and RETI?


RET is used for ordinary subroutines. It will simply Pop the return address from the stack and load it
into PC.
RETI is sued for returning from ISRs.
It will not only Pop return address into PC, but also re-enable interrupts, which were disabled when
8051 starts an ISR.

32.What is the preferred crystal frequency for serial communication applications?


11.0592 MHz. This is so that we can produce the standard UART baud rates of 9600, 4800, 2400, and
their derivatives.
33.What is the difference between synchronous and asynchronous communication?
Synchronous: Common clock. Start Stop not needed.
Asynchronous: No Common clock. Start Stop needed.

ARM based questions

34.Which implementation off ARM are we using?


ARM7TDMI

35.What does ARM stand for?


Advanced RISC Machines

36.What does RISC stand for?


Reduced instruction set computers

37.Give some features of ARM7TDMI


32 bit Microcontroller.
32 bit data bus
32 bit address bus
232 = 4GB memory.
32 bit instructions
32 bit registers
37 registers… 16 available at a time (R0… R15)
7 operating modes

38.Explain ARM7 Pipelining


ARM 7 has a 3 stage pipeline: Fetch decode and execute

39.Whats the difference between IRQ and FIQ?


IRQ is normal interrupt request.
FIQ is Fast Interrupt Request
FIQ gets serviced faster because, it uses a new set of registers from R8-R12.

40.What is the full form of ARM7TDMI?


ARM7: Family Name.
T: Includes Thumb Instruction set.
D: Allows hardware debugging of the circuit via JTAG interface.
M: Includes Long Multiply Instruction.
I: Includes embedded ICE Microcell for breakpoints and watch-points in program.

41.What is Thumb state? How does it improve code density


In normal state, instructions are of 32 bits each.
In thumb state, instructions are 16-bits.
So we can store double the number of instructions in the same space, hence code density improves.

S-ar putea să vă placă și