How to download program to robot?

Hello everyone. I’m on a first year team and we are having a little bit of trouble getting our program to download. If someone could give me a step by step guide to downloading the program, or a link to how to do this it would be great.

The short version:

  1. Connect the robot. Use the programming cable (black) to connect the computer serial (RS-232) port to the programming port on the robot controller (RC)

  2. Press the programming button on the RC, hold it for a few seconds until one of the lights turns orange (I think it’s “Program state” but not sure. Robot turned on, of course!)

3 With the program open on the downloading computer, press F7. If it compiles OK, hit enter to download the program to the robot. If it does not compile OK, you have to fix that first.

That’s about it.

Can I just download the IFI source code hex file to the robot?
Another question… do I have to hold the program button down as I turn the robot on?

You could, but you most certainly want to rebuild it with code that you’ve added.

Another question… do I have to hold the program button down as I turn the robot on?

No. Hold it for a second or two after you’ve turned it on.

Please excuse my noobness, but is there something I’m missing? We have downloaded the source code to the robot, the joystics are plugged in, we have to victors plugged into pwm 1 and pwm 2, and moving the joystics still causes nothing to happen on the robot. Is there a common mistake people make doing this their first time?

Have you configured your OI to interface with your robot controller? Make sure you program your OI with your team number (Use the Team Number switches and use binary logic to make your team number), then hook your OI to your robot controller using the tether (red) cable. Don’t forget to hook your radios up after that if you aren’t using the tether :slight_smile:

Well…there’s quite a bit that could be wrong. Here are a few possibilities:

• First, are all five lights on the robot controller green or green and flashing? If not, there could be something wrong with your code, the link between the Operator Interface and the Robot Controller, or any number of things.

• Check to see that the PWM cables are plugged in correctly. On the Victors, the black wire should be closest to the fan (there’s also a small “B” there), and on the robot controller, the wire colors are marked before the rows of pins.

• Check to see that you don’t have bad PWM cables! If the controller is on and working (all lights are green/green and flashing), yet the LEDs on the Victors are orange AND FLASHING, you probably have a bad cable. When the Victors are receiving a neutral signal, the LEDs will be solid orange.

• Did you change the code at all? If you did, the program may be sending something other than what you intended to the Victors. Make sure you didn’t comment out any drive code you meant to use.

This list is by no means complete, but it should provide a decent starting point.

Check the pwms going from the RC to the Victor. On the Victor, there is a little “b” where the black wire should go, and on the RC Im pretty sure its labeled. Make sure your pwms are plugged into pwm outputs 1 and 2. If that still doesnt work, whats are the lights on the OI and RC doing?

The code has not been modified at all. All LED’s on the robot interface are flashing. the “power on” “data TX” and “valid rx” are flashing green on the operator interface, and also valid rx on the operator interface under the “robot controller” column. The pwm 1 and pwm 2 leds light up on the OI when the joysticks are moved. The lights on the victors are solid amber and don’t change. do “channel” or “disable” need to be configured on the OI?

Did you try doing what I had suggested earlier? Your bot won’t communicate unless your RC knows which OI to talk to.

yes, our operator interface is displaying our team name. Do I have to put our team number in the code somewhere also?

Try tethering the robot to the OI. To tell the Robot controller which OI to use, it must be tethered when setting the team number. Simply toggle one of the team switches to force the Robot controller to learn the team #.

Thanks for all your help, unfortunately we couldn’t get it working and gave up and went home. Our main mentor(electronics and programming) went on a cruise to Jamaica:rolleyes: and I’m totally clueless on how to get this to work.

If you’ve done everything suggested here, read the IFI documentation (here:, you could always try asking a veteran team in your area if they would come over to help you guys out. Im sure they would be happy to.

Our team is having a little bit of a similar problem, however we are working with the robot we built last year and its control boards and we are using EasyC. This is my first year and I have no experience in programming robots to actually do something in real life :smiley: … so what I did in EasyC was I created a new standalone project because I read this is what you have to do to test your robot and have it just run.

I had the serial port connected to the laptop and the robot controller board, and the board was on as well as the robot.

In Main(), I put in some easy code just to test if the robot would react:


Then I downloaded it to the robot by pressing F7 and remembering to hold down the PROG button until Program State turned to red. It uploaded fine, the robot was on, and none of the motors were moving.

So I thought, I’m missing something in my code, something on the robot is broken, or I don’t know how to run the code on the robot. Do the boards from last year work for this year? Also, does the Operator interface have to be connected to the robot, even though I don’t need it to take any commands from the operator? Can anyone help me out? Thanks a lot.

With you saying HEX file I’m assuming that you are using MPLab and the IFI Default code and loader. If you look at the default code under 1 Joystick Drive you will see the Default PWM placement is:
**Left 13 **and **14
Right ****15 **and 16
Your joystick should be plugged into Joystick Port 1

I sent you a Private Message with even more detailed instructions

If you are putting this code in the OperatorControl section of EasyC you do not need the while(1) statement. Make sure you tether your robot (with the red cable) after you set your team number on the OperatorInterface so it can automatically set the team number in the Robot Controller also.

After you tether you can then disconnect the cable and hook up the 2 radios to their respective ports and use the AC Adaptor.

Controller Boards from last year will work on this years robot for testing purposes. I would put a label on your radios (2007 and 2008) so they don’t get interchanged.