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

dsPIC30F5015 FAULT pin activation problem

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



Joined: 20 Jul 2011
Posts: 375

View user's profile Send private message

dsPIC30F5015 FAULT pin activation problem
PostPosted: Sat Dec 27, 2014 7:34 am     Reply with quote

Greatings! dsPIC30F5015 has FAULT pins. I`ve connected a RC group on FAULTB. This RC group is driven by pwm pulses - the idea is if there is a problem with the pwm the controller to be shutted down. Here is the problem on power-up when I activate the FAULTB-
Code:

   ENABLE_INTERRUPTS(INTR_GLOBAL);
   enable_interrupts(INT_FAULTB);

it seems it causes somekind of glitch on the pin, discharging the C and imitating a fault condition. At this moment I`ve passed this problem as I added a software blockage for a few ms after the fault is enabled-
Code:

#INT_FAULTB
void FAULTB()
{
   if(FaultBActive==0) return;
        //code
}

I have a proper delay on power-up(1s) and after that I`m enabling the fault. I really don`t like this solution. Can you tell me what`s going on? On some reason I think PIN_D9 goes low on enable_interrupts(INT_FAULTB); for short period of time. Can you give me an adive how to bypass it without this software blockage?
Thanks!
Ttelmah



Joined: 11 Mar 2010
Posts: 19368

View user's profile Send private message

PostPosted: Sat Dec 27, 2014 9:42 am     Reply with quote

Enabling the interrupts won't directly affect anything.

However you have to remember, that the RC, will be discharged on power on, and if the fault pin is low, the fault will trigger. This _will_ have happened during power on, and the interrupt will be latched.

You need to read the fault pin in code, until it goes high.
Then clear the interrupt.
Then enable it.
stoyanoff



Joined: 20 Jul 2011
Posts: 375

View user's profile Send private message

PostPosted: Sat Dec 27, 2014 10:44 am     Reply with quote

I have 1s power-up delay. So the capacitator is charged! I`ll try to clear the interrupt, before enabling it!
Ttelmah



Joined: 11 Mar 2010
Posts: 19368

View user's profile Send private message

PostPosted: Sat Dec 27, 2014 11:23 am     Reply with quote

As I said, the interrupt will be latched.

Why wait one second?. Wait for the pin(s) to go high, then you know that the fault is OK.
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