При работе с DS2431 возникают расхождения с протеусом.
Интересует мнение тех, кто работал с данной микрухой.
Я руководствуюсь даташитом
Цитата:
|
With the Write Scratchpad command, the CRC is generated
by first clearing the CRC generator and then
shifting in the command code, the target addresses
TA1 and TA2, and all the data bytes as they were sent
by the bus master. The DS2431 transmits this CRC only
if E[2:0] = 111b.
With the Read Scratchpad command, the CRC is generated
by first clearing the CRC generator and then
shifting in the command code, the target addresses
TA1 and TA2, the E/S byte, and the scratchpad data as
they were sent by the DS2431. The DS2431 transmits
this CRC only if the reading continues through the end
of the scratchpad. For more information on generating
CRC values, refer to Application Note 27.
|
Далее вижу
Цитата:
|
Tx (Reset) Reset pulse
Rx (Presence) Presence pulse
Tx CCh Issue “Skip ROM” command
Tx 0Fh Issue “Write Scratchpad” command
Tx 20h TA1, beginning offset = 20h
Tx 00h TA2, address = 0020h
Tx ‹8 Data Bytes› Write 8 bytes of data to scratchpad
Rx ‹2 Bytes CRC-16› Read CRC to check for data integrity
|
Я делаю так:
1. обнуляю CRC
2. считаю Write Scratchpad
3. считаю TA1
4. считаю TA2
5. считаю 8 байт данных
6. читаю CRC16 и инвертирую (2 байта)
У меня CRC16 не совпадает с протеусом. Что я делаю не так.