Default code problem

I don’t know why, some time after turning on the robot and driving with it, the robot stops and the robot controler indicates program error (the led of program state is blinking red), so it doesn’t work anymore. And in the OI the pwm[number] leds are not working (instead of green and red for forwards and backwards, its only blinking red).
I’m using the frc default code 2005 for mc18 2.4, have already updated the firmware and have mc18 2.4 and mplab 6.62.

If someone knows what’s my problem please tell me!!

It usually means you have hit an infinite loop in your code or something else prevents it from doing a Putdata fast enough to satisfy the Master processor, but you can use the Dashboard Viewer to get more information about the “blinking red light” error.

“Make sure your OI and RC are linked via tether or radio, connect your PC’s serial port to the DASHBOARD port on your OI, make sure the OI/RC jumper is set to “RC”, and you will see details about the type of error which caused the flashing red LED at the bottom of the Dashboard Viewer window.”

Sometimes we get the blinking red light (Code Error) with the default code when we’re driving with a low Main Battery and no Backup Battery.

If you see the voltage dip on the OI a lot (hit the select button a few times, and it will eventually display your main battery voltage) after driving, you might be under-volting the RC causing it to code error.

This happend to us quite a lot after a few minutes of driving Blizzard 5 (6 motor, 4x8" wheel drive with really grippy wheels).

If batteries were not fully charged, all it took was a couple seconds of all-out high-gear spinning on axis to cause the problem.


thanks a lot!! :smiley:

i think that one of this “things” that you’ve said will solve my problem here :wink:


Now I’m really confused!! Even putting a charged 12V battery, and the charged backup battery, it continues to get the same error :stuck_out_tongue:

And, a curious thing: The program freezes in exactly 45 seconds!!

make sure the gyro is unconnected while trying to set the camera up to reconize the colors (callibrating). I found this will mess the program up and make the camera send bad pictures. Once it is first callibrated, then plug in the servo. How do you have the java program AUTOMATICALLY control the servo according to where the red blue or green tetra is?

Try redownloading the default code. Sounds stupid, but you never know…

The default code v2.4 with camera support does this to let you know it hasn’t established communication with the CMUcam. If you aren’t using a camera, you should probably be using default code v2.2 instead.

If you are using a camera, the blinking red LEDs on the OI mean there is something either not connected, connected improperly, or just plain broken. That might be a clue to why your program freezes reliably after 45 seconds.

Yeah, you’re right… we’re not using the camera yet, and that was the reason for the error on the RC.
So we have downloaded the 2.2 default code, and it’s working all right now :cool:

thanks a lot!!! :smiley:

Actually, the 2.4 default code can be compiled without the camera support and then you can later turn the camera on. Just go to Project/Build Options/Project and click the MPLAB C18 tab. If you remove _USE_CMU_CAMERA, the camera code will be ignored by the compiler.

Alternatively, you can edit user_camera.h and comment out the #define FREEZE_ON_ERROR. This define causes the blinking Red lights and the controller errors if there is any communication problem with the camera.

On a separate note, has anyone seen the tracking packets from the camera quit after some time when Kevin’s gyro code is integrated into the 2.4 default code? I’m suspecting an interrupt conflict or corruption between the gyro’s 400hz interrupt and the camera’s serial port for receiving the T packet data. Anyone seen anything similar?

Lynn (D) - Team Voltage 386 -