> ...It is named the same as the EEPROM module so it
> seems to include itself and the compiler can't find needed
> references. I solved that by renaming the expample code.
Sorry about that - the search path ordering was changed in the last update (documented) from
LIB->USERLIB->SOURCEFOLDER
to
SOURCEFOLDER->USERLIB->LIB
Hopefully you can see that this new search ordering has a number of benefits. I'll rename the sample file in question in the next release build.
> I give up, am going to need some help
Like Bruce, I tried this on a 18F252 and 18F452 without problems. The code is known to work on many other 18 series also.
However, what hardware silicon version is the MCU (you should be able to get this information from your hardware programmer). Revisions B2, B3, B4 and B5 had a problem which required EEDATA to be saved immediately after a read. If using older silicon, you might want to try the following
(a) Open ..\Swordfish\Library\EEPROM.bas
(b) Unlock the file for editing (double click on the padlock above the code windows)
Comment out the 'ReadByte' function and replace with this one
Code: Select all
public function ReadByte(pAddress as TAddress) as byte
dim RD as EECON1.Booleans(0)
EECON1 = $00
RD = true
result = EEDATA
BackToFLASH
inc(Address)
ClrWDT
end function
There was also an error with C0 and C1 silicon, where RD could not be set immediately after writing to ADR, but this should not be a problem with the current library code or the code shown above.