Lab 8
Lab 8
PROCESSOR
1. Andrew Sloss, Dominic Symes, and Chris Wright. ARM system developer's guide: designing and
optimizing system software. Elsevier, 2004.
2. Mazidi, M., Naimi, S., Naimi, S. and Mazidi, J., ARM Assembly Language Programming &
Architecture. y Pearson Education, Inc., 2013.
8.5 Procedure
i) Enter the PROGRAM
ii) Execute the program
iii) Check for the result in destination.
8.6 PROGRAMS:
Program 1: SAWTOOTH WAVEFORM GENERATION (Assembly Language Program)
L1 LSL R1,R2,#6
STR R1,[R0]
ADD R2,R2,#1
CMP R2,R3
BLT L1
B L1
END
#include<lpc214x.h>
int count = 0;
int main (void)
{
PINSEL1 = 0X00080000;
while(1)
{
For (count=0; count<1023; count++)
{
DACR = (count<<6);
}
For (count=0; count>0; count--)
{
DACR = (count<<6);
}
}
}
STR R2,[R1]
L1 LSL R1,R2,#06
STR R1,[R0]
ADD R2,R2,#01
CMP R2,R3
BLT L1
L2 LSL R1,R2,#06
STR R1,[R0]
SUBS R2,R2,#01
BNE L2
B L1
END
#include<lpc214x.h>
int count = 0;
int main (void)
{
PINSEL1 = 0X00080000;
while (1)
{
For (count=0; count<1023; count++)
{
DACR = (count<<6);
}
For (count=1023; count>0; count--)
{
DACR = (count<<6);
}
}
}
PRE-LAB QUESTIONS:
1. Comment on the PINSEL registers of LPC2148 processor
2. How does the DACR register of LPC2148 processor is accessed for ARM operations?
POST-LAB QUESTIONS:
1. List the special function registers of LPC2148 device.
2. What is the purpose of using EQU directive in source code.
Result: