поискавой системы для электроныых деталей
  Russian  ▼
ALLDATASHEETRU.COM

X  

AN3254 датащи(PDF) 14 Page - STMicroelectronics

номер детали AN3254
подробное описание детали  SPI protocol for the STPMC1 metering device
PDF  24 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
производитель  STMICROELECTRONICS [STMicroelectronics]
домашняя страница  http://www.st.com
Logo STMICROELECTRONICS - STMicroelectronics

AN3254 датащи(HTML) 14 Page - STMicroelectronics

Back Button AN3254 Datasheet HTML 10Page - STMicroelectronics AN3254 Datasheet HTML 11Page - STMicroelectronics AN3254 Datasheet HTML 12Page - STMicroelectronics AN3254 Datasheet HTML 13Page - STMicroelectronics AN3254 Datasheet HTML 14Page - STMicroelectronics AN3254 Datasheet HTML 15Page - STMicroelectronics AN3254 Datasheet HTML 16Page - STMicroelectronics AN3254 Datasheet HTML 17Page - STMicroelectronics AN3254 Datasheet HTML 18Page - STMicroelectronics Next Button
Zoom Inzoom in Zoom Outzoom out
 14 / 24 page
background image
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.



Html Pages

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24


датащи скачать

Go To PDF Page


ссылки URL



Вашему бизинису помогли Аллдатащит?  [ DONATE ] 

Что такое Аллдатащит   |   реклама   |   контакт   |   Конфиденциальность   |   Ссылка на техническое описание    |   обмен ссыками   |   поиск по производителю
All Rights Reserved©Alldatasheet.com


Mirror Sites
English : Alldatasheet.com  |   English : Alldatasheet.net  |   Chinese : Alldatasheetcn.com  |   German : Alldatasheetde.com  |   Japanese : Alldatasheet.jp
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