Pages

Showing posts with label triangle wave in 8051. Show all posts
Showing posts with label triangle wave in 8051. Show all posts

program for Dual DAC, triangle wave in 8051

#include <REG51xD2.H>

#include "lcd.h"
main()
{
unsigned char i=0;
InitLcd(); /* Initialise LCD */
WriteString("Triangular Wave"); /* Display on LCD */
P0 = 0x00; /* P0 as Output port */
while(1)
{
for(i=0;i<0xff;i++){ /* Generate ON pulse */
P1 = i;
P0 = i; }
for(i=0xfe;i>0x00;i--) /* Generate OFF pulse */
{P0 = i;
P1 = i;}
}
}