Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

waveform decoding with 8051 coding problem

Status
Not open for further replies.

aliraza786

Full Member level 4
Joined
Nov 10, 2009
Messages
210
Helped
14
Reputation
28
Reaction score
14
Trophy points
1,298
Location
Lahore, Pakistan, Pakistan
Activity points
2,914
i wana decode a simple wave form genertaing from one controller and the other controller is programed to decode it ......i write simple code for this here but it is not working i dnt know what is the problem in this or there are other methods one can use for decoding wave form...here is the code
Transmiter:
________________________________________
#include<reg51.h>
sbit sw=P2^0; sbit sw1=P2^1; unsigned int x,g;
sbit relay=P1^6;
void delay(x)
{
for(g=0;g<x;g++)
{
TMOD=0x01;
TH0=0xFC;
TL0=0x67;
TR0=1;
while(TF0==0);
TR0=0;
TF0=0;
}
}
void main()
{
while(1)
{
if (sw==0)
{
sw1=1;
delay(2);
sw1=0;
delay(4);
sw1=1;
delay(8);
sw1=0;
delay(4);
}
}
}

____________________________________________________
RECIVER:
______________________________________________________
#include<reg51.h>
sbit sw=P2^0; sbit sw1=P2^1; unsigned int x,g;
sbit relay=P1^6;
void delay(x)
{
for(g=0;g<x;g++)
{
TMOD=0x01;
TH0=0xFC;
TL0=0x67;
TR0=1;
while(TF0==0);
TR0=0;
TF0=0;
}
}
void main()
{ relay=0;
while(1)
{
if(sw==0)
{
delay(2);
{
if(sw==1)
{
delay(4);
{
if(sw==0);
{
delay(8);
{
if(sw==1)
{
delay(4);
relay=1;
}
}
}
}
}
}
}
}
}
_____________________________________________________
here is the protious simulation...
 

please suggest me the sample code for demodulation in C... i wana decode a simple wave form..any idea will be highly appreciated
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top