2 Replies Latest reply on May 28, 2020 5:49 PM by YoIs_1298666

    Circular buffer(Software buffer) of UART for PSoC4100S

    YoIs_1298666

      Hello,

       

      In SCB_UartComm01 of sample project, I want to use the circular buffers with both TX and RX software buffer of 64 length like below.

       

      I got the hint from the UART component datasheet.

      Therefore, I added an interrupt handler as follows.

      Q1:It is working fine under these conditions. Are the both TX and RX interrupt sources in the interrupt request register cleared correctly?

            Is the interrupt handler description correct?

       

      Q2:In the datasheet, there is the description "The External interrupt mode is preferred in this case.".

            But if I set RX buffer size or TX buffer size greater than the FIFO depth, I can not select the external interrupt.

            What does this mean?

       

      Best regards,

      Yocchi

        • 1. Re: Circular buffer(Software buffer) of UART for PSoC4100S
          AH_96

          Hi YoIs_1298666

           

          1. As mentioned in the datasheet (the snippet you have added) you must not clear the interrupt for RX FIFO not empty or TX FIFO not full as these are automatically cleared by the component. Hence, the statements within UartIntHandler must be removed.

           

          Q2:In the datasheet, there is the description "The External interrupt mode is preferred in this case.".

                But if I set RX buffer size or TX buffer size greater than the FIFO depth, I can not select the external interrupt.

                What does this mean?

          Please check the statement above that.

          "In case RX buffer size or TX buffer size is equal to the FIFO depth only the hardware TX or RX FIFO is used. In the Internal interrupt mode the interrupts are not cleared automatically. It is the user’s responsibility to do this. The External interrupt mode is preferred in this case."

           

          It is only if hardware FIFO is used that external interrupts are available and preferred. If software FIFO is used, that is, Buffer size > 16 bytes in byte, mode this option is unavailable and internal interrupt is enabled.

           

          Thanks,
          Hari

          • 2. Re: Circular buffer(Software buffer) of UART for PSoC4100S
            YoIs_1298666

            Hello Hari-san,

             

            Thank you very much.

            I can understand all.

            Since there is no interrupt enable in the sample code, just add the following.

             

            CyGlobalIntEnable;

             

            Best regards,

            Yocchi