Current location - Music Encyclopedia - Chinese History - Single-chip EEPROM data storage and reading, want to read the latest 10 group data, specific ideas.
Single-chip EEPROM data storage and reading, want to read the latest 10 group data, specific ideas.
1, I don't know how you display it, LCD display or serial port printing.

I don't know whether you want to save all the ten data measured many times.

EepROM reads and writes data in the form of IIC. Generally speaking, the address of IIC is fixed. Just write the address of the location to be read in the second address.

Here are the detailed steps:

Read operation:

1: IIC address for sending data, which is not described in IIC protocol.

2: Send the address to be read,

3: Send IIC read address, that is, write address plus 1.

4. Read data, so it depends on whether your protocol is hardware implementation or IO simulation. If it is implemented by hardware, just read the register buff directly. If it is software simulation, the delay needs to be calculated, so that the sampling will be accurate.

These four steps all need IIC protocol to start, transmit data, wait for reply and end.