How we got to know each other
It hapend one day I almost made it through IKEA without buying anything!
In viewing distance of the checkout zone I started celebrating not buying anything.
But we didn't pass the "Fundgrube" yet... There was a Bekant sit-stand desk waiting for me and it was quite cheap for an electrically adjustable desk, because it was "broken". ;-)
How we got to know ourselves better
What I knew was there has to be someting wrong with the desk. Upon arrival at home the flaw showed Itself: one of the Legs fell half way out when I turned the table around.
A few minuties later that was fixed. I had to take one leg apart. It's a two stage worm drive powered by a Bosch automotive motor in each of the two legs.
The two motors have some encoder attached to them, so they know thier position/length and stay in sync.
Getting to the nitty-gritty
I said to my self: "What If I can teach my tabel to remember positions?"
So, because the leggs are only accessable from the top (thats where the Table plate normally is). I open the control Pod, expecting something like two buttons, a microswitch and maybe some diodes.
But I found more:
That is a PIC16LF1938 as a LIN master.
- running at 16Mhz
- Buttons connected to RB0, RB1 to GND
- LIN tx @RC6/7
A bit of poking around later...
This has to be LIN And yes it is 19.2 kbps LIN with 0-12V Levels.
The protocoll is something like:
PID 17: Data 0-2 is always 0
PID 8+9: Data 0+1 is the position, Data 2 is 96 when stopped and something small when running.
There are some vias on the PCB. Two of them carry the 5V LIN Signal. (I'll mark them later)
Uuh it's ICSP!
I'm not a PIC afficinado, so I had no PIC programmer laying around, but those fife holes under the flex-cable connector screamed "use me".
So I got a PIC programmer and read the flash. (In the version I have it's not protected)
And Disassembled it. That's all for now :-(
I didn't have the time to implement a alternative Firmware, so there isn't that much in the github repo
This is a work in Progress. Feel free to join in.