Writes 1 block (32 bytes) to the non-volatile user or calibration memory. Command number 0x28 accesses the user memory area which consists of 512 bytes (block numbers 0-7). Command number 0x2B accesses the calibration memory area consisting of 512 bytes (block numbers 0-15), of which the last 6 blocks are not used. Memory must be erased before writing. Do not call this function while streaming.
The U6 flash has a rated endurance of at least 20000 writes, which is plenty for reasonable operation, but if this function is called in a high-speed loop the flash could eventually be damaged. In the case of these functions, that means 20000 writes per 32-byte block.
Note that the U6 has 512 Bytes of user memory, but only 256 Bytes are accessible when using the LJ_chUSER_MEM function in the UD driver.
Table 5.2.7-1. WriteMem Command Response
Command: | |
Byte | |
0 | Checksum8 |
1 | 0xF8 |
2 | 0×11 |
3 | 0×28 (0×2B) |
4 | Checksum16 (LSB) |
5 | Checksum16 (MSB) |
6 | 0×00 |
7 | BlockNum |
8-39 | 32 Bytes of Data |
Response: | |
Byte | |
0 | Checksum8 |
1 | 0xF8 |
2 | 0×01 |
3 | 0×28 (0×2B) |
4 | Checksum16 (LSB) |
5 | Checksum16 (MSB) |
6 | Errorcode |
7 | 0×00 |