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.
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.
; 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 ENDMake 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 | | | +--------------------------------------------------------------------+
'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 >>
You send data to the device by entering a command number (a real in range 0..127) and press RC5 ...