i’ve been testing my encoders and encoder 1 doesn’t count intill the other encoder has something to count
i donno but it doesn’t seem that interrupt 1 is called intill interrupt 2 is called and vis versa.
any ideas?
Thank you, in Advanced
i’ve been testing my encoders and encoder 1 doesn’t count intill the other encoder has something to count
i donno but it doesn’t seem that interrupt 1 is called intill interrupt 2 is called and vis versa.
any ideas?
Thank you, in Advanced
Are you using MPLAB or EasyC? Are you using Kevin Watson’s encoder code? Can you post your interrupt handler code? We need some more information before we can make intelligent suggestions. Offhand, I can suggest that your interrupt handler isn’t correct in some fashion, you’ve forgotten to enable interrupts on the encoder pin, you’ve plugged the encoder into the wrong place, your encoder simply isn’t working properly or isn’t sending strong enough signals… Unless you want to spend the day running down every single random idea we can toss out, please post more info about what’s connected where physically, and what your program actually is.
The Encoders are connected to Port 1 and 2 of digital input.
i’m Using Kevins Code with Mplab
Sense i’m using the KOP Encoder i’ve changed the Interrupt handler to
if (pwm16 >= 127){
Encoder_1_Count += ENCODER_1_TICK_DELTA;
}
else {
Encoder_1_Count -= ENCODER_1_TICK_DELTA;
}
for both oh/course with the correct corresponding Motor and Encoder Count.
i’ve Enabled the Int in the ifi_frc.h, the Encoder.h and the Initialize_Encoder_1(); in the teleop.c
I haven’t Changed anything else
I’ll look at your code if you zip it up and send it to me.
-Kevin
Having had a quick look at your code, nothing jumps out. What exactly is malfunctioning?
-Kevin
I’m kind of curious if he’s updating pwm16 atomically so it’s guaranteed to be in a valid state in the ISR. If he’s left the default routine in and then updates it later in the routine he could get some odd effects every 26.2ms or so… Also, there’ always doing a clean build in case something’s gone haywire.
We figured it out. The signal was grounded through the frame. Thanks for all of the help.