
Revision: 1.18
CrossFire IX – Freely Programmable - Data Logger Edition -
Programming Manual
2018-12-21
11
together with the external FLASH memory to be able to log certain things with a “real time”
timestamp.
Reading and writing to the RTC is relatively slow as it is connected through the I2C bus. It is
recommended to read the RTC at start up and set the processor clock accordingly and use the
processor clock from then on.
The functions for the RTC are:
unsigned char
EXTRTC_SetTime(timeStruct
*time);
Set RTC Time
unsigned char
EXTRTC_GetTime(timeStruct
*time);
Get the current time. This is a slow operation so generally it is
better to read this once at start up and set processor clock
accordingly.
15.2.
External FLASH Memory
The external FLASH memory is a 4/8MB flash memory connected to the main processor using SPI.
The FLASH memory can be used for logging or for storage of large amounts of data that does not fit
within then main processor FLASH memory.
The FLASH memory is divided into 4KB sectors and 64KB blocks. Erase must be performed in
sector or block sizes. It is faster to erase a complete block at once than erasing a block sector by
sector. It is also possible to erase the complete FLASH at once. Please note that writing to and
erasing the external FLASH memory is a relatively slow operation. Writing to the FLASH memory
requires the memory to be erased first. There is a limited number of erase/write operations the can
be done to the FLASH memory. For writing small amounts of data that changes often, consider
using the FRAM memory instead.
The Read/Write/Erase speed that can be expected from the FLASH memory can be seen in the
table below. Please note that these values are only indicative and can vary. These values are real
values measured on the CrossFire IX. Values within parenthesis are from FLASH memory
reference manual.
Operation
Speed
Size
Sector Erase
68 KB/s (58 KB/s)
4096 bytes
Block Erase
158 KB/s (146 KB/s)
65536 bytes
Read
1074 KB/s (6.5 MB/s)
256 bytes
Write
286 KB/s (365 KB/s)
256 bytes
Although possible to implement, there is no file system for the external FLASH memory delivered
by CrossControl.
Please read the data sheet for the FLASH memory for additional details.
The most common functions for the external FLASH are the following
unsigned char
EXTFLASH_SectorErase(unsigned long
address, BOOL async)
Erase a FLASH sector (4096 bytes). Erase speed is about
68Kb/s. This will take about 60ms.
unsigned char
EXTFLASH_BlockErase(unsigned long
Erase a FLASH block (65536 bytes). Erase speed is about