matrixofdynamism
Advanced Member level 2
When receiving data on the ESUART of the PIC one may either poll using kbhit or enable the ISR called INT_RDS in CCS PIC C and wait for it to be fired. Then one can use getc() and store the result into a variable and wait for the next character.
I usually see kbhit() being used.
(1) Which approach is suited for which scenario? What approach is unsuitable for which scenario?
Besides this, I have few other questions. The manual of CCS PIC C states:
INT_RDA Interrupt fires when the receive data available
INT_TBE Interrupt fires when the transmit data empty
(2) While I understand the concept of INT_RDA and assume that it is fired for everytime a character is received, is it?
(3) As far as I understand if we do read input characters, the buffer will store upto 3 characters and once the third character is received, a bit shall be set that specifies buffer overrun. After this the 4th input bit shall be lost. is this correct?
(4) Why is there no interrupt for buffer overflow?? That makes no sense.
(5) What is the point of a transmit empty buffer? How big is the transmit empty buffer? When we want to transmit data we just write putc() or printf(). This makes transmit empty buffer appear strange.
I usually see kbhit() being used.
(1) Which approach is suited for which scenario? What approach is unsuitable for which scenario?
Besides this, I have few other questions. The manual of CCS PIC C states:
INT_RDA Interrupt fires when the receive data available
INT_TBE Interrupt fires when the transmit data empty
(2) While I understand the concept of INT_RDA and assume that it is fired for everytime a character is received, is it?
(3) As far as I understand if we do read input characters, the buffer will store upto 3 characters and once the third character is received, a bit shall be set that specifies buffer overrun. After this the 4th input bit shall be lost. is this correct?
(4) Why is there no interrupt for buffer overflow?? That makes no sense.
(5) What is the point of a transmit empty buffer? How big is the transmit empty buffer? When we want to transmit data we just write putc() or printf(). This makes transmit empty buffer appear strange.