Getting LIN slave example to work

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
lock attach
Attachments are accessible only for community members.
EsJ_4836916
Level 1
Level 1

Hello,

I have gone through the “LIN slave implementation” documentation and referring the reference code available at  link[1]. The reference code was compiled successfully

In a similar way, I am trying to implement the code on another target CY8C4147AZA-S455 but unable to get any LIN frames on the pin

I am not sure if anything is missing

Things I have tried:

  1. Replicate init and send frame sequence from LIN component reference code but no data on DSO
  2. Explicitly set NSLP pin to high (active low) to avoid sleep behavior o transceiver IC

Test setup:

LIN line (after transceiver IC) connected to DSO to see sent frame. Periodically also monitoring LIN1_TX pin (before transceiver IC) directly from MCU

Attaching reference project and my project

Kindly help on this at earliest,

Thanks,

Eshwar

0 Likes
1 Solution
Ashish
Moderator
Moderator
Moderator
25 likes received 50 solutions authored 100 replies posted

Hi Eshwar,

LIN communication needs LIN Master for communication to happen. I understand there is no master in your setup (correct me if I am wrong). Following is the flow:

1) The master generates header which contains break field, sync and PID field. Slaves can not generate header, so they can't initiate communication.

2) Based on the header and PID (protected identifier field), the slave will respond accordingly.

Since in your case, there is no master, so header is not generated, so communication is not even initiated. So you can not see any activity on the BUS.

Regards,

Ashish

View solution in original post

3 Replies
Ashish
Moderator
Moderator
Moderator
25 likes received 50 solutions authored 100 replies posted

Hi,

I have a question: Do you have LIN Master? It could be either LIN Analyzer working as Master, or any other LIN Master device. The Master should generate the PID in order for LIN Slave (our PSoC in this case) to respond. Unfortunately, PSoC4 device does not have LIN Master component, so as of now, we can only support the LIN Slave using PSoC4, so you will need the Analyzer or any other device working as LIN Master. Also, I don't think the DSO will work as LIN Master, although you can observe the frame on it by connecting it to a working LIN bus.

For getting started, we also request you to refer these KBAs:

1)Getting Started with PSoC® 4 LIN Slave Componen... | Cypress Developer Community

2)Local Interconnect Network (LIN) Slave Componen... | Cypress Developer Community

Regards,

Ashish

AshishS_66 Hello Ashish,

Thanks for your reply. I have already referred the links suggested by you. I am not trying to use DSO as LIN master, I am trying to observe only the LIN frame on DSO without master. Below is the code snippet from main(). PFA an illustration of the setup. The following code snippet must give output to LIN_TX pin (on test pads) which I want to see on DSO. I am not able to get any output on LIN_TX pin (before transceiver IC). If you could please check on the project add your suggestions/comments related to code or block configuration

Thanks,

Eshwar

/* Enable Global Interrupts */

    CyGlobalIntEnable;     

   

     /* Call initialization function */

    l_sys_init();

   

    /* Start LINS component */

    if(0u != l_ifc_init(LINS_IFC_HANDLE))

    {

        /* Turn ON the LED1 */

        LED1_ON;

    }

   

    // Set to disable sleep (active LOW)

    LIN_NSLP_Write(1);

   

    // Send test data forever

    while(1)

{

        uint8 testData = 0x05;

       

        l_u8_wr(OutSig_SIGNAL_HANDLE, testData);

        l_u8_wr_OutArraySig(testData);

       

        CyDelay(2000);

}

IMG-20201214-WA0003.jpg

0 Likes
Ashish
Moderator
Moderator
Moderator
25 likes received 50 solutions authored 100 replies posted

Hi Eshwar,

LIN communication needs LIN Master for communication to happen. I understand there is no master in your setup (correct me if I am wrong). Following is the flow:

1) The master generates header which contains break field, sync and PID field. Slaves can not generate header, so they can't initiate communication.

2) Based on the header and PID (protected identifier field), the slave will respond accordingly.

Since in your case, there is no master, so header is not generated, so communication is not even initiated. So you can not see any activity on the BUS.

Regards,

Ashish