Re:MDL BDC24 Black Jaguar to PC problem
Regarding the protocol: Taking a look at chapter 5 in the SW-RDK-BDC24-UG-5570.pdf document, you will see that when you are using the UART interface, Byte 0 is defined as the SOF byte, which has a value of 0xff. Byte 1 is the Size byte, which will vary depending on the message.
So, taking a look at the first sample packet that you referenced: #volt set 10 the code is: ff 06 81 00 02 02 0a 00
Byte 0 is "ff" which is the SOF character. Byte 1 is "06" which is the Size byte, indicating that there are 6 additional bytes remaining in the packet.
Byte 2 is "81" which is defined as ID0. Byte 3 is "00" which is defined as ID1. Byte 4 is "02" which is defined as ID2. Byte 5 is "02" which is defined as ID3. Byte 6 is "0a" which is defined as Data (first byte). Byte 7 is "00" which is defined as Data (second byte).
As you can see in Chapter 5, the messages on the UART interface are simply an encapsulated version of the CAN bus messages, meaning that all messages bytes starting with Byte 2 are actually the same as the CAN bus messages, which are defined in Chapter 4.
So, moving to Chapter 4, we can start decoding with Byte 2
Byte 2 is defined as ID0. The lower 6 bits of ID0 are the device ID. In this case, you are communicating with Device ID 1.
The upper 2 bits of Byte 2 (ID0) concatenated with Byte 3(ID1) define the API that you are using (002). This field is further broken down into two separate fields, a 6-bit field(00) followed by a 4 bit field(2). The first field indicates the API class of "Voltage Control" (table 4.4). If you go to section 4.3 (Voltage Control Interface), you will see that the second field(2) indicates an API of "Voltage Set".
Byte 4 is defined as ID2, which indicates the Manufacturer. Table 4.3 shows the value of 2 to indicate "Texas Instruments (Stellaris)".
Byte 5 is defined as ID3. The upper three bits of this field are not used. The lower 5 bits(02) indicate device type. From Table 4.2, the device type is "Motor Controller".
Since from ID0/ID1, this has been identifed as a Voltage Control API, we then turn to section 4.3 to determine what the required data bytes are. In the section "Set Output Voltage" which corresponds to value 2 "Voltage Set" in Table 4.6, you can see that the first parameter is a 16 bit (little endian) signed number. The "0a 00" represent a signed value of 10. Since the optional second parameter is not included, this indicates that the value should be updated immediately.
Hope this helps. --Bobby
login or register to reply
|