here is my code , but how to get the proper byte and dislay,
i knows the NEC protocol
#include"IR_controller.h"
void LoadTimer0(unsigned char LoadCode)
{
switch(LoadCode)
{
case LoadValue9ms: TH0=0xDF;TL0=0x99; break;
case LoadValue4ms5: TH0=0xEF;TL0=0xCC; break;
case LoadValue0ms56: TH0=0xFD;TL0=0xFB; break;
case LoadValue0ms565: TH0=0xFD;TL0=0xF7; break;
case LoadValue1ms69: TH0=0xF9;TL0=0xEA; break;
}
TF0 = 0; //reset the TF value
}
void IRsend(IRaddress,IRcommand)
unsigned char IRaddress,IRcommand;
{
unsigned char x,y,temp;
TMOD = (TMOD & 0xF0) | 0x01;
TR0 = 1;
IRsendport = 1;
LoadTimer0(LoadValue9ms);
while(TF0!=1);
IRsendport = 0;
LoadTimer0(LoadValue4ms5);
while(TF0!=1);
for(y=0;y<4;y++)
{
switch
{
case 0: temp = IRaddress; break;
case 1: temp = ~IRaddress; break;
case 2: temp = IRcommand; break;
case 3: temp = ~IRcommand; break;
}
for(x=0;x<8;x++)
{
IRsendport = 1;
LoadTimer0(LoadValue0ms56);
while(TF0!=1);
IRsendport = 0;
if ((temp & 0x01) == 0)
{
LoadTimer0(LoadValue0ms565);
}
else
{
LoadTimer0(LoadValue1ms69);
}
while(TF0!=1);
temp = temp >> 1;
}
}
IRsendport = 1;
LoadTimer0(LoadValue0ms56);
while(TF0!=1);
IRsendport = 0;
}
---------- Post added at 15:19 ---------- Previous post was at 15:06 ----------
Hi,
To familiarize yourself with the NEC protocol, please check this useful link. You should have a thorough knowledge of the protocol before coding.
SB-Projects: IR remote control: NEC protocol
i knows the NEC protocol
if u have the proper code for reading remot entered code and displaying that code on lcd using 8051 controller , please pass to me . urgent
[