Go to Post the best way to make things most unfair is to have different rules for different people. - Jack Jones [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 22-05-2007, 10:40
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: new to EEPROM

Quote:
Originally Posted by Bomberofdoom View Post
The user-programmable PIC in the Robot Controller has 1024 bytes of EEPROM in it. Reading a byte from EEPROM is easy: set the address and read the value. Writing is a bit more complex: set the address, set the value, flip some control bits, wait a specific amount of time, flip some more bits, wait, flip, wait, done. Kevin Watson wrote a library that takes care of all the details behind the scene, so all you need to do is call the functions that read and write values. It keeps a buffer of requested data writes so you don't have to wait around for it to finish each time you want to change a value.

It might help if you consider EEPROM to be the equivalent of a data file on disk. You can make changes to it which will not disappear when the RC is powered down. Kevin's camera communication and servo tracking code uses EEPROM to store configuration values. The TechnoKats this year adapted and extended the idea to hold PID calibrations for the drivebase and arm, as well as the desired pan and tilt values for driving to the target light. Instead of changing #defines in the code, recompiling, and downloading every time we want to modify a value, we just use a menu-driven system to change the numbers directly on the robot.
  #2   Spotlight this post!  
Unread 22-05-2007, 11:57
Bomberofdoom's Avatar
Bomberofdoom Bomberofdoom is offline
Biggest FIRST addict in Israel
AKA: Nir Levanon
FRC #2230 (Zcharia's Angels)
Team Role: Programmer
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Israel
Posts: 471
Bomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond repute
Send a message via MSN to Bomberofdoom
Re: new to EEPROM

Quote:
Originally Posted by Alan Anderson View Post
Instead of changing #defines in the code, recompiling, and downloading every time we want to modify a value, we just use a menu-driven system to change the numbers directly on the robot.
Ok, how do I do that?
__________________
TEAM 2230 ZECHARIA'S ANGELS

2009 Microsoft Israel FRC Regional Winners!
2009 Microsoft Israel FRC Regional Chairman's Award Winners!!!
---------------------------------
2008 Microsoft Israel FRC Regional semi-finalist.
2008 Microsoft Israel FRC Regional Delphi's "Driving Tommorow's Technology" Award winner.
2008 Robot Driver
---------------------------------
2007 GM/Technion Israel FRC Regional semi-Finalist.
2007 GM/Technion Israel FRC Regional Xerox Creativity Award winner.
2007 Robot Driver.
  #3   Spotlight this post!  
Unread 22-05-2007, 12:51
JBotAlan's Avatar
JBotAlan JBotAlan is offline
Forever chasing the 'bot around
AKA: Jacob Rau
FRC #5263
Team Role: Mentor
 
Join Date: Sep 2004
Rookie Year: 2004
Location: Riverview, MI
Posts: 723
JBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond repute
Send a message via AIM to JBotAlan Send a message via Yahoo to JBotAlan
Re: new to EEPROM

As everyone else has said, you have 1024 bytes of EEPROM. What they haven't said is how to use it...

When you have Kevin Watson's EEPROM code installed, you call EEPROM_Write() with the address you want to write to (this needs to be between 0 and 1023, inclusive) and the value you want to write. Later on, call EEPROM_Read() with the address you wrote to, and it will return the value saved in EEPROM.

If you call EEPROM_Write(0,1); (which writes 1 to the first byte, byte 0, in EEPROM) then call EEPROM_Read(0); it will return 1. This lasts even if the controller loses power--if you called EEPROM_Write(x,y), and that's the last byte you wrote to that address in EEPROM, EEPROM_Read(x) will always return y.

The controller doesn't care where you save data in the EEPROM; it is entirely up to you. I suggest making a quick spreadsheet listing which address is what.

The best part about EEPROM is that all of it is at your disposal. The default code does not touch EEPROM at all. You can use every byte, 0 to 1023, for whatever you want. You could even make it a 1KB flash drive, if you want (but I'm not sure if you could find a good enough MP3 encoder to get your music compressed that small... ).

If you need specific code, I can probably supply it, but you learn best when you figure it out yourself--try it!

Happy coding
JBot

EDIT: If you want a menu-driven system, you will need to build it yourself. Check into some more of Kevin's code--there is an example of a terminal in Kevin's "Bells and Whistles" camera code. You will need his serial driver (no point in writing that yourself...it's a lot of gross low-level garbage) at the very least.

Again, I'll help you with the specifics if you really can't figure it out, but I'd like you to take the plunge yourself.
__________________
Aren't signatures a bit outdated?

Last edited by JBotAlan : 22-05-2007 at 13:05. Reason: More info
  #4   Spotlight this post!  
Unread 22-05-2007, 13:37
tseres's Avatar
tseres tseres is offline
obsessed with FIRST...
FRC #1565 (Think Tank Tech)
Team Role: Leadership
 
Join Date: Apr 2007
Rookie Year: 2007
Location: Cambridge, ON
Posts: 305
tseres is a glorious beacon of lighttseres is a glorious beacon of lighttseres is a glorious beacon of lighttseres is a glorious beacon of lighttseres is a glorious beacon of lighttseres is a glorious beacon of light
Re: new to EEPROM

thanks. ya..i figured out how the camera tracking values use the eeprom, now i'll just have to play around with it. maybe a menu driven system? or maybe autonomous stuff....
__________________


  #5   Spotlight this post!  
Unread 22-05-2007, 18:10
Bomberofdoom's Avatar
Bomberofdoom Bomberofdoom is offline
Biggest FIRST addict in Israel
AKA: Nir Levanon
FRC #2230 (Zcharia's Angels)
Team Role: Programmer
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Israel
Posts: 471
Bomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond repute
Send a message via MSN to Bomberofdoom
Re: new to EEPROM

Yep, thank you all and thank you tesers for asking
__________________
TEAM 2230 ZECHARIA'S ANGELS

2009 Microsoft Israel FRC Regional Winners!
2009 Microsoft Israel FRC Regional Chairman's Award Winners!!!
---------------------------------
2008 Microsoft Israel FRC Regional semi-finalist.
2008 Microsoft Israel FRC Regional Delphi's "Driving Tommorow's Technology" Award winner.
2008 Robot Driver
---------------------------------
2007 GM/Technion Israel FRC Regional semi-Finalist.
2007 GM/Technion Israel FRC Regional Xerox Creativity Award winner.
2007 Robot Driver.
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
EEPROM Problem Jake M Programming 0 19-02-2007 20:04
EEPROM Code Kevin Watson Programming 31 12-01-2006 11:37
EEProm Ryan Cumings Programming 2 01-02-2005 12:47
EEPROM Problems devicenull Programming 8 27-01-2005 15:07
EEPROM + Backup Battery Ryan Cumings Programming 4 28-02-2004 13:30


All times are GMT -5. The time now is 00:25.

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