Go to Post Long post, I know, but to sum it all up, power house teams are a resource, not an enemy. - Michael Corsetto [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 05-10-2005, 17:00
ajsetter's Avatar
ajsetter ajsetter is offline
Registered User
AKA: Andrew Setter
FRC #1741 (Red Alert Robotics)
Team Role: Mentor
 
Join Date: Oct 2005
Rookie Year: 2004
Location: Indianapolis
Posts: 12
ajsetter is an unknown quantity at this point
Compiling Help!!

We're using the Microchip MPLAB version 7.00 and the C18 v2.4 compiler. We can load the pre-compiled code (FRC_default.hex) to the robot with no errors and it works just fine. Our problem is when we try to compile the code (that FRC_default is supposed to be compiled from) with no changes whatsoever to the code and load it to the robot, we get a program error (as in the program state LED on the robot controller is flashing green and red). We expierenced this problem last year as well, but i can't for the life of me remember what we did to fix it. It obviously seems to be a compiling issue because the pre-compiled default works fine. I have tried useing different computers to compile but nothing is working still. Any help from anybody would be great, thanks.

-Andrew
Team #612
  #2   Spotlight this post!  
Unread 05-10-2005, 21:50
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,800
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: Compiling Help!!

Well there are several reasons this could happen.
Start with making sure you are compiling for the correct PIC version.

In MPLAB under Configure->Select Device does it show "PIC18F8520"?
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
  #3   Spotlight this post!  
Unread 06-10-2005, 20:12
ajsetter's Avatar
ajsetter ajsetter is offline
Registered User
AKA: Andrew Setter
FRC #1741 (Red Alert Robotics)
Team Role: Mentor
 
Join Date: Oct 2005
Rookie Year: 2004
Location: Indianapolis
Posts: 12
ajsetter is an unknown quantity at this point
Re: Compiling Help!!

Yes, the select device shows "PIC18F8520" However I have contacted older members of the programming team from previous years to see what they did to fix the problem. Our setup is as follows: an old p2 desktop with windows 2000 pro and all updated microlab, compiler and ifi loader (has 2 serial ports), our other computer is a p4 windows xp pro laptop with no serial ports, only USB slots, it also has all the updated software. As I was told from last year, when we had this problem, we just switched to using the new laptop (with a usb to serial converter) and everything was fine. Well our converter was stolen in between last year and this year, and we haven't been able to get our new converter to work yet. We can still edit and compile code on the laptop but it wont transfer to the robot. The old p2 computer will transfer the code to the robot, but only the FRC_default gives us no error, any other hex file we try to send to the robot (wether is was compiled on the p2 OR the laptop) won't work and gives us the bad code error. Maybe the old team is right and if we can just get the new usb to serial converter working on the laptop then maybe it will work. We are using a Bafo Technologies BF-810 converter and we've checked all the bitrates to make sure they match up and windows also recognises it as a usb to serial converter in COM2 but ifi loader still wont transfer the code (it gives the "make sure the program state LED is orange" error). I trust the old team members that once we get the laptop working, everything will work, so any help with this problem would be great as well. Thank you so much for you time.

-Andrew
  #4   Spotlight this post!  
Unread 07-10-2005, 09:44
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,800
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: Compiling Help!!

Quote:
Originally Posted by ajsetter
... in COM2 but ifi loader still wont transfer the code (it gives the "make sure the program state LED is orange" error).
I've sometimes seen this when using the COM port claimed by the manufacturer's manual on the new USB converter. The device seemed to be there, but it really wasn't. Try ignoring what port they declare it will be on and test it with each of the other ports one-by-one anyway. I had one from Radio Shack that said it was supposed to be in COM3, and I got a similar error. I actually found it worked on COM4 instead. That's one of those things you have to watch out for in software, making the assumption that the documentation is actually correct. My basic assumption is the documentation always lags what gets delivered, so it's up to me to discover the errata. Don't believe what you read, especially if you can easily test the alternatives.

Select the different COM ports one-by-one in IFI_Loader under the PortSettings pull-down and send.

It could also happen of course if there is other software, e.g., Hyperterminal or something like that, running on your PC that's trying to claim the same port. You can try disabling all unnecessary software running on the old desktop PC.

After you've attempted to downloaded the compiled HEX file and get the error message, does restarting the controller get it out of that state and back to regular operation, or must you redownload the default HEX file before you can drive your robot? I'm just wondering if any transmission takes place at all. Also, I assume you know you are really succeeding at re-downloading the default HEX file based on the IFI_Loader progress bar.

As a further diagnostic take a look at the sizes of the default vs the compiled hex file. They are probably different based on the debug settings selected in MPLAB under Project->Build Options...->Project then the "MPLAB C18" tab, then "Optimization" under the "Categories" pull-down. It's probably difficult to get them to be the same, because we don't know how the default HEX was originally constructed. I'm more curious if you're compiled HEX file is larger or smaller than the default HEX file.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 07-10-2005 at 10:52. Reason: Reordered my stream of consciousness thoughts
  #5   Spotlight this post!  
Unread 07-10-2005, 18:53
HaWkeYe15's Avatar
HaWkeYe15 HaWkeYe15 is offline
Registered User
AKA: Tommy
FRC #1031 (Boilermakers)
Team Role: Alumni
 
Join Date: Oct 2004
Rookie Year: 2003
Location: San Francisco
Posts: 46
HaWkeYe15 is on a distinguished road
Send a message via AIM to HaWkeYe15
Re: Compiling Help!!

Our MPLAB is giving us a .cof file instead of a .hex... how do i make it come out as a hex file?
__________________
Regional winner in 2004 Pacific Northwest Regional with teams 492 and 957.

Semi-Finalist 2005 Las Vegas Regional.

Quarter-Finalist in 2006 SVR.

Quarter-Finalist in 2007 Davis Regional.
  #6   Spotlight this post!  
Unread 07-10-2005, 21:41
ajsetter's Avatar
ajsetter ajsetter is offline
Registered User
AKA: Andrew Setter
FRC #1741 (Red Alert Robotics)
Team Role: Mentor
 
Join Date: Oct 2005
Rookie Year: 2004
Location: Indianapolis
Posts: 12
ajsetter is an unknown quantity at this point
Re: Compiling Help!!

I have tried other ports other than COM2. When i look under windows device manager in the ports list, thats where I see the USB to serial converter. When I go into the properties, I can change which port its on (COM1, COM2, etc.) and i have most of them and none of them seem to work. I have also tried changing around bite rates to match IF loader and changing some settings about buffers, but nothing still seems to work.


As for the downloading hex file; When I download my compiled hex file, and get the error, restarting the controller doesn't do anything. Normally when the hex file is finished downloading the program state goes from blinking orange to solid green telling us the program is running. Once i download our hex file, the blinking orange light stays blinking until i reset the controller and then after its reset, it flashes red and green (bad code). I then have to re-download the default hex file and after it finishes, it runs as it should.
  #7   Spotlight this post!  
Unread 07-10-2005, 21:48
ajsetter's Avatar
ajsetter ajsetter is offline
Registered User
AKA: Andrew Setter
FRC #1741 (Red Alert Robotics)
Team Role: Mentor
 
Join Date: Oct 2005
Rookie Year: 2004
Location: Indianapolis
Posts: 12
ajsetter is an unknown quantity at this point
Re: Compiling Help!!

Quote:
Originally Posted by HaWkeYe15
Our MPLAB is giving us a .cof file instead of a .hex... how do i make it come out as a hex file?
I used to have this problem as well. Check your output window to make sure that there are no errors in the compile process, if there is even just one error, all it'll give you is a .cof file.
  #8   Spotlight this post!  
Unread 07-10-2005, 22:17
HaWkeYe15's Avatar
HaWkeYe15 HaWkeYe15 is offline
Registered User
AKA: Tommy
FRC #1031 (Boilermakers)
Team Role: Alumni
 
Join Date: Oct 2004
Rookie Year: 2003
Location: San Francisco
Posts: 46
HaWkeYe15 is on a distinguished road
Send a message via AIM to HaWkeYe15
Re: Compiling Help!!

I have it set to stop compiling when there are any errors.. so i don't think thats the problem.. hmm...

im not sure the programming is the problem though, I reloaded the default and it still didnt work.
I have no idea why its not working though... the spike works when its plugged into another pwm port.. so its not the spike.. maybe i should change the programming to an unused pwm..
we'll see..
anyway, thanks for your help
__________________
Regional winner in 2004 Pacific Northwest Regional with teams 492 and 957.

Semi-Finalist 2005 Las Vegas Regional.

Quarter-Finalist in 2006 SVR.

Quarter-Finalist in 2007 Davis Regional.

Last edited by HaWkeYe15 : 07-10-2005 at 22:22.
  #9   Spotlight this post!  
Unread 07-10-2005, 22:35
RbtGal1351's Avatar
RbtGal1351 RbtGal1351 is offline
~La Reina de los Robots~
AKA: Stephanie
FRC #1351 (TKO)
Team Role: Programmer
 
Join Date: Dec 2004
Rookie Year: 2004
Location: San Jose, CA
Posts: 166
RbtGal1351 is a splendid one to beholdRbtGal1351 is a splendid one to beholdRbtGal1351 is a splendid one to beholdRbtGal1351 is a splendid one to beholdRbtGal1351 is a splendid one to beholdRbtGal1351 is a splendid one to beholdRbtGal1351 is a splendid one to behold
Send a message via AIM to RbtGal1351 Send a message via MSN to RbtGal1351
Re: Compiling Help!!

i've gotten the green and red blinking lights on the controller a few times.
Normally it seems to be a problem with the serial port connection, and i re-plug in all the cables, and try again; and it usually works. It didn't think it was a problem with compiling the code.

~Stephanie
Team 1351
__________________
2004 Founding member and Arm leader, 2005 Lead programmer, 2006 Controls leader, 2007 Project Manager/President
Thanks for making FIRST such a great experience for me. I'm no longer on 1351, and I'm not currently planning to mentor team 97, but FIRST has meant so much in getting me to where I am now, in life and at MIT, class of 2011.
I met Billfred! He recognized me!
SVR 04: 11th seed - Highest Rookie Seed - Semifinalists w/ 1120 and 568 - GM Industrial Design Award
SVR 05: Semifinalists w/ 8 and 766
SVR 06: 6th seed - Quarterfinalists w/ 368 and 1072
Davis 06: 1st seed - Quarterfinalists w/ 649 and 100 - KPCB Entrepreneurship Award
SVR 07: 36th seed
David 07: 4th seed - Semifinalists w/ 1280 and 692 - Johnson and Johnson Sportsmanship Award
  #10   Spotlight this post!  
Unread 11-10-2005, 08:57
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,800
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: Compiling Help!!

Quote:
Originally Posted by ajsetter
Once i download our hex file, the blinking orange light stays blinking until i reset the controller and then after its reset, it flashes red and green (bad code). I then have to re-download the default hex file and after it finishes, it runs as it should.
It sounds like your downloading works okay since the original hex file downloads and runs. I've seen this happen when the hex file didn't get completely downloaded, or the hex file was a partial one, or as RbtGal1351 suggested the cable connection was noisy or otherwise poor, but unless the compiled hex is larger than the default hex I don't see why this would be your case.

To help isolate the culprit I've attached a default v2.2 hex file I compiled and tested on our robot. Try downloading this. If you still have problems then it isn't your compiler it's the connection, if you do have problems then lets dive into your compiler settings.

PS: I was backpacking in Mass. over the weekend, so I was out of touch for awhile.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 11-10-2005 at 10:28.
  #11   Spotlight this post!  
Unread 11-10-2005, 19:51
CJO's Avatar
CJO CJO is offline
Emeritus Pain in the $@#$@#$@#
AKA: Christopher J. O'Connell
None #1097 (Site 3 Engineering)
Team Role: Alumni
 
Join Date: Feb 2003
Location: Latrobe (over the rainbow), CA
Posts: 217
CJO will become famous soon enoughCJO will become famous soon enough
Re: Compiling Help!!

Quote:
Our MPLAB is giving us a .cof file instead of a .hex... how do i make it come out as a hex file?
One is supposed to be able to edit the workspace to output a hex, however, I have sometimes been unable to do this, in which case:

In the /bin folder of C18 you can find a cof2hex executable. This can be called from a shell script and used to convert your cof to hex.
__________________
Team 1097 -- Site 3 Engineering
~~~~~~~~~~~~~~~~~~~~
2003 Sacramento Rookie All Star
2003 Silicon Valley Rookie All Star
2004 Sacramento Engineering Inspiration Award
2004 Sacramento Visualization Award
2004 Outstanding Volunteer Award (G. Glasser)
2004 Silicon Valley Sportsmanship Award
2004 National Visualization Runner Up
2004 Cal Games Finalist
2005 Sacramento Sportsmanship Award
2005 Sacramento #1 seed
2005 Sacramento Finalist

2005 Silicon Valley Sportsmanship Award
2005 Silicon Valley #1 Seed
2005 Silicon Valley Finalist

  #12   Spotlight this post!  
Unread 12-10-2005, 12:33
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,567
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: Compiling Help!!

Are you, by any chance, using the camera default code without the camera attached?

Last edited by Joe Ross : 12-10-2005 at 17:25.
  #13   Spotlight this post!  
Unread 12-10-2005, 19:26
ajsetter's Avatar
ajsetter ajsetter is offline
Registered User
AKA: Andrew Setter
FRC #1741 (Red Alert Robotics)
Team Role: Mentor
 
Join Date: Oct 2005
Rookie Year: 2004
Location: Indianapolis
Posts: 12
ajsetter is an unknown quantity at this point
Re: Compiling Help!!

OK, I've solved one of my problems. I switched from using the old p3 to using a newer Compaq p4 and it transfers the code fine over to the robot. It doesn't have the MP LAB Ode v7.00 yet because we can't find the install disk, but we know where one is. So right now we just compile it using our laptop, transfer it to the desktop via a flash drive and everything works fine. That brings me to the problem I still have at hand, I still can't get the laptop to transfer across the USB-serial converter. Windows recognizes its there (under device manager it sees a "prolific USB-serial converter" on port COM1). We've checked to make sure the bit rates are fine and checked the drivers, but for some reason, the IF loader still won't transfer the code across. Any suggestions about this problem would be great, and thank you so much for your help on the previous one.

-Andrew
  #14   Spotlight this post!  
Unread 12-10-2005, 19:32
JamesBrown JamesBrown is offline
Back after 4 years off
FRC #5279
Team Role: Engineer
 
Join Date: Nov 2004
Rookie Year: 2005
Location: Lynchburg VA
Posts: 1,276
JamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond repute
Re: Compiling Help!!

mplab 7.00 (and 7.20) can be downloaded from the Microchip website
  #15   Spotlight this post!  
Unread 13-10-2005, 10:38
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,800
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: Compiling Help!!

Quote:
Originally Posted by ajsetter
Windows recognizes its there (under device manager it sees a "prolific USB-serial converter" on port COM1).
I have run into USB driver conflicts from past USB drivers loaded onto a machine. Did you use the install disk that came with the BAFO or did you let Windows pick the driver?

I might still try testing the other COM ports through the IFI_Loader pull-down rather than the Device Manager properties. I did run into a strange case where Windows declared it to be on one COM port, but it actually worked if you lied to IFI_Loader and picked the port next to it. I think that was really a USB drive issue though and I don't remember what version of Windows that occurred under.

P.S. On a side note did you know that if you spend a long time replying you can avoid the CD timeout by going into Spell Check before attempting to post the message?
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Moody Compiling on certain computers... ConKbot of Doom Programming 4 28-02-2005 18:22
Compiling Failed Teh Mike Programming 7 09-02-2005 13:27
Compiling Problems Chris Hleva Programming 11 20-02-2004 17:12
White Paper Discuss: IFI Loader for Linux with compiling instructions CD47-Bot Extra Discussion 1 09-02-2004 16:46
Problem compiling edubot Ben B Programming 3 14-01-2004 00:51


All times are GMT -5. The time now is 09:42.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi