oEEProm Object

Main Index
Object List
Back to top of pageDescription:
 Provides access to the non-volatile I2C EEPROM memory.
 The following table lists the size and availability of the oEEProm Object.
 ObjectSizeDescriptionA1A2B1B2C1
oEEProm5 BytesProvides access to the non-volatile I2C EEPROM memory.xxxxx
Back to top of pageOperation:
 The oEEProm Object reads/writes a byte from/to the EEPROM memory chip located in socket E0 or E1. The memory location that gets read from or written to is specified by the Location property. Each time the Value property is read or written to, the Location property will increment by 1. The Location property can be assigned to the location of specified data by using the Data method.

When the Data method is used, All of the properties are automatically set up for the EEPROM that is plugged into the E0 socket.

When an Value property is read from, it reads the memory location specified by the location property from the EEPROM and updates the Value property. 

When the Value property is written to, it writes the new value to the location specified by the location property.

Note that the Value property cannot be assigned to a pointer in a virtual circuit.

Caution: If a program writes to the EEPROM memory chip when the Location is positioned before the program's end, then care must be taken to prevent it from overwriting the program code. If the Location has not been allocated for data, then any writes to the oEEProm Object will overwrite the program code and the EEPROM memory will have to be re-programmed in order to retrieve the program code that was overwritten.

The I2C property is an instance of the oI2C object which the oEEProm Object uses to communicate with the I2C-EEPROM used in the E0 and E1 sockets.  It configures I2C's properties accordingly and modifying them will affect the oEEProm Object's operation in ways that could make it unable to communicate with the EEPROM.  See the oI2CM Help for more detail on how to access I2C devices such as the EEPROM.

Back to top of pageProperties:
 

The following table lists the properties of the oEEProm Object:

Property

Description

Value
A value that indicates the contents of the EEPROM's memory location specified by the Location property. When read, the value stored in the EEProm memory chip will be returned. When Written, the value is stored into the EEProm memory chip.
Object Class: oProperty Value Range: 0 - 65535
Data Type: Numeric Default Value: 0
Note that the Value property is a function and not an instance of the oValue Object. Therefore it cannot be assigned to a pointer in a virtual circuit.
Location
A value that specifies the current read/write location in the EEProm memory chip.
Object Class: oVar1 Value Range: 0 - 65535
Data Type: Numeric Default Value: 0
Node
A value that specifies which EEPROM to use.
Object Class: oVar7 Value Range: 0 - 127
Data Type: Numeric Default Value: 0
The following table lists the values of the Node property:
NoIncConstantDescription
80cvE0The EEPROM in Socket E0 is addressed.
84cvE1The EEPROM in Socket E1 is addressed.
NoInc
A value that selects if the Location property will be incremented each time the oEEProm object's Value property is read or written.
Object Class: oSelect0to1L Value Range: 0 - 1
Data Type: Numeric Default Value: 0
The following table lists the values of the NoInc property:
NoIncConstantDescription
0cvFalseThe oI2CM Object increments the Location property each time the Value property is read or written
1cvTrueThe oI2CM Object does not increment the Location property each time the Value property is read or written
Width
A value that selects the number of Bytes to read/write at a time.
Object Class: oSelect0to1 Value Range: 0 - 1
Data Type: Numeric Default Value: 0
A value that specifies the number of bytes to read/write
WidthConstantDescription
0cv8BitThe oI2CM Object will read and write 8 bits at a time
1cv16BitThe oI2CM Object will read and write 16 bits at a time (see history)
I2C
The I/O function object used to communicate with the EEPROM.
Object Class: oI2CM Value Range: 0 - 65535
Data Type: Numeric Default Value: 0
Address
Returns a pointer to the address of the oCounter Object instance.
Object Class: oAddress Value Range: 0 - 127
Data Type:Pointer (Read Only) Default Value: Address of Object

 In the following example uses the oEEProm Object.
Visual Basic SyntaxC and Java Syntax
' This program stores the numbers
' 1, 2, 3, 4 & 5 into the EEProm
' at compiler time.
' It then reads those numbers
' at run time.

Dim A As New oEEProm
Dim B1 As New oByte
Dim B2 As New oByte
Dim B3 As New oByte
Dim B4 As New oByte
Dim B5 As New oByte

Sub Main() 
  A.Data(1,2,3,4,5)
  B1 = A
  B2 = A
  B3 = A
  B4 = A
  B5 = A
End Sub
// This program stores the numbers
// 1, 2, 3, 4 & 5 into the EEProm
// at compiler time.
// It then reads those numbers
// at run time.

oEEProm A = New oEEProm;
oByte B1 = New oByte;
oByte B2 = New oByte;
oByte B3 = New oByte;
oByte B4 = New oByte;
oByte B5 = New oByte;

Void Main(Void){
  A.Data(1,2,3,4,5);
  B1 = A;
  B2 = A;
  B3 = A;
  B4 = A;
  B5 = A;
}
Basic Syntax 
' This program stores the numbers
' 1, 2, 3, 4 & 5 into the EEProm
' at compiler time.
' It then reads those numbers
' at run time.

A As oEEProm
B1 As oByte
B2 As oByte
B3 As oByte
B4 As oByte
B5 As oByte

A.Data(1,2,3,4,5)
B1 = A
B2 = A
B3 = A
B4 = A
B5 = A
 
Back to top of pageMethods:
 The following table lists the Methods of the oEEProm Object:
Methods

Description

DataFills the EEPROM with the specified arguments at compile time.  When encountered at run time, sets the Location property to the data's beginning address.  Each use of Data will update the Location property.

Note that the Data method expect that the EEPROM being used is in Socket E0.  All data generated at compile time will be downloaded accordingly.

Back to top of page Related Items:

 Variables can be created in EEPROM with the directive "A As EEPROM Byte".
Back to top of page Version History and Bug List:
 Firmware Ver A1: Introduced.

Bugs:
Firmware B.2 introduced a bug where 16 bit values cannot be written/read reliably.
Firmware C.1 fixed.


ooPIC Compiler Ver 6.0 (c) Copyright 1997 - 2007 Savage Innovations, LLC.