Code Error when I try to program it

I am new to programming, but Mark McLeod from Team 358 helped me learn the basics yesterday.

Now my problem is that when I try to program the robot today, and download the program into the board, and I press the program button on the FRC Robot Controller Board to get the Program State LED solid orange, the Code Error LED on the Operator Interface was showing solid red. And on the computer screen, it said that I have to get the Program State LED solid orange when it already is.

We had this problem yesterday too when Mark was helping us with it. So we used his computer to program it which worked.

But since I am trying to put more commands on the programming, I wanted to download the program I wrote to the robot controller.

Don’t worry about the LED on the Operator Interface (OI). The OI doesn’t have the actual code from the robot on it, so it lights up the Code Error LED if the robot should be running (according to the OI) but is not sending signals back. Thus, when downloading code, the code error LED should be red, since the robot has no working code. As long as the program status LED on the robot is solid orange, you should be fine - you don’t even need the OI to download.

what you need to do is pull out the .hex file so that it will download to the robot we had the same problem but u NEED to use the .hex file on the ifi loader to have it transfer to the robot mesage us if you need any more help if it does not work ok.

                                                             your friends @,
                                                               team 1165

                                 :) :) :) :) :)

Heres my $.02

If you are using the IFILoader that comes with easyC, you HAVE to download the program FROM easyC. This is at least the experience I had yesterday. Simply using a .hex file with the loader doesn’t work.

Also, I can’t get my RC to go into program mode without the OI connected. Any thoughts here?

The Code error light on the OI only lights up for two major events, if you indeed have a code error within you code OR you are in program state.

Now, if you upload your code AND the light remains orange, it means that the code was incomplete. I got this error alot last year, our USB to RS-232 (Serial) adapter was loose and the cable was not connected properly.

Also be sure you have the most updated version of the IFI Loader. (If you installed the programs from the discs included in this years KOP, then you do.) We were had problems until we noticed that we had an outdated version of the uploader.

One more thing to check is the computer you are using. I have notice that certian computers encounter problems when trying to download; they either detect the connection wrong or will stop uploading part way through. This happened with one of our team’s coach’s laptop.

Now, I am fairly sure that you CAN upload the code to the robot when no OI is connected. I know that the User Processor requires the OI to be connected.

I dont see how you HAVE to use EasyC to upload EasyC files, a HEX file is a HEX file.

Have you tried connecting the computer to the dashboard port on the OI and using the Dashboard program on IFI’s website? It gives you error codes and reasons for the Error Light.

Are you using a USB to Serial converter? We’ve found some USB to Serial Converters will either die or fail to upload one way or another. If your using the latest IFI Loader, and your code was able to be uploaded when using a different computer, this sounds most likely.

If your using a serial port, or you are sure your USB to Serial converter works, the only other thing I can think of that hasn’t been mentioned, is sometimes the controller just won’t let you load code and you have to do a master reset (happened like once during the 3 years I’ve been in FIRST), hold both prog and reset, then I think let go of either prog or reset (can’t remeber), but the right one will leave only the green power light flashing, when it stops flashing you can let go and load code.

We use the IFILoader from EasyC even though we compile with MPLAB. And I don’t think you need the OI connected to download.

Ive been trying to download this program onto the board and it just wont do. It kept saying that “To enable download, hold the ‘PROG’ button down until the ‘PROGRAM STATE’ LED is solid orange. Make sure that power is on and the serial cable is connected.”

The PROGRAM STATE LED is solid orange, and the power is on and the serial cable is connected.

I had the whole thing set up right but it just kept saying the above mentioned quote.

Oh and the code error LED just turns solid orange everytime I press and hold the program button to have the Program State LED solid orange.

So where is my problem here? On the computer? On the program? Or the USB to Serial connector?

The Code error Light on the Operator interface is supposed to turn red when you are in program mode.

Now, if the robot automaticly sets the Program State light to orange when it gets power, you still have to press it down for 4-5 seconds.

There are a few things to check, first make sure everything is wired and working properly; you could have a faulty DB9 Cable. Make sure you are plugged into the program port all the way. Now, if you are using a Serial to USB, Make sure you have the correct COM port. The Adapter will sometimes pick a different com port each time you plug it in (Ours will change COM ports randomly, I’m really not sure why).

You can check for the COM port in device manager. to get to Device manager, right click on My Computer, then click properties. I can’t remember on which tab device manager is (I have vista), so click throught them to find it. in Device Manager, you should see an entry for Printer and COM ports (Or something similar to that). Open the List. You should see you adapter listed with the COM port listed after it.

the COM port isnt a problem because I figured that i have to use a certain COM port. So I got that working.

Going to the device manager is a problem because I am using a school computer to program it and it has SO MANY restrictions.

Maybe we do have a faulty DB9 because when Mark McLeod went to my school to help us with programming, he used his own laptop that doesnt need a DB9 to connect. It had its own built-in port. So maybe the DB9 is the problem. Im not 100% sure about that though, so if you guys got other ideas to help me upload the program in the controller, then please just let me know. I tried every single thing that you guys said and it still didnt work. Maybe it is the DB9 because thats the only thing we havent tried (I mean using a different one).

If you can, find another laptop with regular serial ports. It doesn’t have to be powerful, we used a PII our first couple years. Make sure you use the new black cables in the KOP. Run IFI loader 1.10 *.hex files using a Flash Stick to verify correct operation.

It may be the restrictions the school district is placing on your user account. Industry and schools get a little carried away with security because some hackers love a challenge. Restricting serial ports is not unheard of.

It might also be interrupt errors within the laptop your using. Sometimes other devices use the same interrupts. This problem existed more with Win98, WinME, and some Win2K installations. XP doesn’t care.

Also check the settings of the serial port. I think the settings are 115K baud, 8 data bits, 0 stop bits, no parity. Check the IFI Programming tips manual to be sure.

Download into the robot the default.hex file from FIRST. This should ALWAYS work if no changes have been made to it.

If the above does work, then you have a program error in your code. That Dreaded red light of death ( or orange in your case because it happened so fast) does appear quick if there is a While loop error in Initialization.

I hope this helps.