| 전자부품 데이터시트 검색엔진 |
|
AN3254 데이터시트(PDF) 14 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
AN3254 데이터시트(HTML) 14 Page - STMicroelectronics |
|
14 / 24 page ![]() Data processing AN3254 14/24 Doc ID 17783 Rev 1 Normally, each byte is read out as the most significant bit (MSB) first. But this can be changed by setting the MSBF configuration bit. If this is done, each byte is read out as the least significant bit (LSB) first. 4.1.1 Data register assembling example The following is an example of the reading and re-arranging of STPMC1 registers. On the left there are the eight data records as they are read, represented as hexadecimal bytes while MSBF was cleared, on the right is the corresponding register. 1. 65 7A 7C 82 DAP = 82 7C 7A 65 2. 00 7A 0C E0 DRP = E0 0C 7A 00 3. 00 00 8C 92 DFP = 92 8C 0 00 4. 00 06 6E 22 PRD = 22 6E 06 00 5. … 4.2 Parity check Each bit of parity nibble is defined as odd parity of all seven corresponding bits of data nibbles. In order to check the data record integrity, the application should execute something similar to the following C code, given as an example: int BadParity (unsigned char *bp) { register unsigned char prty = grp; /* temporary register set to group # (0..6)*/ prty = *bp, /* take the 1st byte of data */ prty ^= *(bp+1), /* XOR it with the 2nd byte */ prty ^= *(bp+2), /* and with the 3rd byte */ prty ^= *(bp+3), /* and with the 4th byte */ prty ^= prty<<4, prty &= 0xF0;/* combine and remove the lower nibble */ return (prty != 0xF0); /* returns 1, if bad parity */ } If the parity nibble check fails, the reading task should be repeated, but this time without the request of latching, otherwise a new data would be latched and the previous reading would be incorrectly lost. In a very harsh EMI environment, it would be a good practice to read the data records twice and then compare both readings. In this way, the probability of detecting bad readings would be significantly improved. However, a single piece of bad data can be discarded because no meaningful information is lost as long as the reading frequency is about 30 ms. |
|
|
링크 URL |
| ALLDATASHEET 가 귀하에 도움이 되셨나요? [ DONATE ] |
Alldatasheet는? | 광고문의 | 운영자에게 연락하기 | 개인정보취급방침 | 링크 투 데이터시트 | 링크교환 | 제조사별 검색 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 |