Hi,
How to read/write the memory register of the DS2431 at address 080h-08Fh?
Maybe you can help me to create the script.
https://datasheets.maximintegrated.com/en/ds/DS2431.pdf
See page 7 for memory mapping
Code: Select all
// DS2431
// Read registers from address 80h-87h
#SCRIPT HEADER;
SCRIPT:v1.8.2;
#HARDWARE SETTINGS;
HW:1-WIRE,4.5V,SLOW;
// Protection Control Byte 0-3
#OPERATION;
SW:0,0,1,3,0,0,0,0,0,500;
INSTR:CC, F0, 80, 00; // SKIP ROM + READ MEMORY (4 bytes) + START ADDR
// Copy Protection Byte
#OPERATION;
SW:0,0,1,0,0,0,0,0,0,500;
INSTR:CC, F0, 84, 00; // SKIP ROM + READ MEMORY (4 bytes) + START ADDR
// Factory Byte. Set at Factory
#OPERATION;
SW:0,0,1,0,0,0,0,0,0,500;
INSTR:CC, F0, 85, 00; // SKIP ROM + READ MEMORY (1 byte) + START ADDR
// User byte/Manufacturer ID (2 bytes)
#OPERATION;
SW:0,0,1,1,0,0,0,0,0,500;
INSTR:CC, F0, 86, 00; // SKIP ROM + READ MEMORY (2 bytes) + START ADDR
Code: Select all
// DS2431
// Write registers at 80h-87h
#SCRIPT HEADER;
SCRIPT:v1.8.2;
#HARDWARE SETTINGS;
HW:1-WIRE,5.0V,SLOW;
// STEP 1 - Write Scratchpad (write 8 data bytes to registers)
#OPERATION;
SW:1,7,0,0,0,0,0,10,0,500;
INSTR: CC, 0F, 80, 00; // SKIP ROM + Write Scratchpad + TA1 [7:0] target address LSB + TA2 [15:8] target address MSB
DATA: 00,00,00,00,00,55,12,34; // Write 8 byte register (Protection Control Byte 0,1,2,3 + copy protection byte + dummy byte + user ID1 + user ID2)
// STEP 2 - Read Scratchpad (TA1 + TA2 + ES + 8 DATA BYTE = 11 bytes total)
// 1st byte should be equal to TA1 from Step 1
// 2nd byte should be equal to TA2 from Step 1
// 3rd byte is AUTHORIZATION CODE which should be used in next step
// 4rd byte should be equal to data byte from Step 1
#OPERATION;
SW:0,0,1,10,0,0,0,0,0,500;
INSTR:CC, AA; // SKIP ROM + READ Scratchpad
// STEP3 - Copy Scratchpad
// Please note - you need to first execute STEP1 and STEP2 to read autorhization code (3rd byte in step2) and use this autorization code last byte in below instruction
#OPERATION;
SW:0,0,0,0,0,0,10,0,0,500;
INSTR:CC, 55, 80, 00, 07; // SKIP ROM + COPY Scratchpad + TA1 (from step1) + TA2 (from step1) + AUTHORIZATION CODE (3rd byte read in STEP 2)
Return to “Tutorials and Examples”
Users browsing this forum: No registered users and 2 guests