3 Replies Latest reply on Jul 19, 2018 9:52 PM by nsha

    LIN Bus Master Implementation

    info_1957421

      Hello,

       

      I use a CY84247AZI-M485 for a LIN-Master application.

       

      So I have some questions:

       

      How can I set the LIN-Break Signal Lenght to 13 Bits?

      How can I send a  Break Signal?

      How can I evaluate the Break Signal? if (LIN_INTR_RX_BREAK_DETECT) ... ?

       

       

      // UART Name = LIN
      
      CY_ISR(LINRxIsr)
      {
          uint8 rxStatus,errorStatus;         
          uint8 rxData;       
          
          if (LIN_GetInterruptCause()==LIN_INTR_CAUSE_RX) {
                if (LIN_INTR_RX_BREAK_DETECT) {
                
                }
           }
      
      int main(void)
      {
           LIN_SetCustomInterruptHandler(LINRxIsr);
      
           CyGlobalIntEnable; // Enable global interrupts.
      }
      

       

      Regards,

      Michael

        • 1. Re: LIN Bus Master Implementation
          nsha

          Hi Michael,

           

          1) In case you are using UDB,

          You can set the LIN break length in Advanced tab of UART component configuration window.

          You can use API UART_SendBreak(uint8 retMode) to send break condition.

          You can use API UART_ReadRxStatus() to check if break was detected.

           

          2) In case you are using SCB,

          You can use API SCB_UartSendBreakBlocking(uint32 breakWidth) to send the break condition and width can also be set here (parameter passed).

          In advanced tab of component configuration, you can enable "break detect" interrupt.

           

          Thanks,
          Shanmathi

          • 2. Re: LIN Bus Master Implementation
            info_1957421

            HI Shanmathi,

             

            thx for your answer, I try it but without success.

             

            I use the SCB Unit for UART, Name of the UART is "LIN".

             

            1. There is no Break IRQ option in Advanced (see Picture)

             

            2. I have no SCB_UartSendBreakBlocking(uint32 breakWidth) or LIN_UartSendBreakBlocking(uint32 breakWidth) API

             

            Regards,

            Michael

             

            settings.JPG

            • 3. Re: LIN Bus Master Implementation
              nsha

              Hi Michael,

               

              It looks like you are using old SCB component.

              Could you please check using SCB V4.0?

               

              You can also refer to page 143 and 159 of http://www.cypress.com/file/408071/download

               

              Thanks,
              Shanmathi