MPMCLab_final
MPMCLab_final
Laboratory Manual
for
2022-2023
1
EXPERIMENT-1
AIM: To write an ALP to perform 16 bit Arithmetic operations using MASM software.
INSTRUCTIONS USED:
ADD: Adds the data in destination operand to accumulator and stores the result in
accumulator.
ADDC: Adds the data in destination operand along with carry to accumulator and stores the
result in accumulator.
Step 1: Start
Step 2: Move data into registers
Step 3: Perform addition operations
Step 4: Store sum and carry
Step 5: Move data to ports.
Step 6: Stop
Step 1: Start
Step 2: Move data into registers
Step 3: Perform subtraction operations
Step 4: Store difference and borrow
Step 5: Move data to ports.
Step 6: Stop
2
FLOW CHART:
Start
Add/subtract/Multiply/divide data in
destination register to accumulator
Store sum/difference/product
along with carry
Stop
3
PROGRAM:
4
MOVMLT,AX
MOV MLT+2, DX
MOV AX, NUM1
MOV DX,0000H
DIV BX
MOVDVS,AX
MOV DVS+2,DX
MOV AH,4CH
INT 21H
CODE ENDS
END START
RESULT:
1. 8 bit ADDITION
SUM=P1:68H
2. 16 bit ADDITION
SUM=P1, P2:68ACH
3. 8 bit SUBTRACTION
DIFFERENCE=P1:22H
4. 16 bit SUBTRACTION
DIFFERENCE=P1, P2:4444H
5
EXPERIMENT-2
software.
INSTRUCTIONS USED:
MOVX: MOVX moves a byte to or from External Memory into or from the Accumulator
ANL: ANL does a bitwise "AND" operation between operand1 and operand
SWAP: SWAP swaps bits 0-3 of the Accumulator with bits 4-7 of the Accumulator
ALGORITHM:
FLOW CHART:
PROGRAM:
STRING OPERATIONS
AIM: Write an assembly language program to find length of a string and to perfrorm reversal of a
string operation using MASM software.
INSTRUCTIONS USED:
ALGORITHM:
LENGTH OF A STRING:
Step 1: Set up segments.
Step 2: Define data segment.
Step 3: Define code segment.
Step 4: Initialize registers.
Step 5: Loop to calculate string length:
a. Load character into AL.
b. Increment counters SI and CX.
c. Check for null terminator.
d. Jump back if not found.
Step 6: Adjust string length.
Step 7: Prepare to terminate.
Step 8: End code segment.
Step 9: End program.
REVERSAL OF A STRING:
Step 1: Set up segments.
Step 2: Define data segment.
Step 3: Define code segment.
Step 4: Initialize registers.
Step 5: Loop to reverse the string:
a. Load word into AX.
b. Store word at destination.
c. Update pointers and counters.
d. Check for loop continuation.
Step 6: Reversal of string complete.
Step 7: Prepare to terminate.
Step 8: End code segment.
Step 9: End program.
FLOW CHART:
Length of a string: Reversal of a string:
Start Start
Stop
Stop
PROGRAM:
LENGTH OF A STRING:
ASSUME CS:CODE, DS:DATA
DATA SEGMENT
STR1 DB 'HELLO'
COUNT DB 01H DUP(?)
DATA ENDS
CODE SEGMENT
START: MOV AX,DATA
MOV DS,AX
MOV CX,0
MOV SI, offset STR1
BACK: MOV AL,[SI]
INC SI
INC CX
CMP AL,00H
JNZ BACK
DEC CX
MOV AH,4CH
INT 21H
CODE ENDS
END START
REVERSAL OF A STRING:
; REVERSAL OF A STRING
ASSUME CS:CODE, DS:DATA
DATA SEGMENT
STR1 DB 'HELLO'
COUNT EQU 06H
STRREV DB 06H DUP(?)
DATA ENDS
CODE SEGMENT
start: mov AX,DATA
MOV DS,AX
MOV CX,COUNT
mov SI, offset STR1
MOV DI, OFFSET STRREV
ADD SI,05H
back: MOV AX,[SI]
MOV [DI],AX
DEC SI
INC DI
DEC CL
JNZ back
MOV AH,4CH
INT 21H
CODE ENDS
END START
RESULT: Given string length is known and reversal of the string is performed.
EXPERIMENT NO: 4
INSTRUCTIONS USED:
ALGORITHM:
UP1:MOV AL,[SI]
CMP AL,BL
JNZ DOWN
INC DX ; REPRESENTS THE REPETITION TIMES
DOWN: INC SI
DEC CL
JNZ UP1
MOV AH,4CH
INT 21H
CODE ENDS
END START
MASM Software.
SOFTWARE USED: (Microsoft macro assembler) MASAM software.
INSTRUCTIONS USED:
ADD: Adds the data in destination operand to accumulator and stores the result in accumulator.
ALGORITHM:
ASCENDING ORDER
DESCENDING ORDER
Ascending Order:
Descending Order:
PROGRAM FOR ASCENDING ORDER:
DATA SEGMENT
STRING1 DB 99H,12H,56H,45H,36H
DATA ENDS
CODE SEGMENT
ASSUME CS:CODE,DS:DATA
START: MOV AX,DATA
MOV DS,AX
MOV CH,04H
UP2: MOV CL,04H
LEA SI,STRING1
UP1: MOV AL,[SI]
MOV BL,[SI+1]
CMP AL,BL
JC DOWN
MOV DL,[SI+1]
XCHG [SI],DL
MOV [SI+1],DL
DOWN: INC SI
DEC CL
JNZ UP1
DEC CH
JNZ UP2
INT 3
CODE ENDS
END START
PROGRAM FOR DESCENDING ORDER:
DATA SEGMENT
STRING1 DB 99H,12H,56H,45H,36H
DATA ENDS
CODE SEGMENT
ASSUME CS:CODE,DS:DATA
START: MOV AX,DATA
MOV DS,AX
MOV CH,04H
UP2: MOV CL,04H
LEA SI,STRING1
UP1:MOV AL,[SI]
MOV BL,[SI+1]
CMP AL,BL
JNC DOWN
MOV DL,[SI+1]
XCHG [SI],DL
MOV [SI+1],DL
DOWN: INC SI
DEC CL
JNZ UP1
DEC CH
JNZ UP2
INT 3
CODE ENDS
END START
RESULT:
Inputs: x: 0x2000 -- 05h, 02h, 01h, 04h
INSTRUCTIONS USED:
Step 1: Start.
Step 2: Initialize the DPTR register with starting address of data
Step 3: Initialize R0 register
Step 4: Clear accumulator
Step 5: Move the contents of data from starting address into accumulator
Step 6: Add the contents of data one by one
Step 7: Move the result into register B
Step 8: Increment R1 on generation of carry
Step 9: Increment the DPTR
Step 10: Repeat the process till R0 becomes zero
Step 11: Complement the result in accumulator
Step 12: Stop
FLOW CHART:
PROGRAM:
STEPPER MOTOR
AIM: To perform the rotation of stepper motor in clockwise and anti-clockwise direction.
HARDWARE USED: ARM LPC2929 board, Interfacing Board and Stepper Motor.
THEORY:
A stepper motor or a step motor is a brushless, asynchronous motor which divides a full rotation
into a number of steps. Unlike a brushless DC motor which rotates continuously when a fixed DC
voltage is applied to it, a step motor in discrete step angles. The stepper motors therefore are
manufactured with steps per revolution of 12,24,72,144,180,200, resulting in stepping angles of
30,15,5,2.5,2 and 1.8 degrees per step. The stepper motor can be controlled with or without
feedback.
ALGORITHM:
Step 1: Start.
Step 2: Declare Dir as value as 0x00.
Step 3: Initialize GPIO3_OR value as 0x000000FF.
Step 4: Declare SFSP2_26 value as 0x03 << 2.
Step 5: Initialize GLCD.
Step 6: Clear GLCD.
Step 7: Set the LCD back color as blue, text color as white.
Step 8: Display first line of LCD as “GVPCOE”, second line as “ECE” and third line as
“EMBEDDED SYSTEMS LAB”.
Step 9: Set LCD back color as white and text color as blue.
Step 10: Display fourth line of LCD as “stepper motor”.
Step 11: Check the condition if condition is true, go to next step, otherwise go to
step 18.
Step 12: Check the condition “ Dir =1”. If the condition is true, go to next step
otherwise go to step 18.
Step 13: Initialize GPIO3_DR.
Step 14: Initialize “delay (50000)” function.
Step 15: Initialize variable r as random unsigned integer.
Step 16: Check the condition “x>0”; if it is true, go to next step otherwise go to step18.
Step 17: Decrement x and go to step 16.
Step 18: Return to next step.
Step 19: Initialize GPIO3_OR.
Step 20: Repeat steps from step 14 to step 18.
Step 21: Initialize GPIO3_OR.
Step 22: Repeat steps from step14 to step 18.
Step 23: Initialize GPIO3_OR.
Step 24: Repeat steps from step 14 to step 18.
Step 25: Initialize GPIO3_OR.
Step 26: Repeat steps from step 14 to step 18.
Step 27: Initialize GPIO3_OR.
Step 28: Repeat steps from step 14 to step 18.
Step 29: Initialize GPIO3_OR.
Step 30: Repeat steps from step 14 to step 18.
Step 31: Initialize GPIO3_OR.
Step 32: Repeat steps from step 14 to step 18.
Step 33: Check the condition if true go to next step otherwise go to step 41.
Step 34: Check the condition if true go to next step otherwise go to step 41.
Step 35: Initialize “direction ( )” function.
Step 36: Declare Dir =~ Dir.
Step 37: Check the condition, if true go to next step, else go to step 41.
Step 38: Display “clockwise” and go to step 41.
Step 39: Display “anti-clockwise” and go to step 41.
Step 40: Repeat steps from step 14 to step 18.
Step 41: Stop.
FLOW CHART:
PROGRAM:
#include <LPC29xx.H>
#include "GLCD.h"
main()
{
/*Configure GPIO pins as Outputs */
GPIO3_DR |= 0x000000FF; /* Configure the BUTTON(S1) GPIO pin as Input with internal
pull-up */
SFSP2_26 = (0x03 << 2);
while(1)
{
if(Dir) /* Clockwise Direction */
{
GPIO3_OR = (GPIO3_OR & 0xFFFFFF00) | 0x00000088;
/* Write data for clock wise direction*/
delay(50000);
GPIO3_OR = (GPIO3_OR & 0xFFFFFF00) | 0x00000044;
/* Write data for clock wise direction*/
delay(50000);
GPIO3_OR = (GPIO3_OR & 0xFFFFFF00) | 0x00000022;
/* Write data for clock wise direction*/
delay(50000);
GPIO3_OR = (GPIO3_OR & 0xFFFFFF00) | 0x00000011;
/* Write data for clock wise direction*/
delay(50000);
}
else /* AntiClockwise Direction */
{
GPIO3_OR = (GPIO3_OR & 0xFFFFFF00) | 0x00000011;
/* Write data for anticlock wise direction*/
delay(50000);
GPIO3_OR = (GPIO3_OR & 0xFFFFFF00) | 0x00000022;
/* Write data for anticlock wise direction*/
delay(50000);
GPIO3_OR = (GPIO3_OR & 0xFFFFFF00) | 0x00000044;
/* Write data for anticlock wise direction*/
delay(50000);
GPIO3_OR = (GPIO3_OR & 0xFFFFFF00) | 0x00000088;
/* Write data for anticlock wise direction*/
delay(50000);
}
if(Dir)
GLCD_DisplayString (8, 0, 1," Clockwise ");
/*Display "Clockwise" on LCD */
else
GLCD_DisplayString (8, 0,1, " Anti Clockwise ");
/* Display "Anti Clockwise" on LCD */
delay(50000);
}
RESULT: Hence, performed the rotation of stepper motor in clockwise and anti-clockwise direction.
EXPERIMENT – 8
POTENTIOMETER
AIM: To perform ADC Channel testing with a rotator potentiometer on LPC2929 board.
THEORY:
Analog to digital converter (ADC) is a digital converter that is used to converter analog
signal/voltage into its equivalent digital number. The conversion is required so that the micro
controller can process that numbers and make it human hearable. The ADC is characterized by
resolution, which indicates the number of digital valves that can be measured. In LPC2929
microcontroller, we have in-built 10 bit ADC i.e. resolution=10 bit and maximum value = 2^10 =
1024. Digital valve lies between 0 to 1023.one of the most important term relate ADC is step size.
Step size is minimum change in input voltage which can be resolved by ADC.
ALGORITHM:
STEP 1: Start
STEP 6: Initialize MTIMO_PR, Match registers – MR0, MR2, MCR, EMR1 and TCR.
Step 16: Check i< 12000000 condition, if condition is true go to the next step, otherwise go to
step 25.
Step 18: Check the if condition. If condition is true, go to the next step, otherwise go to step 25.
Step 26: Check the if condition. If condition is true, go to the next step, otherwise go to step 29.
T
F
T
F
T
PROGRAM:
#include <stdio.h>
#include <LPC29xx.H>
#include "GLCD.h" /* LCD function prototypes */
const unsigned intled_mask[] = { 1 << 16, 1 << 17, 1 << 18, 1 << 19, 1 << 20, 1 << 21 , 1 << 22, 1 <<
23 };
const unsigned intbut_mask[] = { 1 << 26, 1UL << 27 };
volatile short AD0_val, AD2_val;
char text[40]; /* Import external functions from Serial.c file */
#ifdef __ADC0
#define AD_value AD0_val
#else
#define AD_value AD2_val
#endif
Speed = 5; /* Initial speed at half */
/* Configure MSCSS clock = PLL clock / 2 = 96 MHz (max allowed 125 MHz) */
MSCSS_CLK_CONF = (2UL << 24) | (1 << 11) | (1 << 2);
MTIM0_PR = (96000000/1000) - 1; /* Prescaler to drive timer with 1 ms */
MTIM0_MR0 = (10 - 1); /* Match value = 10 * 1ms = 10 ms -> ADC0*/
MTIM0_MR2 = (10 - 1); /* Match value = 10 * 1ms = 10 ms -> ADC2*/
MTIM0_MCR = (1 << 4); /* On Match 2 event reset timer */
MTIM0_EMR |= (3 << 4); /* Match 0 event generate logic 1 -> ADC0*/
MTIM0_EMR |= (3 << 8); /* Match 2 event generate logic 1 -> ADC2*/
MTIM0_TCR = 1; /* Start Timer 0 */
for (;;)
{ /* Loop forever */
if (AD_value != AD_valueOld)
{
GLCD_SetTextColor(Blue); /* Set the Text Color */
sprintf(text, "AD value = 0x%04X", AD_value);
GLCD_DisplayString(4, 0, (unsigned char *)text);
GLCD_SetTextColor(Red);
GLCD_Bargraph (0, 120, 320, 24, AD_value);
AD_valueOld = AD_value;
}
if (Clock)
{ /* LED activate and deactivate */
Clock = 0;
LEDState ^= 0x01;
change_speed(); /* Check buttons to change LED speed */
if (LEDState)
{
GPIO2_OR |= led_mask[num]; /* Turn LED on */
}
else
{
GPIO2_OR &= ~led_mask[num]; /* Turn LED off */
RESULT: ADC channel testing is done with a rotator potentiometer using LPC2929 Board.
EXPERIMENT – 9
THEORY:
Seven Segment Displays is the most common devices used for displaying digits and alphabet.
You can see the seven segment display devices in TV shows counting down to ‘0’. Use of
LEDs in seven segment displays made it more popular. The binary information can be
displayed in the form of decimal using this seven segment display. Its wide range of
applications is in microwave ovens, calculators, washing machines, radios, digital clocks etc.
The seven segment displays are made up of either LEDs or LCDs. Light emitting diode is P-N
junction diode which emits in the form of heat. These LEDs or LCDs are used to display the
required numeral or alphabet. Single seven segment or number of segments arranged in an
order meets our requirements.
ALGORITHM:
Step 1: Start.
Step 2: Calling and delay function.
Step 3: Declare I as unsigned long integer.
Step 4: Initialize i=0.
Step 5: Check i<15000000 condition, if true go to next step, otherwise go to step 7.
Step 6: Declare i, j, m, k, s as unsigned char.
Step 7: Initialize char display[6][4].
Step 8: Initialize GPIO2_DR 1 = 0x00010000.
Step 9: Initialize GPIO3_DE 1 = 0x0000100.
Step 10: Initialize the GLCD
Step 11: Clear the GLCD value.
Step 12: Set the GLCD back color as blue.
Step 13: Set the GLCD text color as white.
Step 14: Display GLCD first string as GVPCOE, second string as ECE, third string as EMBEDDED
SYSTEMS LAB.
Step 15: Set GLCD back color as white.
Step 16: Set GLCD text color as blue.
Step 17: Display GLCD fifth string as 7 segment display, eighth string as demo.
Step 18: Check while condition, if true go to next step otherwise go to step 34.
Step 19: Initialize i=0.
Step 20: Check i<6 condition, if true go to next step otherwise go to step 34.
Step 21: Initialize j=0.
Step 22: Check j<4 condition, if true go to next step, else step 33.
Step 23: Initialize s= display[i][j].
Step 24: Initialize k=0.
Step 25: Check k<8 condition, if true go to next step, otherwise go to step33.
Step 26: Initialize m=s.
Step 27: Perform operation on m=m&0*80.
Step 28: Check m == 0 condition, if true go to next step, otherwise go to step 30.
Step 29: GPIO3_DR = (GPIO_OR & 0xFFFFFEFF).
Step 30: Initialize the GPIO3_OR = (GPIO3_OR & 0xFFFFFEFF)|0X00000100.
Step 31: Initialize the GPIO2_OR = GPIO_OR & 0Xfffeffff.
Step 32: Initialize s << 1.
Step 33: Call the delay function.
Step 34: Stop.
FLOW CHART:
PROGRAM:
#include <LPC29xx.H>
#include "GLCD.h"
int main()
{
unsigned char i,j,k,m,s;
/* Look Up Table To Display */
unsigned char display[5][4]= { 0xff,0xff,0xff,0xff, 0x86,0xc7,0x86,0xc6, 0x87,0xde,0xc0,0xbf,
0x92,0x91,0x92,0xff,
0x87,0x86,0xc8,0x92 }; /* Values passed to 7 Segment */
GPIO2_DR |= 0x00010000;
GPIO3_DR |= 0x00000100; /* Configure GPIO pins as Outputs */
while(1)
{
for(i=0;i<5;i++) /*Number of Groups(5) */
{
for(j=0;j<4;j++) /* Number of LEDs(4) per Group*/
{
s = display[i][j]; /* code to Display */
for(k=0;k<8;k++) /* Number of Segments Per LED */
{
m = s;
m = m & 0x80;
if(m == 0)
/* Send Data */
GPIO3_OR = (GPIO3_OR & 0xFFFFFEFF);
else
GPIO3_OR = (GPIO3_OR & 0xFFFFFEFF) | 0x00000100;
GPIO2_OR = (GPIO2_OR & 0xFFFEFFFF) | 0x00010000; /*
Send Clock */
GPIO2_OR = (GPIO2_OR & 0xFFFEFFFF);
s <<= 1;
}
}
delay();
}
}
}
RESULT: Hence performed the interface of the 7 segment display to LPC2929 board and displayed
the required contents on 7 segment display.
EXPERIMENT – 10
AIM: To generate square wave or control Pulse Width Modulator using LPC 2929 board.
THEORY:
Pulse width modulation (PWM), or pulse-duration modulation (PDM), is a method of reducing the
average power delivered by an electrical signal, by effectively chopping it up into discrete parts.
The average value of voltage (and current) fed to the load is controlled by turning the switch
between supply and load on and off at a fast rate. The longer the switch is on compared to the off
periods, the higher the total power supplied to the load. Along with maximum power point
tracking (MPPT), it is one of the primary methods of reducing the output of solar panels to that
which can be utilized by a battery PWM is particularly suited for running inertial loads such as
motors, which are not as easily affected by this discrete switching, because their inertia causes them
to react slowly. The PWM switching frequency has to be high enough not to affect the load, which
is to say that the resultant waveform perceived by the load must be as smooth as possible.
ALGORITHM:
Step 1: Start.
Step 2: Configure GPIO pins as output.
Step 3: Initialize GLCD.
Step 4: Clear the GLCD.
Step 5: Set the back color.
Step 6: Set the text color.
Step 7: Display the string on the GLCD.
Step 8: Set the back color.
Step 9: Set the text color.
Step 10: Display the string on the GLCD.
Step 11: Loop for high amplitude.
Step 12: Delay routine.
Step 13: Loop for high amplitude.
Step 14: Delay routine.
Step 15: Stop.
FLOW CHART:
PROGRAM:
#include <LPC29xx.H>
#include "GLCD.h"
void delay(void) /* Delay Routine */
{
unsigned char i;
for(i=0;i<100;i++);
}
main()
{
unsigned char i=0,j=0;
GPIO3_DR |= 0x0000FFFF; /* Configure GPIO pins as Outputs */
while(1)
{
for(i=0; i<0x0FF; i++)
{
GPIO3_OR = (GPIO3_OR & 0xFFFFFF00)| 0x000000FF;
GPIO3_OR = (GPIO3_OR & 0xFFFF00FF)| 0x0000FF00;
delay();
}
for(j=0xFF; j>0; j--)
{
GPIO3_OR = (GPIO3_OR & 0xFFFF00FF) ;
GPIO3_OR = (GPIO3_OR & 0xFFFFFF00);
delay();
}
}
}
RESULT: Hence, demonstration of PWM using LPC 2929 board is performed and observed.
EXPERIMENT -11
LCD INTERFACING
THEORY:
A liquid-crystal display (LCD) is a flat-panel display or other electronically modulated optical device
that uses the light-modulating properties of liquid crystals combined with polarizers. Liquid crystals do
not emit light directly, [1] instead using a backlight or reflector to produce images in color or
monochrome. LCDs are available to display arbitrary images (as in a general-purpose computer
display) or fixed images with low information content, which can be displayed or hidden, such as
preset words, digits, and seven-segment displays, as in a digital clock. They use the same basic
technology, except that arbitrary images are made from a matrix of small pixels, while other displays
have larger elements. LCDs can either be normally on (positive) or off (negative), depending on the
polarizer arrangement.
ALGORITHM:
Step 1: Start.
Step 2: Declare int type variables ‘a’ i.e. Variable ‘a’ as integer.
Step 3: Initialize LCD.
Step 4: Clear the previous data on the LCD Display.
Step 5: Set the LCD background color as blue.
Step 6: Set the LCD text color as white.
Step 7: Display LCD first line as “GVPCOE”
Step 8: Display LCD second line as “ECE”
Step 9: Display LCD third line as “EMBEDDED SYSTEMS LAB”
Step 10: Initialize i=0
Step 11: Check i<12000000 condition, if the condition is true then go to step, otherwise go to step13.
Step 12: Increment ‘i’ valve and g to step11.
Step 13: Stop
FLOW CHART:
PROGRAM:
#include <LPC29xx.H>
#include "GLCD.h"
#include <stdio.h>
void delay1()
{
unsignedinti,j;
for(i=0; i<0x50; i++)
{
for(j=0; j<0x4fb; j++);
}
}
/* Function to display the character entered from the keyboard */
voidDisp_Key(unsigned long c)
{
GPIO3_OR = (GPIO3_OR & 0xFFFFFF00) | c;
/* E R/W* RS */
GPIO3_OR = (GPIO3_OR & 0xFFFF00FF) | (0xFA << 8); /* 0 1 0 */
GPIO3_OR = (GPIO3_OR & 0xFFFF00FF) | (0xF9 << 8); /* 0 0 1 */
GPIO3_OR = (GPIO3_OR & 0xFFFF00FF) | (0xFD << 8); /* 1 0 1 */
GPIO3_OR = (GPIO3_OR & 0xFFFF00FF) | (0xF9 << 8); /* 0 0 1 */
delay(50);
}
/* Function to read characters from a string and displaying the same by calling the Disp_keyfucntion
*/
void Disp_String1(void)
{
inti=0;
while(disp1[i] != 0x00)
{
Disp_Key(disp1[i]);
delay1();
i++;
}
}
voidDisp_Message(void)
{
inti;
i = 0;
while(mess[i] != 0x00)
{
Disp_Key(mess[i]);
i ++;
}
}
int main()
{
unsigned long com_word;
unsigned char c;
init_serial();
init_lcd();
com_word = 0x80;
Command_Write(com_word);
delay1();
delay1();
Disp_String1(); /* Displays the "ENTER A KEY" message on LCD */
printf("\n\rESA LCD INTERFACE DEMO PROGRAM \n\r ");
printf("\n\rEnter any key to clear the display\n\r ");
c = getkey();
while(1)
{
printf("\n Enter Key \t"); /* Enter the key to be displayed on the display */
c = getkey();
THEORY:
In electronics, a digital-to-analog converter (DAC, D/A, D2A, or D-to-A) is a system that converts
a digital signal into an analog signal. An analog-to-digital converter (ADC) performs the reverse
function. There are several DAC architectures; the suitability of a DAC for a particular application
is determined by figures of merit including: resolution, maximum sampling frequency and others.
Digital-to-analog conversion can degrade a signal, so a DAC should be specified that has
insignificant errors in terms of the application. DACs are commonly used in music players to
convert digital data streams into analog audio signals. They are also used in televisions and mobile
phones to convert digital video data into analog video signals. These two applications use DACs at
opposite ends of the frequency/resolution trade-off. The audio DAC is a low-frequency, high-
resolution type while the video DAC is a high-frequency low- to medium-resolution type.
ALGORITHM:
Step 1: Start.
Step 2: Configure GPIO pins as output.
Step 3: Initialize GLCD.
Step 4: Clear the GLCD.
Step 5: Set the back color.
Step 6: Set the text color.
Step 7: Display the string on the GLCD.
Step 8: Set the back color.
Step 9: Set the text color.
Step 10: Display the string on the GLCD.
Step 11: Loop for high amplitude.
Step 12: Delay routine.
Step 13: Loop for high amplitude.
Step 14: Delay routine.
Step 15: Stop.
FLOW CHART:
PROGRAM:
#include <LPC29xx.H>
#include "GLCD.h"
void delay(void) /* Delay Routine */
{
unsigned char i;
for(i=0;i<100;i++);
}
main()
{
unsignedinti,j;
GPIO3_DR |= 0x0000FFFF; /* Configure GPIO pins as Outputs */