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

PrismIQ - new executor

 
Post new topic   Reply to topic    JP1 Remotes Forum Index -> JP1 - General Forum
View previous topic :: View next topic  
Author Message
The Robman
Site Owner


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

                    
PostPosted: Thu May 25, 2006 11:44 am    Post subject: PrismIQ - new executor Reply with quote

Hey John,
I'm trying to help someone use his Slingbox to control his PrismIQ device. Jon Armstrong looked into this a while back and came up with three separate upgrades for it. Apparently it uses a keyboard style signal, which he describes at the bottom of this page...

http://members.cox.net/movie_maker/prismiq/PRISMIQ-FAQ.html

I am trying to develop a single protocol that can replicate all of the buttons, as the Slingbox can only use one upgrade at a time. The problem, as you may recall, is that there's a size limit for the upgrades, so I'm designing the code so that it can use 1-byte hex commands. I have uploaded my PB file, which shows what I'm trying to do. I haven't tested the code yet because I think it's still too big for the Sling. If you have any spare time, could you look at the code to see if you can make it more efficient?

Here's the PB file...
http://www.hifi-remote.com/forums/dload.php?action=file&file_id=3259

Here's the rundown on the 3 upgrades Jon developed...

1) The first one works most of the buttons. It just replicates the DOWN press.
2) The next one is just for the SELECT/ENTER button. He found that this button requires the DOWN and UP signals, but the signal itself follows the same format as the rest of the regular buttons.
3) The final one is for the arrow buttons, which use the same style of signal of the other buttons, but the format is different.

Here's a brief summary of the signal structure. Each logical byte of data is actually 11 bits in length, where the format is as follows...

1 start bit (value 0)
8 data bits
2 stop bits (value 11)

Defining logical 0 as "+820 -0" and logical 1 as "+0 -820" these bytes can be replicated by setting the lead-in pair as "+820 -0" and the lead-out time as "-1640", but this also means that we can onlt send the signal one byte at a time. (ie, each call to $0146 sends one byte).

For the regular buttons, the 8 data bits consist of a 7-bit OBC followed by an UP/DOWN toggle bit. The signal itself has 2 bytes, where the 2nd byte is a copy of the 1st XOR'd with 0x1F. I don't know what these buttons would do when held, but I don't think any of them need to repeat, so it's not an issue.

The arrow buttons use 3 bytes of data with no UP/DOWN bits. The binary format, which does repeat, is as follows...

11111100 00000000 00001111 Up
11111100 00000000 11110000 Down
11111100 11000000 00000000 Right
11111100 00111111 00000000 Left

If you use the following binary as a starting point:
11111100 11000000 00001111

You'll notice that for each arrow, byte1 is fixed, then either byte2 or byte3 is zeroed out. The byte that's not zeroed out is either used "as is" or is complimented.

So, here's how I'm trying to handle it in my protocol code. I'm using 3 fixed bytes of data, set to the values used by the arrows. I've set the controls bits to say that there's no fixed data and just 1 byte of variable data. I test bit0 of the variable byte, if it's set I go with the regular button format, if it's clear, I go with the arrow format.

For regular buttons, I copy the variable byte to byte2 and XOR it with 0x1F. I then send the first byte by calling $0146. Then I increment R01 and call it again to send the 2nd byte. Next, I send a delay, then I then toggle bit0 on both bytes and send them again.

For arrow buttons, if bit1 is set, I zero out byte2, otherwise I zero out byte3.

If bit1 is set and bit2 is clear, I leave byte3 "as is", otherwise I COMP it.
If bit1 is clear and bit2 is clear, I leave byte2 "as is", otherwise I COMP it.

Now that the data is formatted, I send all the bytes one at a time by calling $0146 and then incrementing R01. Then I send some delay and repeat the sends.
_________________
Rob
www.hifi-remote.com
Please don't PM me with remote questions, post them in the forums so all the experts can help!


Last edited by The Robman on Fri Jun 02, 2006 10:08 am; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
johnsfine
Site Admin


Joined: 10 Aug 2003
Posts: 4766
Location: Bedford, MA

                    
PostPosted: Thu May 25, 2006 12:07 pm    Post subject: Reply with quote

I've forgotten some of the basics of Slingbox (if I ever really read them at all).

Which MCU chip is it.

What is the size limit on a protocol? And the size limit on a device upgrade? Or are they combined?

What does "button still held" mean? Does it transfer duraction of a mouse click across the net?

For your non arrow keys, why mess around with two copies of the byte and adjusting r10? Why not adjust a single value each time?

IIUC, you want
X
X ^ 1F
pause
X ^ 1
X ^ 1 ^ 1F

Notice that X ^ 1 is X ^ 1F ^ 1E
so
call 146
xor r07, 1F
call 146
delay
xor r07, 1E
call 146
xor r07, 1F
jp 146
Back to top
View user's profile Send private message Send e-mail Visit poster's website
The Robman
Site Owner


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

                    
PostPosted: Thu May 25, 2006 12:23 pm    Post subject: Reply with quote

johnsfine wrote:
Which MCU chip is it.

S3C8+

johnsfine wrote:
What is the size limit on a protocol? And the size limit on a device upgrade? Or are they combined?

I don't recall the exact limit, but when you re-wrote the DirecTV protocol, you reduced it to about 81 bytes, which allowed me to include maybe a dozen buttons before I tripped the limit. So, it appears to be a combined limit, and it's somewhere around the 100 byte mark.

johnsfine wrote:
What does "button still held" mean? Does it transfer duraction of a mouse click across the net?

I think so. I believe you can hold the virtual buttons down.

johnsfine wrote:
For your non arrow keys, why mess around with two copies of the byte and adjusting r10? Why not adjust a single value each time?

Interesting idea. Let me see if I can make it a loop.
_________________
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
johnsfine
Site Admin


Joined: 10 Aug 2003
Posts: 4766
Location: Bedford, MA

                    
PostPosted: Thu May 25, 2006 12:38 pm    Post subject: Reply with quote

The Robman wrote:
Let me see if I can make it a loop.


I'm not sure it's worth the loop overhead, but as a first cut:

Is the delay really required, especially the different delay?

Am I correct that the rightmost bit has the pattern on,off,off,on for the four bytes?

call 146
delay?
and r07, FE
xor r07, 1E
counted loop back to call
inc r07
jp 146
Back to top
View user's profile Send private message Send e-mail Visit poster's website
The Robman
Site Owner


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

                    
PostPosted: Thu May 25, 2006 9:55 pm    Post subject: Reply with quote

Here's how I ended up using your XOR idea, now let's hope it works...
Code:
FF1A: 6C 02        LD RC6, #02H
FF1C: F6 01 46     CALL 0146H
FF1F: B6 06 1F     XOR R06, #1FH
FF22: F6 01 46     CALL 0146H
FF25: B6 06 1E     XOR R06, #1EH
FF28: F6 FF 2D     CALL FF2DH
FF2B: 6A EF        DJNZ RC6, FF1CH

FF2D: C6 F8 06 A0  LDW RF8, #06A0H
FF31: 8D 01 58     JP 0158H

_________________
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
johnsfine
Site Admin


Joined: 10 Aug 2003
Posts: 4766
Location: Bedford, MA

                    
PostPosted: Thu May 25, 2006 10:42 pm    Post subject: Reply with quote

Internal subroutines rarely justify their overhead.

Instead of calling FF2D, just do those two steps inline. Then add an RTS at the end. I assume you don't really need a delay at the end, just in between.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
The Robman
Site Owner


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

                    
PostPosted: Fri May 26, 2006 7:10 am    Post subject: Reply with quote

I don't need another delay at the end, but I didn't see the point in wasting a byte by adding an RET. I do, however, also need a delay in the arrow button process, that's why I made it a subroutine.

Is there any chance that you can add something to DecodeIR for this protocol? Converting learned data back to binary by hand takes forever with this protocol.

Here's a KM file in case any PrismIQ users what to experiment with this upgrade:

http://www.hifi-remote.com/forums/dload.php?action=file&file_id=3262
_________________
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
johnsfine
Site Admin


Joined: 10 Aug 2003
Posts: 4766
Location: Bedford, MA

                    
PostPosted: Fri May 26, 2006 7:54 am    Post subject: Reply with quote

If you hadn't needed the delay as a subroutine for the arrows, the RET would net save two bytes rather than cost one.

If you want that as a callable routine, you still shouldn't call it here. Instead use a call instead of the loop:

CALL half
half: CALL 0146H
XOR R06, #1FH
CALL 0146H
XOR R06 #1EH
LDW RF8 #06A0H
JP 0158H

For DecodeIr work, I've forgotten where the learned signals are for this protocol, preferably CCF, but .ir will do. If you have the URL handy, please provide it. Otherwise I'll search the various threads on this topic later.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
gfb107
Expert


Joined: 03 Aug 2003
Posts: 3411
Location: Cary, NC

                    
PostPosted: Fri May 26, 2006 8:40 am    Post subject: Reply with quote

Once you guys have this all figured out, please provide details so I can create a protocols.ini entry for this.
_________________
-- Greg
Original RemoteMaster developer
JP1 How-To's and Software Tools
The #1 Code Search FAQ and it's answer (PLEASE READ FIRST)
Back to top
View user's profile Send private message Visit poster's website
The Robman
Site Owner


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

                    
PostPosted: Fri May 26, 2006 10:45 am    Post subject: Reply with quote

johnsfine wrote:
If you want that as a callable routine, you still shouldn't call it here. Instead use a call instead of the loop:

I like it, I'll do it that way.

Here's a link to a CCF for the PrismIQ.

I don't have a good IR file of learns, but you could re-create some learns by loading Jon's working upgrades into a remote and then learning them to another.

Here's the file that contains his working upgrades:
http://www.hifi-remote.com/forums/dload.php?action=file&file_id=999

I have created a file of learns from my experimental upgrade, that I am trying to hand decode. The Slingbox user that I'm helping was able to load this into the Slingbox, but he got sporatic results when he tried it. He said "On one attempt, the right cursor worked once, the left on another, and then another attempt put the Prismiq into a weird looping behavior where the cursor jumped from one screen element to another and all the lights lit up on the front of the unit."

Here's the file...
http://www.hifi-remote.com/forums/dload.php?action=file&file_id=3264
_________________
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
The Robman
Site Owner


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

                    
PostPosted: Wed May 31, 2006 2:37 pm    Post subject: Reply with quote

I've been sent a copy of the official UEI upgrade for the PrismIQ (which is VIDACC/1574 and uses exec $0192). Needless to say, the code is HUGE (148 bytes) and it uses 2 variable bytes, but it did give me one important clue as to how best to handle this protocol. If you set R29 appropiately, you can prepend a 1 to every byte and append some zeroes to every byte.

Here's the KM file...
http://www.hifi-remote.com/forums/dload.php?action=file&file_id=3288

Here's the PB file...
http://www.hifi-remote.com/forums/dload.php?action=file&file_id=3287
_________________
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
The Robman
Site Owner


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

                    
PostPosted: Fri Jun 02, 2006 10:10 am    Post subject: Reply with quote

Quick update. I have modified the official protocol so that it's now half the size and the upgrade uses 1-byte commands rather than 2-byte.

I still have a few more tweeks to try to reduce the size by a few more bytes, but the code has been tested and it works, so if you're a PrismIQ user the following KM upgrade will let you combine all the buttons into one upgrade...

http://www.hifi-remote.com/forums/dload.php?action=file&file_id=3262
_________________
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
ratovan



Joined: 03 Feb 2005
Posts: 3

                    
PostPosted: Sat Aug 26, 2006 7:50 pm    Post subject: Reply with quote

Thanks for this

It's great to have everything in one file, however Smile There is something funny with the select button. For most things it works great, but when I have a search box up, I can't pick the search or cancel button. The select button "pushes" the button down, but it doesn't actually do anything. OTOH, since whenever I search I tend to pull out the keyboard, it works for 95% of the time I use my prismiq. I've also never been able to "spell" using either upgrade. repeated presses of for example the "2" key should cycle through 2,a,b,c etc...

But, I'm still really grateful to have only 1 upgrade file to keep track of now. Smile
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic       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
Top 7 Advantages of Playing Online Slots The Evolution of Remote Control