Jump to content

Recommended Posts

Posted (edited)

This is a continuation of an idea that got a little spring-boarding in another thread...

 

 

 

Thanks to the participants, for their motivations... Special thanks to @apersson850 for a patient and helpful review.

 

 The purpose of version 1.0, at conclusion was simply to directly control an IR device using a physical connection...

 

Further testing, over the course of a few days, revealed inconsistent reliability(keypresses being missed). I tried adjusting the software's timing, circuit changes, to no avail.

 

I then continued to investigate the possibility of adding an external generator circuit to produce the 38K carrier needed for IR transmission.(Nov 17)

 

I determined: To move forward with the IR sender idea, in order to explore physical separation as an electrical isolation solution... 

 

Finally, the IR carrier module arrived(May 11th, from China).

 

38kemitter.thumb.JPG.7d6c7521df0f0a004bd98feab8043125.JPG 

 

After the addition of an inverter, the IR sender worked out! However, the "keypress" issue persisted.

 

inverter.thumb.JPG.9f0253ca7651bc2a1f66f77206e8abc3.JPG

 

I had been so close, but, for one thing, had failed to mind the separation pulses, when adjusting the total number of data pulses sent.(Thanks, Classic99's DEBUGGER).;)

 

After achieving some measure of success... I decided to look into decoding the remote control's signals, on-the-fly... in order to REMOTE CONTROL the TI itself.:cool:

 

626563769_justlanded.thumb.JPG.61606957820ae9f4c262e50b34aeb6ee.JPG

 

After reviewing some others findings...

 

7-Scope-Trace_Deciphered-550x230.jpg.c5f74d4da1dcc14d49214fbc62222e99.jpg

     https://www.electroschematics.com/ir-decoder-encoder-part-1

 

This was successful, and also led me to developing a way to produce the needed IR signals, directly from the extracted HEX CODES! Now, only a small buffer is needed to reproduce any device's(NEC) codes!

 

       code1.thumb.JPG.530d879eb9dc9f06954abfbb78cbf3eb.JPG       code2.thumb.JPG.847d29bda43717d172689213a24b1147.JPG    

 

The above images, from >1000 to >1FFF, is ment to load into MINIMEMORY, from >7000 to >7FFF. While reviewing the image, try and pretend that the first >1, in the addresses is a >7.


This image contains 5 subroutines that can be called manually by using EASY BUG's (E)Execute COMMAND.

 

1. RECEIVE IR, at >7120, will scan the output from an IR receiver, connected to a port on the TI's 9901 interface I.C.. The subprogram fills the buffer at >7D00, with word values representing the length of the pulses received.

 

2. SEND IR, at >7160 will read the values from the buffer at >7D00, and reproduce the pulses needed to drive a 38kHz IR sending module, connected to a port on the TI's 9901 interface I.C..

 

3. KEY SEQ. PLAYER, at >7DCA(Execute >7DCC), Sends a series of keypresses(Bursts), repeatedly, by modifying the buffer addresses used in the SEND IR routine. This method is now, as though it were deprecated.:lol:

 

4. KEY DECODER, at >7EA0(Execute >7EA6), will read the buffer at >7D00, and write the derived HEX CODES to addresses >7EA0(DEVICE ID) and >7EA2(COMMAND).

 

5. KEY ENCODER, at >7F00(Execute >7F08), will read HEX CODES specified in R1 and R2 at addresses >7F0A(DEVICE ID) and 7F0E(COMMAND), than write the pulse length values to the buffer at >7D00, capable of driving the SEND IR subroutine! These synthesized values are experimental. I'm not using a scope of any kind or even a calculator!

 

So, YMMV. These pulse values are within the detection range of, and appear to work well with:

The only test unit I'm using.:roll: To be sure, I'm not certain if I should be counting MARKs or SPACEs, HIGHs/LOWs, here.:twisted: I did a lot of trial and error to get this to work...;)

 

Looking at the buffer(>7D00). The first word(>0266) seems to be a waking-up shift from HIGH to LOW and could perhaps trigger an interrupt.

 

The second word(>0134) at(>7D02) seems to be a header/tail pulse.

 

The third and every other word(>0024) is a LOW, separator pulse.

 

Looking at the fourth word(>0023) in the buffer, from the ASCII view, a #, can be seen. The #'s are the 0's, the o's are the 1's, and the $'s are the separator pulses. So the HEX CODE seen is ########=>00, oooooooo=>FF, #o#o##o#=>52, o#o#oo#o=>AD, or >00FF, >52AD. >00FF being the Device's ID, and >52AD being the COMMAND CODE(for "key 9" on my device).

 

  P.S. Any ideas on how I could bottle and sell this are welcome.;-)

 

        H.A.

 

                phm3058C.BIN

 

                phm3058G.BIN

Edited by HOME AUTOMATION
  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites

I have switched to using a board mounted IR RECEIVER, this is giving more consistent values.:thumbsup:

 

sensortype.thumb.JPG.5a4e1f1b5aa8545d0f64a0d761875486.JPG

 

I've been reconstructing the source code, from the many hex-edited mods I'd made.
I'm slowly making the sources more RELOCATABLE... in order to satisfy the exhilarated masses! I know it's been a real let down, that this requires both dedicated CRU IN and OUT ports. So I've been looking into some sort of dongle to support this...:ponder:

 

I tried to integrate the last version's subroutines into a "type-on-screen" program. It turned out that while RECEIVE IR works well for scanning a single keypress, under test conditions. When used as a keyscan routine, it failed miserably! It seems that by the time One, releases a key, the repeat codes(shorter) have already presented into the next scan loop, usually leaving it hanging. I tried adjusting variously placed delays, to little avail... many dropped characters and a need to type at a precise speed(Ha!).:lol:

 

After doing some more signal analysis...

I arrived at the following updated observations:

 

The first word(>0266), in the buffer at >7D00, is indeed the very first pulse sent by the remote control, this is the rather long, HEADER pulse, all the other pulses are very short, data seperator pulses. The second word, if less than >115 is a toggle bit(key held down). If greater than 115, the second word indicates a 32-Bit data BURST will follow. These values can be enforced to provide DEBOUNCE. Here I have done so...

 

While it is still theoretically possible to get hung-up in the data timing loops, I haven't been able to get that to happen. If it did happen, execution should self-resync on the next BURST. None the less, I intend to correct this, in order to make certain that the subroutine cannot hang, though this will require re-calibration.

 

For now I am just shunting the toggle codes back to reject/re-scan.

 

I have determined that the BUFFER could be eliminated, at least for NEC codes. However, I'm keeping with this method, as it seems to offer greater flexibility.

 

I've provided the latest .BIN image...

 

...and here, the Source Code... as such, for possible review.

 

Spoiler

 

       AORG >7200
       DEF  SCANER
SCANER CLR  R12
       LI   R7,>88
       LI   R6,>7D00
NEXT   CLR  *R6+
       DECT R7
       JNE  NEXT
       LI   R6,>7D00
WAIT   TB   17
       JEQ  WAIT
TEST   CLR  R5
CHECK1 INC  R5
       TB   17
       JNE  CHECK1
       MOV  R5,*R6+
       CLR  R5
CHECK0 INC  R5
       TB   17
       JEQ  CHECK0
       MOV  R5,*R6+
       CI   R6,>7D8A
       JLE  TEST
       RT
       END
       AORG >7240
       DEF  SEND
SEND   CLR  R12
       SBZ  16
       LI   R6,>7D00
MARK   CLR  R5
       MOV  *R6+,R5
CHECK1 SBO  16
       NOP
       DEC  R5
       JNE  CHECK1
SPACE  CLR  R5
       MOV  *R6+,R5
CHECK0 SBZ  16
       DEC  R5
       JNE  CHECK0
       CI   R6,>7D88
       JLT  MARK
       LI   R8,>44FF
WAIT   DEC  R8
       JNE WAIT
       RT
       END
       AORG >7270
       DEF DECODE
HEXCOD DATA 0,0,>40
DECODE LI   R3,>7D04
       CLR  R4
ADVANC INCT R3
       C    *R3+,@HEXCOD+4
       JGT  ONES
ZEROS  SLA  R4,1
       JMP  DONE16
ONES   SLA  R4,1
       INC  R4
DONE16 CI   R3,>7D44
       JNE  DONE32
       MOV  R4,@HEXCOD
DONE32 CI   R3,>7D84
       JLT  ADVANC
       MOV  R4,@HEXCOD+2
       RT
       END
       AORG >72B0
       DEF  ENCODE
STABLE DATA >266
BURST  DATA >134
TAIL   DATA >0A9F
OFFSTA DATA >0024
ENCODE LI   R9,>00FF
       LI   R10,>52AD
       LI   R3,32
       LI   R4,>23
       LI   R5,>6F
       LI   R6,>7D06
       LI   R8,>24
       MOV  @STABLE,@>7D00
       MOV  @BURST,@>7D02
       MOV  @TAIL,@>7D86
       MOV  @OFFSTA,@>7D04
       MOV  R9,R7
GEN    SLA  R7,1
       JOC  ONE
ZERO   MOV  R4,*R6+
       JMP  NEXT
ONE    MOV  R5,*R6+
NEXT   CI   R3,17
       JNE  COUNT
       MOV  R10,R7
COUNT  MOV  R8,*R6+
       DEC  R3
       JNE  GEN
       RT
       END
       AORG >7310
       DEF  SEQPLA
SAVRTN DATA 0
SEQPLA MOV  R11,@SAVRTN
       JMP  GO
PLAY   BL   @>72C0
       BL   @>7240
GO     MOV  *R13+,R10
       CI   R10,>0
       JNE  PLAY
OUT    MOV  @SAVRTN,R11
       RT
       END
       AORG >7330
       DEF  RECEIV
RECEIV CLR  R12
       LI   R7,>88
       LI   R6,>7D00
NEXT   CLR  *R6+
       DECT R7
       JNE  NEXT
       LI   R6,>7D04
WAIT   TB   17
       JEQ  WAIT
       CLR  R5
HEADER INC  R5
       TB   17
       JNE  HEADER
       CI   R5,>200
       JLT  WAIT
       CLR  R5
TBFLAG INC  R5
       TB   17
       JEQ  TBFLAG
       CI   R5,>115
       JLT  WAIT
TEST   CLR  R5
CHECK1 INC  R5
       TB   17
       JNE  CHECK1
       MOV  R5,*R6+
       CLR  R5
CHECK0 INC  R5
       TB   17
       JEQ  CHECK0
       MOV  R5,*R6+
       CI   R6,>7D88
       JLE  TEST
       RT
       END
       AORG >7380
       DEF  ONSCRN
       REF  VSBW
DTAB   DATA >6897,>30CF,>18E7,>7A85,>10EF
       DATA >38C7,>5AA5,>42BD,>4AB5,>52AD
ONSCRN MOV  R11,R15
INPUT  CLR  R0
PRESS  BL   @>7330
       BL   @>7276
       LI   R1,DTAB
       LI   R2,JTAB
       CLR  R3
COMP   INCT R3
       CI   R3,22
       JEQ  PRESS
       C    @>7272,*R1+
       JNE  COMP
       DECT R3
       A    R3,R2
       MOV  *R2,R2
       BL   *R2
       SWPB R1
       BLWP @VSBW
       INC  R0
       JMP  PRESS
JTAB   DATA D0,D1,D2,D3,D4,D5,D6
       DATA D7,D8,D9
D0     LI   R1,>30
       RT
D1     LI   R1,>31
       RT
D2     LI   R1,>32
       RT
D3     LI   R1,>33
       RT
D4     LI   R1,>34
       RT
D5     LI   R1,>35
       RT
D6     LI   R1,>36
       RT
D7     LI   R1,>37
       RT
D8     LI   R1,>38
       RT
D9     LI   R1,>39
       RT
       END
       AORG >7E00
LIST   DATA >38C7 "5"
       DATA >30CF "1"
       DATA >4AB5 "8"

       AORG >7DE0
       DEF  GOSEQ
GOSEQ  LI   R9,>00FF
       LI   R13,>LIST
       BL   >7312
       B    >7DE0
       END

 

                         Version 3

                 phm3058C.BIN

                 phm3058G.BIN

Share this post


Link to post
Share on other sites

Sooo, I wanted others to be able to share in the bounty, w/o having to tear-down their TI's, in order to gain access to the needed I/O ports.:woozy:

 

Getting enough power from the JOYSTICK port, to run both the emitter and the receiver, simultaneously, involved some squeezing. At one point I started designing a hungry, Joule thief type circuit with little supercapacitors, in an attempt to get sufficient current and voltage in spurts, but somehow managed to do w/o. Emitter power is probably minimal(untested). I had to disable some of the keyboard's lines, in the port initialization routine, not sure if putting them back will straighten things out for KSCAN w/o a reset. Also the ALPHA-LOCK(keep down for full power). Anyway, One could put a cheap IR SENDER nearby to boost the signal! I doubt though that this will work on a QI model.:P

 

 XMITTERS.JPG.d953226c6d6b56a6033529c054f507e1.JPG

 

  P.S. I'm wondering if there's a way to get my sub. hooked by the keyboard's SCAN routine, than perhaps I could set the final values at >8375, then return or barge back into it(providing compatibility for existing software). So far the only thing I've come up with involves a need for the LOAD interrupt line...

 


  P.P.S. I'll try to upload the modified routines and port initialization, a little later on today.:)

Edited by HOME AUTOMATION
raised capacitance!
  • Thanks 1

Share this post


Link to post
Share on other sites

These can be used as a update/replacement to/of post #2's sources, for the purpose of using the JOYPORT.

 

Spoiler
       AORG >71F0
       DEF  INITPO
INITPO CLR  R12
       SBZ  31
       SBZ  21
       SBO  19
       SBO  20
       RT
       END
       AORG >7200
       DEF  SCANER
SCANER CLR  R12
       LI   R7,>88
       LI   R6,>7D00
NEXT   CLR  *R6+
       DECT R7
       JNE  NEXT
       LI   R6,>7D00
WAIT   TB   4
       JEQ  WAIT
TEST   CLR  R5
CHECK1 INC  R5
       TB   4
       JNE  CHECK1
       MOV  R5,*R6+
       CLR  R5
CHECK0 INC  R5
       TB   4
       JEQ  CHECK0
       MOV  R5,*R6+
       CI   R6,>7D8A
       JLE  TEST
       RT
       END
       AORG >7240
       DEF  SEND
SEND   CLR  R12
       SBZ  20
       LI   R6,>7D00
MARK   CLR  R5
       MOV  *R6+,R5
CHECK1 SBO  20
       NOP
       DEC  R5
       JNE  CHECK1
SPACE  CLR  R5
       MOV  *R6+,R5
CHECK0 SBZ  20
       DEC  R5
       JNE  CHECK0
       CI   R6,>7D88
       JLT  MARK
       LI   R8,>44FF
WAIT   DEC  R8
       JNE WAIT
       RT
       END
       AORG >7330
       DEF  RECEIV
RECEIV CLR  R12
       LI   R7,>88
       LI   R6,>7D00
NEXT   CLR  *R6+
       DECT R7
       JNE  NEXT
       LI   R6,>7D04
WAIT   TB   4
       JEQ  WAIT
       CLR  R5
HEADER INC  R5
       TB   4
       JNE  HEADER
       CI   R5,>200
       JLT  WAIT
       CLR  R5
TBFLAG INC  R5
       TB   4
       JEQ  TBFLAG
       CI   R5,>115
       JLT  WAIT
TEST   CLR  R5
CHECK1 INC  R5
       TB   4
       JNE  CHECK1
       MOV  R5,*R6+
       CLR  R5
CHECK0 INC  R5
       TB   4
       JEQ  CHECK0
       MOV  R5,*R6+
       CI   R6,>7D88
       JLE  TEST
       RT
       END

 

 

  • Like 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...