| Datenblatt-Suchmaschine für elektronische Bauteile |
|
MCS3142-I/ST Datenblatt(PDF) 8 Page - Microchip Technology |
|
|
|||||||||||||||||||||||||||||
MCS3142-I/ST Datenblatt(HTML) 8 Page - Microchip Technology |
|
8 / 37 page ![]() MCS3142 DS40001747A-page 8 2014 Microchip Technology Inc. 3.1 Counter and Timer Protection Because they are written during normal operation of the device, the two synchronization counters, Reset counter and time value receive special protection to guard against data loss from unexpected power loss. An 8-bit CRC is calculated and stored alongside each variable. Further, each variable is duplicated in a different portion of memory. Whenever a value is read, the CRC is calculated and verified against the stored value. If there is a mismatch, the second copy of the data is read instead. The CRC calculation uses a polynomial represented by . Example 3-1 describes a sample C function to compute this value. EXAMPLE 3-1: CRC CALCULATION x 8 x 4 x 3 x 2 1 ++++ static uint8_t crc(const uint8_t* buffer, size_t len){ uint8_t bitcount; uint8_t c = 0xFF; while(len--) { c ^= *buffer++; for(bitcount = 0; bitcount < 8; bitcount++){ if((c & 0x80)!= 0) { c <<= 1; c ^= 0x1D; }else{ c <<= 1; } } } return ~c; } |
|
Link URL |
| War ALLDATASHEET hilfreich? [ DONATE ] |
Über Alldatasheet | Werbung | Kontakt | Privatsphäre und Datenschutz | Link zum Datenblatt | Linktausch | Hersteller All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |