View Full Version : Intermittent Code Error
Every once in a while, (0-1 times per match) our robot disables itself and the code error light comes on... requiring the drivers to push robot reset to clear the error and continue playing. This has happened on more than one RC, so it probably is a problem with the code.
Now... this happened at a regional and the IFI representative there informed me that his scanner picked up an "Invalid CONTROL or CURRENT_MODE byte" error.
Looking at the code... the control and current_mode bytes are the last two bytes of txdata. However, I am not using them in the code at all... nor am I using the bytes immediately prior to them (essentially ruling out a runover memory leak).
This problem is not dehabilitating... but it has been nagging me for a while. Does anyone have any ideas/theories as to why this may be happening?
Thanks,
Plloyd
You should try re-installing your firmware, do you have version 10? (They should've checked to made sure at the regionals, but they might not have)
Hey Plloyd,
Can you describe when this actually happens in the game?
We had a similar problem for a couple of practice matches in which we had blocked out our autonomous mode, so sometimes when the went from auton to user-controlled mode, the code error on the RC would light up and robot was disabled until reset was pressed. It turned out that while blocking out the auton mode we had blocked out the entire code including the getrxdata and putrxdata commands which lead to the error. As soon as they were put in the problem stopped.
Hope this helps, if you could describe your problem and your code in more detail it would be great.
Take it easy,
Vivek.
Chris Hibner
08-04-2005, 17:17
Did you make any changes to the serial communication portions of the default code? This can cause your controller to hang up.
Unfortunately, I have not been able to pinpoint a specific action which causes the code error (or makes it more likely to occur)... but for the most part the robot performs and operates perfectly.
I am using firmware version 10 and have not modified any of the write protected files in the default code (that includes the serial communication functions)... but I am using hall effect sensors (basically just kevin watson's encoder code), and a gyro (again, kevin watson's).
Any help is appreciated.
Thanks,
-Plloyd
This has happened to me. I suspect that it is as a result of the main loop taking too long to execute (because of the interrupts...). It is just a speculation, but it may be correct.
Kevin Watson
08-04-2005, 23:58
This has happened to me. I suspect that it is as a result of the main loop taking too long to execute (because of the interrupts...). It is just a speculation, but it may be correct.Yes, this would be my guess as well. How many (peak) interrupts per second are being generated? Does this happen when the 'bot isn't moving?
-Kevin
ColleenShaver
09-04-2005, 00:01
We had the same problem our first regional and it was more of a hassle than anything (we have a gyro that takes a few seconds to recal everytime the robot resets). The IFI Rep gave us the same feedback as you as to what it was showing. It was occuring at various points in the match too (auto, switch from auto to operator mode, during operator mode). In the end it ended up being what Joel was saying above and it was a problem with the interrupts and how many times per second they were being called (I'm not programmer, so my guys can correct me if I'm wrong).
We just modified that and we have not had an issue with it since (knock on wood).
I believe we are running the gyro at 400Hz, and the hall effects can trigger up to 20 interrupts per cycle (total). Does that sound excessive?
I had also thought that the code may be taking too long to execute (since the code error light is supposed to indicate an infinite loop), but I dont think that we have had any code errors during autonomous mode... which has a lot more calculations to go through than our default routine. Does anyone have any ideas that could explain this?
As for when this happens during the match, I honestly dont know. I will definitely be asking the drivers and coach more questions next time I see them.
Thanks for all the responses... this has been really helpful.
Thanks,
Pete
EricS-Team180
09-04-2005, 21:37
If you don't need the Hall Effects while running manual mode, your could turn the interrupts off in Default_Routine
Thanks,
Eric
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.