參數(shù)資料
型號: VIRTUAL
英文描述: Virtual Flash EEPROM Driver for the M16C/62
中文描述: 虛擬閃存EEPROM的雙隨機PWM驅(qū)動
文件頁數(shù): 3/7頁
文件大?。?/td> 255K
代理商: VIRTUAL
M16C/62
5. Implementing the VirtEE drivers in a User Programs
Virtual Flash EEPROM Driver for the M16C/62
Include “flash.h” in any project file that requires driver functions. Add “RAM62.c” , “virtEE.c”, and
“EE_fl_util.c” to your project. These files require the “fdriver.h” and “sfr62.h” header files. By default, the
driver uses the two 64k blocks 5 and 6 for the virtual EEPROM. This can be changed to the two 8k blocks
(1 and 2) at FA000h and FA000h by un-commenting the definition “#define BLOCKS8K “ near the top of
file “flash.h”. The maximum size of EEPROM changes to FF0h. Note that using blocks 1 and 2 is not
compatible with the ROM monitor and KD30.
The following is a list of the driver function calls and how to use them.
int setEE_size(size)
This function MUST be called before calling any other of the following functions.
Size = 2 to 7ff0h (or 2 to ff0h if using 8k blocks). Sets the maximum size of the EEPROM in words
(16 bits). Once set, it can only be changed with the resetEE() function (size stored in flash).
Returns 1 if no errors, 0 on invalid size, -1 on error, or the previously set size value (2 to 7ff0h).
Errors (-1) are caused by flash write errors or the EEPROM “file” in flash cannot be found. To
determine the flash write error call readsrd().
When called for the first time (no size stored in flash), flash blocks C0000h and D0000h are
completely erased.
The user must call this function before calling checkEE().
int void checkEE(void)
This function verifies that the flash blocks used for EEPROM contain the same data (see theory of
operation). This function should always be called after reset but after calling setEE_size().
Returns 1 if no errors, -1 on error. These errors can result from an interruption of power or non-
maskable interrupt occurring during a write to EEPROM If a nonrecoverable error is detected, call the
resetEE() function.
Obviously, this function cannot detect a loss of data due to a power loss before or shortly after a call
to writeEE().
int
void resetEE()
Completely erases flash blocks C0000h and D0000h. Call this function only after checkEE() detects
an error.
After calling this function, call EE_size().
int writeEE(int value, int tag)
Writes the word “value” to EEPROM at EEPROM location “tag” (0 to size -1). Returns 1 if no errors, -
1 on SRD error, or 0 on invalid “tag”. Before writing, this function checks if the value to be written is
the same as that stored in the EEPROM. If so, function returns with no error.
char readsrd()
Returns the flash SRD register.
AN-DECE-MCU-31-A
February 2002
2
相關(guān)PDF資料
PDF描述
VIT5000 Optoelectronic
VIVL224 LIGHT FITTING OFFICE
VIVL224EMIN LIGHT FITTING OFFICE
VIWT826A VDSL FILTER SOLUTIONS
VJ0612 Multilayer Ceramic Chip Capacitors LowInductance
相關(guān)代理商/技術(shù)參數(shù)
參數(shù)描述
VI-RU 制造商:VICOR 制造商全稱:Vicor Corporation 功能描述:50 to 600W Autoranging AC-DC Switchers
VI-RU011-EUUU-BC 制造商:VICOR 制造商全稱:Vicor Corporation 功能描述:50 to 600 W Autoranging AC-DC Switchers
VI-RU011-EUUU-BM 制造商:VICOR 制造商全稱:Vicor Corporation 功能描述:50 to 600 W Autoranging AC-DC Switchers
VI-RU011-EUUU-OC 制造商:VICOR 制造商全稱:Vicor Corporation 功能描述:50 to 600 W Autoranging AC-DC Switchers
VI-RU022-EYYY 制造商:Vicor Corporation 功能描述:VI Series AC/DC Switcher; 1-95 Vdc, Several outputs; 50 600 W