
This page in PDF |
Uart Code General Structure The Data Flash library is written much like a file system with differences that account for the media which is not byte erasible. Data flash can be rewritten, but it must be erased in large blocks first, for instance 4 kBytes. Saving it to RAM for latter re-write is not always feasible because of memory limitations. In the case of a power failure before the block can be rewritten, data loss occurs. Data logging applications generally don't need re-write capability, however, a way to keep track of file size and read/write pointers is necessary. Keeping them is RAM is possible, but unsafe. A better solution is to store them in EEPROM, or FRAM. The latter, made by Ramtron is read/write capable, with very fast response, and is non-volatile. Functions exist to open named files, concatenate data to them, and to transfer the data to a host via a serial port. The number of data flash chips and their byte size is configurable. Chip select logic is done based on a linear address and the declared byte size of chips. Reading and writing across chip boundaries is transparent to the application.
|