Frequently Asked Question

KID Serial Data Explained
Last Updated 4 years ago

Master Jack Pinout:
P3= TX
P4= RX
P5= GND

UART_BAUD 57600

I will try to do a quick write up to poll some data from the kid serial port, but if you want to see the data out of the kid hook it up to the master jack on the kid and set the mode to Sync that will periodically spit data,
Every packet is 4 bytes long.

Hello here is a quick and dirty explanation on what that data means;

-Every package is and must be consisted of 4 bytes.
-the first 2 bits tell the package type, so there are 4 possible package types
-#define PK_TYPE_Restricted 0X00 /// 00 we should never get this in the first 2 bits....
-#define PK_TYPE_Restricted 0X01 /// 01 Restricted
-#define PK_TYPE_SET 0X02 /// 10 This type comes from the kid as a reply to the PC or to the master Kid
-#define PK_TYPE_GET 0X03 /// 11 Master Kid or PC is asking for a Variable

----- Here is how the Package gets structured:

Type SET: Set is used mostly by the slave to respond to the master or PC to be able to respond to a GET PK.
there is an enum with a list of variables it can get send there are 6 bits on the 4 byte pk that will be used to
define only the variables to send and receive.

Structure of a Set Pack
PK Type What2Set Data (Required) XOR
10 000000 00000000 00000000 00000010

PK Type: This is the global pk type only 4 variations.
What2Set: Variable from the enum to be able to interpret the data
Data: Actual data 16 bits

Type GET: Get is mostly used by the Master or PC to ask the slave for a variable.
Any Get pk will be responded by a set PK.
Every Pk has to consist on the following:

PK Type What2Get Data (Optional) XOR
11 000000 00000000 00000000 00000010

PK Type: This is the global pk type only 4 variations.
What2Get: Variable from the enum to be able to interpret the data
And here is the Enum:
/* the SET list*/
typedef enum{ // there are 6 bits for this list.
null = 0, /// Not Used
special_key = 3, /// Special key for different Comm modes.
COMM_MODE = 5, /// Not for PC Comm Mode for internal use
COMM_status, /// Not for PC. Comm Status
COMM_RAWiBATT, /// Not for PC. to be able to get the offset of the slave unit
COMM_iBATT , /// Not for PC
COMM_vPV, /// PV Voltage displayed on the kid
COMM_vBATT, /// Battery voltage displayed on the kid
COMM_fetTEMP, /// Internal FET temperature
COMM_loadSTATE, /// Load state On, off, iddle, overcurrent
COMM_KWH, /// displayed KWH daily
COMM_PWMERROR, /// Not for PC Twin mode Only
COMM_wimpf, /// Not for PC Twin mode Only
COMM_batteryStage, /// Battery charge stage Absorb, Bulk, Float, EQ
COMM_batt_setpoint, /// for test Do not use, invalid parameter
COMM_absorbV, /// Absorb battery voltage setpoint value
COMM_floatV, /// Float battery voltage setpoint value
COMM_eqV, /// Eq battery voltage setpoint value
COMM_absorbT, /// Absorb battery time setpoint in minutes
COMM_batteryTemp, /// Battery Temperature as read from the BTS
COMM_TempCompV, /// Battery temperature compensation setpoint in mV
Comm_SystemSet, /// For Twin mode. set the other unit system
Comm_BattNominal, /// battery nominal 12, 24, 36,48 v
Comm_EqT, /// Eq battery time setpoint in minutes

}comm_var;

More Variables could be added to the list if required. Let me know so I can update the list of variables supported.

Now for the data you are seeing. The data you are seeing is of a SET type: here is what the Master is sending:

switch(master_var_send){

handle_set_send(COMM_batteryTemp, dispavg_batt_temp);

handle_set_send(COMM_batteryStage, BattChargeStage);

handle_set_send(COMM_absorbV, absorbV);

handle_set_send(COMM_floatV, floatV);

handle_set_send(COMM_eqV, eqV);

handle_set_send(COMM_TempCompV, BattTempCompOrigValue);

handle_set_send(Comm_BattNominal, battery_nominal);

handle_set_send(COMM_vBATT, dispavgVbatt);

handle_set_send(COMM_absorbT, absorbT);

handle_set_send(Comm_EqT, eqT);

The first variable in the function is from the Enum and the second one is the actual data.

I hope this helps a little, Maybe this needs to go in a new tread.
Mario Rodriguez

Please Wait!

Please wait... it will take a second!