From jurjen@cwi.nl Wed Aug 22 10:13:13 1990 From: jurjen@cwi.nl (Jurjen NE Bos) Newsgroups: comp.sys.handhelds Subject: Remote Control for HP28S Date: 20 Aug 90 09:45:59 GMT Organization: STORD, Veldhoven (This is posted for my brother-in-law) Here is the much-requested repost... USING YOUR HP28S AS A REMOTE CONTROL ------------------------------------ By Michiel Niemeijer & Eric Toonen A lot of people who have the HP28S are currently changing to the HP48SX. If you decide not to sell your classic-28 (and maybe this article will convince you not to) you can use it very easy as an intelligent remote control. Description: ------------ This is an application for the HP28S, Version 2BB, to send the infrared signals as supported by all PHILIPS (and daughter-firms like ARISTONA) remote controlable machines. These machines range from tape-recorders to satelite-tuners. This code is commonly known as RC5 code. The RC5 code: ------------- The RC5 code is an 13-bit code, it used to have a 5-bits group and a 6-bits command, and 2 stop-bits, but it was changed to 5-bits group, 7-bits command and 1 stop-bit. The HP28S led: -------------- The HP28S's infrared led is normally used to send data to a HP printer, using a code used (as far as I know) for HP only. Internally, this code is timed using the real-time clock. The infared led is turned on or off, by accessing address #FFF0Dh the contents is: #2h turns the led on, #0h turns the led off. All we have to do now, is have a machine-code routine time and access the led. To keep this code short and simple (Life is short and RAM is full), we do NOT use the real-time-clock. --- Therefore, DO NOT USE FAST together with RC5. The assembly listing: --------------------- ; RC5 sender ; In: Level 1: pt ; Out: - ; ROM-routines used: SAVER EQU #05081h ;Save registers CONTN EQU #1B505h ;Restore regs & continue RPL GETPT EQU #04F27h ;Read pt from stack in A ; MIO-addresses used: IRLED EQU #FFF0Dh ;IR-led: #2h=On, #0h=Off 8F18050 CALL.A SAVER ;Save registers 8F72F40 CALL.A GETPT ;Read value from stack 1BD0FFF MOVE.5 IRLED,D0 ;point to ledvalue 30D MOVE.P1 #Dh,C ;Send (Counter=13) bits 816 RRN.W C C4 L1: ADD.A A,A ; 1 or 0 ? 5E0 BRCC L2 7120 CALL.3 L4 ;Send 1-bit 7420 CALL.3 L5 6B00 JUMP.3 L3 7C10 L2: CALL.3 L5 ;Send 0-bit 7110 CALL.3 L4 L3: ;Next bit A4E DEC.S C ;Decrement Counter 53E BRCC L1 ;All done? 7700 CALL.3 L4 ;Turn led off 8D505B1 JUMP.A CONTN ;Restore regs & return to RPL L4: ;Led Off 300 MOVE.P1 #0h,C ;Put(0) 6600 JUMP.3 L6 L5: ;Led On 302 MOVE.P1 #2h,C ;Put(2) ;JUMP.3 L6 L6: ;Put(c) 1540 MOVE.P C,(D0) ;set led 3182 MOVE.P2 #28h,C ;wait A6E L7: DEC.B C 5CF BRCC L7 01 RET ;return END Make this into an 'inline machine code', and store it in the variable 'SEND.OBJ' +---"For example"-"(HEXIFY and CHT were posted by Alonzo Gariepy)"---+ | | | "8F180508F72F401BD0FFF30D816C45E ;do not include newlines | | 0712074206B007C107110A4E53E77008 | | D505B1300660030215403182A6E5CF01" | | | | 'SEND.STR' STO ;chk [A27F] | | SEND.STR HEXIFY #2C96h CHT ;make 'inline' | | 'SEND.OBJ' STO | | 'SEND.STR' PURGE | | | +--------------------------------------------------------------------+ The RPL listing: ---------------- 'GROUP' 0 'RC5' [7BFA] << IP 128 MOD IF DUP 64 < THEN 12288 ;RC5? ELSE 8192 ;or Extended RC5? END SWAP 64 MOD + GROUP IP 32 MOD 64 * ;GROUP is a variable with the + DUP ; groupcode IF OLD SAME ;OLD is made by RC5 THEN 4096 + END DUP 'OLD' STO 64 * SEND >> 'SEND' [6B0C] << DUP TYPE IF NOT THEN # C53Bh ;0CB35 real->pt SYSEVAL SEND.OBJ END DROP >> How to use it: -------------- First, set the group-number of the device you want to control. This is done by STOring the number (in range 0..31) in 'GROUP'. You send data to the device by entering a command number (a real in range 0..127) and press RC5 ... The commands: ------------- These are the codes as they are given in the PHILIPS service document "Survey remote control transmitters CTV sets" ------------------------------------------------------------------------------ Commnd: Video mode: TV1 & TV2 Video mode: TXT Video mode: VD Group 0 (TV1) 1 (TV2) Group 2 Group 3 ------------------------------------------------------------------------------ 0 0 0 0 1 1 1 1 2 2 2 2 3 3 3 3 4 4 4 4 5 5 5 5 6 6 6 6 7 7 7 7 8 8 8 8 9 9 9 9 10 1/2/3 digs (japan:10) step page + =/= =/= 11 channel/program(jap:11) step page - * 12 standby standby standby 13 mute/demute mute/demute mute/demute 14 P.P. (personal pref.) P.P. P.P. 15 display display display 16 volume + volume + volume + 17 volume - volume - volume - 18 brightness + brightness + brightness + 19 brightness - brightness - brightness - 20 colour saturation + colour saturation + colour saturation + 21 colour saturation - colour saturation - colour saturation - 22 bass + bass + bass + 23 bass - bass - bass - 24 treble + treble + treble + 25 treble - treble - treble - 26 balance right balance right balance right 27 balance left balance left balance left 28 contrast + enter/validation (Frnc) 29 contrast - memory out 30 search + sequence out attribute on/off 31 tint/hue + 32 channel/program + exchange 33 channel/program - index/summary (France) index 34 alt/channel row zero (France) 35 1st/2nd language 1st/2nd language 1st/2nd language 36 spacial stereo on/off spacial stereo on/off spacial stereo on/off 37 mono/stereo (USA) 38 sleeptimer hardcopy printer hardcopy printer 39 tint/hue - antiope TV mixed (Frnc) 40 RF switch/PIP select PIP select terminal initiation 41 vote page hold on/off 42 timed page/channel clck timed page (F:magazine) 43 increment (USA) large top/lrge bot/norm large top/lrge bot/norm 44 decrement (USA) reveal/conceal/canc pic 45 cancel teletext picture 46 2nd controls (USA:menu) TV/Text mixed/Subtitle TV/Text mixed 47 PIP shift PIP shift view data line off 48 pause pause pause 49 erase erase erase 50 rewind rewind rewind 51 go to go to go to 52 wind wind wind 53 play play play 54 stop stop stop 55 recording recording recording 56 external 1 external 1 external 1 57 external 2 external 2 external 2 58 PIP display mode PIP display mode 59 view data mode/advance view data line on 60 teletext submode (J:12) 61 system standby system standby system standby 62 crispener on/off news flash (France) 63 system select system select system select 64 surround sound surround sound surround sound 65 balance front balance front balance front 66 balance rear balance rear balance rear 67 sound effects sound effects sound effects 68 sound effects sound effects sound effects 69 sound effects sound effects sound effects 70 sound effects sound effects sound effects 71 sound effects sound effects sound effects 72 sound or menu func. sound or menu func. sound or menu func. 73 sound or menu func. sound or menu func. sound or menu func. 74 sound or menu func. sound or menu func. sound or menu func. 75 76 77 linear function up linear function up linear function up 78 linear function down linear function down linear function down 79 sound or menu func. sound or menu func. sound or menu func. 80 cursor step up cursor step up cursor step up 81 cursor step down cursor step down cursor step down 82 menu on menu on menu on 83 menu off menu off menu off 84 display A/V status display A/V status display A/V status 85 cursor step left cursor step left cursor step left 86 cursor step right cursor step right cursor step right 87 menu function menu function menu function 88 PIP on/off PIP on/off PIP on/off 89 PIP shift PIP shift PIP shift 90 PIP main swap PIP main swap PIP main swap 91 strobe on/off strobe on/off strobe on/off 92 multi strobe multi strobe multi strobe 93 main freezed main freezed main freezed 94 3/9 multi scan 3/9 multi scan 3/9 multi scan 95 PIP mode select PIP mode select PIP mode select 96 mosaic mosaic mosaic 97 solarization solarization solarization 98 main stored main stored main stored 99 PIP strobe PIP strobe PIP strobe 100 recall main recall main recall main 101 PIP freeze PIP freeze PIP freeze 102 PIP step up PIP step up PIP step up 103 PIP step down PIP step down PIP step down 104 105 106 107 red 108 green 109 yellow 110 cyan 111 index 112 113 114 115 116 117 118 sub mode sub mode sub mode 119 sub mode sub mode sub mode 120 121 122 cleaning up cleaning up cleaning up 123 connect connect connect 124 disconnect disconnect disconnect 125 cleaning up cleaning up cleaning up 126 cleaning up cleaning up cleaning up 127 cleaning up cleaning up cleaning up ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ Commnd: Video mode: LV1 Video mode: VCR1 & VCR2 Video mode: Satellite Group 4 Group 5 (VCR1) 6 (VCR2) Group 8 ------------------------------------------------------------------------------ 0 0 0 0 1 1 1 1 2 2 2 2 3 3 3 3 4 4 4 4 5 5 5 5 6 6 6 6 7 7 7 7 8 8 8 8 9 9 9 9 10 picture number/time 1/2 digits/AM/PM 1/2 digits 11 channel number channel/program mode channel/program mode 12 standby standby standby 13 mute/demute mute/demute mute/demute 14 P.P. (personal pref.) P.P. P.P. 15 display display display 16 volume + volume + volume + 17 volume - volume - volume - 18 brightness + brightness + brightness + 19 brightness - brightness - brightness - 20 colour saturation + colour saturation + colour saturation + 21 colour saturation - colour saturation - colour saturation - 22 bass + bass + bass + 23 bass - bass - bass - 24 treble + treble + treble + 25 treble - treble - treble - 26 balance right balance right balance right 27 balance left balance left balance left 28 repeat once/TSPo ITR (OTR) delay 29 repeat cont/TSPc timer programming 30 next record select 31 fast run reverse fast run reverse 32 entry step + channel/program + 33 auto stop/memory step - channel/program - 34 slow run reverse slow run reverse 35 audio 1 audio output select language select/mode 1 36 audio 2 clock/channel special stereo on/off 37 still picture speed - audio mixed / mode 2 38 speed + speed + 39 speed - Instant Time Recording 40 slow run forward slow run forward 41 still forward still forward 42 fast run forward fast run forward 43 search automatic index scan 44 scan reverse scan reverse 45 open/close (eject) eject 46 scan forward scan forward subtitle 47 play reverse play reverse 48 pause pause pause 49 erase erase erase 50 rewind rewind rewind 51 go to go to go to 52 wind wind wind 53 play play play 54 stop stop stop 55 recording recording recording 56 external 1 external 1 external 1 57 external 2 external 2 external 2 58 clear all memory short/long play 59 freeze segment counter memory 60 TXT (pal)/ant.sw (ntsc) scroll local display TXT submode 61 system standby system standby system standby 62 CX on/off RF switch 63 system select system select system select 64 surround sound surround sound surround sound 65 balance front balance front balance front 66 balance rear balance rear balance rear 67 sound effects sound effects sound effects 68 sound effects sound effects sound effects 69 sound effects sound effects sound effects 70 sound effects sound effects sound effects 71 sound effects sound effects sound effects 72 sound or menu func. sound or menu func. sound or menu func. 73 sound or menu func. sound or menu func. sound or menu func. 74 sound or menu func. sound or menu func. sound or menu func. 75 data stream start 76 data stream end 77 linear function up linear function up linear function up 78 linear function down linear function down linear function down 79 sound or menu func. catalogue sound or menu func. 80 cursor step up cursor step up cursor step up 81 cursor step down cursor step down cursor step down 82 menu on menu on menu on 83 menu off menu off menu off 84 display A/V status display A/V status display A/V status 85 cursor step left cursor step left cursor step left 86 cursor step right cursor step right cursor step right 87 menu function acknowledge menu function 88 PIP on/off PIP on/off PIP on/off 89 PIP shift PIP shift PIP shift 90 PIP main swap PIP main swap PIP main swap 91 strobe on/off strobe on/off strobe on/off 92 multi strobe multi strobe multi strobe 93 main freezed main freezed main freezed 94 3/9 multi scan 3/9 multi scan 3/9 multi scan 95 PIP mode select PIP mode select PIP mode select 96 mosaic mosaic mosaic 97 solarization solarization solarization 98 main stored main stored main stored 99 PIP strobe PIP strobe PIP strobe 100 recall main recall main recall main 101 PIP freeze PIP freeze PIP freeze 102 PIP step up PIP step up PIP step up 103 PIP step down PIP step down PIP step down 104 automatic start ID 105 write skip ID 106 skip on/off 107 write end ID 108 write FTS 109 write TOC 110 111 112 viss index next 113 viss index previous 114 mark 115 erase 116 renumber 117 blank search 118 sub mode sub mode TV1 119 sub mode sub mode sub mode 120 auto repeat 121 insert temp 122 scr loc disp 123 connect connect connect 124 disconnect 125 126 127 ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ Commnd: Audio mode: LV2/CDLV Audio mode: Pre-Amp Audio mode: Tuner Group 12 Group 16 (#1) 19 (#2) Group 17 ------------------------------------------------------------------------------ 0 0 0 0 1 1 1 1 2 2 2 2 3 3 3 3 4 4 4 4 5 5 5 5 6 6 6 6 7 7 7 7 8 8 8 8 9 9 9 9 10 picture number/time graphic equalizer left 1/2 digits 11 chapter number graphic equalizer right 12 standby standby standby 13 mute/demute mute/demute mute/demute 14 P.P. (personal pref.) P.P. P.P. 15 display display display 16 volume + volume + volume + 17 volume - volume - volume - 18 brightness + brightness + brightness + 19 brightness - brightness - brightness - 20 colour saturation + colour saturation + colour saturation + 21 colour saturation - colour saturation - colour saturation - 22 bass + bass + bass + 23 bass - bass - bass - 24 treble + treble + treble + 25 treble - treble - treble - 26 balance right balance right balance right 27 balance left balance left balance left 28 repeat once/TSPo graph equal left&right 29 repeat cont/TSPc loudness 30 next high tone filter search + 31 programming low tone filter search - 32 step + preset + 33 auto stop/memory step - preset - 34 slow run reverse signal path scroll 35 stereo left/right 36 previous 37 still reverse surround mode mono/stereo 38 speed + sleeptimer 39 speed - balance rear 40 slow run forward balance front RF switch 41 still forward TPS store execute 42 digital multi screen timer set 43 strobe timer up scan forward 44 scan reverse timer down 45 open/close (eject) timer memo FM 46 scan forward acoustic memory MW (USA: MW/FM) 47 acoustic memory select LW 48 pause pause pause 49 erase erase erase 50 rewind rewind rewind 51 go to go to go to 52 wind wind wind 53 play play play 54 stop stop stop 55 recording recording recording 56 external 1 external 1 external 1 57 external 2 external 2 external 2 58 clear all memory clear all memory clear all memory 59 repeat A/B program 60 TXT (pal)/ant.sw (ntsc) dyn range expand/compr 61 system standby system standby system standby 62 CX on/off 63 system select system select system select 64 surround sound surround sound surround sound 65 balance front balance front balance front 66 balance rear balance rear balance rear 67 sound effects sound effects sound effects 68 sound effects sound effects sound effects 69 sound effects sound effects sound effects 70 sound effects sound effects sound effects 71 sound effects sound effects sound effects 72 sound or menu func. sound or menu func. sound or menu func. 73 sound or menu func. sound or menu func. sound or menu func. 74 sound or menu func. sound or menu func. sound or menu func. 75 76 77 linear function up linear function up linear function up 78 linear function down linear function down linear function down 79 sound or menu func. catalogue sound or menu func. 80 cursor step up cursor step up cursor step up 81 cursor step down cursor step down cursor step down 82 menu on menu on menu on 83 menu off menu off menu off 84 display A/V status display A/V status display A/V status 85 cursor step left cursor step left cursor step left 86 cursor step right cursor step right cursor step right 87 menu function menu function menu function 88 PIP on/off PIP on/off PIP on/off 89 PIP shift PIP shift PIP shift 90 PIP main swap PIP main swap PIP main swap 91 strobe on/off strobe on/off strobe on/off 92 multi strobe multi strobe multi strobe 93 main freezed main freezed main freezed 94 3/9 multi scan 3/9 multi scan 3/9 multi scan 95 PIP mode select PIP mode select PIP mode select 96 mosaic mosaic mosaic 97 solarization solarization solarization 98 main stored main stored main stored 99 PIP strobe PIP strobe PIP strobe 100 recall main recall main recall main 101 PIP freeze PIP freeze PIP freeze 102 PIP step up PIP step up PIP step up 103 PIP step down PIP step down PIP step down 104 105 106 107 108 FTS 109 110 111 112 index next 113 index previous 114 115 116 117 118 sub mode 119 sub mode 120 121 122 123 connect connect connect 124 disconnect disconnect disconnect 125 126 127 ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ Commnd: Audio mode: CD Audio mode: Phono Audio mode: Recorder Group 20 Group 21 Group 18 (#1) 23 (#2) ------------------------------------------------------------------------------ 0 0 0 0 1 1 1 1 2 2 2 2 3 3 3 3 4 4 4 4 5 5 5 5 6 6 6 6 7 7 7 7 8 8 8 8 9 9 9 9 10 cursor scroll 11 display scroll 12 standby standby standby 13 mute/demute mute/demute mute/demute 14 P.P. (personal pref.) P.P. P.P. 15 display display display 16 volume + volume + volume + 17 volume - volume - volume - 18 brightness + brightness + brightness + 19 brightness - brightness - brightness - 20 colour saturation + colour saturation + colour saturation + 21 colour saturation - colour saturation - colour saturation - 22 bass + bass + bass + 23 bass - bass - bass - 24 treble + treble + treble + 25 treble - treble - treble - 26 balance right balance right balance right 27 balance left balance left balance left 28 rept once/TSPo/shuffle repeat once repeat once 29 repeat cont/TSPc repeat continuously repeat continuously 30 select + select + select + 31 select - select - select - 32 next next next 33 previous previous previous 34 index next index next 35 index previous index previous last record cancel 36 play/program stereo/mono sequential 37 speed nominal blank search 38 speed + 39 speed - 40 recording pause 41 store execute store execute store execute 42 recording blank 43 scan forward scan forward scan forward 44 mechanism A 45 open/close open/close eject 46 wave scroll mechanism B 47 play reverse 48 pause pause pause 49 erase erase erase 50 rewind rewind rewind 51 go to go to go to 52 wind wind wind 53 play play play 54 stop stop stop 55 recording recording recording 56 external 1 external 1 external 1 57 external 2 external 2 external 2 58 clear all memory clear all memory clear all memory 59 repeat A/B program 60 dynamic range expand 61 system standby system standby system standby 62 dynamic range compress counter memory 63 system select system select system select 64 surround sound surround sound surround sound 65 balance front balance front balance front 66 balance rear balance rear balance rear 67 sound effects sound effects sound effects 68 sound effects sound effects sound effects 69 sound effects sound effects sound effects 70 sound effects sound effects sound effects 71 sound effects sound effects sound effects 72 sound or menu func. sound or menu func. sound or menu func. 73 sound or menu func. sound or menu func. sound or menu func. 74 sound or menu func. sound or menu func. sound or menu func. 75 76 77 linear function up linear function up linear function up 78 linear function down linear function down linear function down 79 sound or menu func. sound or menu func. sound or menu func. 80 cursor step up cursor step up cursor step up 81 cursor step down cursor step down cursor step down 82 menu on menu on menu on 83 menu off menu off menu off 84 display A/V status display A/V status display A/V status 85 cursor step left cursor step left cursor step left 86 cursor step right cursor step right cursor step right 87 menu function menu function menu function 88 PIP on/off PIP on/off PIP on/off 89 PIP shift PIP shift PIP shift 90 PIP main swap PIP main swap PIP main swap 91 strobe on/off strobe on/off strobe on/off 92 multi strobe multi strobe multi strobe 93 main freezed main freezed main freezed 94 3/9 multi scan 3/9 multi scan 3/9 multi scan 95 PIP mode select PIP mode select PIP mode select 96 mosaic mosaic mosaic 97 solarization solarization solarization 98 main stored main stored main stored 99 PIP strobe PIP strobe PIP strobe 100 recall main recall main recall main 101 PIP freeze PIP freeze PIP freeze 102 PIP step up PIP step up PIP step up 103 PIP step down PIP step down PIP step down 104 automatic start ID 105 write skip ID 106 skip on/off 107 write end ID 108 FTS write FTS 109 write TOC 110 111 112 113 114 write start ID 115 Ca/Er/SK ID 116 reformat 117 blank search 118 sub mode sub mode sub mode 119 sub mode sub mode sub mode 120 121 122 123 connect connect connect 124 disconnect disconnect disconnect 125 126 127 ------------------------------------------------------------------------------ Good luck! ----------------- +------------------------------- / / ---------------------------+ | Eric Toonen / ----------- Also adress of STORC: | | / / (Stichting Ter Ondersteuning | | E-Mail: / / van RPL Calculators) | | s89406143@hsepm1.hse.nl / ------- | | / / The dutch supportgroup for | | Snail-mail: / ------- the HP28C, HP28S & HP48SX. | | Djept-Zuid 6 / / | | 5502 RP Veldhoven / / Bank: 86.44.34.057 | | The Netherlands / ----------- Tel: 040-536992 | +----------------------/ / -------------------------------------+ ----------------- -- | | "Never imagine yourself not to be otherwise than what | | Jurjen N.E. Bos | it might appear to others that what you were or might | | | have been was not otherwise than what you had been | | jurjen@cwi.nl | would have appeared to them to be otherwise." |