ARM Manual
ARM Manual
4. Select the target device(here,LPC1768 from NXP) from the list or type the exact name of the device. Press OK.
5. ”Copy start up to Project folder and add to project file”?- Press NO.
6. In the project window, right click on source and select Add new item to group “source group 1”.
7. Select Asm file and give name of the file with .s extension and press ADD.
10. If no error,Select “Build” icon from tool bar or from menu bar.
11. Start the debug session from Menu bar.
12. Press OK
13. Press function key F11 or select “step” option under Debug menu for single step execution and verify the output
inregister window/Memory window/xPSR.
EXP.No: ALP TO MULTIPLY TWO 16 BIT NUMBERS
Date:
AIM:
To write and execute and Assembly Language Program to multiply two 16-bit numbers
SOFTWARE REQUIRED:
1. Keil uVision5
ALGORITHM
Multiplication:
PROGRAM
AIM:
To write and execute and Assembly Language Program to find the given 16 bit number is Odd or Even.
SOFTWARE REQUIRED:
1. Keil uVision5
PROGRAM:
ENTRY
EXPORT Reset_Handler
Reset_Handler
LDR r1,=num
LDR r0,[r1]
RORS r0,#1
BCS l1
MOV r2,#resu
B l2
l1 MOV r2,#res
l2 LDR r3,=result
STR r2,[r3]
stop B stop
AREA data, DATA, READWRITE
num DCW 16
result DCB 0X0
END
OUTPUT:
num=16d.Hence it is EVEN
RESULT
(INTERACING WITH LPC1768 MICROCONTROLLER)
AIM
To Interface a simple Switch and display its status through Relay, Buzzer and LED
BLOCK DIAGRAM
ALGORITHM
#include<LPC17xx.h>
#define switch 11
#define LED 19
#define relay 28
#define buzzer 27
int main(void)
{
LPC_PINCON->PINSEL3=0x00000000;
LPC_PINCON->PINSEL4=0x00000000;
LPC_GPIO2->FIODIR=0x00000000;
LPC_GPIO1->FIODIR=0xFFFFFFFF;
LPC_GPIO1->FIOCLR=0xFFFFFFFF;
while(1)
{
if (!((LPC_GPIO2->FIOPIN>>switch)& 0x1))
{
LPC_GPIO1->FIOPIN=(1<<LED)|(1<<relay)|(1<<buzzer);
}
else
{
LPC_GPIO1->FIOPIN=(0<<LED)|(0<<relay)|(0<<buzzer);
}
}
}
OUTPUT
When the switch is pressed LED is ON, buzzer is ON and relay is ON.
When the switch is not pressed LED is OFF, buzzer is OFF and relay is OFF.
RESULT
EXP.No: PROGRAMMING AND SIMULATION TO INTERFACE A
Date: STEPPER MOTOR
AIM
BLOCK DIAGRAM
ALGORITHM
#include<lpc17xx.h>
#define SW1 11
#define SW2 12
void delay(unsigned int x)
{
unsignedinti,j;
for(i=0;i<x;i++)
{f
or(j=0;j<90000;j++);
}}i
nt main(void)
{
unsignedint direct;
LPC_PINCON->PINSEL0=0X00000000;
LPC_PINCON->PINSEL1=0X00000000;
LPC_PINCON->PINSEL4=0X00000000;
LPC_GPIO0->FIODIR=0xFFFFFFFF;
LPC_GPIO2->FIODIR=0X00000000;
LPC_GPIO0->FIOCLR=0X00078000;// CLEAR P0.15 TO p0.18
while(1)
{
if(!((LPC_GPIO2->FIOPIN>>SW1)& 0X1))
{
while(!((LPC_GPIO2->FIOPIN>>SW1) & 0X1));
direct=1;
}
else if(!((LPC_GPIO2->FIOPIN>>SW2) & 0X1))
{
while(!((LPC_GPIO2->FIOPIN>>SW2) & 0X1));
direct=0;
}i
f(direct==1)
{
LPC_GPIO0->FIOPIN=0X00008000;
delay(15);
LPC_GPIO0->FIOPIN=0X00010000;
delay(15);
LPC_GPIO0->FIOPIN=0X00020000;
delay(15);
LPC_GPIO0->FIOPIN=0X00040000;
delay(15);
}
else
{
LPC_GPIO0->FIOPIN=0X00040000;
delay(15);
LPC_GPIO0->FIOPIN=0X00020000;
delay(15);
LPC_GPIO0->FIOPIN=0X00010000;
delay(15);
LPC_GPIO0->FIOPIN=0x00008000;
delay(15);
}}
}
RESULT
Analysis and Synthesis of Sequential and Combinational
Circuits using CAD Tools
EXP.No: ANALYSIS AND SYSNTHESIS OF BASIC FLIP-FLOPS
Date:
AIM
To analysis the functionality of S-R Flip-Flop, J-K Flip-Flop, D Flip-Flop using CAD tools
PROCEDURE
1. Apply VCC1 and VCC2, so that clock start button will be enabled. Apply low level voltage to
ground(GND1) and (GND2).
2. Next, start the clock pulse by clicking on the "Clock Start" button and after generation of some clock
pulses stop the clock pulse by clicking on the"clock Stop" button. Click the button "Add to table", to
insert the data.
3. Now apply high voltage to S input and low voltage to R input and set "No of clock pulses" to 1. See the
changes at output(Q and Q) at positive clock edge. Click the button "Add to table", to insert the data.
4. Now apply high voltage to R input and low voltage to S input and start the clock pulse. See the changes
at output(Q and Q) at positive clock edge. Click the button "Add to table", to insert the data.
5. Next,apply low voltage to both the inputs(S and R) and see the changes at output(Q and Q) at positive
clock edge. Click the button "Add to table", to insert the data.
6. Next,apply high voltage to both the inputs(S and R) and start the clock pulse again.See both the
outputs(Q and Q) will be zero. It is "not allowed" condition. Click the button "Add to table", to insert the
data.
7. Click button "Plot" to see the graphical representation of S-R flip flop.
TRUTH TABLE
PROCEDURE
1. Apply VCC1 and VCC2, so that clock start button will be enabled. Apply low level voltage to
ground(GND1) and (GND2).
2. Next, start the clock pulse by clicking on the "Clock Start" button and after generation of some clock
pulses stop the clock pulse by clicking on the"clock Stop" button .
3. Now apply high voltage to J input and low voltage to K input and set "No of clock pulses" to 1. See the
changes at output(Q and Q) at positive clock edge.
4. Now apply high voltage to K input and low voltage to J input and start the clock pulse. See the changes
at output(Q and Q) at positive clock edge.
5. Next,apply low voltage to both the inputs(J and K) and see the changes at output(Q and Q) at positive
clock edge.
6. Next,apply high voltage to both the inputs(J and K) and start the clock pulse again. See both the
outputs(Q and Q) will be zero. It is "not allowed" condition.
TRUTH TABLE
PROCEDURE
1. Apply VCC1 and VCC2, so that clock start button will be enabled. Apply low level voltage to
ground(GND1) and (GND2).
2. Next, start the clock pulse by clicking on the "Clock Start" button and after generation of some clock
pulses stop the clock pulse by clicking on the"clock Stop" button .
3. Now apply high voltage to D input and set "No of clock pulses" to 1. See the changes at output(Q and
Q) at positive clock edge.
4. Now apply low voltage to D input and start the clock pulse. See the changes at output(Q and Q) at
positive clock edge.
TRUTH TABLE
AIM
To analysis the functionality of 4 bit and 8 bit Binary Full adder using CAD tools
PROCEDURE
2. For all the combinations of the 4 bit inputs A (A3A2A1A0), B (B3B2B1B0) verify that the LEDs are
ON or not.
Note: Red button symbolize as Low (L), Green button symbolize as High (H).
TRUTH TABLE
A B SUM
A0 A1 A2 A3 B0 B1 B2 B3 C4 S3 S2 S1 S0
0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 1 0 0 0 1 0 0 0 1 0
0 0 1 0 0 0 1 0 0 0 1 0 0
0 0 1 1 0 0 1 1 0 0 1 1 0
0 1 0 0 0 1 0 0 0 1 0 0 0
0 1 0 1 0 1 0 1 0 1 0 1 0
0 1 1 0 0 1 1 0 0 1 1 0 0
0 1 1 1 0 1 1 1 0 1 1 1 0
1 0 0 0 1 0 0 0 1 0 0 0 0
1 0 0 1 1 0 0 1 1 0 0 1 0
1 0 1 0 1 0 1 0 1 0 1 0 0
1 0 1 1 1 0 1 1 1 0 1 1 0
1 1 0 0 1 1 0 0 1 1 0 0 0
1 1 0 1 1 1 0 1 1 1 0 1 0
1 1 1 0 1 1 1 0 1 1 1 0 0
1 1 1 1 1 1 1 1 1 1 1 1 1
Circuit Diagram of 8 bit Binary Full adder
PROCEDURE
3. Enter binary input A=10011011 (Decimal value is 155), B=10011011 (Decimal value is 155). Check
output S=100110110 (C8, S7, S6, S5, S4, C4, S3, S2, S1, S0).
Note: Red button symbolize as Low (L), Green button symbolize as High (H).
TRUTH TABLE
A B SUM
A7 A6 A5 A4 A3 A2 A1 A0 B7 B6 B5 B4 B3 B2 B1 B0 C8 S7 S6 S5 S4 S3 S2 S1 S0
RESULT
Network Simulators Communication Topology of network
using NS2 / any simulators.
EXP.No: IMPLEMENTATION OF STAR TOLOGYUSING CISCO NETWORK
Date: SIMULATOR
AIM
PROCEDURE
Step 4: Transfer message from one device to another and check the Table for Validation.
OUTPUT
Step 4: Transfer message from one device to another and check the Table for Validation.
Command:
Example:
ping 192.168.1.4
Note: If the connections are correct then you will receive the response.
RESULT
EXP.No: CONNECTING MULTIPLE COMPUTERS USING HUB
Date:
AIM
PROCEDURE
Step 2: On opening Cisco packet tracer, click on End devices from bottom left icon menus, Add
four PCs and a hub into the screen of the simulator.
Step 3: Connect all PCs and hub with copper straight cable by selecting it through the cables
menu from the bottom left menus in the simulator. Green signal in the wire shows they’re ready to
communicate.
Step 4: Now, we’ve to give unique IP address to each PC. Click on each PC, go to Desktop
section and then click on IP configuration to give IP address.
Step 6: After that test the ping command in command prompt to check the connectivity between
these PCs.
Step 7: If ping command works successfully, then it means all these PCs are able to
communicate and share data between them and we’ve build our network of four PCs and a Hub
successfully.
OUTPUT
Step 2: On opening Cisco packet tracer, click on End devices from bottom left icon menus, Add
four PCs and a hub into the screen of the simulator.
Step 3: Connect all PCs and hub with copper straight cable by selecting it through the cables
menu from the bottom left menus in the simulator. Green signal in the wire shows they’re
ready to communicate.
Step 4: Now, we’ve to give unique IP address to each PC. Click on each PC, go to Desktop section
and then click on IP configuration to give IP address.
Step 6: After that test the ping command in command prompt to check the connectivity between
these PCs.
Step 7: If ping command works successfully, then it means all these PCs are able to communicate
and share data between them and we’ve build our network of four PCs and a Hub
successfully.
RESULT
Simulation and Programming
Environment Using MATLAB
EXP.No: SIMULATION & PROGRAMMING OF FIR FILTERS USING MATLAB
Date:
AIM
SOFTWARE USED
MATLAB
PROGRAM
clear mlhdlc_sfir;
T = 2;
dt = 0.001;
N = T/dt+1;
sample_time = 0:dt:T;
df = 1/dt;
sample_freq = linspace(-1/2,1/2,N).*df;
% filter coefficients
h1 = -0.1339; h2 = -0.0838; h3 = 0.2026; h4 = 0.4064;
len = length(x_in);
y_out = zeros(1,len);
x_out = zeros(1,len);
for ii=1:len
data = x_in(ii);
AIM
SOFTWARE USED
MATLAB
PROGRAM
% Simulation parameters
numReadings = 100; % Number of sensor readings
samplingRate = 1; % Time interval between readings (in seconds)
ambientTemperature = 25; % Ambient temperature (baseline value)
% Add some random noise to the readings to make it more realistic (optional)
noiseAmplitude = 1;
temperatureReadings = temperatureReadings + noiseAmplitude * randn(1, numReadings);
Real-Time Operating Systems (RTOS) are specialized operating systems designed to meet the stringent
timing requirements of real-time applications. They are commonly used in embedded systems and
microcontrollers, including those based on ARM processors. One popular RTOS for ARM-based
microcontrollers is FreeRTOS (Free Real-Time Operating System). Let's take a closer look at FreeRTOS in the
context of ARM processors/microcontrollers.
1. Overview of FreeRTOS:
FreeRTOS is an open-source, real-time operating system kernel that is small, portable, and easy to use.
It was developed by Richard Barry and is widely adopted in various industries, including automotive,
industrial automation, consumer electronics, and IoT devices.
2. Portability:
3. Task Scheduling:
FreeRTOS provides a preemptive, priority-based task scheduler. Tasks are lightweight, independent
threads of execution that are scheduled by the RTOS kernel. Each task is assigned a priority, and the
scheduler ensures that tasks with higher priorities preempt lower-priority tasks when necessary.
4. Kernel Objects:
FreeRTOS offers various kernel objects, such as tasks, queues, semaphores, mutexes, and timers, which
enable communication, synchronization, and resource management among tasks. These kernel objects
are essential for implementing multi-threaded real-time applications.
5. Memory Management:
FreeRTOS provides several memory allocation schemes, including dynamic memory allocation and
static memory allocation at compile time. This flexibility allows developers to choose the most
appropriate memory management method for their specific application requirements.
6. Real-Time Features:
FreeRTOS is commonly used with ARM development tools, such as Keil MDK (Microcontroller
Development Kit) or the ARM GCC toolchain. These tools provide an integrated development
environment, compilers, and debuggers, streamlining the development process for ARM-based
microcontrollers.
FreeRTOS has a large and active user community, which means developers can find extensive
documentation, tutorials, and examples to get started quickly. Additionally, there are frequent updates
and bug fixes driven by community contributions.
Experiment Setup:
Step 1: Install the necessary tools and IDE for your chosen ARM microcontroller platform.
Step 2: Download the FreeRTOS source code and documentation from the FreeRTOS website
(https://www.freertos.org/).
Step 3: Configure FreeRTOS for your specific ARM microcontroller. The configuration involves setting
the number of tasks, the stack size for each task, and other parameters based on your application
requirements. The FreeRTOS documentation provides detailed instructions on how to configure the
kernel.
Step 4: Write the application code. Create one or more tasks that will run concurrently and perform
specific tasks. For this experiment, we will create two tasks, TaskA and TaskB, each toggling a GPIO
pin at different rates.
Step 5: Compile the code and flash it onto the ARM microcontroller using the appropriate tool chain and
flashing utility.
Step 6: Observe the behavior of the system. In this experiment, TaskA and TaskB are running
concurrently, and you should see the LEDs blinking at different rates (500ms and 1000ms) as defined in
their respective tasks. The real-time behavior of FreeRTOS ensures that tasks run as expected and meet
their timing requirements.
Step 7: Experiment with different task priorities, delays, and other configurations to understand how
FreeRTOS handles task scheduling and real-time performance.
EXP.No: ADDITION OF TWO BINARY NUMBERS IN C
Date:
AIM
Add two binary numbers and find the sum and carry using C programing.
SOFTWARE USED
C Language
PROGRAM
#include <stdio.h>
int main() {
if (remainder != 0)
sum[i++] = remainder;
while (i >= 0)
printf("%d", sum[i--]);
return 0;
}
OUTPUT
AIM
Add two binary numbers and find the sum and carry using C programing.
SOFTWARE USED
C Language
PROGRAM
#include <bits/stdc++.h>
int c;
c = a + (~b + 1);
return c;
// Driver code
int main()
int a = 2, b = 3;
return 0;
}
OUTPUT
-1
2
RESULT