View previous topic :: View next topic |
Author |
Message |
stoyanoff
Joined: 20 Jul 2011 Posts: 375
|
Fault interrupt of 30F5015 |
Posted: Tue Jul 09, 2013 1:22 pm |
|
|
Greetings! I'm using MPlab v 8.91, ccs v4.134 and dsPIC30F5015. I have a problem with the fault interrupt. In normal conditions this interrupt makes 2 things - in sets the pwm outputs to the condition set into set_motor_unit() and it jumps to #INT_FAULT interrupt function. I want to use only the interrupt function without setting the outputs. I tried to compile the program without FAULT setting in set_motor_unit(), but in this case the #INT_FAUL doesn't trigger. I had enable_interrupt(INTR_GLOBAL) and INT_FAULTA but it seems there is something else I have set.
Can you tell me how to achieve this goal?
Thanks! |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19510
|
|
Posted: Wed Jul 10, 2013 1:01 am |
|
|
All you should have to do, is compile with the option in set_motor_unit, 'MPWM_FAULT_NO_CHANGE'. This says to trigger the interrupt, but don't change the PWM pins.
Best Wishes |
|
|
stoyanoff
Joined: 20 Jul 2011 Posts: 375
|
|
Posted: Wed Jul 10, 2013 9:22 am |
|
|
Thanks! |
|
|
notbad
Joined: 10 Jan 2013 Posts: 68
|
|
Posted: Wed Jul 10, 2013 1:03 pm |
|
|
I have a question about PWM fault input in 18F26K22 .
The datasheet is a little vague.
What are the options for using fault input and external interrupt in this chip?
Thanks
Javad |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19510
|
|
Posted: Thu Jul 11, 2013 3:39 am |
|
|
The K22, does not have a fault input like this. What it has is 'auto shutdown', where the hardware can be configured to automatically go to a 'safe' state, when a signal goes over a threshold (using the comparator), or a signal is seen on the INT0 pin. This in itself does not trigger an interrupt, but the same event that is used to trigger it (so comparator, or INT0), can itself trigger an interrupt.
Best Wishes |
|
|
|