Pages

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;}
}
}

0 comments:

Post a Comment