Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Programming FAQ (http://www.chiefdelphi.com/forums/showthread.php?t=31817)

Astronouth7303 16-12-2004 19:17

Programming FAQ
 
It seems like we get a lot of the same questions here. So, here's a repository of some of the most common ones. Feel free to post your own with answers.

If you have a question that is not answered here, please search first. I can almost guarantee that someone has asked a similar question before.

Q. MPLAB says that it can't find "xxx.h". What's up?
A. if it's a standard header (eg, #include <adc.h>) then odds are that MPLAB is misconfigured. Either set the include directory manually, or reinstall MCC18 and checking the check boxes.

Bharat Nain 16-12-2004 19:46

Re: Programming FAQ
 
I need help programming my autonomous?
Look here, there, here, there, here & in the programming white papers & Search for more. There is more stuff than you can imagine.

//Brandon or any mod, Make this a sticky if you can...

Tom Bottiglieri 16-12-2004 19:56

Re: Programming FAQ
 
This one got me for a while when I first started using the RC.

Q: My robot isnt responding to controllers, wont download a new program, and is stuck in disabled mode. What do I do?

A: 1)hold down both the program and reset buttons.
2)Then, let go of the reset button. (The power light will be blinking green. )
3)Wait until the green light is solid.
4)Let go of the program button.

or see here

Astronouth7303 21-12-2004 18:22

Re: Programming FAQ
 
Q. I get an error when i try to compile:
Quote:

Error - Source file 'C:\path\that's\too\long\for\the\compiler\ifi_util ities.c' name exceeds file format maximum of 62 characters.
How do I fix this?

A. Don't put the code on the Desktop or My Documents. Here's why:

MCC18, the compiler, can only handle paths that are less than 62 characters long. Here is a few paths to the Desktop and My Documents (with the first 62 in green and everything else in red):
  • C:\Documents and Settings\Kristin & Steve\Desktop\FIRST Code\Default code\ifi_utilities.c
  • D:\Documents and Settings\Astronouth7303\My Documents\Robotics stuff\codes\Default code\main.c
A better place to put it would be C:\Code\Default Code\.

Ryan M. 22-12-2004 07:33

Re: Programming FAQ
 
Similar to Tom's:

Q: My programming is running the way it should!

A: Amazingly, about a quarter of the time it isn't really your fault. Try pressing the reset button on the robot controller, then re-download. Sometimes things just get a little corrupted. If it still doesn't work, then start debugging your code...

Guest 22-12-2004 23:29

Re: Programming FAQ
 
Quote:

Originally Posted by Ryan Morehart
Similar to Tom's:

Q: My programming is running the way it should!

A: Amazingly, about a quarter of the time it isn't really your fault. Try pressing the reset button on the robot controller, then re-download. Sometimes things just get a little corrupted. If it still doesn't work, then start debugging your code...

Q. My programming isn't running the way it should!

A. See above. But when it is running the way it should, about a quarter of the time it still isn't your fault ;)

randomperson 23-12-2004 02:35

Re: Programming FAQ
 
Quote:

Originally Posted by Astronouth7303
Q. I get an error when i try to compile:

How do I fix this?

A. Don't put the code on the Desktop or My Documents. Here's why:

MCC18, the compiler, can only handle paths that are less than 62 characters long. Here is a few paths to the Desktop and My Documents (with the first 62 in green and everything else in red):
  • C:\Documents and Settings\Kristin & Steve\Desktop\FIRST Code\Default code\ifi_utilities.c
  • D:\Documents and Settings\Astronouth7303\My Documents\Robotics stuff\codes\Default code\main.c
A better place to put it would be C:\Code\Default Code\.

You know... actually technically that isn't true. Sorta. It is true that it generates an error, but the problem with the 62-character limit is only with the COD file that the linker tries to generate, none of the other files. Correct me if I'm wrong, but I don't think that the COD file is actually used for anything, so you could use as big of a path as you would like if this file wasn't generated.

That being said, I am using MPLAB 7 (which you can download at www.microchip.com), so it may not be possible to disable this in MPLAB 6.x. I know a vast majority of you will be using 6.x because it was distributed with the C18 software last year... someone please correct me if this option isn't available in MPLAB 6.x. If you're using the C18 tools by the command line, then just add option /w and it shouldn't generate the file also... which, you can edit the command line in MPLAB 6.x, so you can just add the /w switch to the MPLINK command and not have a problem.

Here's the workaround for MPLAB 7.

In the MPLAB menu:

Project-> Build Options -> Project

Click on the tab "MPLINK Linker", and check the option "Supress COD-file generation".

Now it won't generate this file, and you can use a path as big as you would like to use. Well, within reason... :D

[edit]
Apparently, the C-Bot CD that has the licensed version of C18 does not have the correct linker in its c:\mcc18\ directory... so if you use the /w option you will get "invalid option" and still have the problem. However, if you tell MPLAB to use the linker that it came with (located in c:\program files\Microchip\MPASM Suite\mplink.exe), then it should work with no problem

With all that said, if you don't feel like dealing with any problems, don't touch anything, use the default stuff, and make sure your path is under 62 characters :)
[/edit]

Bharat Nain 02-01-2005 02:52

Re: Programming FAQ
 
Question: What OS is on the robot? If there is none or its horrible can I put embedded Linux on it? I only run Linux myself, is it possible to program this robot on Linux? Is there some sort of emulator I can get so I don't have to be with the robot, or it dose not have to be fully built for me to test?
Or basically
I am a rookie, where do I start, I want to learn about the robot controller.


Answer: OK first, yes you can program this robot using Linux. Visit http://kevin.org/frc/ and you should find some more information. For starting off, I highly recommend the documents on http://www.innovationfirst.com/FIRS...cumentation.htm
And then if you are advanced enough you can look at this page, but only if you are a really core programmer. Otherwise innovation FIRST is the best place to start.

To answer another part of you question, there is no OS on the robot controller. It is a microchip which understands C and assembler. Search, Read documents and get a feel of what our robot controller(microchip product) is. Its might not be such a good idea to try to go as far and put Linux on there or something, Search, Read documents you can find and you will get a feel.

-Bharat

cabbagekid2 10-01-2005 14:03

Re: Programming FAQ
 
Question: Does everyone use the C18 compiler? Or do some of you use the Visual Studio C compiler?

If you use the Visual Studio C complier, how would you download the code to the RC?

Matt Leese 10-01-2005 16:15

Re: Programming FAQ
 
Quote:

Originally Posted by cabbagekid2
Question: Does everyone use the C18 compiler? Or do some of you use the Visual Studio C compiler?

If you use the Visual Studio C complier, how would you download the code to the RC?

You must use the C18 compiler. The Visual Studio C++ compiler does not target the Microchip microcontroller.

Matt

Astronouth7303 10-01-2005 19:01

Re: Programming FAQ
 
Q: Where can I find all this cool stuff that was talked about in the (2005) kickoff?

A: The Camera stuff, default code, (eventually) the new firmware (master code), and technical docs are on http://ifirobotics.com. The link to the new IDE and MCC18 compiler are on FIRST's website (http://www.usfirst.org/).

Q: I CAN'T FIND THE COMPILER!!! THE LINK IS MESSED UP!!! HELP!!!

A: Yes, we know you can't download the compiler right now. Asking again won't help. Just try again later (like tomarrow) and hope it works. We can't do anything about it no matter how much you pester us.

Astronouth7303 16-01-2005 20:34

Re: Programming FAQ
 
Q. Why won't my program link? (Generic Linking problems)

A. If you have any kind of linking problems, the first thing you should do is to tell it to Build All (Ctrl+F10, or Project > Build All). If this doesn't help, keep digging here.

djcapelis 17-01-2005 20:43

Re: Programming FAQ
 
Quote:

Originally Posted by Bharat Nain
To answer another part of you question, there is no OS on the robot controller. It is a microchip which understands C and assembler. Search, Read documents and get a feel of what our robot controller(microchip product) is. Its might not be such a good idea to try to go as far and put Linux on there or something, Search, Read documents you can find and you will get a feel.

-Bharat

Not quite. The controller doesn't understand C or ASM actually, the compiler and linker turns these languages into machine code which the controller can understand. It works just like any other processor in that way. :)

I believe another thread on this forum is porting RTOS to the microcontroller.

JBotAlan 06-02-2005 17:44

Re: Programming FAQ
 
Quote:

Originally Posted by Astronouth7303
Q: I CAN'T FIND THE COMPILER!!! THE LINK IS MESSED UP!!! HELP!!!

A: Yes, we know you can't download the compiler right now. Asking again won't help. Just try again later (like tomarrow) and hope it works. We can't do anything about it no matter how much you pester us.

I e-mailed the support e-mail address on usfirst.org and the next day it worked. I don't know if this was just coincidence or if it was because of my e-mail, but there it is.

Astronouth7303 08-02-2005 18:03

Re: Programming FAQ
 
Quote:

Originally Posted by Astronouth7303
Q: I CAN'T FIND THE COMPILER!!! THE LINK IS MESSED UP!!! HELP!!!

A: Yes, we know you can't download the compiler right now. Asking again won't help. Just try again later (like tomarrow) and hope it works. We can't do anything about it no matter how much you pester us.

This is now outdated. At kick-off, Dave Lavery said that the compiler would be on Microchip's website for 2 weeks. The beggining of week number three was January 22, 2005. If you are still in need of a compiler, your best bet is to contact another FIRST member.


All times are GMT -5. The time now is 13:11.

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