DSC Keybus Protocol
There is no simple answer to decoding a protocol, if they have a good encryption scheme setup then you are probably going to be up &$%* creek. With some work and more questions you might successfully figure out the kind of encryption, and then, if it is poorly implemented, decode it.
Chances are that the keypad has a very simple protocol and the controller has some strict constraints on how many button pushes it will accept and such.
On the note of the synchronous protocol, chances are that the protocol is a NRZ protocol. That is my best informed guess based on your explanation. I cannot open the files right now, but I hope this helps.
The fact that it changes on both clock edges is just a sign that both clock edges represent a point that a "bit" of data occurs. With NRZ you are just checking if there was a change or not.
I hope this helped.
following my web search on this topic, it seems that this protocol is using the CLK line and then rising edge of CLK is for keypad->panel and falling edge for panel->keypad communication. I plan on testing this tonight with this small arduino sketch:
I'll repost my findings after this...
#define CLK 11
#define DTA 12
String st;
void setup()
{
pinMode(CLK,INPUT);
pinMode(DTA,INPUT);
pinMode(13,OUTPUT);
Serial.begin(9600);
Serial.println("Debut");
}
void loop()
{
if (waitCLKchange(1) > 200)
{
// Debut de pattern
st = "";
while (1)
{
// CLK est bas. On attend qu'il remonte
if (waitCLKchange(0) > 50) break;
// CLK est haut, on lit un bit
if (digitalRead(DTA)) st += "1"; else st += "0";
// Attendre que CLK redescende
if (waitCLKchange(1) > 50) break;
}
Serial.println(st);
}
}
int waitCLKchange(int currentState)
{
int c = 0;
while (digitalRead(CLK) == currentState)
{
delayMicroseconds(10);
c++;
}
return c;
}