Go to Post I would feel more comfortable if you used rock-paper-scissor-lizard-Spock. - IndySam [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 21-05-2007, 13:42
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
new to EEPROM

hey everyone....i'm going to be the team programmer next year. so far i can do the major robot functions (driving, solenoids, etc) and i'm working on gyro code as well as camera code. i have a few questions about the EEPROM. i have kevin's code, and i understand the concept and all, but what actually gets written to the eeprom when i use the write functions? cas i assign a variable that gest written? can i store a series of values to one of the 16 slots (i think its 16...)? or, could i even store a function? and for the camera code, i know how to assign the RGB values to track in the header file, but i also know that the code can get values from the eeprom...how do i save the values there? i noticed that the eeprom_write function in the code saves an unsigned character....so i can only save one byte of data per slot? i'm confused about all of this...any answers would be helpful

Thanks

~Tseres
__________________


  #2   Spotlight this post!  
Unread 21-05-2007, 15:18
Qbranch Qbranch is offline
wow college goes fast.
AKA: Alex
FRC #1024 (Kil-A-Bytes)
Team Role: Alumni
 
Join Date: Apr 2006
Rookie Year: 2006
Location: Indianapolis
Posts: 1,174
Qbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond repute
Re: new to EEPROM

Well, first off, here's a listing I wrote a while ago of hardware in the 18F series processors.

There are 1024 (what a coincidence! ) bytes of EEPROM right on board the processor. One unsigned character is one byte of memory... personally, I don't use kevin's driver, I have my own, but, in concept all you are doing is writing and reading bytes to/from a non volatile memory... just remember to hold on to your addresses!

most likely what kevin has done is divided the 1024 bytes of memory into 16, 64-byte 'chunks'... to help with organization of your memory. If you need more specific to kevin's code help, for the time being somebody else will have to help! (i'll read up on kevin's eeprom code when i get a chance though, just for the sake of knowing )

-q
__________________
Electrical Engineer Illini
1024 | Programmer '06, '07, '08 | Driver '08
  #3   Spotlight this post!  
Unread 21-05-2007, 15:23
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...that really does help clarify things...also...is it possible to see a copy of your eeprom code? is it really complex?.....
ya....
__________________


  #4   Spotlight this post!  
Unread 21-05-2007, 18:06
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

Ohhh....So wait, how do I store autonomous data on EEPROM?
__________________
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.
  #5   Spotlight this post!  
Unread 22-05-2007, 09:43
John Gutmann John Gutmann is offline
I'm right here
AKA: sparksandtabs
FRC #0340 (GRR)
Team Role: Mechanical
 
Join Date: Feb 2005
Rookie Year: 2004
Location: rochester
Posts: 804
John Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant future
Send a message via AIM to John Gutmann Send a message via MSN to John Gutmann Send a message via Yahoo to John Gutmann
Re: new to EEPROM

if you have say 3 motors and you want to try a simple example, youc an store the value to send to the victors during autonomous. Then make a timer so it reads and assigns all 3 values every 1 sec or what ever time intervale you want.

as an example:
Code:
EEPROM Contents:
Motor Left
Motor Right
Arm Motor
Motor Left
Motor Right
Arm Motor
Motor Left
Motor Right
Arm Motor
Motor Left
Motor Right
Arm Motor
Motor Left
Motor Right
Arm Motor
Motor Left
Motor Right
Arm Motor
I didn't include addresses because I have never actually dealt with EEPROM before. But this is the basic theory behind it.

-John
  #6   Spotlight this post!  
Unread 22-05-2007, 10:04
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

__________________
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.
  #7   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.
  #8   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.
  #9   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
  #10   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....
__________________


  #11   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.
  #12   Spotlight this post!  
Unread 23-05-2007, 13:44
bcieslak
 
Posts: n/a
Re: new to EEPROM

Quote:
Originally Posted by Bomberofdoom View Post
Ohhh....So wait, how do I store autonomous data on EEPROM?
Send me your email and I will send you a copy of our Autoflex program that stores driver commands into the eeprom . Then when your in auto mode the robot will re-enact what your drivers justt did.

I have an FRC and vex version.

Brian
team 1675
k9wis@yahoo.com
  #13   Spotlight this post!  
Unread 23-05-2007, 15:03
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

I'd like to see that Autoflex program of yours. I've sent you a message.

Quote:
our Autoflex program that stores driver commands into the eeprom . Then when your in auto mode the robot will re-enact what your drivers justt did.
If I understand how your program works from what you've said, I must say it isn't always effective for Rack n' Roll. You re-enact what the drivers just did, but when the rack is shifted it won't always be in the exact spot.
Of course, it's much better than nothing(nothing being doing nothing or driving by dead reckoning).

Well, I received the code. It's really neat for rookie teams, I must agree. Good job.

So, now that I understand a bit about EEPROM, I understand that I don't need to use that function I did to save points of distances from the rack, I can use the EEPROM.
So lets say if I want to save a few points of distances while I'm on manual mode, I need to assign a button to call for EEPROM_Write(); and advance the address number in order to assign another point?
__________________
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.

Last edited by Bomberofdoom : 23-05-2007 at 18:08.
  #14   Spotlight this post!  
Unread 24-05-2007, 15:11
bcieslak
 
Posts: n/a
Re: new to EEPROM

Quote:
If I understand how your program works from what you've said, I must say it isn't always effective for Rack n' Roll. You re-enact what the drivers just did, but when the rack is shifted it won't always be in the exact spot.
BC-True enough...If your going to have a dynamically changing field then autonomous get complicated. Your robot will have to read and react to its environment. Autoflex worked very well for Triple Play and Aim High.

Quote:
Of course, it's much better than nothing(nothing being doing nothing or driving by dead reckoning).

Well, I received the code. It's really neat for rookie teams, I must agree. Good job.
BC-Exactly the purpose of Autoflex. To get teams who either ran out of time or resources to have autonomous ready for a tournament. We could get robots up and recording in about 15 minutes. With autoflex there is no excuse for just sittng there.

But its not a substitute for a well thought out autonomous routine. This year we used the camera to home in on the lights.
Quote:
So, now that I understand a bit about EEPROM, I understand that I don't need to use that function I did to save points of distances from the rack, I can use the EEPROM.

So lets say if I want to save a few points of distances while I'm on manual mode, I need to assign a button to call for EEPROM_Write(); and advance the address number in order to assign another point?
You got it...

Good Luck and feel free to experiment.

Brian
  #15   Spotlight this post!  
Unread 25-05-2007, 01:45
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

Thank you very much! I'll be trying your code sometimes.
__________________
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 19:48.

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