мощность Communication Protocols
KPCD – Serial Communication Protocol
Обзор
KPCD is the common serial communication protocol used across
мощность products. It is based on the standard CDBUS/CDNET serial protocol and supports dual-wire TTL, single-wire TTL, and RS-485 interfaces.
Some products integrate a CDBUS hardware controller, allowing slave devices to report data freely and respond to broadcast packets. Hardware arbitration automatically schedules transmissions to prevent packet collisions, with communication speeds of up to 50 Mbps.
Communication Settings
мощность products typically use a fixed communication rate of
115200 bps for a short period after power-on before switching to the user-configured baud rate.
If the configured baud rate is unknown, the device can be reconnected during this initial window using 115200 bps and the broadcast address.
Protocol Document
KPCAN – CAN Bus Communication Protocol
Обзор
KPCAN is the communication protocol used by KPower products on the CAN bus. It is not an independent protocol; instead, it carries the KPCD serial protocol over CAN using the mapping described in this document.
The destination and source address fields of the KPCD frame header are mapped to the 29-bit extended МОЖЕТИДЕНТИФИКАТОР, while the port fields and subsequent data are placed in the CAN data field. When a packet is not fragmented, the source port is also mapped into the CAN ID.
For details, see Chapter 2 of the KPCAN protocol document.
All function port definitions, register maps, and related specifications remain identical to KPCD. Please refer to the KPCD protocol document for these definitions.
Main Characteristics
Supports both МОЖЕТ 2.0иCAN FD.
Uses extended data frames only (29-bit ID); remote frames are ignored.
Supports optional packet fragmentation. Packets that exceed the capacity of a single CAN frame can be split across multiple frames.
Communication Settings
In the examples provided in this document, the master address is 0x00 and the device address is 0xFE, consistent with the KPCD protocol.
After power-on, KPower products typically listen on the CAN bus at a fixed rate for a short initial period:
During this initial window, devices do not send ACK or error frames. If a valid frame addressed to the device is received during this period, the device retains the initial communication rate. Otherwise, it switches to the user-configured rate after the window expires.
If the configured rate is unknown, the device can be reconnected immediately after power-on using 500 kbps and the broadcast address.
For CAN FD communication, if the host's data-phase rate is not 2 Mbps, use Classic CAN frames or CAN FD frames without Bit Rate Switching (BRS), so the data-phase rate is not relevant.
Device replies use the same CAN FD and BRS flags as the received frame. For products supporting CAN FD, self-reported debug messages (enabled by dbg_en, disabled by default) use CAN FD frames with BRS by default. Products without CAN FD support use Classic CAN frames.
Baud Rate Configuration
The user-configured communication rate is set through the following registers:
| Register | Address | Описание |
| bus_baud_l | 0x0010 | Classic CAN bit rate; CAN FD arbitration-phase bit rate |
| bus_baud_h | 0x0014 | CAN FD data-phase bit rate |
These are the same registers used by the CDBUS hardware controller in the KPCD protocol.
Default rates:
Devices supporting CAN FD can receive both Classic CAN and CAN FD frames without additional configuration. Whether a frame uses CAN FD and whether the bit rate switches are determined by the FDF and BRS bits in each frame.
Protocol Document
KPI2C – I2C Communication Protocol
Обзор
KPI2C is the communication protocol used by KPower products on the I2C bus. It is not an independent protocol; instead, it carries the KPCD serial protocol over I2C using the mapping described in this document.
The destination address of the KPCD frame header is mapped to the I2C address byte, while the LEN field and all subsequent data are transferred unchanged.
All function port definitions, register maps, and related specifications remain identical to KPCD. Please refer to the KPCD protocol document for these definitions.
The SPI bus uses the same frame format. For SPI communication, please refer to the KPSPI protocol document.
Main Characteristics
Master/Slave Structure: Strict master/slave communication. A device never initiates a transfer. Replies and self-reported packets are queued inside the device until the master reads them.
Transaction Boundaries: Defined by I2C START and STOP conditions, so serial bus idle framing is not required.
Single-Master Operation: Only one master is supported; multi-master mode is not supported.
Optional CRC: CRC support is optional and determined by a firmware compile-time macro.
Device Addressing: Device addresses are 6 bits wide, and the broadcast address is 0x3F.
In the examples provided in this document, the device address is 0x3E and the master source port is 0x40.
Serial-related registers such as baud_rate, bus_idle_wait_len, иbus_tx_permit_len do not apply to I2C communication.
Protocol Document