You are here

Interrupt Uart RX problem | Cypress Semiconductor

Interrupt Uart RX problem

Summary: 7 Replies, Latest post by Bob Marlowe on 12 Aug 2015 06:53 AM PDT
Verified Answers: 0
Last post
Log in to post new comments.
user_139039395's picture
User
107 posts

Hello Friends I have a problem whith RX interrupt, I only want to read when I have a data, but the interruption comes once and then, never comes to interrupt again, I attach my code 

user_14586677's picture
User
7646 posts

Do you clear the interrupt by reading the UART status register ?

 

Regards, Dana.

user_1377889's picture
User
9572 posts

Good shot, Dana. No, Jfco did not clear the interrupt cause by reading the status of his RX8.

 

Bob

user_139039395's picture
User
107 posts

Hello how can I clear the RX interrupt? I use M8C_ClearIntFlag ( INT_CLR1 , INT_MSK1_DCB13 ) ; DCB13 block is the place where is the UART module , and the interrupt  Should enter each time send information GPS Module (each 1 second )

user_1377889's picture
User
9572 posts

See our above posts: "by reading the status of his RX8". Have a look into the APIs in datasheet, there you find a description of RX8_bReadRxStatus().

 

Bob

user_139039395's picture
User
107 posts

Hello I check the RX8_bReadStatus inside the ISR and I receive 0x08 (RX8_RX_COMPLETE)  but i have the same problem only can enter in the interrupt once, this is my ISR code

 

#pragma interrupt_handler GPSRX_ISR
void GPSRX_ISR(void){
    
    M8C_ClearIntFlag(INT_MSK1, INT_MSK1_DCB13);
    
    while (!( bRxStatus=GPS_RX_bReadRxStatus() & GPS_RX_RX_COMPLETE ));
    
    while(Reset != 0x0A){
        if (( bRxStatus & GPS_RX_RX_NO_ERROR ) == 0 )
        Reset=GPS_RX_cGetChar();
        TX8_PutChar(Reset);
    }
    
}

 

I only can work if stop the module and then start again

user_14586677's picture
User
7646 posts

Observations -

 

1) In this, while(Reset != 0x0A){, is Reset a reserved word in the compiler ?

2) Is "Reset" declared as volatile ?     http://www.barrgroup.com/Embedded-Systems/How-To/C-Volatile-Keyword Volatile

 

Regards, Dana.

 

 

user_1377889's picture
User
9572 posts

You do not assign the complete status to your variable bRxStatus, but the ANDed result from

GPS_RX_bReadRxStatus() & GPS_RX_RX_COMPLETE

So the following check

( bRxStatus & GPS_RX_RX_NO_ERROR ) == 0

might fail

Better use

 while (!( (bRxStatus=GPS_RX_bReadRxStatus()) & GPS_RX_RX_COMPLETE ));

Bob

 

Log in to post new comments.