[Coco] X10 Protocol for communicating with the CM11A

Aaron Wolfe aawolfe at gmail.com
Sat Sep 25 23:42:08 EDT 2010


Here is the source to the OS9 utility on the disk Bruce sent me.
FWIW, it does make my older gray PnP controller's data light flash,
but doesn't seem to make anything happen on my outlets.  Could be my
coco 3 with 6309 is effecting the timing, could be my PnP controller
is shot, could be my outlets are DOA, could be this code only works on
the white PnP controller... no idea yet.

(slightly edited so it would assemble with mamou)

*
*
******************************
******************************
**                          **
** PLUG'N POWER CONTROLER   **
** MODULE FOR COCO OS-9     **
**    BY                    **
**    BRIAN HICKEY          **
**    [73125,770]           **
**    1600 PULLEN RD #9F    **
**    TALLAHASSEE ,FL 32303 **
**                          **
******************************
******************************
*
*        INSTRUCTIONS
*
* CALLING FORMAT IS PNP A 1 BRI 2
*
*   WHERE A=   HOUSE CODE (UPPER CASE A-P)
*         1=   UNIT # IN HEX (1-9,A-F) OR SET,CLEAR
*         BRI= COMMAND (ON,OFF,BRI,DIM)
*         2=   # OF STEPS TO BRI OR DIM
*
*   ALL PAREMETERS MUST BE UPPER CASE
*   WITH A SPACE BETWEEN EACH
*
*
 NAM PNP
 ttl blah

ifp1
 use   defsfile
endc

tylg     set   Prgrm+Objct
atrv     set   ReEnt+rev
rev      set   $00
edition  set   10

*
 MOD FINISH,NAME,tylg,atrv,START,SIZE
*
NAME FCS /PNP/
*
FLAG RMB 2
RCNTR RMB 1
 RMB 200
SIZE EQU .
*
START EQU *
 PSHS X,Y
 LDA #$03
 CLRB
 STD <FLAG
 PSHS Y
 LDA ,X++
 PSHS X
 LEAY COD1TBL,PCR
 LEAX LETABL,PCR
FIND1 CMPA ,X+
 BEQ OUT1
 LEAY 01,Y
 INCB
 CMPB #$0F
 BNE FIND1
 PULS X
 LBRA FMTERR
OUT1 LDA 0,Y
 STA <FLAG+1
 PULS X
 LDA ,X++
 CMPA #'S
 BNE CONT1
 LDA #$01
 PULS Y
 BRA DONE
CONT1 CMPA #'C
 BNE CONT2
 LDA #$00
 PULS Y
 BRA DONE
CONT2 PSHS X
 CLRB
 LEAY COD2TBL,PCR
 LEAX NUMTBL,PCR
FIND2 CMPA ,X+
 BEQ OUT2
 LEAY 01,Y
 INCB
 CMPB #$0F
 BNE FIND2
 PULS X
 BRA FMTERR
OUT2 LDA 0,Y
 ORA <FLAG+1
 STA <FLAG+1
 LBSR SENPKT
 LDX #$2000
DELAY LEAX -1,X
 BNE DELAY
 LDA <FLAG+1
 ANDA #$F0
 STA <FLAG+1
 PULS X
 LDD ,X
 CMPD #$4F4E
 BNE OFF
 LDA #$02
 PULS Y
 BRA DONE
OFF CMPD #$4F46
 BNE DIM
 LDA #$03
 PULS Y
 BRA DONE
DIM CMPD #$4449
 BNE BRIGHT
 LDA #$04
 BRA GETCTR
BRIGHT CMPD #$4252  BR
 BNE FMTERR
 LDA #$05
GETCTR PULS Y
 LDB -2,Y
 ANDB #$0F
 STB <FLAG
*
DONE ORA <FLAG+1
 STA <FLAG+1
 LDA #$40
 ORA <FLAG
 STA <FLAG
 LBSR SENPKT
 PULS X,Y
 CLRB
 OS9 F$EXIT
*
FMTERR PULS Y
 PULS X,Y
 LDB #230
 OS9 F$EXIT
*
LETABL FCC /ABCDEFGHIJKLMNOP/
COD1TBL FCB $60,$E0,$20,$A0,$10,$90
 FCB $50,$D0,$70,$F0,$30,$B0,$00,$80,$40,$C0
NUMTBL FCC /123456789ABCDEF/
COD2TBL FCB $06,$0E,$02,$0A,$01,$09
 FCB $05,$0D,$07,$0F,$03,$0B,$00,$08,$04,$0C
*
* THIS SECTION ADAPTED FROM
* "X10 PROTOCAL THEORY"
* BY A.B.TREVOR AND C.YAHN
* 6/83 RAINBOW P102
*
BSRSTA EQU $FF20
*
SENPKT LDD <FLAG
 ANDA #$3F
 STA <RCNTR
HEADER ORCC #$50
 BSR BURST
 BSR BURST
 BSR BURST
 BSR PAUSE
* SEND DATA
SEND LDA <FLAG+1
 LDX #8
 BSR BITFLD
* SEND UNIT/CMD FLG
SENF LDA <FLAG
 ROLA
 LDX #1
 BSR BITFLD
 ANDCC #$AF
 DEC <RCNTR
 BNE HEADER
 RTS
*
BSROFF FCB 0
BSRON FCB $FC
* TRANSMIT A BYTE
BITFLD ROLA
 BCS S1
 BSR PAUSE
 BSR BURST
 BRA BITDN
S1 BSR BURST
 BSR PAUSE
BITDN LEAX -1,X
 BNE BITFLD
 RTS
*
* SEND PAUSE
PAUSE LEAY BSROFF,PCR
 BRA BUR1
* SEND BURST
BURST LEAY BSRON,PCR
BUR1 PSHS A,X
BUR2 LDA BSRSTA
 BITA #1
 BEQ BUR2
 LDA #$34
BUR3 DECA
 BNE BUR3
 LDB #3
BUR4 LDA 0,Y
 STA BSRSTA
 LDA #$B2
BUR5 DECA
 BNE BUR5
 CLR BSRSTA
 DECB
 BEQ EXIT
BUR7 LDA #$F8
BUR8 NOP
 DECA
 BNE BUR8
 BRA BUR4
*
EXIT PULS X,A,PC
 EMOD
FINISH EQU *
 END







On Sat, Sep 25, 2010 at 10:59 PM, George Ramsower
<georgeramsower at gmail.com> wrote:
> This is the protocol used to communicate with the CM11A from a computer...
>
> ftp://ftp.x10.com/pub/manuals/cm11a_protocol.txt
>
>  I do not know if this is the same protocol used with the PnP for the coco
> or other devices.
>  I do know the coco PnP cart uses FSK on the cassette port. Tandy could
> have devised their own protocol. It sounds like about 1200 baud or maybe a
> little faster but, not much.
>
>  Here is the X10 standard used on our power lines...
>
> http://www.x10.com/support/technology1.htm
>
>
>  If someone with the knowledge of assembly language can obtain the basic or
> basic09 version of software to operate the PnP timer, then we would then
> discover what RS did. I think. HUH?
>
>  The RS Basic version pokes the ML driver in ram upon startup. I would only
> assume the OS9 version comes with the driver. My copy of the RS Basic
> program is on a 3.5 floppy and right now, I have no way to send it to anyone
> or post in on my website. My main coco is broken and I haven't had time to
> fix it. UGH! This PC has no floppy drive in it and the one with that RS
> Basic version is also broken. I hate that!!!!
>
>  I have a "Bill Gates" house, so to speak. Several things on timer and on
> demand things are done either on the RS PnP timers or from this PC.  If I
> had an OS9 driver, I could do some real, "real time" things from my coco.
> I'm holding my breath to see where this goes. Been dropping in for several
> years on this list to find some interest in this and now it seems it's
> finally happening.
>
>  Thanks for joining MY little club. <grin>
>
>
> George
>
>
> --
> Coco mailing list
> Coco at maltedmedia.com
> http://five.pairlist.net/mailman/listinfo/coco
>



More information about the Coco mailing list