JP1 Remotes Forum Index JP1 Remotes

FAQFAQ SearchSearch 7 days of topics7 Days MemberlistMemberlist UsergroupsUsergroups RegisterRegister
ProfileProfile Log in to check your private messagesLog in to check your private messages Log inLog in

The $005A NEC protocol explained.

Post new topic   This topic is locked: you cannot edit posts or make replies.    JP1 Remotes Forum Index -> JP1 - General Forum
View previous topic :: View next topic  
Author Message
The Robman
Site Owner

Joined: 01 Aug 2003
Posts: 18641
Location: Chicago, IL

PostPosted: Sat Oct 04, 2003 7:36 pm    Post subject: The $005A NEC protocol explained. Reply with quote

For anyone who wants to see the actual source code, with detailed comments, there is a file in the fill section called 5a-commented.txt that has all of that. This post is just meant to be a quick reference for folks that want to tweek this protocol to create exactly the signal that they need. (There is also a zip file containing ASM and BAT files called:

For most of you this will probably go over your head, but don't worry about it, the folks that are likely to help you setup a complicated version of the NEC protocol will most likely understand it, and I'm writing it for their benefit.

I assume you already know what the NEC1, NEC2, NECx1 and NECx2 signals look like as I'm not going to try and explain that here.

The $005A protocol uses three bytes of fixed data. The first byte is a control byte that controls how the signals will be formatted, and that's what I'm discussing here. The remaining two bytes are the device codes.

I'm going to refer to the bits in the control byte like this B0, B1, B2, etc where B0 is the right most bit and B7 is the left most bit.

OK, onto the detail...

If B4 is set, an NECx signal will be created, otherwise it's NEC
If B5 is set, device code 2 comes from the fixed data, otherwise it's the complement of device code 1 (which does come from the fixed data)
If B0 is set, the signal is NEC2 or NECx2, otherwise it's NEC1 or NECx1

The following only applies to NEC1/NEC2 signals (not the NECx signals):
If B3 is set, use NEC2 for the repeatable buttons (ie, VOL+/-, CH+/-, REWIND and F.FWD).
If B1 is set, send the signal 2 times before jumping to the IR engine.
If B2 is set, there's some special handling for the RECORD button, if B5 is clear, use fixed byte3 as the device code (instead of fixed byte2), but if it's set, toggle bit7 of both device codes.

Here's some common non-standard values for this byte:
04: NEC1: B2=set, B5=clear (RECORD button handling)
05: NEC2: B2=set, B5=clear (RECORD button handling)
08: NEC1: B3=set, use NEC2 for the repeatable buttons
10: NECx1 (where dev2 is comp of dev1)
Please don't PM me with remote questions, post them in the forums so all the experts can help!
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   This topic is locked: you cannot edit posts or make replies.       JP1 Remotes Forum Index -> JP1 - General Forum All times are GMT - 5 Hours
Page 1 of 1

Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Get Smart! the band's official homepage Rockabilly Central