|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
Re: Disable Encoders Problem
Quote:
good luck, and if I can help, gimme a yell. -Q |
|
#2
|
|||
|
|||
|
Re: Disable Encoders Problem
I've never understood the && with the enable bit in the interrupt handler. If the interrupt isn't enabled, there will be no jump to the interrupt vector so that test will never be executed. Without the interrupt enabled, it's just an ordinary input pin.
|
|
#3
|
||||
|
||||
|
Re: Disable Encoders Problem
Quote:
-Kevin |
|
#4
|
|||||
|
|||||
|
Re: Disable Encoders Problem
There is only one (low-priority) interrupt handler. It will be called when any interrupt occurs, and the handler has to check all the possible sources in order to service the interrupt properly. The program won't know not to deal with a flag for a disabled interrupt unless you also check the associated enable bit. You don't really want a serial port interrupt to end up running the service routine for a "disabled" encoder.
|
|
#5
|
|||
|
|||
|
Thanks for all the help.
|
|
#6
|
|||
|
|||
|
Re: Disable Encoders Problem
Quote:
This is where I part company with MicroChip's implementation. If you don't enable the interrupt, it should never set the interrupt flag for that interrupt, in my opinion, because an interrupt should not have occurred. I guess one more reason I'll probably opt for something other than PICs for my personal projects. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Autonomous enable/disable | Culvan Van Li | VEX | 4 | 21-09-2006 13:03 |
| Bypass Disable Switch | jakep | Control System | 36 | 19-08-2006 12:46 |
| Question about human disable | Collmandoman | Programming | 6 | 10-03-2005 23:30 |