Go to Post Save the frustration for build season. :p - Brian C [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

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 11-10-2005, 01:44
Kevin Watson's Avatar
Kevin Watson Kevin Watson is offline
La Caņada High School
FRC #2429
Team Role: Mentor
 
Join Date: Jan 2002
Rookie Year: 2001
Location: La Caņada, California
Posts: 1,335
Kevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond repute
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
and write to the Electrically Erasable Programmable Read-only 
Memory (EEPROM) contained within your robot controller's 
processor. Storing information in EEPROM has the advantage of 
being permanent, unlike Random Access Memory (RAM), which
gets reinitialized each time you reset or restart your robot
controller.
 
See the code in Process_Data_From_Master_uP() for an example
application of this software.
 
This source code will work with the Robovation (A/K/A EDU-RC) 
robot controller and the FIRST Robotics robot controller.
 
The included project files were built with MPLAB version 7.20.
If your version of MPLAB complains about the project version, 
the best thing to do is just create a new project with MPLAB's 
project wizard. Include every file except: FRC_alltimers.lib 
and ifi_alltimers.lib and you should be able to build the code.
****************************************************************
Three things must be done before this software will work 
correctly with your robot controller:
 
1) You need to add eeprom.c and eeprom.h to your project.
Do this by copying the two files to your project directory
and then right clicking on "Source Files" in the project
tree, selecting "Add Files...", if necessary, navigate to
the project directory and then double click on eeprom.c.
Repeat the above procedure for eeprom.h under "Header Files".
 
2) A #include statement for the eeprom.h header file must be 
included at the beginning of each source file that calls the 
functions in eeprom.c. The statement should look like this: 
#include "eeprom.h".
 
3) The function EEPROM_Write_Handler() function must be called
from Process_Data_From_Master_uP() each time it executes.
****************************************************************
Here's a description of the functions in eeprom.c:
 
EEPROM_Read()
Reads data from EEPROM.
 
EEPROM_Write()
Places new write data on the EEPROM write queue. This function
returns a value of one if there was an available slot on the
queue, zero if there wasn't. EEPROM_Queue_Free_Space() should
be called to determine if enough free space is available on
the queue before calling EEPROM_Write(). By default, there
are sixteen slots available. The number of usable slots is
defined in eeprom.h.
 
EEPROM_Write_Handler()
If buffered EEPROM write data is present (i.e., EEPROM_Write()
has been called), this function will write one byte to EEPROM 
each time it is called. A call to this function should be placed
in and called each time Process_Data_From_Master_uP() is called.
If, on average, you need to write more than one byte of data to
EEPROM each time Process_Data_From_Master_uP() is called, you can 
call it multiple times each loop. If you start experiencing wacky
behavior when your 'bot runs or get the red-light-of-death, you
might be attempting to write too much data too quickly. Because
it takes 2 milliseconds to write each byte of data to EEPROM and
all interrupts are disabled during this period, don't write data
to EEPROM when you need to service interrupts.
 
EEPROM_Queue_Free_Space()
Returns the number of free slots available on the EEPROM write
queue. This function should be called to determine if enough 
free space is available on the write queue before calling 
EEPROM_Write().
__________________
Kevin Watson
Engineer at stealth-mode startup
http://kevin.org
 


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
Out of the Box Camera Code russell Programming 9 21-10-2009 05:28
Code suddenly fails to initialize miketwalker Programming 11 19-02-2005 15:23
Team THRUST - Kevin's Code and Camera Code Combine Chris_Elston Programming 3 31-01-2005 22:28
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


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

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