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

cross mob
YoIs_1298666
Level 5
Level 5
250 sign-ins 100 replies posted 100 sign-ins

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
Moderator
750 replies posted 500 replies posted 250 solutions authored

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
Moderator
750 replies posted 500 replies posted 250 solutions authored

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

0 Likes

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