cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC 4

YoIs_1298666
Contributor II

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.

pastedImage_0.pngpastedImage_1.png

I got the hint from the UART component datasheet.

pastedImage_2.png

Therefore, I added an interrupt handler as follows.

pastedImage_0.png

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

0 Likes
1 Solution
Hari
Moderator
Moderator

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

View solution in original post

0 Likes
2 Replies
Hari
Moderator
Moderator

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

View solution in original post

0 Likes
YoIs_1298666
Contributor II

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

0 Likes