Electronic recorder memory card

Systems that need to memorize data are measuring instruments, fiscal devices, medical instruments, security systems, flight recorders (black boxes), electronic on-board recorders (EOBR), point of sales (POS) etc. These devices often include electronic non-volatile memories for data accumulation. Currently are used RAM memories with battery backup. However, this configuration has some disadvantages, the battery failure lead to loss of data and the circuit is made with many components. Using flash memories for this purpose is a better option in applications where is no need for many records. Flash memory architecture minimizes interface circuitry needed for updates of memory contents. Also are offered cost-effective in-system reprogramming, extended cycling capability and true nonvolatility without the danger of data loss. There is no need for battery, a very critical component.

I made a project some years ago for a memory card to be used in applications that need data logging. The idea was to not use only a simple flash memory and to use a card with microcontroller for security reasons. The communication with the memory card uses a proprietary non standard protocol over a serial interface with TTL level. Also the format of data stored in flash memory is non standard and encrypted with an algorithm embedded in microcontroller program, not known to end users. The reason was to not allow the people who extract the flash memory from card to read and alter recorded data. In this way, the memory card can be read and write only in systems that are designated by the manufacturer. My project includes a flash memory 28F512 which needs 12V for programming. There is also an equivalent AT29C040, 5 volt only reprogramming, but is not pin to pin compatible with the memory used by me, printed circuit board PCB must be changed for this type of flash.

Specification:
♦ Power supply: Vcc - 5V / 100mA stabilized, Vp - 18V / 50mA
♦ Microcontroller Atmel 89C51
 - 4K Bytes Reprogrammable Flash Memory
 - 128 Bytes internal RAM memory
 - 32 Programmable I/O Lines
 - program memory protection
 - three 16-bit timer/counters
 - six interrupt sources
 - low power idle and power down modes
♦ Flash Memory 512kB
 - organized as 65,536 bytes of 8 bit
 - flash electrical chip-erase - 1 second typical
 - erase/program power supply Vpp 12V
 - over 100,000 electrical chip-erasure/reprogram cycles
 - write protection - the command is only active when Vpp is at high voltage
♦ LM723 - high precision voltage regulator

Figure 1
Schematic diagram
Figure 2
PCB layout
image

Figure 1 contains the schematic diagram of the memory card. The main parts are:
-microcontroller 89C51 with built-in flash memory for program. The on-chip flash allows the program memory to be reprogrammed in-system or by a conventional non volatile memory programmer.
-512 kB external flash memory used for data logging
-high precision power supply regulator for Vpp

The Vpp power supply is switched to high state by microcontroller only when memory updates are desired. In the absence of 12 V on the Vpp pin, the 28F512 is a read-only memory. Communication of memory card with other devices is made by a serial interface with TTL voltage levels. Other signals received by memory card are: RESET to initialize the program and PFAIL to know if the device that sends commands to memory card is ON or OFF.

Note: As an example, consider a typical application of a data logger that memorize 32 bit of data per record and the exact date and time of each measurement. We have 512 kB total memory capacity. We can use an Unix timestamp (seconds since Jan 01 1970) format with 10 bytes and a numeric variable 32 bit for data (either one single-precision floating-point variable with 4 bytes or two variables of 16 bit each, which is the case for some acquisition modules with two channels). This means 14 bytes per record. In this case the memory card has a capacity of approx. 36500 records.
  Another approach more efficient is to store data and time in Unix format at the beginning and for the rest of the records to memorize only time difference in seconds. In this case each record will have 9 bytes and give us approx. 56000 records capacity of memory card.

Warning: This project can be used in applications where is no need for many records. It is not recommended to use the same memory chip for more than 100000 records (this can be arranged by software program). You can use a socket for flash memory and replace the chip when this number is reached. The chip can be kept as evidence. Since the data format is encrypted, cannot be altered without leaving traces by other people who don't know the algorithm.

Disclaimer: The information on this web site is provided "AS IS", without warranty of any kind. The author has made the best efforts to ensure the design and the information provided are reliable. Under no circumstances shall the author be liable for any direct, indirect, incidental, special or consequential loss, damage, expense or injury incurred or suffered which is claimed to resulted from use of this site, even if expressly advised of the possibility of such loss, damage, expense or injury, including, without limitation, any fault, error, omission, interruption or delay with respect thereto.

Links:
[1] - Atmel 89C51 datasheet
[2] - Intel 28F512 datasheet
[3] - LM723 datasheet