上传者: u010210711
|
上传时间: 2024-01-31 22:35:17
|
文件大小: 185KB
|
文件类型: PDF
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.