# pronto hex code format understanding

hi, i am working on universal remote and i am understanding the pronto hex codes and i have search allot and find that there different protocols like NEC , rc5 etc.. i am seen this link http://www.remotecentral.com/features/irdisp3.htm about the format of pronto hex in this link i am not understanding the Lead-in and Lead-out , for eg. they have this pronto code 0000 0067 0000 0015 0060 0018 0018 0018 0030 0018 0030 0018 0030 0018 0018 0018 0030 0018 0018 0018 0018 0018 0030 0018 0018 0018 0030 0018 0030 0018 0030 0018 0018 0018 0018 0018 0030 0018 0018 0018 0018 0018 0030 0018 0018 03f6

and they mentioned that Word 45,46 0018 03fc (24,24 decimal) Burst Pair 20, bit 13 = "0" i mean they convert 0018 to decimal i.e.. 24 thats OK, but how did they convert 03fc to 24 03fc in decimal gives us 1020 and 1111111100 in binary

On page I think are present some errors.
On first table “Lead Out” is presented as 03f6, after when convert 46° word, he write 03fc
03f6=>1014
03fc=>1020

on first table 03f6 in second column is writed as 1024 decimal !!!

hi, even i notice the same mistake you find but in the pronto hex code if we assume that it is 03f6=>1014 dec. then how could we find out the burst pair value for 0018 03f6 0018 == 24 dec and 03f6=>1014 dec. then the combination becomes, as they explained on the remotecentral 0018 03fc (24,1014 decimal) Burst Pair 20, bit 13 = " value " the what is value ? and please can you explain the exact meaning of Lead in and Lead out in pronto code ?

The first word of that burst pair is 0018, meaning that the IR emitter will be ON (sending pulses at the carrier frequency) for 24 cycles at the carrier frequency. The second word is the number of cycles of the carrier frequency that the IR emitter is not sending carrier. Their example was talking about a carrier frequency of 40 Khz, which means that one cycle is 25 microseconds long.

So, in the case of 0018 03f6, the carrier wil be on for 24*25 = 600 microseconds, and it will be off for 1014*25 = 25350 microseconds. The total time of that burst pair, therefore, is 25950 microseconds. The total OFF time is longer in the last word because it is a safeguard against another code being sent too soon.

This burst pair is the lead-out, and it does, in the case of the Sony scheme, carry one bit of data. the ON time (first word in a burst pair) carries the data (in this case it's 0018, meaning a 0 bit). The OFF time could be 0018, like the rest of the bit-significanr burst pairs, but it isn't necessary, and the OFF time can be used as a sort of guardband.

The lead-in is not data (in terms of 0 or 1 values). The receiver uses this pattern to get ready to receive the data, setting its AGC (Automatic Gain Control). This is necessary to set the amplifier gain, making sure that no matter how strong or weak the signal from the remote, it will have the best chance of receiving the code without error.

From Page 2 in the link you supplied...

The Lead In Burst pair can be thought of as the hello or wake up burst. It tells the receiver to start listening (or rather looking) very closely as what is coming. It is usually of different timing duration than the Burst Pairs in the data part. Technically it is also used to set the receivers AGC level, a factor related to how much the receiver will amplify the IR light it sees.

The Lead Out burst pair marks the end of the message and usually has a long OFF time period to guarantee that two IR messages can’t be sent too close together. It may actually be incorporated as part of the last data bit if the ON period is what carries the information (that is, the off time is constant in the data portion and the On time varies between two values). Once again, Sony does exactly that.

It will pay to carefully read all the pages of that document. Yes, there are some minor errors in converting to decimal, but they are indeed, minor. You have the option in an Arduino sketch, of using Hex.

Most of the ‘learned’ Pronto codes I have seen have no lead in ‘one time burst’ and just use the lead out ‘repeat burst’ (0015 = 21 Mark/Space pairs) to record the actual signal. The format also assumes the signal always starts with a Mark and ends with a Space
The 03F6 translates to 25,350 microseconds of Space(no IR) or silence at the end of the signal.

I imported the sample signal you provided and made a screenshot for you. The signal decodes as SONY 20 bit (0x00074B92).
The 2 signals shown in green and yellow are the same just at different zoom levels.

The modulation frequency seems to be 40,244Hz - but We know that it should really be 40kHz for Sony.

This signal exports in IRremote format as:

``````Raw (43): -1000,2400,-600,600,-600,1200,-600,1200,-600,1200,-600,600,-600,1200,-600,600,-600,600,-600,1200,-600,600,-600,1200,-600,1200,-600,1200,-600,600,-600,600,-600,1200,-600,600,-600,600,-600,1200,-600,600,-25350
``````

or when we adjust it for 40kHz the Pronto format becomes: (the 0067 becomes 0068)

``````0000 0068 0000 0015 0060 0018 0018 0018 0030 0018 0030 0018 0030 0018 0018 0018 0030 0018 0018 0018 0018 0018 0030 0018 0018 0018 0030 0018 0030 0018 0030 0018 0018 0018 0018 0018 0030 0018 0018 0018 0018 0018 0030 0018 0018 03F6
``````

Search for ‘sb projects IR’ to find out all you need to know about the make up of IR signals.

hi, thanks for the reply, now i understand the format of pronto hex code.., but i have another query I am working on universal remote , now I have to convert the pronto hex code to .wave file and i have read the file format of the wave from this link https://ccrma.stanford.edu/courses/422/projects/WaveFormat/ I have been unable to convert one pronto code to .wav file for any device I have, although I know my IR transmitter works as after hours of looking for LG .wav files I found a file called service-ok-ok.wav from this link http://chomikuj.pl/adam18021964/LG+450USB+Sowty/LG_DTV/Lg-Service-menu-All*2c/LED-Wav. This file allows me to get into the service menu of my TV.... but this is all I can do as I do not know how to create a wave file. my transmitter is just 2 IR LEDs on a 3.5mm audio jack which I am going to plug into my phone's 3.5 mm jack and then i play the wave file to send the signal to TV.here is my transmitter device http://rtfms.com/episode-4-turn-your-iphoneandroid-mac-pc-player-etc-into-a-universal-remote.htm#source , you can see the picture of 2 IR LEDs on a 3.5mm audio jack.

I’m not sure what you want to do. Will you be trying to generate a wave file on an Arduino, or are you going to generate it on a PC and send it to an iPhone or to an Arduino?

On the link you provided to the project at rtfms.com, there is a Python script that will generate a wave file from Pronto codes.

It would help if you could describe what role you want the Arduino to play in your universal remote. If the Arduino is to be the remote, you don’t need a wave file. You can just send the code through a digital output to an IR LED.

hi, as you see that there is project at rtfms.com, there is a Python script that will generate a wave file from Pronto codes. but i don't know whether the python code is correct or not , basically i am working with JAVA , i mean there is any way which will or any hint that will convert the Pronto hex codes into wave file in JAVA and that file i am going to play on my phone as i explained my transmitter which is going generates the signal when i play that wave file in-front of my TV. and you asked me about the role of Arduino, I'll explained bit more. first you can see this video http://www.youtube.com/watch?v=wFMqjknLn8o and i have sansui tv as you can see in this video he is getting the IR code just pressing the button of remote in-front of the arduino hardware, and i am using the same thing to detect the IR code for remote e.g., when i press my sansui TV Power button infront of the device i am getting this code 40BF48B7 and from this code i am converting this 40BF48B7 remote code to pronto hex code using IrMaster. here is my thread on remotecentral.com http://www.remotecentral.com/cgi-bin/mboard/pro_remotes/thread.cgi?196

OK, so the Arduino is being used to capture the codes. That's good.

As for the Python script being correct or not, the only way to really tell is to try it. Create a wave file using the codes you captured, and pay the file on your phone, into the IR LEDs.

If you don't have Python, you can get it at http://python.org

I can't help you much with the Python stuff, or even testing, as my phone doesn't do music.

hi, basically i am java developer so i don't have any knowledge about python. but is there any tool or software which takes Pronto hex code as input and generates the wave file or is there something in java , i mean any code or hint, and most important think Arduino is being used to capture the codes like i have sansui TV and the code i am getting from arduino is 40BF48B7 and or is there any way to convert or decode into Pronto hex codes ?

user1:
hi, basically i am java developer so i don’t have any knowledge about python.

Neither do I, but I know I can get a free Python interpreter and the libraries to go with it, on that link I gave you. Then all you need to do is to run the script from the command line. The developer of the script is on that rtfms site, and it looks like he’s available to answer questions. There are lots of Java forums, in which you might get help in translating Python to Java.

but is there any tool or software which takes Pronto hex code as input and generates the wave file or is there something in java , i mean any code or hint,

and most important think Arduino is being used to capture the codes like i have sansui TV and the code i am getting from arduino is 40BF48B7 and or is there any way to convert or decode into Pronto hex codes ?

Probably, but what did you code in the Arduino sketch? Or, if you didn’t write it, where did you get it? I haven’t seen your Arduino code, so I have no way of telling what it does.

hi, i have done allot of research and i have posted my query on every forum and on every community but no body have any idea about converting the wave files from Pronto hex codes..,even i posted on stackOverflow the biggest forum ,no body gives me any kind reply or any hint and you asked me about the Arduino sketch and code i am using the Ken Shirriff's IR library to capture the remote codes http://www.righto.com/2009/08/multi-protocol-infrared-remote-library.html but I'll try the python script then I'll give you reply and one thing I am not able to post on rtfms about my query, plz can you help me on that , on the rtfms i am not able to see where and how to create my account for posting my issue ?

I think i have issue in understanding the pronto format , so i need help on format , so i have the below Pronto code
Pronto code = 0000 006d 0022 0002 0154 00ab 0016 0015 0016 0015 0016 0015 0016 0015 0016 003f 0016 0015 0016 003f 0016 0015 0016 003f 0016 003f 0016 003f 0016 003f 0016 0015 0016 003f 0016 0015 0016 003f 0016 0015 0016 003f 0016 003f 0016 003f 0016 003f 0016 003f 0016 0015 0016 0015 0016 003f 0016 0015 0016 0015 0016 0015 0016 0015 0016 0015 0016 003f 0016 003f 0016 05e8 0154 0055 0016 0e3f
and i have to Break down it , and please tell me where i am wrong, i have found this Pronto from this link http://www.avsforum.com/t/787145/what-format-are-these-codes-and-how-to-convert-to-pronto
Breaking down the pronto code gives me this:
0000 = Start is always 0000
006d = 38Khz. 006d hex =109 decimal (38,028 = 1000000/(109*.241246))
0022 = 0022 hex = 34 dec. 34 Single burst pairs (bits)
0002 = 2 Repeat burst pairs (bits)

i have some issue like
i am not understanding the proper meaning of these two
0022 = 0022 hex = 34 dec. 34 Single burst pairs (bits)
0002 = 2 Repeat burst pairs (bits).

and in the above Pronto what is the meaning of Lead-in and Lead-out
0154 00ab = is this Lead in ?
and then what is the lead out and
what are 0002 = 2 Repeat burst pairs (bits)
in the above Pronto ?

Attached is a graphical representation of the signal you uploaded.
It shows the same signal twice at different zoom levels.
The frequency works out at 38029Hz and it decodes as an NEC 32 bit signal (in Hex 0x0AF57C83)

The mark/space timings (microseconds) in IRremote format are as follows:

``````8840,-4446,572,-546,572,-546,572,-546,572,-546,572,-1638,572,-546,572,-1638,572,-546,572,-1638,572,-1638,572,-1638,572,-1638,572,-546,572,-1638,572,-546,572,-1638,572,-546,572,-1638,572,-1638,572,-1638,572,-1638,572,-1638,572,-546,572,-546,572,-1638,572,-546,572,-546,572,-546,572,-546,572,-546,572,-1638,572,-1638,572,-39312,8840,-2210,572,-94822
``````

Regarding Pronto format - it is well described here: RC: The Pronto's IR Code Format (1)
Note there are 3 pages for you to study!

Hopefully, that may help you in understanding the Signal & Pronto format.

hi.. AnalysIR , thanks for your reply that relay helps me, now i know the format of Pronto hex code but please read my 5th and 7th reply what exactly is my requirement