A question about the PSOC5866 UART Rx interrupt

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

cross mob
Anonymous
Not applicable

Hello every one, Hello BOB:

     I set the UART interrupt as 'Rx-on byte received' and keep other parameters as default, then writed a simple ISR as following:

CY_ISR(Isr_UART_Rx)

{

    /* ISR Code here */

    //uint8 rxStatus;        

    uint8 rxData;          

    rxData = UART_RXDATA_REG;

    switch(rxData)

    {

       case '1':

        LED1_Write(0u);

        break;

       .........

       default:

        break;

    }

    UART_TXDATA_REG = rxData; 

}

    I find that evey time immediately after I download the program into the chip,

    the interrupt occurs whenever a character is received;

    But when I powerdown and then powerup the board again, the interrupt always occures after four characters are received,

    which means the Rx interrupt occurs not at byte received but at the receiving FIFO becoming full.

    How can I make the interrupt ocurring at each byte received?

0 Likes
6 Replies
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Can you please post your complete project so that we all can have a look at all of your settings. To do so, use

Creator->File->Create Workspace Bundle (minimal)

and attach the resulting file.

Bob

0 Likes
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

Thanks a lot, Bob!

I am sorry for replying so late.

I post the project here, please help me to check if there is any uncorrect settings.

Thank you again!

0 Likes
lock attach
Attachments are accessible only for community members.
NoriTan
Employee
Employee
25 sign-ins 5 questions asked 10 sign-ins

I created a project to reproduce your issue, but I cannot reproduce the issue with my CY8CKIT-059.  Please refer attached example project.

GS003264.png

uint8 rxData = 0;

CY_ISR(int_Rx_isr) {

    rxData = UART_RXDATA_REG;

    UART_TXDATA_REG = rxData;

}

In the ISR, the value of RXDATA register is copied into the TXDATA register like your code.

int main(void) {

    CyGlobalIntEnable; /* Enable global interrupts. */

    /* Place your initialization/startup code here (e.g. MyInst_Start()) */

    UART_Start();

    int_Rx_StartEx(int_Rx_isr);   

    UART_PutString("HELLO WORLD\r\n");

    for (;;) {

        /* Place your application code here. */

    }

}

In the main() function, UART and Interrupt components are started and show a greeting message.

When this project is written to the Prototyping kit, the greeting message was displayed and loop-back the entered characters.  ISR is called once a character.

In my project, both FIFO size are set to four.  This means the UART component uses the hardware FIFO only.  Please check the FIFO size you specified.

Regards,

Noriaki

0 Likes
Anonymous
Not applicable

Dear Noriaki,

Thank you very much for your help.

I post the project here, Please help me to check if there is any uncorrect setting if you have time!

0 Likes
lock attach
Attachments are accessible only for community members.
NoriTan
Employee
Employee
25 sign-ins 5 questions asked 10 sign-ins

I have converted your project into my CY8CKIT-059 but the issue is not reproduced.

I assigned pins as follows.  Other pins are automatically assigned.

Pin NamePin
UART_RxP12[6]
UART_TxP12[7]
CMODP15[4]
LED1P2[1]

When I typed '1' and '3' alternately, the LED1 on the CY8CKIT-059 turns ON and OFF.

The behavior is same when the CY8CKIT-059 is disconnect and reconnect.

Regards,

Noriaki

0 Likes
Anonymous
Not applicable

Thank you dear Noriaki!

The phenomenon is weird.

Could it be a specific problem of the cypress chip on my PCB?

Or could it be a problem of the PCB designed by myself?

I will try the hardware and report it again.

Thanks again!

0 Likes