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.

nec remotr cantrol interface with 8051

Status
Not open for further replies.

arun_9998

Banned
Joined
Aug 25, 2008
Messages
53
Helped
11
Reputation
22
Reaction score
10
Trophy points
1,288
Location
india
Activity points
0
hey all guyes
can any one help me to nec remote interface to 8051 in c
i tired but i can't interface
please help me
i wrote some code
cpu FQ 12MHz
when event occur by pressing remote key i start interrupt 0(P3^2) isr
isr_()interrupr 0
EX0=0;
TR0=1;
while(ir pin);
TR0=0;
compare TH0>>8|TL0 to 9000 count
after this
TH0=0
TL0=0
TR0=1
while(!ir pin)
TR0=0
compare TH0>>8|TL0 to 4500 count

please help me i cant read lead code i captuer event on P3^2

Thanks
 

ard

Full Member level 5
Joined
May 3, 2009
Messages
252
Helped
52
Reputation
104
Reaction score
50
Trophy points
1,308
Location
Mumbai, India
Activity points
2,783
Hi Arun,

I have never used the 8051 nor 'C'. I generally use PICs with PBP, but I DO have some experience with decoding NEC signals, so here are a few suggestions.

An NEC signal, after the preamble, consist of 32 pulses. The first 8 are the Device ID, next 8 are the complement of Device ID. You can safely ignore these as for a given remote these are the same for all buttons. The next 8 bytes are the function. These are the ones which would be unique to each button you press. The last 8 are complements of the function, so you can ignore these too, unless you need error checking.

Now for the actual decoding; just monitor the *spaces* between the pulses; dont worry about the pulse widths, they would be the same. Assign a '1' for a wider pulse width and a '0' for a short one. Inject these bits into a byte by shifting every bit you read. At the end, you should have a 8 bit number that is unique to your key press.

Look up SB-Projects: IR remote control: NEC protocol for more specifics.

Regards,

Anand Dhuru
 

arun_9998

Banned
Joined
Aug 25, 2008
Messages
53
Helped
11
Reputation
22
Reaction score
10
Trophy points
1,288
Location
india
Activity points
0
ok ! but i cant read lead code please post me any hint
thanks
 

g_shyam1682

Full Member level 4
Joined
Jan 11, 2010
Messages
206
Helped
53
Reputation
106
Reaction score
43
Trophy points
1,308
Location
Udaipur-Rajshan-India
Activity points
2,551
Hi friend

I have attached some material below.
I have already write successful program for NEC protocol from that maretial.

Hope this is help you.
Shyam
India
 

Attachments

  • NEC Protocol.rar
    54.4 KB · Views: 81

arun_9998

Banned
Joined
Aug 25, 2008
Messages
53
Helped
11
Reputation
22
Reaction score
10
Trophy points
1,288
Location
india
Activity points
0
ok! can you share with me your code
thanks.
Hi friend

I have attached some material below.
I have already write successful program for NEC protocol from that maretial.

Hope this is help you.
Shyam
India
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top