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

Artificial Hardware Interrupt

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



Joined: 25 Jan 2007
Posts: 2

View user's profile Send private message

Artificial Hardware Interrupt
PostPosted: Thu Jan 25, 2007 11:30 pm     Reply with quote

Hi. Forgive my ignorance I'm a PIC & CCS newbie. I've inherited a project based on CCS 3.249 & a PIC16F628A. The PIC has several GPIO lines configured as edge triggered interrupts. The related interrupt service routines are complex but work as expected except at powerup. In some cases the interrupt events are missed as the edge transitions have taken place prior to processor initializatioin & interrupts enabled. There are several paths I can take to resolve the issue but it seems to me one of the easiest & lowest risk ways of resolving the issue is to artificially induce a hardware interrupt after processor inititalization is complete. My questions are: Is this possible? Is it safe? If possible, how?

Thanks in advance.
Neutone



Joined: 08 Sep 2003
Posts: 839
Location: Houston

View user's profile Send private message

PostPosted: Thu Jan 25, 2007 11:45 pm     Reply with quote

I think you just need to read the port after initializing.
Humberto



Joined: 08 Sep 2003
Posts: 1215
Location: Buenos Aires, La Reina del Plata

View user's profile Send private message

PostPosted: Fri Jan 26, 2007 3:08 am     Reply with quote

Quote:

The PIC has several GPIO lines configured as edge triggered interrupts.

It will be helpfull to see how did you configure these lines.

Quote:

The related interrupt service routines are complex but work as expected except at powerup.

Adding to Neutone comment: you should disable the interrupts during init, read the
inputs and after this you can enable interrupts.
Anyway if you need better help you would post a code.

Humberto
Mark



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

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

PostPosted: Fri Jan 26, 2007 7:01 am     Reply with quote

If these events occur before the PIC is "up and running" then your best bet is to make sure the PIC comes up first or either past events shouldn't matter. You really don't give enough detail about the hardware and why it is important to handle past events.
twibb



Joined: 25 Jan 2007
Posts: 2

View user's profile Send private message

Artificial Hardware Interrupt
PostPosted: Fri Jan 26, 2007 9:16 am     Reply with quote

Thanks for the input. As I mentioned I inherited this project & I'm still investigating how, what & why it works. Our board interfaces with external hardware that we have no control over. This external hardware generates the interrupt events so I have no control of their timing. As I mentioned the interrupt service routines work as expected after power up is complete & new events are generated. It would seem simple to just poll the I/O pins for state & act accordingly but the I/O interrupts trigger timer interrupts & after timing related decisions are made the main software acts accordingly. Since I didn't write the software I'm looking for a low risk way of fixing the problem without major modification to it's operational theory. If artificially inducing a hardware interrupt isn't possible, simple & safe....I'll pick another path.
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