How would I convert this to Pronto format?

Interested in integrating USB-UIRT support into an application? Look here!

Moderator: jrhees

How would I convert this to Pronto format?

Postby Dean Roddey » Thu Jan 20, 2005 2:10 am

How would I take these RC5 commands:

System address: 10 hex (00010000 binary) (5 bit system address)

6 bit button code:

Button Code Hex Code Binary
Discrete OFF 19 00011001
Discrete ON 1A 00011010

And convert that to a Pronto type format? A CQC customer wants to get this command into CQC, but my UIRT driver only takes Pronto style commands for import for the UIRT.
Dean Roddey
 

Postby jrhees » Sun Jan 23, 2005 6:14 am

I know there are programs out there to convert -- just don't know where...

-Jon
jrhees
Site Admin
 
Posts: 1652
Joined: Tue Jan 28, 2003 11:49 pm

Postby Frank Mc Alinden » Sun Jan 23, 2005 11:11 am

Hi Guys
Might be worth while having a chat with schelte he has done some pronto to Homevision ir conversions , Also Jon he has done some work on Daikon Air Con codes and i believe The Redrat people did likewise...

http://home.wanadoo.nl/sbron/irledit.html

HTH
Frank
Frank Mc Alinden
 
Posts: 50
Joined: Sat Aug 28, 2004 3:05 am
Location: Melbourne Australia

Postby mwtb » Mon Mar 14, 2005 4:20 pm

If anyone is still wanting this, I have managed to work it out in order to get the toggle bit working.

I'll post code if someone wants (and I get time to tidy it up), but in order to convert, you need to be aware of the format of RC5 codes:

Code: Select all
 | Start Bits | Toggle Bit | Address Bits | Command Bits |
 |     2      |      1     |      5       |       6      |


This format varies for RC5+ and RC6, which I'm not going to deal with. Given the above, you then need to understand that RC5 is Phase Modulation encoded, and not Phase Width encoded. In other words, it doesn't match the method Pronto codes are intended to represent at all.

So, for Phase Modulation, using the 1 for on and 0 for off as a standard notation, a 0 followed by a 1 is a 1 and a 1 followed by a 0 is a 0.

Code: Select all
| 0 1 | 1 0 | 0 1 |
|  1  |  0  |  1  |


To explain further. Imagine a constant clock tick, with 1s and 0s measurable at each tick. Every value you want ultimately will take two ticks to read off, because you need to read 1 then 0 or 0 then 1 to decode the value.

So, an example RC5 code as a hex value might be 0x3715, in binary:

Code: Select all
| Start Bits | Toggle Bit | Address Bits | Command Bits |
|     11     |      0     |     11100    |    010101    |



Which, Phase Modulated, is:

Code: Select all
| Start Bits | Toggle Bit |   Address Bits   |   Command Bits     |
|   01 01    |     10     |  01 01 01 10 10  |  10 01 10 01 10 01 |



Now, Pronto codes kind of assume Phase Width Modulation, and have the following format:

Code: Select all
 | Type | RCU Freq  |  SeqA Count  |  SeqB Count  | SeqA | SeqB |


Where the first four elements are represented by 4-digit hex numbers and the last two are of variable length sets of these 4-digit hex values (with the length denoted by the sequence counts).

Let's ignore everything except SeqB and its count, as we are going to put the RC5 code in there.

What you need to do is run through your Phase Modulated bitstring and add up any contiguous pulses of the same modulation. A 1 followed by a 1 means an on period of twice the "tick" timing. I haven't worked out a formula for the tick period as I took my timings from a learned code from my target RCU, which happened to be 0020 in Pronto world.

Once you have ran all your 1s and 0s together, you should almost have a Pronto code, except for two things:

* Be aware that RC5 values start with an off, Pronto assumes you start with an on. Just ignore the initial off period of the RC5 code.

* You need to pad out the end, adding an extra off period or simply extending the final off period from the RC5 encoding in order to have the intercommand pause. RC5 assumes 117ms or something like that, but again, I just read this from a learned code.

Now the final step (honest), you need to count the On and off periods you produced (starting with an on and finishing with an off, making an even number, remember -- if not you made an error) and make the SeqB count value equal to half the number of ons and offs, i.e. it's a count of the pairs of on and off values.

Put the values together in a string, and bingo, one RC5 code turned into a Pronto code.

RC5 PM:

Code: Select all
| Start Bits | Toggle Bit |   Address Bits   |   Command Bits     |
|   01 01    |     10     |  01 01 01 10 10  |  10 01 10 01 10 01 |


Pronto Code:

| On | Off | On ...
0020 0020 0040 0040 0020 0020 0020 0020 0040 0020 0020 0020 0020 0040 0040 0040 0040 0040 0020 0C00

Giving a SeqB count of: 000a
mwtb
 
Posts: 4
Joined: Thu Dec 16, 2004 9:59 am


Return to Developers

Who is online

Users browsing this forum: No registered users and 14 guests