![]() |
Simplest Code
What is the simplest code we can upload to the robot? I'm quite pressed for memory space. i can't get both the default code and cordic math libary on their
|
Re: Simplest Code
I believe the simplest code you can download to the robot and have it do something is the default code.
|
Re: Simplest Code
What does "the simplest code" mean? If you just want some joysticks and buttons directly mapped to pwms/relays and don't have any autonomous code, there is a significant amount you can remove from the default code. There are several functions you can remove from user_routines.c/h. Removing printf_lib.c/h and any calls to it would be another very significant space saver. There is probably more in other files, look for yourself.
|
Re: Simplest Code
well, after adding the cordic libary to the base code, it sweels to 48kb.
|
Re: Simplest Code
Can someone speak up who has actually used CORDIC on the IFI robot controller?
My thought is that the CORDIC implementation you're using is no good for our application. I'm wondering if the one you're using uses floating point math. If it does, that would swell the code due to the fact that the math library would have to emulate the floating point operations in software. |
Re: Simplest Code
Quote:
|
Re: Simplest Code
Quote:
Quote:
|
Re: Simplest Code
After some experimentation, it appears that the size of the hex file does not directly correspond to the amount of code that is actually uploaded to the robot controller. The hex file containing the default code has a size of 25 KB, while the hex file with the CORDIC library included (I believe this is the library in question) has a size of 48 KB. Even though this hex file is larger than the PIC's 32 KB flash memory, it still uploads and executes on my RC without any problem.
So it seems therefore the size of the hex file containing the code is not an accurate measure of how much flash space the code will take up on the RC. cibressus53, I think your problem lies somewhere else than in the size of your code. |
Re: Simplest Code
Quote:
In the most general case, a hex file will be more than twice as big as the memory image it loads. This is because each byte of the memory image gets represented by two ascii characters in the hex file. And then there is the overhead of having to store address information, CRC/checksum information, and who knows what else. |
Re: Simplest Code
I had to completly remove the print_lib to get it down to a small enoguh size (35kb). does anyone know the real max size for the hex file?
|
Re: Simplest Code
Quote:
You know what it does look like though is an IFI_Loader version problem. The original IFI_Loader had a bug that only loaded half the available RC program memory. Check your IFI_Loader version. It should be 1.0.7. You should use the .map file MPLAB can generate for you to see how much memory your program requires. It tells you exactly how much space your program uses, e.g., Code:
Note however that the program memory will be full when it reads 90%, because that last little bit of memory gets used for IFI stuff. |
Re: Simplest Code
Quote:
|
| All times are GMT -5. The time now is 02:54. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi