To write the new Voltage Divider value can be programmed as follows: - SubclassID for “Voltage Divider” is 104 or 0x68 hex, and offset is 14 - Write 0x00 using BlockDataControl() command (0x61) to enable block data flash control. (wr 0x61 0x00) - Write 0x68 (Calibration Subclass) using the DataFlashClass() command (0x3E) to access the Registers subclass. (wr 0x3E 0x68) - Write the block offset location using DataFlashBlock() command (0x3F). To access data located at offset 0 to 31, use offset = 0x00. For example, Voltage Divider (offset = 14) is in the first block so use (wr 0x3F 0x00). - To read the data of a specific offset, use address 0x40 + mod(offset, 32). So to read the old Voltage divider (rd 0x4E old_Voltage Divider_MSB) (rd 0x4F old_Voltage Divider_LSB) - To write the data of a specific offset, use address 0x40 + mod(offset, 32). So to write the new Voltage divider (rd 0x4E new_Voltage Divider_MSB) (rd 0x4F new_Voltage Divider_LSB) - The data is actually transferred to the data flash when the correct checksum for the whole block (0x40 to 0x5F) is written to BlockDataChecksum() (0x60). (wr 0x60 NEW_checksum) The checksum is (255-x) where x is the 8-bit summation of the BlockData() (0x40 to 0x5F) on a byte-by-byte basis. A quick way to calculate the new checksum is to make use of the old checksum: (a) temp = mod (255 – OLD_checksum – old_Voltage Divider_MSB - old_Voltage Divider_LSB), 256)(b) NEW_checksum = 255 – mod (temp + new_Voltage Divider_MSB + new_Voltage Divider_LSB, 256) Step 3. Update any individual flash locations, such as serial number, lot code, and date: In a similar manner to the Voltage divider, any pack specific data such as serial number, lot code and date can be changed during the production process.
2024-01-31 22:35:17 185KB BQ78350
1
用逻辑分析仪抓取的波形然后通过代码实现对电量计的dataflash读取和写入,关键部分在怎么样去用波形转化出代码。其实就是iic协议!
2023-03-04 11:16:41 55KB gas gauge
1
新唐NUC029 DataFlash模拟E2PROM存储程序,用于掉电保存参数或者保存设备配置信息,包含.c和.h文件,直接添加到工程即可使用
1
AT45dbxxx系列库 我希望使用它并享受。 我使用Stm32f103vg和Keil编译器以及Stm32CubeMX向导。 请这样做... 1)使能Spi和CS的引脚。 2)在项目设置上选择“一般外围设备初始化为每个外围设备成对的'.c / .h'文件对”。 3)配置您的45dbxxConfig.h文件。 4)在启动您的应用程序时添加AT45dbxx_Init。
2022-04-12 11:19:04 16KB library stm32 hal dataflash
1