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 support@ccsinfo.com

Interrupts. Help with GIE going down... on its own?

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








Interrupts. Help with GIE going down... on its own?
PostPosted: Sun Aug 27, 2006 3:52 am     Reply with quote

Hello, I'm aware that GIE goes down when an interrupt is being attended, but I also believe it goes back high when the service of the interrupt ends.

I'm using a PIC 18f8722 with an USART interrupt to receive/send info on analog conversions. I mean from the outside they ask me to make a conversion on one channel and then, after I read ADC's value I send it back to them in the form of a "formatted" string with the value read and the time the conversion was made at.

Also I'm using an RTC to perform the control of times/dates of conversions.

My problem is when I ask for a conversion and, while it is going I receive a second order. This is not received because GIE is zero so interrupts are disabled and USART is almost useless.

I've tried to use priorities to solve this problem giving the USART the HIGH priority, but it didn't work maybe because I did miss something somewhere.

Is there anything else apart of this to do?

#device HIGH_INTS=TRUE

#INT_RDA HIGH
and here I write the routine to attend to it

Of course I have enblaed interrupts and also added enable_interrupt(global) too. As said before everything works like a charm if I send an order, give it time to answer, then send another. My problem is when I send two orders in a row.

Ah!! I have implemented a buffer to store orders while processing others too and it seems to be working too.

Thanks for any help/clue you can give me as this is exasperating me hehehe.

Kind regards
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

PostPosted: Sun Aug 27, 2006 8:10 am     Reply with quote

Most likely the problem is not GIE going down as you put it. The problem is most likely trying to do too much in an interrupt handler causing a buffer overflow on the UART. Without a program demonstrating the problem it is hard to say exactly.
Guest








PostPosted: Sun Aug 27, 2006 9:55 am     Reply with quote

Hello Mark, thanks for your answer. I see your point and yep, it might be it. I will take a look into the interrupt handler and see if I can shorten it up.

Actually your clue seems to be a goood one!
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