CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Handling of INT_UART1E interrupt [CLOSED]

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
benoitstjean



Joined: 30 Oct 2007
Posts: 566
Location: Ottawa, Ontario, Canada

View user's profile Send private message

Handling of INT_UART1E interrupt [CLOSED]
PostPosted: Thu Nov 26, 2020 10:07 am     Reply with quote

Device: PIC24EP512GP806
Compiler: 5.026

Hi guys.

Very (very) rarely, the INT_UART1E interrupt is triggered. Don't know when and don't know what causes it and unless I'm not seeing this right, I can't seem to find much info in the full spec sheets or extra specs "Section 17. UART" document. In the full specs, it is referred-to as <U1E – UART1 Error Interrupt> but can't find any much more info.

But when that error happens, it seems that the MCU doesn't process anything afterwards and is stuck there.

In the interrupt routine, I print the status of the following registers and they seem fine but they always seem to have the same values so maybe I should print others?
Code:

U1STA  : 0x0510
U1MODE : 0x8000
U1TXREG: 0x0000
U1RXREG: 0x000A

As a temporary measure, I guess I could simply reset the MCU but that's not ideal. Any suggestions or ideas on what else I should look at and how to handle this so that the code simply carries-on?

Thanks.

Ben


Last edited by benoitstjean on Sun Nov 29, 2020 8:12 am; edited 1 time in total
Ttelmah



Joined: 11 Mar 2010
Posts: 19515

View user's profile Send private message

PostPosted: Thu Nov 26, 2020 11:02 am     Reply with quote

Framing error probably.
You have to read the character. The error clears itself when a character
is read. Untill it is cleared it'll stay set.
benoitstjean



Joined: 30 Oct 2007
Posts: 566
Location: Ottawa, Ontario, Canada

View user's profile Send private message

PostPosted: Thu Nov 26, 2020 11:10 am     Reply with quote

So in the INT_UART1E interrupt, should I just do a blind getc( UART )?
Ttelmah



Joined: 11 Mar 2010
Posts: 19515

View user's profile Send private message

PostPosted: Thu Nov 26, 2020 12:22 pm     Reply with quote

Yes, the UART errors all 'attach' to the character currently at the top
of the buffer. So when this is read the errors disappear with it (unless there
are multiple errors).
benoitstjean



Joined: 30 Oct 2007
Posts: 566
Location: Ottawa, Ontario, Canada

View user's profile Send private message

PostPosted: Sun Nov 29, 2020 8:11 am     Reply with quote

Ok thanks. In the interrupt routine, I've added a simple if( kbhit()) getc();

Ben
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group