Author Topic: LM465 and Dim  (Read 4383 times)

x10Tim

  • Jr. Member
  • **
  • Posts: 14
LM465 and Dim
« on: January 19, 2015, 06:51:49 PM »
Apologize for the length.... I am currently using AHP and the CM15A and the XTB-IIR as a repeater.  Thanks to Tuicemen and others, I have AHP rebuilt on a Win7 system after losing my XP one.  After installing AHP again from posted files, and there may be a little Marmitek in there too, I noticed that my LM465's started operating differently.  Instead of coming on full bright and dimming to the AHP programmed level, they ramp from off to the set level.  I am currently designing a new Arduino controller board to get a web interface and other features and to wean off of the CM15A.  I am sending commands to the XTB-IIR TW523 emulation port.  In sending commands to the LM465 I now can do it both ways, come up full on and Dim and go directly to the desired level.  However, I stumbled across the going directly method as I have not seen documentation on this.  If I select the Unit, send it an On, and then delay and then send it a Dim, the lamp dim level will be set by the amount of delay between the On and Dim commands, from 0 to 1 second.  (0 very dim, 1 second full bright minus 1 dim step) Obviously there are small software program execution delays in there too.  I have repeated this over and over reliably and tried all my spare LM465's and they all work this way (They are soft start ones).   After a long, non-successful Google search, my long story question is, has someone documented the firmware operation inside this and other wall / lamp modules that Dim or have any comments on what I am observing?   I have a big collection of X10.com modules and want to keep them going.  Thanks.

Jeff

  • Administrator
  • Hero Member
  • *****
  • Posts: 201
    • Owner, JV Digital Engineering
Re: LM465 and Dim
« Reply #1 on: January 20, 2015, 06:24:36 AM »
Rather than trying to set the brightness based on the delay between the two times, why not just send the extended code that defines the brightness directly?  Then with that single command the lamp module would ramp to that exact brightness level.

Dave Houston has the extended code document on his website:  http://davehouston.net/xtc798.txt

Jeff
X10 automation since the BSR days...

bkenobi

  • Sr. Member
  • ****
  • Posts: 95
Re: LM465 and Dim
« Reply #2 on: January 21, 2015, 12:14:21 PM »
Are you sure it dims to the selected level or does it simply stop the soft start in its tracks?  I have noticed that if I turn a WS467 with soft start on but bump the button a second time during startup, the light will stop brightening.  I actually HATE this "feature" but have no idea how to fix it.  One switch in particular is right next to the back door such that opening the door sometimes causes it to be bumped on or double bumped dim.  I believe there is a way to disable soft start and/or local control but haven't seriously investigated.

Brian H

  • Hero Member
  • *****
  • Posts: 169
Re: LM465 and Dim
« Reply #3 on: January 21, 2015, 01:09:21 PM »
The Soft Start  wall switches also have the Preset Dim feature.
http://kbase.x10.com/wiki/Newer_Wall_Switches_and_Preset_Dim

The Soft Start LM465s I have also do not dim down to 0%. They stop at roughly at 20% to 30%
« Last Edit: January 21, 2015, 01:11:27 PM by Brian H »

x10Tim

  • Jr. Member
  • **
  • Posts: 14
Re: LM465 and Dim
« Reply #4 on: January 21, 2015, 06:00:28 PM »
Thanks, after more debug it is the fact that the Dim command stops the Soft Start sequence.  Not a reliable method.  I am looking into your other suggestions now.   Thanks again.

x10Tim

  • Jr. Member
  • **
  • Posts: 14
Re: LM465 and Dim
« Reply #5 on: January 24, 2015, 07:14:44 AM »
Would you mind sanity checking my assumptions below,

Sending direct dim command with Extended Code 1.
Single 62 bit data frame
I am sending… (Bit inversion after start code implied)
    *  Start Code = 4 bits,
    * Housecode = 4 bits,
    * Extended Code = 5 bits (01111),
    * Unit code (device code) = 4 bits,
    * Data = 8 bits,
    * Command = 8 bits
To send an Extended Code 1 command to the LM465 @ C1 to turn on at 50% it would be sent continuously and it would look like this…
    *  Start Code = 1110,
    * Housecode = 0010,         // HC C
    * Extended Code  = 01111,      // Extended Code 1
    * Unit code (device code) = 0110,   // Unit 1
    * Data = 00011111,         // 0x1f = 50%
    * Command = 00110001      // 0x31 = PRESET RECEIVER O/P on this HC DC
The full message is sent twice without a gap.

Jeff

  • Administrator
  • Hero Member
  • *****
  • Posts: 201
    • Owner, JV Digital Engineering
Re: LM465 and Dim
« Reply #6 on: January 25, 2015, 06:52:14 AM »
The first part looks correct, but I'm not sure of the content of the data and command words.  All I have done on that portion is decode it as a series of 4 hexadecimal characters.  If I get the chance, I can check what the Ocelot transmits when sending an extended code to a Leviton dimmer.

Jeff
X10 automation since the BSR days...

x10Tim

  • Jr. Member
  • **
  • Posts: 14
Re: LM465 and Dim
« Reply #7 on: January 26, 2015, 07:42:15 PM »
Thanks, I am going to set up my spare CM15A to turn on an LM465 at 50% every 5 minutes and put a logic analyzer on the Cypress USB microprocessor to see what they are transmitting or have my Arduino receive the command and see what bytes I get.  I can find lots of documentation on the fact that these are 62 bit commands but not very much where people have stated that they were successful and this is what they transmitted.  I see where there are other third party controllers that you can send these commands with but no documentation on what they are transmitting only the command you send to interface with the controller.

x10Tim

  • Jr. Member
  • **
  • Posts: 14
Re: LM465 and Dim
« Reply #8 on: January 28, 2015, 09:05:25 PM »
I rewrote the Arduino X10 library to receive into a buffer and then I took a spare CM15a and programmed an LM465 (D1) to come on to 50% when it was triggered by an EagleEye sensor in a Macro in AHP.  I am off by one bit at the bottom but it is getting late and wanted to let you know I am getting close and will have an answer soon.

I captured the following on my Arduino connected to the TW523 port on the XTB-IIR so you can receive extended commands!

1110  1010  01111   0110      00100000     00110000?
  SC      D     EXT1    Unit1     0x20(52%)   Probably 0x31

So the X10 documentation is correct, I did not doubt that, and it looks like I am probably sending the correct command from the Arduino from my first post to the TW523 on the XTB-IIR.  I will put a storage scope on things to validate that the command is going out with no issues. I am assuming that the TW523 emulation port supports Extended 1 commands in the default settings, did not see anything to the contrary in the documentation?

Jeff

  • Administrator
  • Hero Member
  • *****
  • Posts: 201
    • Owner, JV Digital Engineering
Re: LM465 and Dim
« Reply #9 on: January 28, 2015, 10:20:34 PM »
Actually the XTB-IIR TW523 emulation goes beyond what the real TW523 can do with respect to extended commands.  While the TW523 can transmit extended commands, it cannot receive them.  The XTB-IIR will do both through the digital port.  And it can also repeat "doublet" (124-bit) extended commands just like "doublet" (44-bit) standard commands.

Jeff
X10 automation since the BSR days...

x10Tim

  • Jr. Member
  • **
  • Posts: 14
Re: LM465 and Dim
« Reply #10 on: February 03, 2015, 06:23:57 PM »
I performed the following in my pursuit of getting Extended 1 commands to work from the XTB-IIR digital port.

I validated the CM15A sends the following (62 bit, 31 cycle) command to set an LM465 to a Dim value of ~50%.  I captured this message off of the Digital Port of the XTB-IIR and hooked up a storage scope to capture the message on the power line.  I went through and validated all 186 bits (Sent 3 times from CM15A under AHP)

1110 1010 01111  0110    00100000   00110001
 SC   D        EXT1  Unit1    0x20(52%)    0x31

So I know the command is correct.  I can send Function commands, ON, OFF, DIM & BRIGHT all day long to the XTB-IIR Digital Port and they all work.  I captured them on the storage scope and as soon as the last transmit bit is sent to the Digital Port, the XTB-IIR transmits the command on the power line.

Here is what I observed when transmitting the 62-bit Extended Command 1 to the Digital Port and looking at the power line and the Digital Port on the scope:  The command to the Digital Port is perfectly timed and the signal looks fantastic, just like in ON, OFF, BRIGHT & DIM.  After the receipt of the 62nd bit, nothing appears on the power line, ever.  I captured the message about 20 times with nothing ever coming out. 

I also have a logic analyzer hooked up and triggering it from the scope to capture so I can capture any PIC pins if desired.

I am really at a loss here on how to proceed.  If you want me to email you traces, I have been capturing them or you want me to experiment doing something I can.

Thanks, Tim

Jeff

  • Administrator
  • Hero Member
  • *****
  • Posts: 201
    • Owner, JV Digital Engineering
Re: LM465 and Dim
« Reply #11 on: February 04, 2015, 06:16:51 AM »
I'm not sure I understand what you are asking.  When you send signals through the digital port, the transmitter is keyed on by each bit (assuming they meet the X10 timing spec).  The XTB-IIR does not repeat commands sent through the digital port, only over the powerline.  So if your transmission stops at the 62nd bit, so would the XTB-IIR output.

The XTB-IIR will repeat extended commands received over the powerline.  It will only repeat "doublet" extended commands, which have the same format as standard X10 commands with two identical halves (totaling 124 bits).

An early version of the firmware would repeat a 62-bit command, but that caused problems in actual operation because an extended command is often part of a sequence of commands.  So if the 62-bit command is repeated, that steps on the next couple of commands in the sequence.  There is a mode option to abort transmission in response to a collision, but by then the trailing command can be already corrupted.

The XTB-IIR watches for the first start bit of the second half of the doublet (63rd bit in the transmission).  If that is there, it will begin repeating the first 62 bits overlaid in bit sync with the second half.

Jeff
X10 automation since the BSR days...

x10Tim

  • Jr. Member
  • **
  • Posts: 14
Re: LM465 and Dim
« Reply #12 on: February 04, 2015, 03:55:44 PM »
You answered my question and I believe the answer is me fail Engineering 101 and made assumptions.   My assumption was that since I had ON, OFF, BRIGHT, and DIM working, the light responded appropriately, that my controller logic was good.  I also assumed when looking at the scope that since I saw nothing until I transmitted the last bit, that you were queuing the command for the repeat and were validating it before transmitting (What does TW523 emulation mean?).  The truth probably is that I never had ON, OFF, BRIGHT, and DIM working properly and that it was your repeat function occurring after my last bit that was actually making these commands work. Your answer of that they should occur immediately now sends me back to the TW523 specification to look at my bit timing.  Does this sound right to you?

x10Tim

  • Jr. Member
  • **
  • Posts: 14
Re: LM465 and Dim
« Reply #13 on: February 05, 2015, 04:41:18 PM »
I am writing this reply from the dim glow of a 60 watt light bulb that was dimmed to 50% from an LM465 from the XTB-IIR from me sending a 62-bit Extended 1 command.  I am embarrassed to say that the pull-up value on zero crossing was not strong enough and that caused too much latency to my transmission of the first bit after a zero cross to where I was out of spec.  It is interesting that the XTB-IIR on ON, OFF, BRIGHT and DIM still picked up the command and repeated it causing me to think that it was working.  I should have hooked up a scope at the start.  Thanks again for a great product and support.

Jeff

  • Administrator
  • Hero Member
  • *****
  • Posts: 201
    • Owner, JV Digital Engineering
Re: LM465 and Dim
« Reply #14 on: February 05, 2015, 04:44:39 PM »
I'm not sure I understand your question.  Every bit that is sent through the digital port should be transmitted.  The only restriction is that it must be asserted by 50uS after the zero crossing transition from the XTB-IIR (per the X10 spec).

When the commands are coming in over the powerline, the XTB-IIR will receive the first half of the doublet (22 bits for a normal command, and 62 bits for an extended command).  Then after error checking that data pattern, it will be repeated overlaid in bit-sync with the second half.  For normal commands it assumes the command is a doublet, but for extended commands it checks for the first start bit of the second half before it begins repeating.

For receiving, it works like the TW523.  In the default mode the first half of the doublet is received and error checked.  Then the digital output is sent during the second half of the doublet as each bit is repeated over the powerline.  Note that the TW523 does not receive extended codes, but the XTB-IIR can.

Ah, I just saw your post as I went to post this.  I guess all is OK now.

Jeff

X10 automation since the BSR days...

 

succession-resounding