Page 1 of 3
Changing modes after a timeout
Posted: Fri Aug 25, 2006 11:29 pm
by itsr0y
Someone asked this same question
in 2004, but I didn't see a good answer. I am using the 6011 extender version 2 and I have only two devices to control: TV and DVD. I have it set to use DVD for Menu and Transport buttons and TV for everything else. However, I would like to use the Home Theater button to temporarily use the TV's Menu buttons, and then if I don't press a key for, say, 15 seconds, it switches back to DVD.
My thoughts:
* I'd prefer not to have to press some button to switch back - the timeout would be cleaner, and would be MUCH less confusing if I forget.
* If timing out after last key press is too difficult, a simple timer running for, say, 2 minutes after pressing Home Theater would be fine. Then I would have an additional quit button if needed.
* Right now, I'm using shift before each button, but this is a pain.
My main concern is forgetting that it is in "TV Menu mode" and not knowing how to get it back. That's why I have a completely modeless setup right now.
Any ideas (besides me writing assembly)?
Thanks.
(And thanks, Rob, for sending me such a great remote at a great price so quickly!)
Posted: Sun Sep 03, 2006 1:06 pm
by ElizabethD
I think the answer is here but I don't know where to find the protocol and I haven't looked. Take a shot at reading about timed macro or similar wording
http://www.hifi-remote.com/files/help/T ... %20JP1.htm
Posted: Sun Sep 03, 2006 2:49 pm
by Capn Trips
Liz has it right. At the very bottom of the document, where author Don Grovestine describes HIS 8911 setup, he refers to a "timed-callback" special feature that seems to do precisely what you want:
A custom “timed-callback” special protocol has been implemented that “presses” a user-specified key upon expiry of the backlight timer. By calling-back a SKP on the HT key, the system automatically reverts to the previous HT mode
Don never uploaded this special protocol that I am aware of (or can locate) so you might want to PM him (user ID "DGG") and see if he's still doing JP1 and will share it with you (and the group).
His system setup using this protocol is in the
Yahoo groups file section (the 6th file from the bottom).
I couldn't figure out how to make the direct link with the hyphen in the filename.
Unfortunately, there are no notes, so you'll have to open the file in IR and examine it to figure out which Device and protocol it is, and how he implemented it.
Posted: Sun Sep 03, 2006 6:11 pm
by ElizabethD
This file is from 2004. IR didn't have notes in those days

It's so sad, because it looks like a fine, insteresting setup, but is so rough to read (for me).
Grovestine IR file. Can be tried in 8910 and relatives.
I see few things in the file that might help synch it with the tutorial:
1. I think it's using KM/RM-style PAUSE protocol 01 FB on xshift-Sleep rather than the extender's pause.
2. xshift-TV and RCVR/Amp macros call xshift-sleep variable pauses and return to the original device, so this might be it, but I don't think so.
3. Backlight timer value is 107, larger than the default 76
4. Some macros include xshift-light which uses the backlight timer
4. There's protocol 01 FD for Misc/1900, not yet sure what it does. It uses register that's not defined in the asm file RB6. Code is 00 00 01 E4 03 B6 AF . ToadTog uses RB4. Protocol 01 FD is used on VCR xshift3 which is used in a ToadTog Test only mode for vcr/xshift-2. It might be his addition to the ToadTog protocol additional bits or something.
5. Protocol 01 f8 on misc/1107 is custom name modified to Grovestine specs, I understand that one, I think.
Without single stepping, it's rough to see what's happening. I wish we had a single step feature.
I never understood the HT mode, so I really can't tell exactly what to expect in spite of the docs. Bottom line, Capn Trips, since you understand the HT mode, perhaps you can sift through the file some more. I've uploaded it here in case you can't get it from yahoo. .
Edit: I see you did, just read your answer.
I did LKP on DVD. Long macro ran to line up equipment. After a long pause, DVD is on the LCD.
Then I did a short press TV and pressed a number key.
The number key signal went out. I watched the LCD to make sure I don't miss the rest of the macro.
After a long delay, DVD came back onto the display. That's consistent with the description that SKP to another device will return to the calling device.
If this is the "timed macro" then that's what we've got - a pause without Dev_Cancel at the end. I suspect what people want is return and revert to the previous device without the pause in a macro (like a second Timer running). But the effect might well be the same to the end user. I really don't know
Posted: Mon Sep 04, 2006 3:19 am
by Capn Trips
I had only LOCATED the file, but had not examined it, as it appears quite complex, but trying to synch Don's notes with the file, I would guess that MISC 1900/01 FD is his customised timed callback special protocol. (You're correct that the notes don't exactly synch, since he discusses 88 keymoves, and the file has 94. But the 19 macros is accurate.)
There are several threads of his from which on can piece together some of his design in which he refers to a
SECOND ToadTog protocol he wrote, and from what I understand, it required use of a SECOND TT device (he used MISC 1801) to access an additional 8 toggle bits, but his final system
apparently did not use this, but he discusses using a combination of three TT toggle bits to track the states of 7 devices. Logically, I can understand this, but how it was implemented (if at all) in THIS IR file, I haven't sorted out.
The timed-callback feature, however, appears to be implemented on VCR/xs-3 and xs-4 buttons with different hex commands (different buttons called at the completion of the timeout?)
On VCR/xs-3 he calls $24 (the HT button in Keycodes.htm)
On VCR/xs-4 he calls $00 (undefined in Keycodes.htm - so perhaps my theory is daft)
VCR/xs-3 is called in VCR/xs-2 in the "execute if bit 3 is ON" string
VCR/xs-4 is called in his xs-Power macro
It's hard to dig through the rest of the implementation, and perhaps if I get ambitious, I'll try to create a flowchart of what he does, as it's pretty interesting, but it can't hurt to try copying and pasting MISC 1900/01 FD into a known working IR setup and see if adding a MISC-1900 command at the end of a string will indeed call a button after the light timer expires. I might do this, but not before next weekend at the earliest.
I don't know whether register RB6 is an issue or not, since I can't read any of that asm stuff.
Don G - where are you?
Posted: Mon Sep 04, 2006 9:45 am
by ElizabethD
1. Those $24(00100100) and $00 values might be just hex values for that $B6 register, and not button numbers. Who knows.
2.
RMIR sure came in handy here to quickly examine the package with all the magic incantations included. Oh, I had to change signature from 78 78 to 78 31 at the end for RMIR to like it (IR didn't object). A clue to possibly different RDF we don't have.
My conclusions, not guaranteed to be correct
ToadTog 0181, L/DKP 01f9, DSM 01fc, KM style Pause 01fb are standard.
MysteryProtocol 01FD is new, CustName 01f8 is modified.
Code: Select all
MysteryProtocol:
Upgrade code 0 = CF 6C (Misc Audio/1900) (RM v1.64)
FD 00 01
End
Upgrade protocol 0 = 01 FD (S3C80) PID 01 FD (RM v1.64)
00 00 01 E4 03 B6 AF
End
Modified CustomName:
Upgrade code 0 = CC 53 (Misc Audio/1107) (RM v1.64)
F8 00 01
End
Upgrade protocol 0 = 01 F8 (S3C80) PID 01 F8 (RM v1.64)
00 00 01 06 3A 2B A6 3A 35 AB 06 B1 3A 20 3A 8B
F5 C6 CC 00 2D C6 CA 00 F7 EC 09 F6 07 AB E6 B5
01 AF
End
If I knew which 2-3 buttons to press to prove some point, I'd put it through Tommy's IRSA Gadget, as it'll give us all the bit patterns and exact timing between the buttons. I can probably muddle through the data that comes out.
I haven't decided whether to move into Don's system or take his things and adapt mine. Gota think about it. Maybe sometime in this century

Posted: Mon Sep 04, 2006 9:50 am
by DGG
Capn Trips brought this thread to my attention.
I haven't accessed the forum for some time. Sorry. Nor have I looked at the code recently. But, I'll be happy to help.
"Timed callback" has a number of possible uses. Essentially, it allows programming of a future "automatic keypress". My primary use of timed callback is to be able to change modes of the remote for a short period with the remote reverting to the previous mode automatically.
The feature works as follows. At any time short-press a device key. The remote switches immediately to that mode, allowing you to, say, adjust some TV setting while the CBL HT mode is active. Ten seconds after the most recent operation in the TV mode, the remote automatically switches back to the CBL mode (or whatever mode it was in before TV is pressed).
I have something urgent going on at the moment which likely will occupy me for the next few days. But, once that's over, I'll dig out the code and better document the feature.
It's good to see some familiar names still involved.
Best regards,
Don
Posted: Mon Sep 04, 2006 1:10 pm
by DGG
Thought I'd take a few minutes to see of I could come up with the answer quickly.
First of all, its been 2 1/2 years since I've "mucked about" with extenders. So my terminology may be a bit rusty.
Elizabeth has it almost figured out. Timed callback uses device MISC 1900 and Protocol 1FD. The protocol simply loads a keycode into register R03, which the remote will call upon expiry of the backlight timer - making use of a feature already in the 8910 Extender 1 (or maybe in the original device code)
Most people use Toadtog to track power status. While I do too, I use a second set of Toadtog bits (my toadtog2 feature) to track the HT mode of the remote. Any short press of HOME THEATER results in the previously saved device mode being restored. A press (long or short) of any device key sets the new device mode and makes its way to VCR/xs-0 via a macro on xs-ENTER. VCR/xs-0 checks for long/short keypress. If long, the newly selected device is recorded. If short, the key-code of the HOME THEATER key is passed to device 1900 - which causes in the previously (long-press) selected mode being restored once the backlight timer expires.
So, the key to making this work is for the system to know at all times what was the last selected long-press mode. Toadtog 2 is the only way I know how to do this.
I'll be happy to answer any specific questions. The special protocol code is shown below. My remote upload code has already been posted.
Hope you're all having a great weekend,
Don
; ---- Special Protocol for Timed Callback
;
; Assemble with "C:\Program Files\Remote Controls\Special Protocols\s3c8asm.exe" CallBack.ASM -A CallBack.HEX -L CallBack.LST
;
;
R_CallBack = RB6 ; Button number for timed callback
Ram = FF00
;
;
; On entry:
; R03 = Hex Command
;
;
db 00,00,01
org Ram
;
LD R_CallBack, R03 ;Get callback key number
RET
; ---- Special Protocol for Multiple ToadTog Bit-sets
;
; A separate dummy device must be defined for each set of 8 ToadTog bits,
; in the form:
;
; pp 00 11 rr (i.e., one more byte than usual)
;
; where: "PP" is the last 2 digits of the number assigned to this special
; protocol (in hex) and
; "rr" is the ToadTog status register address (which is passed to
the protocol in register R03 by the remote's protocol handler),
;
; e.g.:
;
; MISC 1800 - 8D 00 11 B4 (for protocol number 18D and base status register)
; MISC 1801 - 8D 00 11 B6 (for protocol number 18D and second status register)
;
; with the appropriate dummy device (type and setup code) being included in the
; keymove.
;
; Basic ToadTog uses register "RB4" to store bit status. Register "RB6"
; appears not to be used currently, so I used it for the second set of 8 bits.
; While registers "RB6" and several above it appear unused now, that situation
; could change with future versions of extenders and/or additional special protocols.
; (Of course, these registers could also be used by the remote for obscure functions.)
; Unless the group standardizes this special protocol and reserves additional
; ToadTog status registers, you'll have to monitor the situation when upgrading.
;
;
; Use the S3C8ASM program to build it as follows:
; "C:\Program Files\Remote Controls\Special Protocols\s3c8asm.exe" Multi-ToadTog.asm -a Multi-ToadTog.hex -l Multi-ToadTog.lst
;
R_Mac = R95 ; Macro pointer
AR_MacBuf = 9A ; Start of macro buffer
;
Ram = FF00 ; start of RAM
;
; On entry:
; R03 = address of register for ToadTog bit status (RB4/RB6)
; R04 = Hex command from keymove
; R3A = Length of KeyMove body, i.e., # macro steps
; R2D = First byte of keymove data. Remainder of data in successive registers
;
;
db 00,00,11 ; 11 = 1 byte of fixed data (R03) and
; 1 byte of variable data (R04)
;
org Ram
;
LD W0, R03 ;Get ToadTog status register
TT010: LD W2, R04 ;Get the "HEX command" from the KeyMove
SWAP RC2 ;Top digit selects bit number
LD W1, 1 ;Start with bit 0
TT020: AND RC2, 7 ;Use low three bits as bit number, also handle
;overflow when rotating 8 times for bit 0
RL RC1 ;Rotate bit into position
DJNZ W2, TT020 ;Do it N time for 1 to 7, and 8 times for 0
LD W2, R04 ;Get the "HEX command" from the KeyMove
AND R04, 7 ;Length of TRUE side
LD W3, R3A ;Body length of keymove
SUB RC3, 3 ;keylist length
TM RC1, @W0 ;Is the bit currently set?
JREQ TT030 ;No
LD W3, R04 ;Length of TRUE side
CLR R04
TT030: CP RC3, R04 ;Selected side empty?
JRLE TT040 ;Yes
LD W4, R2D[W3] ;Get a key code
CP R_Mac, AR_MacBuf ;Buffer full?
JRULE TT040 ;Yes
PUSHUD @R_Mac, RC4 ;Insert KeyCode into pending keys
DJNZ W3, TT030
TT040: LD W3, @W0 ;Selected status register
BTJRF TT050, W2.3 ;Set requested?
OR W3, RC1 ;Yes: do it
TT050: BTJRT TT060, W2.7 ;Toggle requested?
XOR W3, RC1 ;Yes: do it
TT060: LD @W0, W3 ;Save status register
RET
Posted: Tue Sep 05, 2006 11:51 am
by itsr0y
Well, Don, Liz, and Capn Trips, thank you so much for such detailed answers! It's going to take me a while to sift through all this information, but I just wanted to let you all know that I read the replies and greatly appreciate your help. I'll be sure to post an update when I get enough time to work on it, but in the meantime, if you make any progress yourself, I'll be sure to read it!
Thanks again!
Mark
Posted: Wed Sep 06, 2006 7:25 am
by ElizabethD
MultiTogTog protocol and upgrades made from Don's source code above.
Code: Select all
Upgrade protocol 0 = 01 8D (S3C8+) MultiToadTog (PB v3.12)
00 00 11 08 03 28 04 F0 C2 1C 01 56 C2 07 90 C1
2A F9 28 04 56 04 07 38 3A 26 C3 03 73 10 6B 04
38 04 B0 04 A4 04 C3 2B 0D 87 43 2D A6 95 9A 3B
05 82 95 C4 3A EE C7 30 37 26 02 42 31 37 2F 02
B2 31 D7 03 AF
End
Upgrade Code 0 = 1F 08 (VCR/1800) MultiToadTogB4section (KM v9.02)
8D 00 11 B4
End
Upgrade Code 0 = 1F 09 (VCR/1801) MultiToadTogB6section (KM v9.02)
8D 00 11 B6
End
Work instructions:
> Preserve current IR file
> Delete device MISC/1800. Delete protocol 0181.
> Paste in the protocol.
> Paste in the first Upgrade device VCR/1800 which the current ToadTog keymoves use.
> For eight more ToadTog bits, paste the second upgrade VCR/1801 if space permits. If IR objects about illegal character, just make sure there is one space after B4 and B6.
> On the keymoves sheet, edit existing ToadTogs, as they migrated here. Just change MISC to VCR.
Comments:
> Works OK in 8910, HTPro. Now needs conversion to
6011.
> In IR, I tried retaining MISC/1800 but IR immediately shaded MISC/1800 out on the Special Keymoves sheet dropdown. Not a disaster. It flags that we're non-standard.
> Consequently, it's not fun building new ToadTog keymoves in IR because new ones need to be built the old way, using button numbers.
> VCR/1801 device uses the same register $B6 as the TimedCallback protocol (named MysteryProtocol above). VCR/1801 needs a persistent setting. Any problems here? We need EXPERT HELP.
Posted: Wed Sep 06, 2006 8:33 am
by DGG
If Toadtog 2 is a problem in some remotes, an alternative if you don't have need more than 6 devices for which you keep power status, try using the unused toadtog bits to record HT status (e.g., if only 5 on/off status bits are needed, use the remaining three for HT status - say, h001 for CBL, h010 for DVD, h011 for VCR, h100 for TV, h101 for SAT, etc.). Setting and testing HT mode in this way is more complex and consumes aditional keymoves and upgrade memory, but if there's no choice ....
Don
Posted: Thu Sep 07, 2006 7:28 am
by ElizabethD
1.
Both ToadTog bytes are in use and doing a flawless job 
. Completely transparent on my setup. Also the idea of using 3 bits for holding the last LKP device is pretty cool as well, though I can imagine that the keymoves must be a nightmare to build. Thanks, Don for willing to come here on Capn Trips' call.
2. Still trying to sort out what's what. Am I correct that you do not use the second ToadTog byte within the same IR that uses TimedCallback. So the IR file we're discussing here (URC8911 - Extended (RM).txt) is what Mark should be using as an example, and the two ToadTog devices is a separate subject and independent design.
My reading of
Capn Trips wrote:On VCR/xs-3 he calls $24 (the HT button in Keycodes.htm)
On VCR/xs-4 he calls $00 (undefined in Keycodes.htm
is that $24 inserts the HT button code in order to remember the last LKP device, and $00 clears it and forgets. Please correct if not so. If correct, then in the 6011 it looks like replacing HT button code from $24 to $38 should do the job.
3. Whare can we find the register display routine Dpy_Reg.asm mentioned in the linked thread? I don't see it at yahoo, nor here.
Back to the main subject, 6011. Since, I guess, the TimedCallback is all that Mark needs, how do we go about finding a free register other than guessing from asm for his extender and crashing his remote in the trials? ToadTog register is in $B0, so perhaps someplace around there is a free byte. Where is Nils?
I suppose Capn Trips got the keymoves for the HT section figured out for using the TimedCallback, but any docs on your file will be helpful to all, I'm sure. I don't do HT mode, so can't help much.
Posted: Thu Sep 07, 2006 9:10 am
by DGG
1. Thanks
2. Your question about whether Toadtog2 and Timed Callback are in the same IR prompted me to take another look at my code. No, they are not (now) both resident in the final 8910 IR. I not sure why but, after first implementing the HT status register using Toadtog 2, I changed the code to use the upper three bits in basic Toadtog as I described yesterday. It probably was that I required the upgrade memory used for Toadtog 2 for some other purpose. (I do recall doing a major redesign because I ran out of memory.) I guess that's why the latter scheme was so familiar to me. The implementation uses 20 keymoves (TV/xs0-5, CBL/xs0-6 and sPhantom1 on all devices except SAT) - not a nightmare, but intricate. Toadtog 2 is much more efficient to use if you've got upgrade space for it. Sorry for the earlier confusion.
The $24 inserted by VCR/xs-3 is the keycode for callabck of the HT button which, when short pressed, restores the last HT mode. I can't comment on VCR/xs-4 because it doesn't appear to be a used keymove in my IR file. However, somewhere in my code I will reset to 0 the keycode to be called back and perhaps VCR/xs-4 is involved - but its not obvious to me now how I did it.
3. Sorry, I can't help you with finding a free register in a 6011.
I'll be away for the next few days and won't have access to my code. So, any further questions will have to await my retirn next week.
Don
Posted: Mon Sep 11, 2006 8:31 pm
by ElizabethD
Let's go back to the Timed callback idea. Extra bits in ToadTog is a separate thing, maybe tied in a setup, but is not essential.
DGG wrote:"Timed callback" has a number of possible uses. Essentially, it allows programming of a future "automatic keypress". My primary use of timed callback is to be able to change modes of the remote for a short period with the remote reverting to the previous mode automatically.
The feature works as follows. At any time short-press a device key. The remote switches immediately to that mode, allowing you to, say, adjust some TV setting while the CBL HT mode is active. Ten seconds after the most recent operation in the TV mode, the remote automatically switches back to the CBL mode (or whatever mode it was in before TV is pressed).
Capn Trips wrote:... it can't hurt to try copying and pasting MISC 1900/01 FD into a known working IR setup and see if adding a MISC-1900 command at the end of a string will indeed call a button after the light timer expires.
We need to wait for Don. The missing link is that I am unable to see any place where the backlight timer code actually reads that register $B6 which the little protocol 01FD is stuffing into the macro buffer. Thinking out loud, the way I'd do the test on my setup is at the end of a device LKP which lines up the devices, I'd call the protocol with the device button as data. It might be that just putting it into the macro buffer is sufficient. I don't know. Any ideas?
Posted: Wed Sep 13, 2006 9:22 am
by DGG
The "action" occurs just after label L40 in Extender 1 ($FF5A) . I labelled Register RB6 "R_Callback".
Code follows:
L40:
FF57: F6 41 32 CALL LCDOff ; Turn off LCD
FF5A: A6 B6 00 CP R_CallBack, 0 ; *Is timed callback flag set?
FF5D: 6B 07 JREQ L41 ; *No
FF5F: E4 B6 80 LD R_Key1, R_CallBack ; *
FF62: B0 B6 CLR R_CallBack ; *Clear Callback flag
FF64: 8B 19 JR L51 ; *Issue callback
Hope this helps.
Don