Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 1 of 1

Thread: Teensy as USB Adapter for X-10 CM17A "Firecracker"

  1. #1
    Junior Member
    Join Date
    Nov 2012
    Location
    Temple, Texas
    Posts
    10

    Teensy as USB Adapter for X-10 CM17A "Firecracker"

    The last time I needed to control X-10 was years ago when PCs still had serial ports.

    I didn't have a USB/Serial adapter around tonight so I threw this together.
    Click image for larger version. 

Name:	IMG_20130107_220509.jpg 
Views:	4896 
Size:	65.0 KB 
ID:	119

    The code was so simple, worked the very first time!
    Code:
    /* 
        CM17A Firecracker - USB Adapter
        
        ftp://ftp.x10.com/pub/manuals/cm17a_protocol.txt
        http://www.db9-pinout.com/
        https://www.pjrc.com/teensy/pinout.html
        Pin 4 DTR - Teensy 2 pin 22
        Pin 5 Ground
        Pin 7 RTS - Teensy 2 pin 23
    */
    
    int DTR=22;
    int RTS=23;
    int LED=11;  // Teensy 2
    void setup()   {                
      Serial.begin(38400);
      pinMode( RTS,OUTPUT);
      pinMode( DTR,OUTPUT);
      pinMode( LED,OUTPUT);
    }
    
    void loop()                     
    {
        bool rts=Serial.rts();
        digitalWrite( RTS, rts );
        digitalWrite( LED, rts);  // light led for activity indicator
        digitalWrite( DTR, Serial.dtr() );
    }
    Using "Jimmy's" x10.py from http://www.averdevelopment.com/python/x10.html was also easy
    Code:
    john@mythbuntu:~/pyx10$ wget "http://www.averdevelopment.com/python/x10.zip"
    john@mythbuntu:~/pyx10$ unzip x10.zip
    john@mythbuntu:~/pyx10$ python x10.py /dev/ttyACM0 F1 On  # turn on coffeepot

    Thanks Paul!

    John
    Last edited by johncc; 01-08-2013 at 11:46 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •