This year our team is planning on using the camera as well as the KoP gear-tooth sensor. We have gotten both to work successfully but they are in different MPLab Workspaces. I tried adding some of the interrupt files over and I got some errors on the definitions of the PIC processor. This is over my head so any ideas and help are welcome!
Did you use Kevin Watson’s code in the begining? or built you own code for gear tooth sensor?
If you modified Kevin Watson’s code, you could try to find all the variables you actually used and compare it with kevin watson’s new code.
Well, I think you know about this so I’m not going to talk about it more.
try to compare the defined variables in the default code. (kevin watson’s)
that might give you some idea what had been changed.
I used both of Watson’s FRC codes. For the interrupts and for the camera, I was doing that as far as I could determine but I found problems once It got into compiling processor definitions
Then, only think I could think of is to re-write the code.
If you understand your old code fully, it is not so hard to do that.
copy the main functions from the old code and try to combine old and new together
Run it through a tool like WinDiff to make sure you copied it all over.
Camera uses interrupts for serial communications.
Encoder (gear tooth sensor) outputs should be connected to i/o pins which generate interrupts.
In the Kevin Watson code:
The interrupt routine (see user_routines_fast.c - InterruptHandlerLow) in the camera example only has code to handle the serial port interrupts.
The interrupt routine in the encoder (gear tooth sensor) example has code to handle the serial port interrupts as well as the i/o pin (connected to the encoder outputs) interrupts.
So, when you combine your workspaces use the interrupt service routine from the encoder example.
Thanks for all the help guys! I brought my CompSci teacher (who is our mentor) to help on this.Took us a couple of hours and lets just say we got VERY deep.As into the compiler. But if anyone needs the code let me know vmarmol@gmail.com