Library provided by Embedded Systems Academy, Copyright 2000 Visit www.esacademy.com/faq/progs for examples and libraries. This library: RX2FVLIB - name of application: RX2FVLIBExample ============================================================= Flash Variable Library for the Philips 89C51Rx2 Family Hardware requirements ===================== Phytec RDK Rx2 with Philips Rx2 Software requirements ===================== Phytec Flash Tools (part of RDK Rx2) www.phytec.com Raisonance 8051 compiler system - EVAL version sufficient www.raisonance.com or Keil 8051 Compiler System - EVAL version sufficient www.keil.com Optional: Development Assistant-C by RistanCASE www.ristancase.ch Tested using ============ Raisonance 51 Toolset version 6.1.1 Keil C51 Toolset version 6.02 Application description ======================= Raisonance specific files have their names prefixed with 'r'. Keil specific files have their names prefixed with 'k'. The same source files are used for both compilers. The RX2FVLIB is a Flash Variable library for the Rx2 family, which allows variables to be stored in the flash memory and individually updated without having to erase flash. The library has been written to store variables in a fail-safe manner. A reset, system crash or power failure can occur at any time and the values of the flash variables will not be lost. The package includes the library, a C header file, a manual in PDF format and an example project for both the Raisonance and Keil 8051 Compilers. The following functions are implemented in the library: unsigned char fv_table_full(unsigned char size); unsigned char fv_write_byte(unsigned char id, unsigned char value); unsigned char code *fv_read_byte(unsigned char id); unsigned char fv_init(unsigned char xtal, unsigned char block1, unsigned char block2); unsigned int fv_table_size(void); unsigned char fv_garbage_collector(void); unsigned char code *fv_fast_write_byte(unsigned char code *ptr, unsigned char value); The library only supports storage of single-byte variables, however the method is clearly demonstrated and the library may easily be customized to store any kind and size of variable.