Go to Post I think with so many facets of FIRST, success comes from learning the true meaning of teamwork through working towards a common goal. - Kristina [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 15-04-2005, 23:41
dawonn's Avatar
dawonn dawonn is offline
Mentor
AKA: Dereck
FRC #2586 (Calumet Copperbots)
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Auburn Hills, Mi
Posts: 53
dawonn is an unknown quantity at this point
Arrow Save a variable

Is there a way to save a value in a program after the power had been lost and then recover the value after the power is reaplied?


Thanks ^_^'
  #2   Spotlight this post!  
Unread 16-04-2005, 00:06
Dave Flowerday Dave Flowerday is offline
Software Engineer
VRC #0111 (Wildstang)
Team Role: Engineer
 
Join Date: Feb 2002
Rookie Year: 1995
Location: North Barrington, IL
Posts: 1,366
Dave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond repute
Re: Save a variable

Yes, you can use the EEPROM on the RC. Check out this thread for details and code that will let you do it. Be aware that you can't write to the EEPROM every loop in the RC or you'll wear it out.
  #3   Spotlight this post!  
Unread 16-04-2005, 01:43
RyanMcE RyanMcE is offline
Still Learning...
FRC #0492 (Titan Robotics)
Team Role: Mentor
 
Join Date: Jan 2002
Location: Bellevue, WA
Posts: 60
RyanMcE will become famous soon enough
EEPROM Lifetimes

As far as I know (not an expert by any means), most EEPROMs are good for at least a million write cycles. So don't go writing to it every cycle, but every second should be fine.
__________________
Titan Robotics Club (Team 492) Co-Founder, Alumni & Mentor

#1 in the Northwest: 2001 Silicon Valley Regional Rookie All-Star Award || 2001 Galileo Incredible Play Award || 2002 Southern California Regional Judge's Award || 2002 Pacific Northwest Regional Finalist || 2003 Silicon Valley Regional Entrepreneurship Award || 2003 Pacific Northwest Regional Website Award || 2003 Pacific Northwest Regional Finalist || 2003 Pacific Northwest Regional Engineering Inspiration Award || 2004 Pacific Northwest Website Award || 2004 Pacific Northwest Regional Champions (#1 seed) || 2004 Galileo Semi-Finalist || 2005 Pacific Northwest Regional General Motors Industiral Design Award || 2005 Pacific Northwest Regional Champions (#1 seed) || 2005 Galileo Finalist

"We'll do better next time" -- Team Motto
  #4   Spotlight this post!  
Unread 16-04-2005, 12:11
ConKbot of Doom ConKbot of Doom is offline
Team Alumni
FRC #1184 (Cobra Robotics)
Team Role: Leadership
 
Join Date: Jan 2005
Rookie Year: 2004
Location: Maryland
Posts: 153
ConKbot of Doom has a spectacular aura aboutConKbot of Doom has a spectacular aura aboutConKbot of Doom has a spectacular aura about
Re: EEPROM Lifetimes

Quote:
Originally Posted by RyanMcE
As far as I know (not an expert by any means), most EEPROMs are good for at least a million write cycles. So don't go writing to it every cycle, but every second should be fine.
Ok lets do the math, 1,000,000/(38cycles/sec*3600 seconds/hr)=7.3 hours. not a lot of time.

Once per second gives 277 hours, longer, probably longer than you will need for the robot. But depending on the variable, it could be longer.

How often does the variable change? if it is not that often, you could detect when it changes, and then save it.
__________________
2005 Philly #1 seeded team, highest average points, and semi-finalists
Thanks to 103 and 484 for being alliance mates.
  #5   Spotlight this post!  
Unread 16-04-2005, 13:45
RyanMcE RyanMcE is offline
Still Learning...
FRC #0492 (Titan Robotics)
Team Role: Mentor
 
Join Date: Jan 2002
Location: Bellevue, WA
Posts: 60
RyanMcE will become famous soon enough
Re: EEPROM Lifetimes

Quote:
Originally Posted by ConKbot of Doom
Ok lets do the math, 1,000,000/(38cycles/sec*3600 seconds/hr)=7.3 hours. not a lot of time.

Once per second gives 277 hours, longer, probably longer than you will need for the robot. But depending on the variable, it could be longer.

How often does the variable change? if it is not that often, you could detect when it changes, and then save it.
Good points - it seems to me) that 277 hours is longer than most robots are on, in their lifetimes. Nevertheless, you are right - only writing when you need to is a better solution than writing periodically.

What I had in mind, however, was a variable that is constantly changing (like position, for example), but you don't want to exhaust your EEPROM. So you write only every second. That gives you reasonably up-to-date information, but many fewer write cycles, greatly extending the life of your EEPROM.
__________________
Titan Robotics Club (Team 492) Co-Founder, Alumni & Mentor

#1 in the Northwest: 2001 Silicon Valley Regional Rookie All-Star Award || 2001 Galileo Incredible Play Award || 2002 Southern California Regional Judge's Award || 2002 Pacific Northwest Regional Finalist || 2003 Silicon Valley Regional Entrepreneurship Award || 2003 Pacific Northwest Regional Website Award || 2003 Pacific Northwest Regional Finalist || 2003 Pacific Northwest Regional Engineering Inspiration Award || 2004 Pacific Northwest Website Award || 2004 Pacific Northwest Regional Champions (#1 seed) || 2004 Galileo Semi-Finalist || 2005 Pacific Northwest Regional General Motors Industiral Design Award || 2005 Pacific Northwest Regional Champions (#1 seed) || 2005 Galileo Finalist

"We'll do better next time" -- Team Motto
  #6   Spotlight this post!  
Unread 17-04-2005, 15:50
Kyle T Kyle T is offline
waiting for next season...
FRC #0810 (Mechanical Bulls)
Team Role: Programmer
 
Join Date: Feb 2005
Rookie Year: 2004
Location: Smithtown
Posts: 20
Kyle T is an unknown quantity at this point
Re: EEPROM Lifetimes

honestly, i think your best bet would be to have a button to save the value that you should press before you turn it off-- that saves a lot of writes, even though it requires user intervention
__________________
  #7   Spotlight this post!  
Unread 22-04-2005, 16:07
Astronouth7303's Avatar
Astronouth7303 Astronouth7303 is offline
Why did I come back?
AKA: Jamie Bliss
FRC #4967 (That ONE Team)
Team Role: Mentor
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Grand Rapids, MI
Posts: 2,071
Astronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud of
Re: EEPROM Lifetimes

Quote:
Originally Posted by Kyle T
honestly, i think your best bet would be to have a button to save the value that you should press before you turn it off-- that saves a lot of writes, even though it requires user intervention
I would say to save it if the main battery voltage dips below a certain point. As long as the backup is installed, you should be OK with this.
  #8   Spotlight this post!  
Unread 23-04-2005, 08:30
Dave Flowerday Dave Flowerday is offline
Software Engineer
VRC #0111 (Wildstang)
Team Role: Engineer
 
Join Date: Feb 2002
Rookie Year: 1995
Location: North Barrington, IL
Posts: 1,366
Dave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond repute
Re: EEPROM Lifetimes

Quote:
Originally Posted by Astronouth7303
I would say to save it if the main battery voltage dips below a certain point. As long as the backup is installed, you should be OK with this.
I wouldn't recommend this. If your battery dies while writing to EEPROM you could corrupt it. Using the voltage dropping as a trigger will greatly increase the odds that you're trying to write as the power dies, obviously. Plus, if you suddenly cause a large current drain on your robot (for example, at the beginning of the match with both sticks forward), you could end up trigger ing your write routine, which personally I wouldn't want running at all during a match in case something goes wrong with it and because it wouldn't get the same level of testing as the rest of your code.
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
How do I save a quicktime .mov file? Elgin Clock IT / Communications 20 18-03-2005 17:39
Program for variable speed cabbagekid2 Programming 5 12-01-2005 13:20
Interrupt Handlers and Variable Scope kaszeta Programming 2 14-02-2004 18:30
Pic Block (save server space) Jack CD Forum Support 3 22-09-2002 01:05
what teams have a variable transmissions? Greg Perkins Technical Discussion 4 06-03-2002 06:10


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

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