Works fine.... #include<reg51.h> #include<string.h> typedef unsigned char uchar; uchar flag; uchar count=0; uchar cmd[10]; uchar sineLukup[]={ 0x80,0x96,0x0ab,0x0c0,0x0d2,0x0e2,0x0ef, 0x0f8,0x0fe,0x0ff,0x0fe,0x0f8,0x0ef,0x0e2, 0x0d2,0x0c0,0x0ab,0x096,0x80,0x6a,0x54, 0x40,0x2e,0x1e,0x11,0x08,0x02,0x00,0x02, 0x08,0x11,0x1e,0x2e,0x40,0x54,0x6a,0x80}; code uchar rIDN[] = "PROGRAMMABLE FUCNTION GENERATOR"; code uchar rVER[] = "version 1.1"; code uchar rMODSET[] = "MODE SET SUCCESSFUL"; code uchar rCMDERR[]="CMDERR"; void sendResp(uchar *val,uchar cnt); void sqrWav(); void sthWav(); void sinWav(); void triWav(); void (*wave)(); void delay01ms(uchar val); void initProgram() { EA=1; ES=1; SCON =0x50; TMOD=0x21; TH1 = 0x253; TL1 = 0X253; TR1 =1; flag=1; } void sqrWav() { while( flag ){