![]() |
EEPROM Code
I've just posted software that can be used to read and write the Electrically Erasable Programmable Read-Only Memory (EEPROM) found in IFI's robot controllers. The code can be found here: http://kevin.org/frc. As always, if you find a bug in the code or a problem with the documentation, please let me know.
-Kevin Here's the readme file: Code:
The source code in eeprom.c/.h contains software to read from |
Re: EEPROM Code
THANK YOU!!!!!!!!!
(Bows and kisses Kevin's feet) The possibilities are so good. P.S. Do you know if this will work on the VEXtroller? P.P.S: Did I say thak you? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (Rather than Double Post) How does data need to be formatted when you pass it to the EEPROM_Write() function? Can you send variables by name? Could you call this function using your printf/serial driver. For instance, type "Field Side: Left," and then have this set a variable (such as "rss" - robot start side") equal to 1 (for instance). And then have the handler write to the EEPROM so that when the robot is turned on again, it knows what side it is on without a switch. Also, I am assuming that the read time is negligable compared to the write time (I.E. one does not need to woory about avoiding interrupts when reading?) |
Re: EEPROM Code
Sweet.
We were considering using the EEPROM when we ran out of code space last year, and this ought to make it a lot easier to do. Thanks! |
Re: EEPROM Code
Quote:
Quote:
Quote:
Quote:
-Kevin |
Re: EEPROM Code
Quote:
Code:
#include <math.h>-Kevin |
Re: EEPROM Code
Very cool, thanks.
|
Re: EEPROM Code
Hi Kevin,
Thanks for all the effort, it looks great and we'll definately be using it. I'd like to make one suggestion though. With so many novice progammers using your code, it's likely that someone will use the EEPROM_Write() function too much, even when the data doesn't need to be updated. A small change to EEPROM_Write() might avoid problems for these folks. Code:
unsigned char EEPROM_Write(unsigned int address, unsigned char data)Thanks again for all the hard work. |
Re: EEPROM Code
Quote:
-Kevin |
Re: EEPROM Code
So, to write "127" to the first data block would be
Quote:
Quote:
|
Re: EEPROM Code
Yes, that will work.
-Kevin |
Re: EEPROM Code
hrmm. I love the simplicity of this. Last year, i wrote overly complex EEPROM routines to allow data of arbitrary length to be stored with dynamic allocation and FAT table. It turns out, not a whole lot of that functionality was ever needed. A scheme like yours would have workded just fine. It makes me want to smack myself in the face and say "duh".
|
Re: EEPROM Code
How much variable is space is available in the onboard EEPROM?
|
Re: EEPROM Code
Quote:
|
Re: EEPROM Code
Quote:
-Kevin |
Re: EEPROM Code
It will write only when there is no free space in the write que?
|
| All times are GMT -5. The time now is 04:36. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi