Go to Post Personally, i dont see a problem, If it comes down to esentially building a computer just to run the field then that is what we will have to do, the show must go on. - Dave_222 [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 02-11-2004, 16:25
cibressus53's Avatar
cibressus53 cibressus53 is offline
Registered User
#1397
 
Join Date: Oct 2004
Location: ajax
Posts: 14
cibressus53 is on a distinguished road
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
__________________
EMAIL: TERRYnospamP AHT MELDSTARspammenot DAWT COM
  #2   Spotlight this post!  
Unread 02-11-2004, 17:39
Raven_Writer's Avatar
Raven_Writer Raven_Writer is offline
2004 Detroit & Pittsburgh Winners
AKA: Eric Hansen
FRC #0005 (RoboCards)
Team Role: Mentor
 
Join Date: Jan 2003
Rookie Year: 2002
Location: Melvindale
Posts: 1,549
Raven_Writer is just really niceRaven_Writer is just really niceRaven_Writer is just really niceRaven_Writer is just really niceRaven_Writer is just really nice
Send a message via ICQ to Raven_Writer Send a message via AIM to Raven_Writer Send a message via MSN to Raven_Writer Send a message via Yahoo to Raven_Writer
Re: Simplest Code

I believe the simplest code you can download to the robot and have it do something is the default code.
__________________
AIM: wisprmylastbreth
EMail: nightskywriter@gmail.com
Y!: synsoflife

"ai yoru ga" -- "Love the nights"
  #3   Spotlight this post!  
Unread 02-11-2004, 17:50
Max Lobovsky's Avatar
Max Lobovsky Max Lobovsky is offline
Fold em oval!
FRC #1257 (Parallel Universe)
Team Role: College Student
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Scotch Plains, NJ
Posts: 1,026
Max Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant future
Send a message via AIM to Max Lobovsky
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.
__________________
Learn, edit, inspire: The FIRSTwiki.
Team 1257


2005 NYC Regional - 2nd seed, Xerox Creativity Award, Autodesk Visualization Award
2005 Chesapeake Regional - Engineering Inspiration Award
2004 Chesapeake Regional - Rookie Inspiration award
2004 NJ Regional - Team Spirit Award
  #4   Spotlight this post!  
Unread 02-11-2004, 18:30
cibressus53's Avatar
cibressus53 cibressus53 is offline
Registered User
#1397
 
Join Date: Oct 2004
Location: ajax
Posts: 14
cibressus53 is on a distinguished road
Re: Simplest Code

well, after adding the cordic libary to the base code, it sweels to 48kb.
__________________
EMAIL: TERRYnospamP AHT MELDSTARspammenot DAWT COM
  #5   Spotlight this post!  
Unread 02-11-2004, 20:18
Greg Ross's Avatar
Greg Ross Greg Ross is offline
Grammar Curmudgeon
AKA: gwross
FRC #0330 (Beach 'Bots)
Team Role: Mentor
 
Join Date: Jun 2001
Rookie Year: 1998
Location: Hermosa Beach, CA
Posts: 2,245
Greg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond repute
Send a message via AIM to Greg Ross Send a message via Yahoo to Greg Ross
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.
__________________
Greg Ross (The Grammar Curmudgeon formerly known as gwross)
S/W Engineer, Team 330, the Beach 'Bots
<--The Grammar Curmudgeon loves this cartoon.
“Life should not be a journey to the grave with the intention of arriving safely in a pretty and well preserved body, but rather to skid in broadside in a cloud of smoke, thoroughly used up, totally worn out, and loudly proclaiming "Wow! What a Ride!" Hunter S. Thompson
"Playing a practical joke means doing something mean and calling it funny." Me
  #6   Spotlight this post!  
Unread 02-11-2004, 20:31
Bharat Nain's Avatar
Bharat Nain Bharat Nain is offline
Registered User
no team
Team Role: Alumni
 
Join Date: Jan 2004
Rookie Year: 2003
Location: New York
Posts: 2,000
Bharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond repute
Send a message via AIM to Bharat Nain Send a message via MSN to Bharat Nain
Re: Simplest Code

Quote:
Originally Posted by cibressus53
well, after adding the cordic libary to the base code, it sweels to 48kb.
Why do you want to add the CORDIC library to your base code anyways?
__________________
-= Bharat Nain =-

Whatever you do, you need courage. Whatever course you decide upon, there is always someone to tell you that you are wrong. There are always difficulties arising that tempt you to believe your critics are right. To map out a course of action and follow it to an end requires some of the same courage that a soldier needs. Peace has its victories, but it takes brave men and women to win them. - Ralph Waldo Emerson
  #7   Spotlight this post!  
Unread 02-11-2004, 21:52
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Simplest Code

Quote:
Originally Posted by gwross
Can someone speak up who has actually used CORDIC on the IFI robot controller?
I did some experimentation with it early on, before we gave up on our optical carpet tracking scheme.
Quote:
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.
CORDIC was devised specifically to avoid floating point operations. It uses addition, subtraction, and bitwise shifts. Doing those with floating point would be, um, pointless.
  #8   Spotlight this post!  
Unread 02-11-2004, 22:39
Pat Fairbank's Avatar
Pat Fairbank Pat Fairbank is offline
Circuit Breaker
FRC #0254 (The Cheesy Poofs)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2001
Location: San Jose, CA
Posts: 2,132
Pat Fairbank has a reputation beyond reputePat Fairbank has a reputation beyond reputePat Fairbank has a reputation beyond reputePat Fairbank has a reputation beyond reputePat Fairbank has a reputation beyond reputePat Fairbank has a reputation beyond reputePat Fairbank has a reputation beyond reputePat Fairbank has a reputation beyond reputePat Fairbank has a reputation beyond reputePat Fairbank has a reputation beyond reputePat Fairbank has a reputation beyond repute
Send a message via MSN to Pat Fairbank
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.
__________________
Patrick Fairbank
Team 254 | Mentor (2012-)
Team 1503 | Mentor (2007-2011)
Team 296 | Alumnus (2001-2004) | Mentor (2005-2006)

patfairbank.com
  #9   Spotlight this post!  
Unread 02-11-2004, 23:22
Greg Ross's Avatar
Greg Ross Greg Ross is offline
Grammar Curmudgeon
AKA: gwross
FRC #0330 (Beach 'Bots)
Team Role: Mentor
 
Join Date: Jun 2001
Rookie Year: 1998
Location: Hermosa Beach, CA
Posts: 2,245
Greg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond repute
Send a message via AIM to Greg Ross Send a message via Yahoo to Greg Ross
Re: Simplest Code

Quote:
Originally Posted by Pat Fairbank
...the hex file with the CORDIC library included... 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.
Pat,

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.
__________________
Greg Ross (The Grammar Curmudgeon formerly known as gwross)
S/W Engineer, Team 330, the Beach 'Bots
<--The Grammar Curmudgeon loves this cartoon.
“Life should not be a journey to the grave with the intention of arriving safely in a pretty and well preserved body, but rather to skid in broadside in a cloud of smoke, thoroughly used up, totally worn out, and loudly proclaiming "Wow! What a Ride!" Hunter S. Thompson
"Playing a practical joke means doing something mean and calling it funny." Me
  #10   Spotlight this post!  
Unread 05-11-2004, 09:28
cibressus53's Avatar
cibressus53 cibressus53 is offline
Registered User
#1397
 
Join Date: Oct 2004
Location: ajax
Posts: 14
cibressus53 is on a distinguished road
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?
__________________
EMAIL: TERRYnospamP AHT MELDSTARspammenot DAWT COM
  #11   Spotlight this post!  
Unread 05-11-2004, 11:46
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,906
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: Simplest Code

Quote:
Originally Posted by cibressus53
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?
You can't easily judge by the .hex file size. I can create a .hex file that's 85kb and it fits on the RC just fine.

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:

Program Memory Usage
Start		 End 
--------- ---------
0x000800	0x000805
0x000808	0x006622
0x300000	0x30000d	 
 
24111 out of 33816 program addresses used, program memory utilization is 71%

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.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 05-11-2004 at 11:58.
  #12   Spotlight this post!  
Unread 05-11-2004, 12:01
Greg Ross's Avatar
Greg Ross Greg Ross is offline
Grammar Curmudgeon
AKA: gwross
FRC #0330 (Beach 'Bots)
Team Role: Mentor
 
Join Date: Jun 2001
Rookie Year: 1998
Location: Hermosa Beach, CA
Posts: 2,245
Greg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond repute
Send a message via AIM to Greg Ross Send a message via Yahoo to Greg Ross
Re: Simplest Code

Quote:
Originally Posted by Mark McLeod
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.
Good catch. I had forgotten about that. This version is available from Innovation First at http://www.innovationfirst.com/FIRST...ader_1.0.7.zip. I hope that solves the problem for you.
__________________
Greg Ross (The Grammar Curmudgeon formerly known as gwross)
S/W Engineer, Team 330, the Beach 'Bots
<--The Grammar Curmudgeon loves this cartoon.
“Life should not be a journey to the grave with the intention of arriving safely in a pretty and well preserved body, but rather to skid in broadside in a cloud of smoke, thoroughly used up, totally worn out, and loudly proclaiming "Wow! What a Ride!" Hunter S. Thompson
"Playing a practical joke means doing something mean and calling it funny." Me
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
What is your most prefered programming language? Hailfire Programming 156 19-01-2005 21:42
Sourceforge for Code Repository and other stuff SilverStar Programming 9 15-01-2005 21:16
heres the code. y this not working omega Programming 16 31-03-2004 15:18
Inserting Naviagation code into Default code? actorindp Programming 3 28-01-2004 18:12
Does your team use the Default code. Jeff McCune General Forum 2 09-01-2003 14:46


All times are GMT -5. The time now is 03:10.

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