Skip to content

Instantly share code, notes, and snippets.

@kortschak
Created August 18, 2024 02:40
Show Gist options
  • Save kortschak/ccac68db99e795b5119c9a863ebd0735 to your computer and use it in GitHub Desktop.
Save kortschak/ccac68db99e795b5119c9a863ebd0735 to your computer and use it in GitHub Desktop.
standing desk notes
ARM: HK32F030MF4P6 (TSSOP20)
Appears to have USART and SPI.
RJ45 pinout:
0 - black - +5V
3 - white - GND
4 - yellow - button pressed or start memory movement (do action) also required during initialisation 16ms pulse to start communication; UI queries, but no correct response from controller[2]
5 - green - data ready? (always spikes during a motor controller transmit - though not for all, never when UI Tx is not connected from [1]) does not appear to be necessary[3]
6 - red - UART UI Tx 9600baud (Tx/Rx from [1])
7 - brown - UART UI Rx 9600baud
Bringing 4 high without data on 6 results in movement down always, even is up is pressed.
UART appears to be 4V?
Codes are related directly to the display:
01234567 01234567 01234567 sum(data)
66.0 01111101 11111101 00111111 10111001
66.1 01111101 11111101 00000110 10000000
66.2 01111101 11111101 01011011 11010101
66.3 01111101 11111101 01001111 11001001
66.4 01111101 11111101 01100110 11100000
66.5 01111101 11111101 01101101 11100111
66.6 01111101 11111101 01111101 11110111
66.7 01111101 11111101 00000111 10000001
66.8 01111101 11111101 01111111 11111001
66.9 01111101 11111101 01101111 11101001
67.0 01111101 10000111 00111111 01000011
67.1 01111101 10000111 00000110 00001010
67.2 01111101 10000111 01011011 01011111
67.3 01111101 10000111 01001111 01010011
67.4 01111101 10000111 01100110 01101010
67.5 01111101 10000111 01101101 01110001
67.6 01111101 10000111 01111101 10000001
67.7 01111101 10000111 00000111 00001011
74.0 00000111 11100110 00111111 00101100
7-segment display
-5-
| |
2 6
| |
-1-
| |
3 7
| |
-4- 0
Last byte is a literal checksum (0th+1st+2nd).
Digits:
0 = 0x3f 0. = 0xbf
1 = 0x06 1. = 0x86
2 = 0x5b 2. = 0xdb
3 = 0x4f 3. = 0xcf
4 = 0x66 4. = 0xe6
5 = 0x6d 5. = 0xed
6 = 0x7d 6. = 0xfd
7 = 0x07 7. = 0x87
8 = 0x7f 8. = 0xff
9 = 0x6f 9. = 0xef
Note that 4 does not match the pattern, it should be x1100011 but is x1100110
Queries are made each 16ms.
Query:
0xa5 0x00 0x00 0xff 0xff - what height?
Response:
0x5a 0x7d 0xfd 0x3f 0xb9 - 66.0 (lowest)
0x5a 0x7d 0xfd 0x06 0x80 - 66.1
0x5a 0x7d 0xfd 0x66 0xe0 - 66.4
0x5a 0x7d 0xfd 0x7d 0xf7 - 66.6
0x5a 0x7d 0xfd 0x7f 0xf9 - 66.8
0x5a 0x7d 0x87 0x06 0x0a - 67.1
0x5a 0x7d 0x87 0x4f 0x53 - 67.3
0x5a 0x7d 0x87 0x7d 0x81 - 67.7
0x5a 0x07 0xe6 0x3f 0x2c - 74.0
after 10 seconds:
0x5a 0x00 0x00 0x00 0x00 - don't show on display
Query:
0xa5 0x00 0x40 0xbf 0xff with button line high pressing down
Response:
0x5a 0x7d 0xfd 0x3f 0xb9
Query:
0xa5 0x00 0x20 0xdf 0xff with button line high pressing up
Response:
0x5a 0x7d 0xfd 0x3f 0xb9
scan though
0x5a 0x7d 0xfd 0x3f 0xb9 - 66.0
0x5a 0x7d 0xfd 0x06 0x80 - 66.1
0x5a 0x7d 0xfd 0x5b 0xd5 - 66.2
0x5a 0x7d 0xfd 0x4f 0xc9 - 66.3
0x5a 0x7d 0xfd 0x66 0xe0 - 66.4
0x5a 0x7d 0xfd 0x6d 0xe7 - 66.5
0x5a 0x7d 0xfd 0x7d 0xf7 - 66.6
0x5a 0x7d 0xfd 0x07 0x81 - 66.7
0x5a 0x7d 0xfd 0x7f 0xf9 - 66.8
0x5a 0x7d 0xfd 0x6f 0xe9 - 66.9
0x5a 0x7d 0x87 0x3f 0x43 - 67.0
0x5a 0x7d 0x87 0x06 0x0a - 67.1
0x5a 0x7d 0x87 0x5b 0x5f - 67.2
0x5a 0x7d 0x87 0x4f 0x53 - 67.3
0x5a 0x7d 0x87 0x66 0x6a - 67.4
0x5a 0x7d 0x87 0x6d 0x71 - 67.5
0x5a 0x7d 0x87 0x7d 0x81 - 67.6
0x5a 0x7d 0x87 0x07 0x0b - 67.7
0x5a 0x7d 0x87 0x7f 0x83
0x5a 0x7d 0x87 0x6f 0x73
0x5a 0x7d 0xff 0x3f 0xbb
0x5a 0x7d 0xff 0x06 0x82
0x5a 0x7d 0xff 0x5b 0xd7
0x5a 0x7d 0xff 0x4f 0xcb
0x5a 0x7d 0xff 0x66 0xe2
0x5a 0x7d 0xff 0x6d 0xe9
0x5a 0x7d 0xff 0x7d 0xf9
0x5a 0x7d 0xff 0x07 0x83
0x5a 0x7d 0xff 0x7f 0xfb
0x5a 0x7d 0xff 0x6f 0xeb
0x5a 0x7d 0xef 0x3f 0xab
0x5a 0x7d 0xef 0x06 0x72
0x5a 0x7d 0xef 0x5b 0xc7
0x5a 0x7d 0xef 0x47 0xbb
0x5a 0x7d 0xef 0x66 0xd2
0x5a 0x7d 0xef 0x6d 0xd9
0x5a 0x7d 0xef 0x7d 0xe9
0x5a 0x7d 0xef 0x07 0x73
0x5a 0x7d 0xef 0x7f 0xeb
0x5a 0x7d 0xef 0x6f 0xdb
0x5a 0x7d 0xbf 0x3f 0x05
0x5a 0x7d 0xbf 0x06 0xcc
0x5a 0x7d 0xbf 0x5b 0x21
0x5a 0x7d 0xbf 0x4f 0x15
0x5a 0x7d 0xbf 0x66 0x2c
0x5a 0x7d 0xbf 0x6d 0x33
0x5a 0x7d 0xbf 0x7d 0x43
0x5a 0x7d 0xbf 0x07 0xcd
0x5a 0x7d 0xbf 0x7f 0x45
0x5a 0x7d 0xbf 0x6f 0x35
0x5a 0x7d 0x86 0x3f 0xcc
0x5a 0x7d 0x86 0x06 0x93
0x5a 0x7d 0x86 0x5b 0xe8
0x5a 0x7d 0x86 0x4f 0xdc
continues
Query (66.0->74.0 M2):
0xa5 0x00 0x04 0xfb 0xff with button line high for 175ms after pressing M2
query changes to normal 'where am i' above after button line goes low
Response:
0x5a 0x07 0xe6 0x3f 0x2c (target?)
(a lot - even after button line goes down)
0x5a 0x7d 0x87 0x5b 0x5f
0x5a 0x7d 0x87 0x4f 0x53
0x5a 0x7d 0x87 0x66 0x6a
more
until button line pulses very briefly (after this section)
0x5a 0x07 0xcf 0x66 0x3c
0x5a 0x07 0xcf 0x6d 0x43
0x5a 0x07 0xcf 0x7d 0x53
0x5a 0x07 0xcf 0x07 0xdd <- 1µs pulse on button line (73.7) - not at the first or last time this value is seen
0x5a 0x07 0xcf 0x7f 0x55
0x5a 0x07 0xcf 0x6f 0x45
0x5a 0x07 0xe6 0x3f 0x2c
Query (74.0->66.0 M1):
0xa5 0x00 0x02 0xfd 0xff with button line high for 200ms after pressing M1
query changes to normal 'where am i' above after button line goes low
Response:
0x5a 0x7d 0xfd 0x3f 0xb9 (target?)
(a lot - even after button line goes down)
0x5a 0x07 0xdb 0x6f 0x51
0x5a 0x07 0xdb 0x7f 0x61
0x5a 0x07 0xdb 0x07 0xe9
more
until button line pulses very briefly (after this section)
0x5a 0x7d 0xfd 0x66 0xe0
0x5a 0x7d 0xfd 0x4f 0xc9
0x5a 0x7d 0xfd 0x5b 0xd5
0x5a 0x7d 0xfd 0x06 0x80 <- 1µs pulse on button line (66.1) - not at the first or last time this value is seen
0x5a 0x7d 0xfd 0x3f 0xb9
[1]Files with name pattern turn_on_no_?line_to_interface* have circuit break between the interface module and the probes for the line in the ? position.
[2]turn_on_no_0line_to_interface
[3]turn_on_no_1line_to_interface
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment