6 Replies Latest reply on Feb 17, 2015 7:11 AM by yonkou.claire

    UART and I2C with Interrupt

    user_350540870

      I can program the UART with Hardware Interrupt, because the Rx_Interrupt pin is available in the UART component. I need help in programming I2C with interrupt, because the component does not have any hardware Interrupt pin. Please find the piece of ISR that I have written to get a byte on UART of Master and send it to the Slave by I2C:

         

      CY_ISR(ISR_Rx_UART_Interrupt)
      {
        
          I2CM_I2CMasterSendStart(I2C_SLAVE_ADDR, 1u);
          I2CM_I2CMasterWriteByte(UART_GetChar());
         
      }
       

         

      At the end, I want to configure UART and I2C with Software Interrupt. Any reference to the explanation of Hardware and Software interrupt will be highly appreciated.

         

      Thanks in Advance.

         

      Shaunak