
94
Example 2a:
Use of serialization split with RETLW instructions for Microchip PIC16F628 devices.
Device PIC16F628 has 14 bit wide instruction word. Instruction RETLW has 14-Bit Opcode:
Description
MSB 14-Bit
word LSB
RETLW
Return
with
literal
in
W 11 01xx kkkk kkkk
where xx can be replaced by 00 and k are data bits, i.e. serial number byte
Opcode of RETLW instruction is hexadecimal 34KKH where KK is data Byte (serial number
byte)
Let’s assume we want to write serial number 1234ABCDH as part of four RETLW instructions
to device PIC. The highest Byte of serial number is the most significant Byte. We want to write
the serial number to device program memory at address 40H. Serial number split us very
useful in this situation. Serialization without serial number split will write the following number
to buffer and device:
Address Data
0000080 CD AB 34 12 xx xx xx xx xx xx xx xx xx xx xx xx
Note:
Address 80H is because buffer has byte organization and PIC has word organization so
it has equivalent program memory address 40H. When buffer has word organization x16, the
address will be 40H and number 1234ABCDH will be placed to buffer as following:
Address Data
0000040 ABCD 1234 xxxx xxxx xxxx xxxx xxxx xxxx
We want to use RETLW instruction so buffer has to be:
Address Data
0000040 34CD 34AB 3434 3412 xxxx xxxx xxxx xxxx
We can do this by following steps:
A)
write four RETLW instructions at address 40H to main buffer (this can be done by hand
editing buffer or by loading file with proper content). The bottom 8 bits of each RETLW
instruction are not important now, because serialization will write correct serial number bytes at
bottom 8 bits of each RETLW instruction.
The buffer content before starting device program will look for example as following:
Address Data
0000040 3400 3400 3400 3400 xxxx xxxx xxxx xxxx
8 bits of each RETLW instructions are zeros, they can have any value.
B)
Set the serialization options as following:
S/N size:
4 Bytes
Address:
40H
Start value:
1234ABCDH
Step:
1
S/N mode:
BIN
Содержание 448PRO2
Страница 7: ...Introduction 7 Introduction...
Страница 12: ...12 Quick Start...
Страница 15: ...Detailed description 15 Detailed description...
Страница 16: ...16 DATAMAN 448PRO2...
Страница 30: ...30 DATAMAN 48PRO2 DATAMAN 48PRO2C...
Страница 46: ...46 DATAMAN 40PRO...
Страница 55: ...Setup 55 Setup...
Страница 60: ...60 Step 8 Installation process will start Step 9 Click Finish button to finish setup...
Страница 64: ...64 Click on Continue Anyway button For Windows Vista Click Install this driver software anyway...
Страница 66: ...66 PG4UW...
Страница 133: ...PG4UWMC 133 PG4UWMC...
Страница 146: ...146 Installation procedure customized...
Страница 151: ...Common notes 151 Common notes...
Страница 165: ...Troubleshooting and warranty 165 Troubleshooting and warranty...