Hey Rob, I hope you’re still out there. I’ve been a bit busy with work, and so I’ve only really just now got to sorting some of this out. I’ve got an update for you on all of this. I ordered a logic analyzer like you suggested and this turned out to be the key to everything. I hadn’t imagined so. I wasn’t sure if it’d actually help, if it’d actually tell me what I needed to know, but it did that and more.
So, I realized all my problems with running Guy A’s code was because I hadn’t connected ground from the controller to the Arduino. Sooo… yeah. I realized this when I connected the logic analyzer for the first time and got some weird readings. I opened up the manual and saw a note about connecting to ground. Makes sense. Things worked then. I don’t want to use Guy A’s code though, and this is something you helped me realize. It can be done better. It can be done very simple.
A very important mistake to have made (Not connecting ground) though because it led me to here, and a much better understanding of all of this.
A screenshot of the logic analyzer.
I learned a couple of important things to this. Firstly, it’s not important to have the data in sets of 8/16, or whatever. It doesn’t need to mimic that aspect of the S88. That’s something that is messy with GuyA’s code. It’s just not needed.
With each clock cycle one bit is sent. It’s either high for on or low for off. You can see this in the screenshot. The Load signal is sent to load the data so it’ll be ready to send to the controller. Then the clock signal starts. With each tick of the clock signal, a bit is sent in.
So it should work that the code loads whatever data it has gathered into a variable and then waits for the start of the clock signal. When the clock signal starts, with each tick, it should send the first bit in line in the variable and it should also pull a bit from the incoming line (From a connected S88 down the line) and add it to the tail end of the variable.
Rob, it’s been your help and talking with you that has helped me to understand this and see how simple it actually is.
