- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Labels:
-
PSoC 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Do you clear the interrupt by reading the UART status register ?
Regards, Dana.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Good shot, Dana. No, Jfco did not clear the interrupt cause by reading the status of his RX8.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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 )
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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