Generation of Sinusoidal Waveform

There is a website which gives and generates Sine wave look-up table as per requirement.

link to website: Sine Look-up table Generator

Generation of sinusoidal waveform

Assembly Language Program:

LOOP: MOV DPTR,#TABLE ; Move the first value of table to DPTR
MOV R0,#51 ; Moving immediate value into R0
L1: CLR A ; Clear the accumulator
MOVC A,@A+DPTR ; Move code byte relative to DPTR to ACC
MOV P1,A ; Move the content of ACC into port P1
INC DPTR ; Increment DPTR
DJNZ R0,L1 ; Decrement R0 and jump to L1 if R0 is not equal to zero
SJMP LOOP ; Short jump to LOOP

ORG 300H
TABLE: DB 128,143,159,174,188,201,213,224,234,242,248,252,254,255,253,250,245,238,229,219,207,195,181,166,151,135,120,104,89,74,60,48,36,26,17,10,5,2,0,1,3,7,13,21,31,42,54,67,81,96,112
END ; End the program

 

Advertisements