[Coco] Plugging more stuff in to the RS-232 Pak

Dave Philipsen dave at davebiz.com
Fri Dec 25 19:46:55 EST 2015


On 12/25/2015 8:06 AM, K. Pruitt wrote:
> Is it possible to power an IR LED via the RS-232 pak and successfully 
> send a set pattern of signals to an IR-controlled device?
>
> In other words, can I use my RS-232 pak to turn my CoCo in to a TV 
> Remote? I have no idea at what "baud rate" those signals are sent out. 
> Can the CoCo match the speed? I'm guessing yes.
>
> Certainly someone has tried this already, if it isn't just out and out 
> stupid. It sounds pretty simple. A resistor or two and an IR LED?  I 
> have a bazillion remotes around here I can pull an IR LED from. Am I 
> going to blow up my CoCo! Hehe.
>
Here's a code snippet that I wrote about 18 years ago for sending IR 
commands via a single output bit that was wired to a LED.  The code was 
for a JVC die sublimation video printer if I remember correctly. All 
delays were done purely in software and the code ran on a 4 MHz MC68HC11 
which is pretty similar to a 6809 but obviously if the 6809 runs at a 
different bus speed and the equivalent instructions have different cycle 
times then you'd have to make some changes. And you'll probably need a 
DSO (digital storage oscilloscope) to debug it although, at the time I 
did not have such a scope.  I simply tied the remote control LED to an 
input bit on my MPU and wrote a program to store the bit timings (poor 
man's DSO!)


Dave



* CAM.SRC - A program for the CAMERA / OVERLAY / PRINTER controller.

* Revision History:
*
* 12/06/97 - Project started with initialization of DUART and generation of
*            IR control signals for printer. The printer control routines
*            seem to be pretty solid although they hog CPU time because
*            the CPU is generating the carrier frequency in software.
*            The PCB was modified to read/write handshake signals on pins
*            7 & 8 of the DB9 connector (RTS/CTS). A trace was missing for
*            serial data to the modulator circuit and that was also wired
*            in.
*
* 12/08/97 - FINALLY got the camera protocol working!
*
* print button pressed
     jsr    memry        send IR "MEMORY"
     ldab    #2
     jsr    dl100ms
     jsr    source        send IR "SOURCE"
     ldab    #2
     jsr    dl100ms
     jsr    memry        send IR "MEMORY"
     ldab    #2
     jsr    dl100ms
     jsr    stabl        send IR "FRAME STABILIZER"
     ldab    #2
     jsr    dl100ms
     jsr    print        send IR "PRINT"

* delay for B * 1/10 sec
dl100ms
dl0    ldy    #$8D2D
dl1    dey
     nop
     nop
     bne    dl1
     decb
     bne    dl0
     rts


* send burst on IR LED
burst    pshb
     ldaa    porta
     anda    #$7F
     staa    porta        make sure LED is off
     ldab    #40
kc38    ldaa    porta
     eora    #$80
     staa    porta
     ldy    #$3
kc38a    dey
     nop
     bne    kc38a
     decb
     bne    kc38
     pulb
     rts

* send a long space (IR LED)
lsp    ldaa    porta
     anda    #$7F
     staa    porta        make sure LED is off
     ldy    #900
lsp1    dey
     bne    lsp1
     rts

* send a short space (IR LED)
ssp    ldaa    porta
     anda    #$7F
     staa    porta        make sure LED is off
     ldy    #354
ssp1    dey
     bne    ssp1
     rts

* send a intra-byte interval
brsp    ldaa    porta
     anda    #$7F
     staa    porta        make sure LED is off
     ldy    #10700
brsp1    dey
     bne    brsp1
     rts

blsp    jsr    burst
     jsr    lsp
     rts

bssp    jsr    burst
     jsr    ssp
     rts

pwron
     ldab    #2
pwrn1
     jsr    blsp
     jsr    blsp
     jsr    blsp
     jsr    blsp
     jsr    blsp
     jsr    bssp
     jsr    blsp
     jsr    blsp
     jsr    blsp
     jsr    blsp
     jsr    bssp
     jsr    blsp
     jsr    bssp
     jsr    bssp
     jsr    bssp
     jsr    bssp
     jsr    burst
     jsr    brsp
     decb
     bne    pwrn1
     rts


source
     ldab    #2
sorc1
     jsr    blsp
     jsr    blsp
     jsr    blsp
     jsr    blsp
     jsr    blsp
     jsr    bssp
     jsr    blsp
     jsr    blsp
     jsr    blsp
     jsr    blsp
     jsr    bssp
     jsr    blsp
     jsr    bssp
     jsr    bssp
     jsr    blsp
     jsr    bssp
     jsr    burst
     jsr    brsp
     decb
     bne    sorc1
     rts


memry
     ldab    #2
memr1
     jsr    blsp
     jsr    blsp
     jsr    blsp
     jsr    blsp
     jsr    blsp
     jsr    bssp
     jsr    blsp
     jsr    blsp
     jsr    bssp
     jsr    bssp
     jsr    blsp
     jsr    blsp
     jsr    blsp
     jsr    bssp
     jsr    bssp
     jsr    bssp
     jsr    burst
     jsr    brsp
     decb
     bne    memr1
     rts

stabl
     ldab    #2
stbl1
     jsr    blsp
     jsr    blsp
     jsr    blsp
     jsr    blsp
     jsr    blsp
     jsr    bssp
     jsr    blsp
     jsr    blsp
     jsr    blsp
     jsr    bssp
     jsr    blsp
     jsr    blsp
     jsr    bssp
     jsr    bssp
     jsr    bssp
     jsr    bssp
     jsr    burst
     jsr    brsp
     decb
     bne    stbl1
     rts

print
     ldab    #2
prnt1
     jsr    blsp
     jsr    blsp
     jsr    blsp
     jsr    blsp
     jsr    blsp
     jsr    bssp
     jsr    blsp
     jsr    blsp
     jsr    bssp
     jsr    bssp
     jsr    blsp
     jsr    blsp
     jsr    bssp
     jsr    bssp
     jsr    bssp
     jsr    bssp
     jsr    burst
     jsr    brsp
     decb
     bne    prnt1
     rts




More information about the Coco mailing list