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

IR codes: Short version like 7E-A2 and long stream

 
Post new topic   Reply to topic    JP1 Remotes Forum Index -> Non-JP1
View previous topic :: View next topic  
Author Message
arware



Joined: 23 Jul 2021
Posts: 1

                    
PostPosted: Sat Jul 31, 2021 10:54 am    Post subject: IR codes: Short version like 7E-A2 and long stream Reply with quote

There is a Yamaha Master File, http://www.hifi-remote.com/forums/dload.php?action=file&file_id=2099, with HTML converter, that converts short form (7E A2) hex command to a longer one. Is there a reverse converter? I'm working on a small device and really limited on memory to keep all long formats. I rather use MCU with timer to generate the proper IR stream based on the shorter HEX code, like 7E A2, for example. And how does the long code translate to IR stream anyway? Is it binary representation of bursts and gaps? Could not make any sense out them anyway.
Any help will be greatly appreciated.
Back to top
View user's profile Send private message
The Robman
Site Owner


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

                    
PostPosted: Sat Jul 31, 2021 3:54 pm    Post subject: Reply with quote

Could you give a little bit more detail in what you're trying to do and what you found in that spreadsheet? That particular spreadsheet just lists the device codes and OBCs for all the known functions for a Yamaha receiver, it doesn't include any short or long hex codes.

Perhaps you were really looking at this file which does show the short hex codes that you mentioned, but not the long ones.

The short hex code that you posted (ie, 7E A2) shows the device code and command code (OBC) in hex format rather than decimal format (ie, 7E = dev 126, A2 = command 162, which would appear to be the "AUDIO MUTE ON" function).

When you talk about long hex codes, I'm guessing that you're referring to Pronto hex codes (eg, "0000 006d 0022 0002 0155 00aa 0016 0014 0016 003f 0016 0015 0016 003f 0016 003f 0016 003f 0016 003f 0016 0014 0016 003f 0016 0014 0016 003f 0016 0014 0016 0015 0016 0015 0016 0015 0016 003f 0016 0015 0016 003f 0016 003f 0016 003f 0016 003f 0016 0015 0016 0015 0016 0015 0016 003f 0016 0014 0016 0014 0016 0014 0016 0014 0016 003f 0016 003f 0016 003f 0016 05e6 0155 0055 0016 0e39", taken from here).

Now, let's say I gave you a list of all the functions for a Yamaha receiver in short hex format, what would you do with them? It sounds like you haven't developed an IR generator yet, so this might be a case pf putting the cart before the horse.

IR signals are binary and they are created by flashing the infrared light on and off. Yamaha signals use the NEC1 protocol (sometimes with some modifications), where the difference between a logical ONE and ZERO is represented by the difference in off time. A ZERO is +550 -550 (which means ON for 550 uS then OFF for 550 uS). A ONE is +550 -1650 (which means ON for 550 uS and OFF for 1650 uS).

NEC1 has 32 data bits, where the first 8 bits are the device code, the next 8 bits are usually the complement of the device code but can sometimes be a 2nd device code, the next 8 bits are the command code and the last 8 bits are usually the complement of the command code but can sometimes be a 2nd command code. All of these are in LSB format, which means you read the binary backwards, so device code 1 would be 10000000 (rather than 00000001). NEC1 has a carrier frequency of 38kHz. You'll need some additional info if you are to create your own generator, but if that hasn't already scared you off, we can give you the rest.

To convert that Pronto string to binary, you need to understand the Pronto format. This link is a good place to start, but high level:

Preamble
0000 = raw format
006d = carrier frequency
0022 = 34 pairs sent once
0002 = 2 pairs sent on repeat

IR Signal
0155 00aa = leadin pair
0016 0014 0016 003f 0016 0015 0016 003f 0016 003f 0016 003f 0016 003f 0016 0014 0016 003f 0016 0014 0016 003f 0016 0014 0016 0015 0016 0015 0016 0015 0016 003f 0016 0015 0016 003f 0016 003f 0016 003f 0016 003f 0016 0015 0016 0015 0016 0015 0016 003f 0016 0014 0016 0014 0016 0014 0016 0014 0016 003f 0016 003f 0016 003f = data
0016 05e6 = leadout pair
0155 0055 0016 0e39 = repeat pair

All the data is shown in pairs where the first word (eg, 0016) is the ON time and the second word (eg, 003f) is the OFF time. 0014 or 0015 or 0016 all represent the +550 time and 003F represents the 1650 time.

Converting the data string to binary we get:
01011110 10100001 01111000 10000111

Here you'll notice that the 2nd word is the complement of the 1st, and the 4th is the complement of the 3rd. So in this case, there's no dev2 or obc2 data.

The DEV is 01011110 which converts to 122
The OBC is 01111000 which converts to 30
_________________
Rob
www.hifi-remote.com
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   Reply to topic       JP1 Remotes Forum Index -> Non-JP1 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
Top 7 Advantages of Playing Online Slots The Evolution of Remote Control