Questions on timers/simulator
Hi,
My name is Dan Rasmussen and I'm one of the new programmers for team 61 (Corey Schalck, an associate of mine, is the oter programmer for team 61 but in the same boat I am). I was an FLL coach and was asked a loaded question the Blackstone Valley FLL tournament in November (do you know how to program in C?). So here I am.
I have years of experience in writing C code (I wrote C exclusively from 1988 to 1993, lots of C++ after that, now using java) but I'm fairly new to PIC programming. I have dabbled in PIC assembler using MPLAB and GPASM as well as JAL and OOPIC. I have downloaded and compiled the default code for the full sized robot in MPLAB/C18 (note: I had to add a #define _FRC_BOARD to user_routines.c to get it to compile).
I seem to be finding my way around the default code (full robot controller) which is well commented but would like to hear about best practices for dead reckoning using timed operations. For example, I see that Process_Data_From_Master_uP is called every 26.2 ms. I could put a static counter in there and use it for timed operations or are polled/interrupt driven timers the only way to go?
Finally, I spoke to Mike Norton, the coach, last night and he told me that in previous years he was able to use a robot simulator against the compiled code that would give him a visual indication of the robot movement and pin state. I haven't tried the MPLAB sim but I have a feeling that it will fall short. Maybe there is something in the FIRST kit that I need (I only have the MPLAB/C18 downloaded from Microchip). Am I missing something if I only have the downloads from Microchip?
Thanks for any help.
Dan
|