![]() |
Calling Incorrect Interrupt Handler
I'm having a few problems with my program, and I've spent quite a while trying to figure out how to fix them, to no avail.
I am using Kevin Watson's encoder driver. I did encoder testing on the EDU RC, and everything worked fine. I switched to the FRC RC, and I have hooked up the encoders as stated in the file description. So, DIG IN 1 should cause interupt 2, which will in turn call the Left_Encoder_Int_Handler(). I do not have an encoder hooked up as the right side encoder (dig in 2) The encoder itself is working fine, but it increments the right side variable instead of the left. Also, when I plug the encoder into dig in 2, which should handle the right side encoder, neither right or left gets incremented. I have configured my phase B pins in the correct way, but I dont think this is part of the problem. Does anyone know what may be wrong? |
Re: Calling Incorrect Interrupt Handler
Tom,
On the RC, DIO1 is tied to interrupt 1 and DIO2 is tied to interrupt2. Are you trying to run the EDU code on the RC? If so, be advised that they are not compatible. Regards, Mike |
Re: Calling Incorrect Interrupt Handler
Quote:
Quote:
Quote:
|
Re: Calling Incorrect Interrupt Handler
Mike,
I am not using edu code on the bot, at the time i was using Kevin's EDU-Encoders workspace, but now I am using the FRC-Encoders. I am pretty sure pin 1 is INT2 From user_routines_fast.c... Code:
if (INTCON3bits.INT2IF && INTCON3bits.INT2IE) /* The INT2 pin is RB2/DIG I/O 1. */ |
Re: Calling Incorrect Interrupt Handler
Quote:
-Kevin |
Re: Calling Incorrect Interrupt Handler
I am having the exact same problem. I could swear that the encoders even worked correctly a day or two ago! I have checked the connections several times - the left encoder's phase A is definitely on pin 1, and its phase B is on pin 6, but turning the left encoder increments the right encoder count and turning the right encoder does nothing at all. However, the left encoder count does change from 0 to -1 when the right encoder count is less than 0. I have gone so far as to simply compile and load the Navigation_FRC demo from kevin.org, but I still experience the problem. I have also switched encoders, encoder cables, and FRCs. Can anyone offer some advice?
|
Re: Calling Incorrect Interrupt Handler
This sounds strangely like a problem I just had. It turned out that nothing was wrong with the encoder code (of course), just a printf statement.
Note that Get_Right_Encoder_count() returns a long! So you cannot just put it into a printf with a %d type. If you have 2 %ds, you will get 1/2 of the long for each one, the upper part is usually 0. The thing to do is to use %ld to let printf know to expect a long value. |
Re: Calling Incorrect Interrupt Handler
Quote:
|
| All times are GMT -5. The time now is 15:23. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi