0% found this document useful (0 votes)
9 views30 pages

Esad File 1

This document outlines experiments performed with an 8051 and ARM microcontroller. It includes the aims, software used, steps, program code, and output for experiments interfacing ports, sending serial data, using timers, and manipulating bits. Embest IDE was also used to develop and debug ARM projects.

Uploaded by

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

Esad File 1

This document outlines experiments performed with an 8051 and ARM microcontroller. It includes the aims, software used, steps, program code, and output for experiments interfacing ports, sending serial data, using timers, and manipulating bits. Embest IDE was also used to develop and debug ARM projects.

Uploaded by

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

Embedded system architecture and design

lab file
6th semester

BACHELORS OF TECHNOLOGY
IN
Electronics and communication
Engineering

Submitted to - submitted by-


MRs. Gagandeep Kaur Abhishek Yadav
01513202821
index
Sno. Experiments Date Sign
1 Write a program to load three numbers
into Accumulator and send them to port
1.

2 Write an 8051 C program to send hex


values for ASCII characters of
0,1,2,3,4,5,6,7,8,9,A,B,C,D,E to P1.
3 Write an 8051 C program to toggle bits of
P1 ports continuously with a 250 Ms.

4 Write an 8051 C program to get byte of


data from P1, wait ½ second (i.e. 500ms)
and then send it to P2.

5 Write an 8051 C program to send the two


messages “first name” and “last name” to
the serial port. If SW=0, send first name
else if SW=1, send last name. Set the
baud rate at 9600,8-bit data, and 1 stop
bit.

6 To use Embest IDE for ARM and ARM


Software Emulator.

7 Write an 8051 C program to interface


stepper motor to rotate the motor in
clockwise and anticlockwise directions.

8 Write an ALP to add 16 bits using ARM 7


processor.
9 Write a program to multiply two numbers
using ARM processor
EXPERIMENT – 1

AIM: Write a program to load three numbers into


Accumulator and send them to port 1.

SOFTWARE USED: Keil uVision5.

STEPS TO PERFORM THE EXPERIMENT


Step 1: First Start KEIL Software.
Step 2: Go to New Project.
Step 3: Give Name of the project (do not add any extension).
Step 4: Now save the project after that select Microcontroller. Step 5: Now go
to File and select New File.
Step 6: Now save this Editor file in the same folder where you have saved your
project.
Step 7: Now write your program code here and save it.
Step 8: Now add this file (Save it with extension .c) in the project i.e. in Source
Group1.
Step 9: Now right click on Source Group and click on build target. Step 10: Now
go to Debug section and click on Start/Stop.
Step 11: Go to Peripherals and select Port (As you Used).
Step 12: Now Run the project and you will get the output int the Port.

PROGRAM CODE:
OUTPUT:
EXPERIMENT – 2

AIM: Write an 8051 C program to send hex values for ASCII


characters of 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E to P1.

SOFTWARE USED: Keil uVision5.

STEPS TO PERFORM THE EXPERIMENT


Step 1: First Start KEIL Software.
Step 2: Go to New Project.
Step 3: Give Name of the project (do not add any extension).
Step 4: Now save the project after that select Microcontroller. Step 5: Now go
to File and select New File.
Step 6: Now save this Editor file in the same folder where you have saved your
project.
Step 7: Now write your program code here and save it.
Step 8: Now add this file (Save it with extension .c) in the project i.e. in Source
Group1.
Step 9: Now right click on Source Group and click on build target. Step 10: Now
go to Debug section and click on Start/Stop.
Step 11: Go to Peripherals and select Port (As you Used).
Step 12: Now Run the project and you will get the output int the Port.
PROGRAM CODE:

OUTPUT:
EXPERIMENT – 3

AIM: Write an 8051 C program to toggle bits of P1 ports


continuously with a 250 Ms.

SOFTWARE USED: Keil uVision5.

STEPS TO PERFORM THE EXPERIMENT


Step 1: First Start KEIL Software.
Step 2: Go to New Project.
Step 3: Give Name of the project (do not add any extension).
Step 4: Now save the project after that select Microcontroller. Step 5: Now go
to File and select New File.
Step 6: Now save this Editor file in the same folder where you have saved your
project.
Step 7: Now write your program code here and save it.
Step 8: Now add this file (Save it with extension .c) in the project i.e. in Source
Group1.
Step 9: Now right click on Source Group and click on build target. Step 10: Now
go to Debug section and click on Start/Stop.
Step 11: Go to Peripherals and select Port (As you Used).
Step 12: Now Run the project and you will get the output int the Port.
PROGRAM CODE:

OUTPUT:
EXPERIMENT – 4

AIM: Write an 8051 C program to get byte of data from P1,


wait ½ second (i.e. 500ms) and then send it to P2.

SOFTWARE USED: Keil uVision5.

STEPS TO PERFORM THE EXPERIMENT


Step 1: First Start KEIL Software.
Step 2: Go to New Project.
Step 3: Give Name of the project (do not add any extension).
Step 4: Now save the project after that select Microcontroller. Step 5: Now go
to File and select New File.
Step 6: Now save this Editor file in the same folder where you have saved your
project.
Step 7: Now write your program code here and save it.
Step 8: Now add this file (Save it with extension .c) in the project i.e. in Source
Group1.
Step 9: Now right click on Source Group and click on build target. Step 10: Now
go to Debug section and click on Start/Stop.
Step 11: Go to Peripherals and select Port (As you Used).
Step 12: Now Run the project and you will get the output int the Port.

PROGRAM CODE:
OUTPUT:
EXPERIMENT – 5

AIM: Write an 8051 C program to send the two messages


“first name” and “last name” to the serial port. If SW=0, send
first name else if SW=1, send last name. Set the baud rate at
9600,8-bit data, and 1 stop bit.

SOFTWARE USED: Keil uVision5.

STEPS TO PERFORM THE EXPERIMENT


Step 1: First Start KEIL Software.
Step 2: Go to New Project.
Step 3: Give Name of the project (do not add any extension).
Step 4: Now save the project after that select Microcontroller. Step 5: Now go
to File and select New File.
Step 6: Now save this Editor file in the same folder where you have saved your
project.
Step 7: Now write your program code here and save it.
Step 8: Now add this file (Save it with extension .c) in the project i.e. in Source
Group1.
Step 9: Now right click on Source Group and click on build target. Step 10: Now
go to Debug section and click on Start/Stop.
Step 11: Go to Peripherals and select Port (As you Used).
Step 12: Now Run the project and you will get the output int the Port.
PROGRAM CODE:

OUTPUT:
EXPERIMENT – 6

AIM: To use Embest IDE for ARM and ARM Software Emulator.

SOFTWARE USED: Embest IDE.

THEORY
Embest IDE is an Integrated Development Environment for software
cross- development. The Embest IDE is an application that provides a
simple and versatile graphical user interface and tools for developing
embedded software. It is an Integrated Development Environment
(IDE) that facilitates managing and building projects, establishing and
managing host-target communication, running and debugging
applications. It provides an efficient way for developing embedded
applications. EmbestIDE comprises the following elements (Figure 1-
1):
•An integrated source-code editor.
 A project management facility.
 Integrated C and ASM compilers and linker. Z
 a source-level debugger.
 an integrated development environment.
 an ARM simulator

EmbestIDE uses host-target cross model for developing embedded


applications. EmbestIDE runs on a host computer. Your target board
is connected to the host computer through debug device (BDM/JTAG
Emulator). You can edit and build your projects on the host, and
create a target executable file with EmbestIDE. Download the target
file to the target, and then use EmbestIDE debugger to debug it
through the communication of debug device connected between the
host computer and the target board. Figure1-2 illustrates the host-
target cross model with EmbestIDE.
When you use EmbestIDE for ARM, a debug device--Embest JTAG
Emulator is provided. See appendix A "JTAG Emulator Connection"
for detail describe about Embest JTAG Emulator.

Simple Example
This section shows users step by step how to create, compile and
debug a simple project. The project described below is to create a
random number. The project demo locates at \Examples\arm\
explasm under EmbestIDE installing directory. The files to be used
are:
Random.s Assemble file of random number function
Randtest. Main program file
Create a Project
1) Creating Project
Select File > New Workspace menu, Give a project name and specify
project directory as shown Rantest has been used as a project name,
and project directory has been

specified as D:\EmbestIDE\Example\arm250\explasm\, D:\EmbestIDE


is default installing directory of EmbestIDE unless noted.
After clicking OK, two files will be created in the project directory:
Rantest.ews Workspace file

Randtest.pjf Project file


After the project has been created, files pane will appear in Embest
IDE workspace window as shown in Figure 3-2.
The Figure 3-2 shows current workspace is rantest which contains a
project named rantest. Boldface indicates that rantest is an active
project.
2) Add Source Files
Choose Project Source Files folder in rantest workspace window.
Click Project > Add To Project> Files to add source files. You can also
right click Project Source Files folder to add source files, See Figure
3-3:

Figure 3-3 Add Source Files In Workspace Window


You can add the source files in the pop up dialog box. To select source
files, press CTRL key and hold, click source files of random.s and
randtest.c in Project directory, See Figure 3-4.
Figure 3-4. File open window

Figure 3-5. Workspace window


3.1.1 Project Settings
Figure 3-5 Workspace Window
After creating a project, you need to configure the project. The
project settings include CPU settings, emulator settings, debug
settings, directory settings, compiler settings, assembler settings and
linker settings. The project settings is a critical step to entire software
development.
Click Project > Settings, Project Settings dialog box pops up, then
Choose randtest files in the dialog.
1) CPU Settings
Select Processor pane from Project Settings dialog box. Define CPU
module as ARM7, CPU family and CPU member as ARM7 too. Switch
Endian to little endian. Build tools are GNU tools for ARM.

Figure 3-5. Processor pane of projct settings dialog


After build tool has been set, Project Settings dialog will show the
pane of this build tool.
2) Emulator Settings
Select Remote pane from Project Settings dialog. Define Remote
Device as jtagarm7. Because of Embest Emulator for ARM does not
support to change the working speed, don't worry about the setting
of Speed item. When using Embest
PowerICE for ARM, select the valid work speed: Full
Speed(120Kbyte/s). High Speed. Medium Speed, Low Speed.
Communication port with remote device is PARALLEL.
Communication channel is LPT1 as shown on Figure 3-6.

Figure 3-6. Remote pane of project settings dialog


3) Debug Settings
Select Debug pane from Project Settings dialog. Select General from
Category, Set symbol file as
./debug/rantest.elf and Action after connected as None. See Figure
3-7.

Figure 3-7. debug general options of project settings dialog

Select download from category . set Download file


as./debug/rantest.elf.set Download verify option on . set download
file to address 0x20000000.
Execute program starting from download address.
Figure 3-8. debug download options of project settings dialog.

Set memory map to use map file, and set target memory map file as
$(EMBEST_IDE)\targets\at91\targets\eb40.map.

Figure 3-9. debug memory maps options of project settings


1)Compiler Settings
Select compiler pane from project settings dialog.set object
files locaton as./debug and others

Figure 3-9.Compiler pane of project settings dialog


2) Assembler settings
Select assembler pane from project settings dialog. set object files
location as./debug and other as default.
Figure 3-11.Assembler pane of project settings dialog
3)linker settings
Select linker pane from project settings dialog. Select general from
category. Set object files location as./debug and others as default

Figure 3-12 .linker general options of project settings select image


entry.

Options from category. set select entry files as


Rantest.o. select entry point as main. Add “-Text 0x20000000” in link
options.
Figure 3-13.linker image entry options of project settings dialog entry
file

'Rantest.o' means that executive code compiled and linked


'rantest.c' will locate at starting point of entire executive program.
Entry Point 'main' means
that executive code will run starting from 'main'. "-Ttext 0x2000000"
means that address of entire executive program code will start from
0x2000000.
EXPERIMENT – 7

AIM: Write an 8051 C program to interface stepper motor to


rotate the motor in clockwise and anticlockwise directions.
SOFTWARE USED: Keil uVision5.

STEPS TO PERFORM THE EXPERIMENT


Step 1: First Start KEIL Software.
Step 2: Go to New Project.
Step 3: Give Name of the project (do not add any extension).
Step 4: Now save the project after that select Microcontroller. Step 5: Now go
to File and select New File.
Step 6: Now save this Editor file in the same folder where you have saved your
project.
Step 7: Now write your program code here and save it.
Step 8: Now add this file (Save it with extension .c) in the project i.e. in Source
Group1.
Step 9: Now right click on Source Group and click on build target. Step 10: Now
go to Debug section and click on Start/Stop.
Step 11: Go to Peripherals and select Port (As you Used).
Step 12: Now Run the project and you will get the output int the Port.
PROGRAM CODE:

OUTPUT:
EXPERIMENT – 8

AIM: Write an ALP to add 16 bits using ARM 7 processor.

SOFTWARE USED: Keil ARM IDE.


THEORY:
ARM7 processor is commonly used in embedded system applications.
Also, it is a balance among classic as well as new-Cortex sequence.
This processor is tremendous in finding the resources existing on the
internet with excellence documentation offered by NXP
Semiconductors. It suits completely for an apprentice to obtain in
detail hardware & software design implementation.
This generation introduced the Thumb 16-bit instruction set
providing improved code density compared to previous designs. The
most widely used ARM7 designs implement the ARMv4T
architecture, but some implement ARMv3 or ARMv5TEJ. ARM7TDMI
has 37 registers (31 GPR and 6 SPR). All these designs use a Von
Neumann architecture, [citation needed] thus the few versions
containing a cache do not separate data and instruction caches.
Some ARM7 cores are obsolete. One historically significant model,
the ARM7DI[2] is notable for having introduced JTAG based on-chip
debugging; the preceding ARM6 cores did not support it. The "D"
represented a JTAG TAP for debugging; the "I" denoted an ICEBreaker
debug module supporting hardware breakpoints and watchpoints,
and letting the system be stalled for debugging. Subsequent cores
included and enhanced this support.
It is a versatile processor designed for mobile devices and other low
power electronics. This processor architecture is capable of up to 130
MIPS on a typical 0.13 um process.
PROGRAM CODE:

OUTPUT:
EXPERIMENT – 9

AIM: Write a program to multiply two numbers using ARM


processor
SOFTWARE USED: Keil ARM IDE.
Program code:

OUTPUT:

You might also like