Local Interconnect Network (LIN) Slave Component User Guide for PSoC - KBA225227

Author: harshadap_76           Version: **

 

Question:

What are the general considerations while using a Local Interconnect Network (LIN) Component and how can I troubleshoot different LIN issues?

 

Answer:

This document provides the general guidelines for using PSoC® LIN component. It documents the best practices, commonly reported issues, and the debugging steps. This document could be used as troubleshooting guide for PSoC LIN.

 

1.  General Information

LIN Slave Component is supported in PSoC 3, PSoC 5LP, and PSoC 4 families. To get started with PSoC 4 LIN Slave, see Getting Started with PSoC® 4 LIN Slave Component - KBA210346. The steps to configure LIN Slave in PSoC 3 and PSoC 5LP are similar to that for PSoC 4.

For the PSoC 4 family, the LIN Slave Component implemented is based on Serial Communication block (SCB), while in PSoC 3 and PSoC 5LP, it is based on Universal Digital Block (UDB).

1.1  Supported Kits

Table 1. Kits that Support LIN Slave Component Evaluation

Name

Supported Product Family

Kit MPN

PSoC Development Kit

PSoC 3, PSoC 4, PSoC 5LP

CY8CKIT-001C

CAN and LIN Shield

PSoC 4

CY8CKIT-026

PSoC 3 Development Kit

PSoC 3

CY8CKIT-030A

PSoC 4000 Pioneer Kit

PSoC 4

CY8CKIT-040

PSoC 4000S Pioneer Kit

PSoC 4

CY8CKIT-041-40XX

PSoC 4100S Pioneer Kit

PSoC 4

CY8CKIT-041-41XX

PSoC 4 Pioneer Kit

PSoC 4

CY8CKIT-042

PSoC 4 BLE Pioneer Kit

PSoC 4

CY8CKIT-042-BLE

PSoC 4 BLE 4.2 Pioneer Kit

PSoC 4

CY8CKIT-042-BLE-A

PSoC 4 M-Series Prototyping Kit

PSoC 4

CY8CKIT-043

PSoC 4 M-Series Pioneer Kit

PSoC 4

CY8CKIT-044

PSoC 4 L-Series Pioneer Kit

PSoC 4

CY8CKIT-046

PSoC 41xx Prototyping Kit

PSoC 4

CY8CKIT-049-41XX

PSoC 42xx Prototyping Kit

PSoC 4

CY8CKIT-049-42XX

PSoC 5LP Development Kit

PSoC 5LP

CY8CKIT-050B

PSoC 5LP Prototyping Kit

PSoC 5LP

CY8CKIT-059

PSoC 4000S Prototyping Kit

PSoC 4

CY8CKIT-145-40XX

PSoC 4200DS Prototyping Kit

PSoC 4

CY8CKIT-146

PSoC 4100PS Prototyping Kit

PSoC 4

CY8CKIT-147

PSoC 4100S Plus Prototyping Kit

PSoC 4

CY8CKIT-149


1.2        Example Projects

PSoC Creator™ includes LIN Slave example projects for all supported devices. Follow the menu path, FileCode Example. In the Find Code Example window, select the PSoC family from the Device family dropdown list. Type LIN in the Filter by field. The code examples related to LIN are listed.

 

Figure 1. Selecting LIN Slave Example in PSoC Creator

                   

You can also find the following example projects on the website:

§  CE96999 - Basic LIN Slave Implementation in PSoC® 4

§  CE95332 - Local Interconnect Network (LIN) Slave with PSoC 3/5LP

1.3        Documents

Go through the following documents before starting with LIN Slave in PSoC:

§  LIN Slave component datasheet

§  LIN 2.2A specification and earlier versions of LIN specification documents

§  CY8CKIT-026 CAN and LIN Shield Kit Guide

Here are some additional documents that you can read:

§  PSoC® 3 Architecture TRM

§  PSoC® 5LP Architecture TRM

§  PSoC 4100M / PSoC 4200M Family: PSoC® 4 Architecture Technical Reference Manual (TRM)

§  PSoC 4200L Family: PSoC 4 Architecture Technical Reference Manual (TRM)

§  PSoC 4100S and PSoC 4100S Plus: PSoC 4 Architecture Technical Reference Manual (TRM)

§  PSoC 4100 and 4200 Family: PSoC® 4 Architecture Technical Reference Manual (TRM)

§  PSoC 4000S Family: PSoC 4 Architecture Technical Reference Manual (TRM)

§  PSoC 4000 Family: PSoC® 4 Architecture Technical Reference Manual (TRM)

You can find the respective Registers Technical Reference Manual here.

2.          General Guidelines

2.1        Schematic Review

In case of reliable LIN communication, check LIN Tx, Rx, and LIN enable/NLSP pin connections to the transceiver on board. Also, check the transceiver schematic on board as mentioned in the respective transceiver datasheet. For reference schematic, see the CY8CKIT-026 CAN and LIN Shield Kit user guide that use TJA1020 LIN transceiver chip.

Check if VBAT and ground connections of the transceiver are proper.

2.2        Hardware Connections

LIN Slave Component provides Tx and Rx pins. The NSLP pin is a software pin which is configured in the TopDesign of the LIN Slave project. See Figure 2. NSLP PinFigure 2.

Figure 2. NSLP Pin

 

Make sure that Tx, Rx, and NSLP are connected to the respective pins of the transceiver. If you are using CY8CKIT-026 you can use one of the two transceivers the kit. Table 2 lists the Rx, Tx, and NSLP lines for respective transceivers.

Table 2. LIN Transceiver Pin Headers on CY8CKIT-029

     

LIN1 Transceiver

LIN2 Transceiver

J15_1 (LIN1_RX)

J6_1 (LIN2_RX)

J15_2 (LIN1_TX)

J6_2 (LIN2_TX)

J15_3 (LIN1_NSLP)

J6_3 (LIN_NSLP)

 

See CY8CKIT-026 CAN and LIN Shield Kit for more details.

2.3        Configuring LIN Slave Projects

See CE96999 - Basic LIN Slave Implementation in PSoC® 4 for the steps to configure a LIN Slave in PSoC 4. The steps include the configuration of unconditional frames. Follow these steps to configure diagnostic frames:

1.    Right-click the LIN Slave Component and select Configure.

2.    In the Configure ‘LIN’ window, go to the Transport Layer tab and:

a.    Select the Use transport layer option.

b.    Select Raw transport layer API as the API format selection.

c.    Set the Initial NAD and select the Transport layer data buffer lengths (for Raw transport layer) as per the requirements.

Figure 3. Transport layer Tab Configuration

3.    Go to the Config. Services tab and:

a.    Select the Automatic configuration request handling option enable the source code to handle selected services.

b.    Select the configuration services based on the requirement.

c.    Select the Slave information including Supplier ID, Function ID, and Variant.

Figure 4. Configuration Services Tab

In firmware, monitor the receive status of the respective LIN signal or frame to check if any diagnostic frame was received. Following code snippet is an example to monitor frame reception and receive data using raw APIs.

if((ld_raw_rx_status(LINS_IFC_HANDLE) == LD_DATA_AVAILABLE))

{

ld_get_raw(LINS_IFC_HANDLE, rxBuffer);

}

 

Use the following code snippet to update the response frame:

ld_put_raw(LINS_IFC_HANDLE, rxBuffer);

 

If automatic service request handling is enabled, then the code for handling respective services will be enabled in LIN.c. Note that code will not be generated for the services that are greyed out or not selected in the Config. Services tab (see Figure 4). Also, for custom diagnostic services the code will not be enabled in LIN.c. In such cases, you should handle the service in user firmware.  See Testing Diagnostic Services.

You can follow the same steps to configure LIN Slave Component in PSoC 3 or PSoC 5LP.

2.4        Testing Diagnostic Services

Table 3 lists the LIN diagnostic services supported by the PSoC 4 LIN Component.

Table 3. Supported Diagnostic Services

             

Service Number

Service Name

0xB0

Assign NAD

0xB2

Read by identifier

0xB3

Conditional Change NAD

0xB6

Save Configuration

0xB7

Assign Frame identifier

 

If a service is selected in the Config. Services tab (see Figure 5), the source code for handling that service is enabled in LIN.c.

Figure 5.Supported LIN Diagnostic Services

The services greyed out in Figure 5 are not implemented in the LIN Slave Component. However, you can monitor the service field of the LIN diagnostic frame and create your own service handling function.

For instance, if you want to handle 0xB1, then you can use the following code snippet to handle the service:

/* If there is a data in the MRF then proceed frame receiving. */

if((ld_raw_rx_status(LINS_IFC_HANDLE) == LD_DATA_AVAILABLE))

{          /* Receive the data into a rxBuffer[] */

            ld_get_raw(LINS_IFC_HANDLE, rxBuffer);

}

if(rxBuffer[2] == 0xB1)

{

  //Handle the service

}

 

Similarly, you can handle user defined services also.

2.5        Using LIN Slave to Wake up the PSoC 4 Device from Deep Sleep

A typical requirement in a LIN network is to wake up the controller from low power mode when a LIN wake-up pulse is received. In such cases, LIN Rx pin should be monitored. In PSoC 4, waking up a device from DeepSleep using LIN slave requires dynamic modification of LIN Rx pin.

GPIO interrupt is one of the sources to wake up PSoC 4 devices from DeepSleep. Any pin which is configured as an interrupt source can wake up the device.

By default, the LIN Component pins cannot be used as a wake-up source for DeepSleep. To use LIN pins as wake up sources, you need to configure those pins as interrupt pins using system reference APIs and respective pin APIs.

Following is the sample code for configuring Rx pin of the LIN Component as an interrupt pin. When the Rx line is pulled low, the devices wake up from sleep.

 

LINS_SCB_tx_Sleep();  // this will backup the drive mode

LINS_SCB_rx_Sleep();  // this will backup the drive mode

       

LINS_SCB_rx_SetDriveMode(LINS_SCB_rx_DM_RES_UP);

       

CyIntEnable(0); //IRQ0 for GPIO port 0

CyIntSetVector(0, &LINRx); //IRQ0 for GPIO port 0 and address of function that needs to be handled when interrupt is detected

       

LINS_SCB_rx_SetInterruptMode(LINS_SCB_rx_0_INTR, LINS_SCB_rx_INTR_BOTH);           

 

// Go to low power mode

CySysPmDeepSleep();

 

In the above code snippet, the LINS_SCB_rx APIs are used to configure the Rx pin for interrupt. Also, CyIntEnable(0) enables the interrupt for the pin.

Parameter 0 in CyIntEnable(0) indicates the interrupt number of the GPIO port. In the project, Rx is assigned to port0 and the IRQ number for port0 is ‘0’. The same IRQ number is passed to the CyIntEnable API. Also, the interrupt needs to be cleared when it is triggered. You can define a function that clears the interrupt. The address of this function should be assigned to the interrupt vector of GPIO port. CyIntSetVector is used to assign the address of custom function to an IRQ. The address of LINRx(), a custom function, is passed to CyIntSetVector and LINRx() and is defined as:

void LINRx()

{

    LINS_SCB_rx_ClearInterrupt();

    LINS_SCB_tx_ClearInterrupt();

   

}

The IRQ number can be found in the corresponding Architecture TRM. Table 4 lists the IRQ mapping in PSoC 4200. For instance, GPIO interrupt - IRQ0 is mapped to Port0 interrupt source, thus the IRQ number for port0 is ‘0’.

 

Table 4. IRQ Mapping for GPIOs

IRQ Vector

Interrupt Source

IRQ0

GPIO Interrupt - Port 0

IRQ1

GPIO Interrupt - Port 1

IRQ2

GPIO Interrupt - Port 2

IRQ3

GPIO Interrupt - Port 3

IRQ4

GPIO Interrupt - Port 4

 

Make sure to use CyIntDisable(0) to disable interrupt and LINS_SCB_tx_Wakeup() to restore the drive mode.

 

To use Rx pin as wake up source, configure a timer that will start when any interrupt is received over Rx. The timer will be used to calculate the time of the pulse received over Rx. The LIN slave wakes up when wake up command is sent to the component using the following API call:

l_ifc_ioctl_LINS(L_IOCTL_WAKEUP, NULL);

The above API should be called only when a valid wake up pulse is received on Rx. The timer can be started at the falling edge of Rx pulse and stopped at rising edge of Rx pulse. The time calculated can be compared with wake pulse specification for LIN.

2.6        Handling Error for Unconditional Frames

LIN protocol mandates to have an error bit assigned to one of the publish frames. LIN Master can request for this publish frame to monitor if error bit was set.  LIN node can detect if there was any error in the frame. Define error handling and set up in the implementation.

The error response bit is set when any of the following condition is observed:

§  The transmission medium has a short circuit.

§  The Sync field was incorrect.

§  The signal levels are not as per the LIN specifications.

§  A parity error was detected in the frame header.

§  A checksum mismatch was detected in the received frame.

§  There was a frame error.

 

You can monitor the LIN status register to know if there was any error in the response frame.

Figure 6. LIN Status Register

Here is an example to monitor the error status register:

 

error= l_ifc_read_status_LINS();

       

if (LINS_IFC_STS_ERROR_IN_RESPONSE == (error & LINS_IFC_STS_ERROR_IN_RESPONSE) )

        {

           

            UART_PutString( "Frame error ");

            UART_PutHexByte(error);

            UART_PutCRLF();

        }

 

2.7        Sending the Wake-up Pulse using LIN Slave

Follow these steps to send wake-up pulse:

1.    Call the l_ifc_wake_up_LIN() API. See section 7.2.5.3 l_ifc_wake_up of the LIN 2.2 A specification for more details.

2.    After the wake-up signal is sent, wait for 150 ms for response.

3.    If there is no response, then resend the pulse by calling the l_ifc_wake_up_LIN() API.

If the wake-up signal is sent thrice already, wait for 1.5 secs. After 1.5 secs start resending the above sequence. These steps should be taken care in the application firmware. Use a timer (TCPWM Component) to monitor these timings.

2.8        Using Systick Timer in LIN Project

The LIN Component uses Systick timer for maintaining the timings in the protocol. Hence mapping Systick interrupt to custom ISR may affect the LIN functionality. For example, LIN Component may not be able to detect bus inactivity.

Systick has five callbacks and the LIN timer function, l_ifc_aux_LIN_1, is called in callback number ‘0’ of Systick ISR. Instead of mapping a separate ISR to Systick, you can use the LIN timer ISR itself or you can pass your custom function to callback number 1, 2, 3, or 4 of Systick timer. For more details on Systick timer and its APIs, refer the PSoC 4 System Reference Guide - cy_boot Component v5.70 section in the System Reference Guide (go to Help in PSoC Creator to access the System Reference Guide).

 

To pass your custom function, for example ‘UserFunc()’, use following API:

CySysTickSetCallback(1u, &UserFunc);

 

Alternatively, follow these guidelines for using LIN timer function:

The function void l_ifc_aux_LIN_1(void) in LIN.c (LIN source file) has a variable LIN_1_periodCounter that increments whenever this function is called. l_ifc_aux_LIN_1 is passed as argument to Systick callback function as:

CySysTickSetCallback(0u, &l_ifc_aux_LIN_1);

This call back function is called while initialization. The function l_ifc_aux_LIN_1 provides a placeholder to write custom code. Following comment is provided in this function:

/***************************************************************************
*  Place your BASE ISR code here
***************************************************************************/
/* `#START LIN_1_BASE_ISR_CODE` */

/* `#END` */

You can add your custom code below/* `#START LIN_1_BASE_ISR_CODE` */. You must include the respective header files in the LIN source files. Also, if any modification is done in TopDesign the source file gets regenerated. Hence, make sure to include the files again.

It is not recommended to have large codes in callbacks. If callbacks hold huge code, then it may affect LIN functionality.

2.9        Using SCB UART in LIN Mode

In PSoC 4, SCB UART can be used in LIN mode by enabling the SCB_LIN_ MODE bit in SCB_UART_RX_CTRL register.  Also, LIN protocol requires break detection and baud rate detection feature. This section explains how to enable and use these features.

Figure 7. SCB_UART_RX_CTRL Register

See Figure 7 for the SCB_UART_RX_CTRL register.

When SCB_LIN_ MODE is set, the receiver performs break detection and baud rate detection on the incoming data.

 

First, break detection counts the number of bit periods that have a line value of 0. BREAK_WIDTH specifies the minimum number of bit periods required.

Successful break detection sets the SCB_BREAK_DETECT in SCB_INTR_RX register.

 

Figure 8. SCB_INTR_RX Register

Baud rate detection counts the number of peripheral clock periods that are used to receive the synchronization byte (0x55; least significant bit first). The count is available through the SCB_BR_COUNTER field in the SCB_UART_RX_STATUS register.

 

Figure 9. SCB_UART_RX_STATUS

Successful baud rate detection sets the SCB_BAUD_DETECT bit in SCB_INTR_RX register. Read the BR_COUNTER after SCB_BAUD_DETECT is set.

Read the counter value and check if it is within 14% tolerance of LIN baud rate and then go for further reception.

2.10      Importing and Exporting LDF and NCF

You can import the LIN Descriptor File (LDF) and Node Configuration File (NCF) = provided by the clients into the LIN Slave Component. Importing these files configures all tabs of LIN Component. You should write the application firmware based on the configuration.

In the LIN Slave configuration window, go to the General tab and use the Import File option to import the LDF or NCF file. You can also export LIN configurations as a NCF file.

Figure 10. Options to Import and Export Files in Lin Component

See the General Toolbar section in LIN Slave Component datasheet.

 

 

3.          Debugging Issues

3.1        Communication Issues

If LIN is unable to transmit or receive the frames:

§  Check if the Tx and Rx pins are connected correctly (Tx pin of PSoC to Tx of the transceiver and Rx pin of PSoC to Rx of transceiver).

If you are using CY8CKIT-026 make sure that your connections follow the specifications mentioned in the Hardware Connections section.

§  Check if the LIN baud rate configured in LIN master matches with the baud rate set in LIN slave.

§  Check if Auto baud sync is enabled if the clock tolerance is > 1.5%.

If you are using IMO it is recommended to enable Auto baud sync.

§  Check whether the checksum set in the analyzer is classic or enhanced. The unconditional frames use enhanced checksum for LIN 2.0 and above, and diagnostics frames use classic checksum.

§  LIN 1.3 uses classic checksum for both frame types.

§  LIN Component does not explicitly provide NSLP pin to send sleep or wake up signal to the transceiver. A software pin should be configured separately and it should be high for normal operations.

Make sure the NSLP pin is correctly configured. See Figure 11.

 

Figure 11. NSLP Pin Configuration

 

§  Go to debug mode using PSoC Creator and check if the LIN interrupt is triggered successfully when LIN Master sends any frame. LIN ISR is defined in the LIN_INT.c file. Place a break point in LIN ISR. When a frame is received successfully, the code will reach this break point. See Figure 12.

Figure 12. LIN interrupt

 

 

If the debugging reaches the breakpoint in the ISR, check the l_ifc_rx_LINS() function and  verify if each line of code within this function is executed correctly.

 

3.2        Inconsistent Data Received

The received data on LIN Slave is inconsistent with the data sent by LIN Master. Certain bytes of the received frames are not updated.

In such case, make sure that the code uses notification functions while updating a publish frame or receiving a subscribe frame. Here is an example:

if(1u == l_flg_tst_SignalIn())

        {

            /* Clear signal flag */

            l_flg_clr_SignalIn();

        }

where, SignalIn is the LIN signal configured in the LIN frame as shown in Figure 13.

Figure 13. Signal Configured in LIN Frame

 

3.3        UART in LIN Mode

While using UART component in LIN mode, interrupt is triggered even if there is no signal on bus.

Make sure UART_ClearRxInterruptSource is called in UART's ISR. You can refer the LIN.c source file of LIN Component while implementing LIN Slave.

4.          Frequently Asked Questions

1.    Does PSoC 4, PSoC 3, or PSoC  5LP support LIN Master?

PSoC 4, PSoC 3, and PSoC 5LP do not have the LIN Master Component. However, you can build your own stack using the UART Component. For PSoC 4, see the UART Local Interconnect Network (LIN) Mode section in the PSoC 4200 Architecture TRM.

2.    What is the use of CY8CKIT-026?

CY8CKIT-026 have LIN transceivers which act as level shifters as per the LIN specification.

3.    The PSoC 4 LIN Component in TopDesign view does not show the Tx and Rx pins. Where can I find the assigned pin ports?

PSoC 4 LIN Component is a SCB-based component. The associated pins will be visible in Project.cydwr à Pins tab. Pin names will be 'component name':SCB:rx and 'componentname':SCB:tx. If the component name is LINS, the pins will appear as LINS:SCB:rx and LINS:SCB:tx.         

4.    Can I change the frame format and timings of LIN protocol in PSoC 4 LIN Component?

If you change the LIN frame format, it will not follow the LIN specification. This will be a custom protocol. You need to use your own custom library over UART for defining timings and setting frame formats.

Example: Follow these steps to remove sync field from the frame format:

a.    Set the UART mode to LIN for break detection.

LINS_SCB_UART_RX_CTRL_REG |= (uint32)(LINS_SCB_UART_RX_CTRL_LIN_MODE);

 

Wait for break detect event as shown in the below code:

while(0u =(LINS_SCB_INTR_RX_REG & LINS_SCB_INTR_RX_BREAK_DETECT));

 

After break detection, the mode should be changed back to UART.

LINS_SCB_UART_RX_CTRL_REG ^= (uint32)(LINS_SCB_UART_RX_CTRL_LIN_MODE);


 

b.    SCB in UART mode receives ID symbol. This will set the RX_FIFO_NOT_EMPTY interrupt. You need to monitor RX_FIFO_NOT_EMPTY and change the mode back to LIN.

Pole for RX_FIFO_NOT_EMPTY as follows:

while(0u == (LINS_SCB_INTR_RX_REG & LINS_SCB_INTR_RX_NOT_EMPTY));

LINS_SCB_UART_RX_CTRL_REG |= (uint32)(LINS_SCB_UART_RX_CTRL_LIN_MODE);

 

5.    LIN data in the frame was received incorrectly and certain fields showed previous data. How can this be addressed?

Make sure to use notification functions while updating a publish frame or receiving a subscribe frame. See the Inconsistent Data Received section and LIN Component datasheet for information on how to use notification functions.

6.    What is the clock tolerance required for LIN Slave Component?

Following are the clock tolerances recommended by the LIN Slave specification:

o  When Automatic Baud Rate Select (ABRS) option is disabled: ±1.5%

o  When ABRS option is enabled: ±14%

7.    Why does the component throw error when assign NAD = 0xFF (128)?                   

According to the LIN specification, the range of node address (NAD) is from 1 to 127. Hence NAD cannot be 128.

8.    Why do I observe framing error even if LIN clock has 5% tolerance? 

Check if the Automatic Baud Sync is disabled. LIN clock should have 1.5% tolerance if auto baud rate sync is not used.

9.    How can LIN Component be used for bootloading?

To use LIN Component for bootloading you may have to use bootloader with custom communication protocol and then follow from step 2 mentioned in this knowledge base article.

10. During bootloading, will LIN interrupt affect flash writes?

When there is a write to the flash all interrupts are disabled. Hence during flash writes, LIN interrupts will not be triggered.

11. Can LIN Component be used to listen to the bus?

You must modify the stack or build the stack over UART. For details on how to use UART in LIN mode, see the SCB_LIN_MODE bit description in PSoC 4 Registers TRM.

 

12. How can I use PID 0x3C and 0x3D?

To use 0x3c and 0x3d, enable the Use Transport layer option in LIN Component configuration (right-click LIN Component and select Configure. In the Configure ‘LIN’ window, go to the Transport Layer tab).  See Configuring LIN Slave Projects.

13. The LIN Component uses more flash than that mentioned in datasheet. Why does the flash consumption data not match with datasheet?

Flash size depends on the LIN Component configuration. The flash size mentioned in the datasheet is only for the example project. Adding frames and transport layer increases the flash consumption. Make sure that optimization is enabled for the project to use the flash optimally.

14. How can I monitor if the transmission is completed? Can I monitor the LIN Tx pin and check its status?

Monitor SCB_UART _DONE bit of SCB_INTR_Tx register. This bit will be set when the transmission is completed.

You can use the following code snipper to monitor completion of transmission:


if((CY_GET_REG32(LINS_SCB_SCB__INTR_TX)&LINS_SCB_INTR_TX_UART_DONE)==LINS_SCB_INTR_TX_UART_DONE)

{

}

In SCB, the input buffer of buried output pins (Tx) is disabled to avoide current leakage in low power mode. Hence, reading the status using the LIN_1_SCB_Tx_Read () API always returns zero. Thus, you cannot monitor the status of the LIN Tx pin in firmware.

 

15. In the LIN Component, default PID can be configured from 0x00 to 0x3B. The IDs 0x3C and 0x3D are not visible in the PID options. Does component handle PIDs 0x3C and 0x3D in firmware?

You need to enable 'Use Transport layer ' to use the IDs 0x3C and 0x3D. The Component handles these IDs in the LIN source code.

16. Where can I find information on LIN APIs?

For information on LIN APIs, see the PSoC Creator Component datasheet.

17. Does the LIN Component support multiple NADs?

No. The LIN Component supports only one NAD.

18. Where can I find data regarding the current consumption due to LIN Component?

See the electrical specification mentioned in the LIN Component datasheet.  

19. Does LIN Component come with source or object code? Also, can you provide the LIN conformance certification report?                                                                   

LIN Component consists of LIN slave protocol source files. The LIN component source files are visible under Generated Source in the Workspace Explorer after generating the code in PSoC Creator. For conformance test, see Getting Started with PSoC® 4 LIN Slave Component - KBA210346.

20. Can the error response bit be removed from the LIN Component?       

No. According to LIN 2.x specification, there must be at least one published frame with error response bit configured in the LIN slave node. LIN 1.3 specification, does not specify an error response bit. If LIN 1.3 is enabled in the LIN Component, then the error bit disappears.

21. How is bit sample timing, mentioned in the LIN specification, implemented in PSoC 4 LIN Component? What is the source code?                                                                     

sampling is taken care in hardware. UART is the physical layer which takes care of the sample timing. Hence, there is no source code for bit sample timing.

22. Do I need to do inter byte test (IBT) for PSoC 4 LIN Component?                               

Ans: Inter Byte space test is not applicable for PSoC 4 LIN Component as Inter Byte space IBT < 1 bit. Hence there is no need to perform IBT test. The user needs to deselect this test.

23. At which position is the sampling point set?

In LIN, sample point is based on the UART protocol. UART will sample start and stop bits.  The sample point is at the middle of the bit.

24. Does LIN Slave Component satisfy the following bit rate tolerance in the LIN 2.1 specification?

o  FTOL_RES_MASTER < ±0.5 %

o  FTOL_RES_SLAVE < ±1.5 %

o  FTOL_UNSYNC < ±14 %

o  FTOL_SYNC < ±2 %

o  FTOL_SL_to_SL < ±2 %

The LIN Component supports only the slave. Thus, LIN Component satisfies the LIN slave bit timings and tolerance specification. Following are the details of bit rate tolerance specification:

o  FTOL_RES_SLAVE < ±1.5 %: Depends on the clock source. If an external clock with a tolerance lesser than 1.5% is used, then this synchronization is covered.

o  · FTOL_SYNC < ±2 %: Depends on the clock source. If an external clock or IMO with a tolerance less than 2% is used, then this synchronization is covered.

o  · FTOL_SL_to_SL < ±2 %: Depends on the clock source. If and external clock or IMO with a tolerance less than 2% tolerance is used, then this synchronization is covered.

25. Is there a corresponding part in the generated code for bit sampling and bit rate tolerance?

Bit sample point is covered in Hardware. Regarding Bit rate tolerance, see the within the if condition in LIN.c as shown below.

        /***********************************************************************

    *                      Sync Field Complete                            *

    ***********************************************************************/

    if(0u != (LINS_SCB_INTR_RX_REG & LINS_SCB_INTR_RX_BAUD_DETECT))

 

 

26. How can I monitor inactivity timeout?

Monitor the Bus Activity bit of the LIN status register. This bit will be reset when bus inactivity times out. See Figure 6.  Use l_ifc_read_status_LIN() API to monitor this bit as shown in the code snippet:

busStatus = l_ifc_read_status_LIN();

if((busStatus & LINS_IFC_STS_BUS_ACTIVITY) == 0u )


27. How can I check if LIN Master has sent a sleep frame?

Monitor the Go to sleep bit of the LIN status register. This bit will be set when master sends a sleep frame.  See Figure 6. Use the l_ifc_read_status_LIN() API to monitor this bit as shown in the code snippet:

busStatus = l_ifc_read_status_LIN();

 

if((busStatus & LIN_IFC_STS_GO_TO_SLEEP) != 0u )