|
Re: Can't enter Vex autonomous mode when using MPLab
I haven't looked at the vex MPLab code in a while (that'll be changing shortly) but if it's going off interrupt 6, are you sure you're not accidentally mangling that bit in your code somewhere? The aliases file tells me it's PORTBbits.RB7, aliased as rc_dig_int6. If you're doing anything with these somewhere in your own code, it could account for the wackiness. Similar wackiness could probably occur if you're doing anything with TRISB and as a remote possibility, any of the INTCON registers.
Looking at the rest of the code, you can't really screw up the setting of the autonomous mode bit, but you can screw up actually going into autonomous mode if you've made improper changes to ifi_aliases.h, main.c, or user_routines_fast.c. Since it sounds like it's going into autonomous mode with the channel 5 trick, I think you're best off making sure that you're getting a proper value from interrupt 6. You should just be able to toss in:
printf("%2x\n", rc_dig_int6);
somewhere to read the value you're getting from interrupt 6. Then put the jumper in and out and make sure it's changing properly. If it's not... well then you know you're doing something wrong somewhere, or you're got a bad controller.
__________________
The difficult we do today; the impossible we do tomorrow. Miracles by appointment only.
Lone Star Regional Troubleshooter
|