Flash Memory and EEPROM

The EM500 has 512KB of internal flash memory and 208 bytes of EEPROM (see Ordering Info and Specifications).

A portion of the internal flash memory is used to store the TiOS firmware. When you are performing a firmware upgrade, it is to this memory you are saving the firmware binary.

The rest of this flash memory is available to your Tibbo BASIC/C application. The internal flash memory cannot be used as a flash disk. On the EM500, the fd. object requires an external flash IC.

As shown in the schematic diagram below, this flash IC is ATMEL AT45DB041. When connected, this flash IC is used exclusively by the fd. object and provides 1MB of storage. The 5.1KΩ pull-up resistor is needed to "sharpen" the SPI clock signal. The EM500's bidirectional GPIOs allow interconnecting the SI and SO lines — this saves one GPIO line!

A circuit diagram illustrating the connections between an EM500 and an ATMEL AT45DB041.

The fd. object is enabled in the Project Settings dialog of Tibbo IDE (TIDE). To enable, click on the Customize button (in the Project Settings dialog) and set Flash disk (fd.) object to Enabled.

A warning note icon.DO NOT enable the fd. object unless you actually have the flash IC attached. When the fd. object is enabled, the EM500 will attempt to detect the flash IC's presence. That is, the EM500 will try to access the flash through SPI. This means that there will be signals on GPIO4 (CS), GPIO3 (CLK), and GPIO1 (DI/DO). Flash IC detection may interfere with the operation of your device (if you have something else connected to these GPIOs).  

The EEPROM is almost fully available to your application, save for a small 28-byte area called "special configuration area." The EEPROM is accessed through the stor. object. Details on the special configuration area are provided in the EM500 platform documentation.

A warning note icon.On the advice of one of our customers, we would like to remind you that, like all other EEPROMs on the market, the EEPROM ICs used in Tibbo devices allow for a limited number of write cycles. As the Wikipedia article on the subject states, the EEPROM "... has a limited life for erasing and reprogramming, now reaching a million operations in modern EEPROMs. In an EEPROM that is frequently reprogrammed while the computer is in use, the life of the EEPROM is an important design consideration."

If you plan to use the stor. object, please carefully consider if the intended mode of EEPROM use will allow the EEPROM to work reliably throughout the entire projected life of your product. For more information, see Prolonging and Estimating EEPROM Life.

Like all other flash memory devices on the market, flash ICs used in Tibbo products only allow for a limited number of write cycles. As the Wikipedia article on the subject explains, modern flash ICs still suffer from comparatively low write endurance. In Tibbo devices, this endurance is about 100,000 write cycles per sector. When you are using the flash memory for file storage, the fd. object employs sector wear leveling to maximize the life of the flash IC — but the life remains limited. If your application employs direct sector access, you need to plan the application around the flash memory's life limitations. For data that changes often, consider using the EEPROM instead. EEPROMs have much better endurance.