Interrupt Uart RX problem

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

cross mob
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

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 

0 Likes
7 Replies
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

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

   

 

   

Regards, Dana.

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

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

   

 

   

Bob

0 Likes
Anonymous
Not applicable

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 )

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

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

0 Likes
Anonymous
Not applicable

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

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

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.

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

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

0 Likes