// 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)