Programming Problem: Extremely Frustrating

We were programming fine, everything was going well. Then we started getting an error. The program light on the robot controller would switch between red and green blinking very fast. Somehow, we don’t know how, we were able to fix it. Then we got the same problem again, and now we are stuck. The two similarities between the two cases was that a person tried to download the new code into the robot while the program light was green and not yellow. I have searched many forums relating to this issue and this is what I have done so far to try and fix it:

  1. We tried the hold down reset and program, release reset, release program, download, reset method

  2. We have tried the hold down reset and program, release program, release reset, download, reset method

  3. We have checked our batteries.

  4. We have checked the connections

  5. We have checked the wires

We have also checked the radio signals. The joystick controller signal says transmit, but the robot controller signal says stand by. I think our problem is that the program won’t run until the robot RC signal says receive. That is what i think the problem is. Can anyone tell us how to fix it? Also, can anyone suggest what else the problem might be and how we can fix it. Thanks.

Team 612

We were finally able to download, however the only thing that seems to work is the FRC_Default code. When we build the new FRC code, without ANY changes it will not work correctly. Our code from last year will not work. The only thing working is the FRC_Default Code. Can anyone explain to us why this is happening?

once again thanks,

~Team 612

I’m not sure what could be wrong… but have you loaded the new firmware onto your controller? Available here. Maybe that can help shrugs.

Unplug all radios and tether.

Download the latest firmware.

Download the default code.

Plug in the OI via Tether.


Try downloading your code.

Does the default code work?

If you can back out to very simple, “known good” conditions, and it still doesn’t work, you may want to call IFI. I had trouble with the IF loader last year and they were very helpful.

But first try to eliminate as many suspect things as possible, things that IFI cannot vouch for, which means your code and any extra connections. Back off to the default code. Unhook all unnecessary wires until the only wires you have are those required to test download and running.

Get the new firmware and make sure you have the new compiler 2.40. Apparently last year’s compiler does not support stuff in the new firmware.

We just did the firmware. Also the default works fine. We built the original code with no changes at all and sent it to the machine, and it did not work.

-downloaded firmware

-default code works fine

-compiled unedited code and did not work

-we also had it working fine and were editing and getting it to work, until we put this line of code in:

printf(“potval: %d”, Get_Analog_Value(rc_ana_01));
note: I know that is not the right method/variable, but we did the right one, i am just on a different computer with internet to type this and can’t remember it

so as i said until we put that printf in it was working fine, then when we took the printf out it didn’t work

thanks for the help and keep it coming

Is there any chance you could use Dashboard instead of printf statements?

Last year we had the same problem (program light flashes red/green quickly). Our problem was we had a printf before we called Initialize_Serial_Comms().

It was a tough bug to track down, because every time we uploaded the program it worked until we reset the robot. Once we reset it started doing the red/green flashing.

Does it not compile, or does it compile fine (no errors), but just doesn’t download? If it’s the first, then it’s probably something like the printf library isn’t ok for some reason/you have to included it, but if it’s the second (which I think you’re saying it is), then… leave it overnight in a cold work building with no power, reset it the next time you see it, and pray. Time solves all problems. :wink: But, it may seriously just a weird hardware error which will be fine after it gets a chance to cool down.

The code compiles fine without any error. But after downloading the code into the Robot controller, all the lights on it start blinking rapidly. Even if compile the default code(without any changes in it) and then download it, it has the same problem. But it responds perfectly when we download the “FRC_default.hex” into it, instead of “FRCcode.hex” We tried shutting it off and turning on after few hours, it doesnt work. We are having this problem for the past whole week. Any kind of help is appreciated.
Chantilly team member.

I suspect the compiler because from the symptoms it sounds like compiling the default code does not produce an identical .hex file.
A couple of possible reasons this could be happening are:

  • The wrong PIC has been specified and the compiler is producing a .hex for a different model
  • The complier is the wrong one
  • The linker file is incorrect

What is “PIC” . We also suspect there is a problem with compiler. But we downloaded and installed the new compiler C18 version 2.40 . We tried to installing it and then compiling it, but the problem does not go away. Also what is “linker file”. please specify .
Chantilly team member.

When you installed the new compiler, did you make sure all the options were checked? I assume you installed the new version of MPLA IDE 7.0 before installing the compiler, right?

Is the newer version of MPLAB IDE included in the First CD ? Is that version 7.0 ? I installed it from CD, but I think I have version 6.x . Do I have to uninstall the earlier version before installing the previous version of both the IDE and the compiler ?
Chantilly team member.

The MPLAB most of us are using is not the one that came on the kit CD. It’s free to the general public. Pick it up from here:[font=Verdana][/font]](
[font=Verdana]The version doesn’t really matter, but later on when you have questions it’ll be easier if we’re all using the same copy.[/font]

[font=Verdana]If you reinstall any of these, make sure to uninstall the old versions first.[/font]
The computer we are programming on the RC is a Microchip PIC18F8520, one of hundreds of types available.

The linker file gives directions on how the physical space on the RC is divided up. Don’t worry about it since I doubt it’s causing your problem now. It’s the file 18f8520user.lkr in the FrcCode_1_7_2005 default project folder.

You have to have the OI and the RC connected to download the master code.

The problem is not going away. I tried installing new compiler and master code. But still it does not respond to any other downloaded program except “FRC_default.hex”
Its very frustrating…
chantilly team member.

For what it is worth, we have had a very similar problem. Compiling the code out of the box doesn’t work. We spent a long time verifying all the hardware (FRC, serial ports, camera) was ok (it was).

We were able to get stripped down versions of the code to work, then slowly added back the missing pieces. Eventually it failed when we included enough code - even though that code was not being invoked. We verified that we are nowhere near the memory limit when this happened - we are using around 30% of available memory. We’ve checked all the settings in MPLAB - right processor, compiler and linker options, starting address to download and linker file. We’ve scoured the map file, to no avail.

Now we’ll try the unistall/reinstall route - we’ve pretty much run out of other options.


Chantilly Team Here, it turned out we had done everything right, except for one problem, our computer was too old. It wasn’t even a P1, so I guess it couldn’t handle this years code with the camera in it. After struggling to get a new computer, the school finally gave us a windows xp laptop, P4 i think, and everything is working fine. Im not sure how old your computer is, but if it is somewhat old, or not the best computer, try reinstalling everything on a newer computer and working from there. Hope this helps.

Nothing like coming to the end of your rope to find the solution. We reinstalled MPLAB, the compiler and the loader, and everything works fine. Too bad we lost 10 days of programming time. On the other hand, we really understand a lot about the tools now!