Embedded Slave Software
KIT33912EVME System Basis Chip with LIN Tranceiver Setup Instructions, Rev. 2.0
20
Freescale Semiconductor
Chapter 6 Embedded Slave Software
6.1
Overview
This chapter describes the embedded generic Slave software. It gives basic information on how to use the embedded software
features successfully. The following sections provide the basic information:
•
Generic Control Slave Software Description
•
•
•
6.2
Generic Control Slave Software Description
Generic Control of the MC33912 device is through the SPI channel. Control data is transported to the MCU by FreeMASTER
protocol or LIN protocol, as well as data from the A/D converter and MCU memory.
The units that are transported in a LIN diagnostic frame are called PDU’s (Packet Data Unit). A PDU used for Generic Control of
the device is a Single Frame message based on the User Defined Diagnostics specification. The diagnostic format sends a fixed
master request frame with eight data bytes provided. This is used to issue specific Generic Control fixed frames.
Messages issued by the master are called requests, and messages issued by the slave are called responses. Requests are
always sent in master request frames and responses are always sent in slave response frames. The Master request frame has
a fixed identifier, 60 (0x3C) and a fixed size (8 bytes). The Slave response frame has a fixed identifier, 61 (0x3D) and a fixed size
(8 bytes).
The meaning of each byte in a PDU is defined in the following sections.
6.2.1 Generic Control PDU Structure
The Generic Control PDU structure is described in this section; see
.
NAD
CMD
M5
M0
M1
M2
M3
M4
NAD
CMD
S5
S0
S1
S2
S3
S4
Request
Response
The left byte (NAD) is sent first
Figure 6-1. Generic Control PDU Structure
NAD
NAD is the address of the slave node being addressed by a request. NAD is also used to indicate the source of the
response.
Generic Control is uses Free NAD values, meaning that the NAD value must be selected from the range 128 (0x80)
- 255 (0xFF), and not to be interpreted as a diagnostic. For the KIT33912EVME NAD - 160 (0xA0) is used.
CMD
CMD is a command being sent by the master in a request to be interpreted by the slave. CMD is also used to
interpret the status data in a response.
CMD code:
0 = SPI - read and write SPI data registers through the SPI channel
1 = PWM - write a value to the MCU pulse width modulation registers
2 = ADC - read data from the A/D converter the MCU registers
3 = TOOLS_TO_MCU - special commands to change the MCU state and activity
4 = TOOLS_TO_PC - special commands to read the MCU state and activity