| 数据搜索系统,热门电子元器件搜索 |
|
STGAP1AS 数据表(PDF) 50 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
STGAP1AS 数据表(HTML) 50 Page - STMicroelectronics |
|
50 / 70 page ![]() Programming manual STGAP1AS 50/70 DocID029344 Rev 2 The device register can be written through the WriteReg command when the device is set in the configuration mode only (refer to Section 9.1.1), otherwise the write command is ignored and the SPI_ERR flag is forced low. The WriteReg command is followed by the data to be written into the target register. The CRC code following the data is based on both command and data bytes. In this way, in case of communication error, a data byte cannot be decoded as a command and vice-versa (refer to Section : CRC protection on page 46). 9.1.3 ReadReg command All the registers of the device can be read anytime, and this requires two accesses (CS must be asserted LOW and HIGH twice). In the first access the SPI host issues the ReadReg command (including the register address) and the CRC of the first byte, which will be ignored if SPI CRC is not enabled. After the command is received and decoded by the device, the register value and the respective CRC code is prepared for the transmission. The CRC polynomial used by the device during the transmission is different from the one used by the host, but the CRC code is not inverted before transmission (refer to Section : CRC protection ). The time required to obtain the reading result changes according to the side where the register is located. The reading of a local register (low voltage side) is available in 800 ns. The reading of a remote register (isolated side), if no communication error occurs between the two sides of the device, is available in 30 µs. After the read result is ready it is stored in the SPI output buffer, and the host MCU will receive it as soon as it will send a new SPI command. Any command can be used for this purpose, including a NOP or the ReadReg command for the next register to be read. Some status and configuration registers contain a reserved bit whose content is not predictable. In order to clearly identify the content of relevant information, the value read from each register should be masked with the appropriate masking code (see “Mask code” in Table 23). Table 17. ReadReg command synopsis Byte 1 2 3(1) 1. Proper time have to be waited in order to allow the device to prepare the data. 4 To device 101A AAAA(2) 2. The command byte where AAAAA is the address of the target register. CCCC CCCC(3) 3. The CRC byte of the command, if the CRC check is disabled this byte is ignored. 0000 0000 CCCC CCCC(4) 4. The CRC byte of the NOP command. From device 0000 0000 0000 0000 DDDD DDDD(5) 5. Data read from the target register. KKKK KKKK(6) 6. The CRC byte of the data. |
|
链接网址 |
| 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 |