Trouble setting CM11 clock

Hi, I am building a project of PC Interface to manage a building, and I am using (trying to use) the CM11G device to control/interact the system. I'm writting the code in C#.NET. My problem is that I can not do anything whit the device... I can read the 0xa5 code but when I try to anwser whit the 0x9b code the device "freaks out" and I stop reciving from it, and I need to unplug it from the power line to be able to recive from it again (but only the 0xa5).

Can someone help me?

Thanks in advance,

Jo=E3o Carias

Reply to
Quina
Loading thread data ...

Reply to
Dave Houston

Thank you Dave for a very quick answer! I've already seen the thread you've sugested and I might have found something... but I didn't understood what everybody means with "just send the setclock code

0x9b..." do they mean a sigle byte or what? And if so, what answer should I expect from the device? The 0x55 code, perhaps? Thank's again Dave.

Joao Carias

Reply to
Quina

The CM11A will send a checksum if you send the entire seven bytes described in the protocol documentation but it will stop sending 0xA5 and be ready to accept other commands if you send just 0x9b or 0x9b plus five or fewer bytes. There's no response from the CM11A unless it receives the full seven bytes.

I referred you to the thread because it sounds like you might be experienc>Thank you Dave for a very quick answer! I've already seen the thread

Reply to
Dave Houston

Yes I got it. But when I send the further code, apparently the checksum is not correct (0x87). If my calculations are rigth, the result should be 0x22...

(=2E..)

// 7 bytes array definition byte[] setClk=3Dnew byte[7];

//chksum definition and initialization to 0 byte chksum=3D0;

//Values assinged to the seven bytes with a cast to byte setClk[0] =3D (byte)(0x9b); setClk[1] =3D (byte)(0x13); setClk[2] =3D (byte)(0x40); setClk[3] =3D (byte)(0x0A); setClk[4] =3D (byte)(0x48); setClk[5] =3D (byte)(0x82); setClk[6] =3D (byte)(0x60);

//cycle to calculate de checksum for (int i =3D 0; i < setClk.Length; i++) chksum +=3D setClk[i]; chksum &=3D 0xff;

(=2E..)

After this, I send the "setClk" to the device and get a reply (the one mentioned above) from it. Am I making a mistake calculating the checksum?

Note: the code is C#

Jo=E3o Carias

Reply to
Quina

Don't include the 0x9b in the checksum but only the final 6 bytes.

for (>Yes I got it. But when I send the further code, apparently the checksum

Reply to
Dave Houston

Thank you very much Dave!!=20 It worked just fine ;)

Jo=E3o Carias

Reply to
Quina

Thank you Dave, your help was really great! However, there is something that still makes me a bit confused. Shouldn't the CM11 respond with the ready code (0x55) after the "set interface clock" sequence(*)? Thank you again,

Jo=E3o Carias

(*) Sequence: 0x9b,... =BB chkSum =BB 0x00

Reply to
Quina

Even if you send less than seven bytes, the CM11 will set those parameters for which it has received data. It does not wait for a 0x00 verification. You can check this by omitting the last byte and then reading the interface status with 0x8b.

The checksum, 0x00, 0x55 sequence is used >Thank you Dave, your help was really great! However, there is something

Reply to
Dave Houston

Right... but why do I get only the value of one (the first) byte when requesting the status? Should'n they be 13? Note that I set the clock with the full 7 bytes sequence, so I've assumned that, at least, the firtst 7 bytes of the status sequence would be diferent of 0, as now happens.

Jo=E3o Carias

Reply to
Quina

Reply to
Dave Houston

Yes ok, but the problem is that only the first byte has a non zero value (0xff - after a setclock), all others are 0...

Jo=E3o Carias

Reply to
Quina

At 1547 hours I sent and received the following sequence.

->9B 2A 6B 07 04 08 D0 8B Yes ok, but the problem is that only the first byte has a non zero

Reply to
Dave Houston

In article , snipped-for-privacy@whocares.com (Dave Houston) writes: | Even if you send less than seven bytes, the CM11 will set those parameters | for which it has received data. It does not wait for a 0x00 verification. | You can check this by omitting the last byte and then reading the interface | status with 0x8b. | | The checksum, 0x00, 0x55 sequence is used only with PLC commands.

If you do send the 0x00 to acknowledge the checksum from the set interface clock command, the CM11a will respond with the expected 0x55. The checksum is real, so at least you can tell if something went wrong even though the CM11a will have already acted on the bogus data.

Dan Lanciani ddl@danlan.*com

| "Quina" wrote: | | >Thank you Dave, your help was really great! However, there is something | >that still makes me a bit confused. Shouldn't the CM11 respond with the | >ready code (0x55) after the "set interface clock" sequence(*)? | >Thank you again, | >

| >Joco Carias | >

| >(*) Sequence: 0x9b,... ; chkSum ; 0x00

Reply to
Dan Lanciani

Ok Dave, I'll try send the sequence you used for this example, but how Dan Lancini mencioend, the interface should repond with 0x55 after the

0x00 to acknowledge the checksum. I start to think that my CM11 is damaged... or maybe the the owner's programming skills! Oh, one other thing, my CM11 is the only X10 device in the power line. I never mentioned it before because I thought it wasn't important (and still don't...).

Jo=E3o Carias

Reply to
Quina

Ok Dave, I'll try send the sequence you used for this example, but how Dan Lancini mencioend, the interface should repond with 0x55 after the

0x00 to acknowledge the checksum. I start to think that my CM11 is damaged... or maybe the the owner's programming skills! Oh, one other thing, my CM11 is the only X10 device in the power line. I never mentioned it before because I thought it wasn't important (and still don't...).

Jo=E3o Carias

Reply to
Quina

Cabling-Design.com Forums website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.