Trying to decode an SPI protocol - Page 1
Forum section: electronics / projects

author: brainwash
author_rank: Frequent Contributor
timestamp: August 11, 2019, 06:16:54 pm
content: This is a shot in a dark, but perhaps worth a try.I have these big LED panels which are controlled via an RF remote. Some specs on them:- 4 channels- 32(?) steps of color temperature- 255(?) steps of brightnessThe remote has 16 buttons which are addressable in a matrix/multiplexer configuration through 8 pins.I want to automate these light and cannot find any info about the Rx/Tx pair. Looks like some custom chip, one remote has two chips inside while another one has just one. I'm focusing on the one with 2 chips since it seems that one does the matrix decoding and the other one the Tx on 2.4GHz.I could just attach to the key pads and connect them through a multiplexer, however, it seems that I can gain direct control over the channels by skipping the first chip.Here are the pictures from the two remotes and some Sigrok/Pulseview screenshots as well as some of my notes:https://imgur.com/a/JfetA8VI've decoded most of the protocol, but, I'm having some questions about the last two bytes. They seem to randomly toggle a specific bit if a key is re-pressed, otherwise just almost randomly toggles bits whenever something is pressed. It doesn't seem to be a checksum, as it doesn't change if the key is held pressed (such as brightness increase). It also changes slightly if the same key is pressed again.The entire thing runs on a 1Mhz SPI clock, assuming I've got the connections and assignments right.The matrix decoder/SPI encoder chip is an SSOP-14 labeled WD1391 1643 (date code). This will likely become the first result whenever someone searches for this chip. The TSSOP-16 RF chip has no markings.Anyway, just trying to get more info on this, especially if the fixed bytes mean anything (RF channel?) and how to generate the last two bytes.I'll probably just set up an Arduino thing and let it try all the combinations and see what works, at this stage it's faster than trying to decode everything.My notes so far, for reference only:Code:1Mhz clock D2, MISO D4?, MOSI D5?, CS D7?wake?230300ack/repeat/confirm cmd?07.00.00 07.01.14 or 07.00.00shutdown?23.4f.00first 6 bytes - [34.80.80 32.0a.ff]byte 7 = byte 8 =  + button:1=?2=ch 3 on3=ch 1 on4=brightness up5=?6=ch 3 off7=ch 1 off8=warmer9=ch 4 ona=ch 2 onb=coolerc=?d=ch 4 offe=ch 2 offf=bright down00000000byte 9 = bytes 10-13 = [32.04.01.32]byte 14 = brightnessbyte 15 = color temperaturebyte 16 = bytes 17,18 =‭0010 0110 1010 1111‬ ch1 on.0110 0110 1010 1111 ch1 off* *‭0110 0010 1010 1111‬ ch1 on again?.‭0110 1010 1010 1111‬ ch1 bright up.‭0110 1010 1110 1111‬ ch1 bright down.1110 1010 1110 1111 ch1 warmer.1110 1010 1110 1011 ch1 cooler* . *0110 1010 1110 1011 ch1 warmer. .0110 1010 1010 1001 ch2 on.0110 1010 1010 1101 ch2 cooler.0110 1010 1000 1101 ch2 off*‭0110 1010 1010 1101‬ ch2 off again. .‭0110 1000 1000 1101‬ ch3 on.‭0100 1000 1000 1101‬ ch3 off*‭0110 1000 1000 1101‬ ch3 off again. .‭0100 1000 1001 1100‬ ch4 on.‭0100 0000 1001 1100‬ ch4 bright up*‭0100 1000 1001 1100‬ ch4 bright up again. .‭0100 1000 1100 1101‬ ch4 bright down*‭0100 1000 1000 1101‬ ch4 bright down againch1 on34.80.80 32.0a.ff 32.83.b5 32.04.01 32.02.1a 32.26.af 07.01.14ch1 off | |34.80.80 32.0a.ff 32.87.b5 32.04.01 32.02.1a 32.66.af 07.01.14ch1 off bounce |34.80.80 32.0a.ff 32.87.b5 32.04.01 32.02.1a 32.26.af 07.01.14ch1 on 2nd after off | ||34.80.80 32.0a.ff 32.83.b5 32.04.01 32.02.1a 32.62.af 07.01.14brigthness up34.80.80 32.0a.ff 32.84.b5 32.04.01 32.03.1a 32.6a.af 07.01.1434.80.80 32.0a.ff 32.84.b5 32.04.01 32.04.1a 32.6a.af 07.01.1434.80.80 32.0a.ff 32.84.b5 32.04.01 32.05.1a 32.6a.af 07.01.14... ||34.80.80 32.0a.ff 32.84.b5 32.04.01 32.11.1a 32.6a.af 07.01.14brigthness down | || |34.80.80 32.0a.ff 32.8f.b5 32.04.01 32.10.1a 32.6a.ef 07.01.1434.80.80 32.0a.ff 32.8f.b5 32.04.01 32.0f.1a 32.6a.ef 07.01.14... ||34.80.80 32.0a.ff 32.8f.b5 32.04.01 32.02.1a 32.6a.ef 07.01.14warmer | || |34.80.80 32.0a.ff 32.88.b5 32.04.01 32.02.1c 32.ea.ef 07.01.1434.80.80 32.0a.ff 32.88.b5 32.04.01 32.02.1d 32.ea.ef 07.01.14... ||34.80.80 32.0a.ff 32.88.b5 32.04.01 32.02.38 32.ea.ef 07.01.14cooler | || |34.80.80 32.0a.ff 32.8b.b5 32.04.01 32.02.37 32.ea.eb 07.01.1434.80.80 32.0a.ff 32.8b.b5 32.04.01 32.02.36 32.ea.eb 07.01.14... ||34.80.80 32.0a.ff 32.8b.b5 32.04.01 32.02.00 32.ea.eb 07.01.14warmer again | || |34.80.80 32.0a.ff 32.88.b5 32.04.01 32.02.01 32.6a.eb 07.01.1434.80.80 32.0a.ff 32.88.b5 32.04.01 32.02.09 32.6a.eb 07.01.14warmer again || |34.80.80 32.0a.ff 32.88.b5 32.04.01 32.02.0a 32.ea.eb 07.01.14warmer again || |34.80.80 32.0a.ff 32.88.b5 32.04.01 32.02.0b 32.6a.eb 07.01.1434.80.80 32.0a.ff 32.88.b5 32.04.01 32.02.1f 32.6a.eb 07.01.14*ch2 on34.80.80 32.0a.ff 32.8a.b5 32.04.01 32.80.2d 32.6a.a9 07.01.14cooler | || |34.80.80 32.0a.ff 32.8b.b5 32.04.01 32.80.2c 32.6a.ad 07.01.1434.80.80 32.0a.ff 32.8b.b5 32.04.01 32.80.2b 32.6a.ad 07.01.14...34.80.80 32.0a.ff 32.8b.b5 32.04.01 32.80.17 32.6a.ad 07.01.14ch2 off | |34.80.80 32.0a.ff 32.8e.b5 32.04.01 32.80.17 32.6a.8d 07.01.14ch2 off again |34.80.80 32.0a.ff 32.8e.b5 32.04.01 32.80.17 32.6a.ad 07.01.14ch2 off again |34.80.80 32.0a.ff 32.8e.b5 32.04.01 32.80.17 32.6a.8d 07.01.14ch2 off again |34.80.80 32.0a.ff 32.8e.b5 32.04.01 32.80.17 32.6a.ad 07.01.14*ch3 on - -- - -34.80.80 32.0a.ff 32.82.b5 32.04.01 32.80.32 32.68.8d 07.01.14ch3 off | |34.80.80 32.0a.ff 32.86.b5 32.04.01 32.80.32 32.48.8d 07.01.14ch3 off again |34.80.80 32.0a.ff 32.86.b5 32.04.01 32.80.32 32.68.8d 07.01.14ch3 off again |34.80.80 32.0a.ff 32.86.b5 32.04.01 32.80.32 32.48.8d 07.01.14*ch4 on - --34.80.80 32.0a.ff 32.89.b5 32.04.01 32.80.32 32.48.9c 07.01.14bright up | || |34.80.80 32.0a.ff 32.84.b5 32.04.01 32.81.32 32.40.9c 07.01.14... ||34.80.80 32.0a.ff 32.84.b5 32.04.01 32.88.32 32.40.9c 07.01.14bright up again || |34.80.80 32.0a.ff 32.84.b5 32.04.01 32.89.32 32.48.9c 07.01.14bright up again || |34.80.80 32.0a.ff 32.84.b5 32.04.01 32.8a.32 32.40.9c 07.01.14bright down | || |34.80.80 32.0a.ff 32.8f.b5 32.04.01 32.89.32 32.40.dc 07.01.14... ||34.80.80 32.0a.ff 32.8f.b5 32.04.01 32.7d.32 32.40.dc 07.01.14ch4 off | |34.80.80 32.0a.ff 32.8d.b5 32.04.01 32.7d.32 32.40.cc 07.01.14on+bright down | || |34.80.80 32.0a.ff 32.8f.b5 32.04.01 32.7c.32 32.40.8d 07.01.14... ||34.80.80 32.0a.ff 32.8f.b5 32.04.01 32.6b.32 32.40.8d 07.01.14bright up | || |34.80.80 32.0a.ff 32.84.b5 32.04.01 32.6c.32 32.48.8d 07.01.14... || |34.80.80 32.0a.ff 32.84.b5 32.04.01 32.7a.32 32.48.8d 07.01.14bright down | || |34.80.80 32.0a.ff 32.8f.b5 32.04.01 32.79.32 32.48.cd 07.01.1434.80.80 32.0a.ff 32.8f.b5 32.04.01 32.68.32 32.48.cd 07.01.14bright down again || |34.80.80 32.0a.ff 32.8f.b5 32.04.01 32.67.32 32.48.8d 07.01.1434.80.80 32.0a.ff 32.8f.b5 32.04.01 32.57.32 32.48.8d 07.01.14