| Electronic Components Datasheet Search |
|
ADBMS6830BCSWZ Datasheet(PDF) 43 Page - Analog Devices |
|
|
|||||||||||||||||||||||||||||
ADBMS6830BCSWZ Datasheet(HTML) 43 Page - Analog Devices |
|
43 / 83 page ![]() Data Sheet ADBMS6830B I2C/SPI MASTER USING GPIOS analog.com Rev. 0 | 43 of 83 COMM COMMANDS Three commands help accomplish I2C or SPI communication to the slave device: WRCOMM, STCOMM, and RDCOMM. The WRCOMM command writes data to the COMM register. This command writes six bytes of data to the COMM register. The PEC must be written at the end of the data. If the PEC does not match, all data in the COMM register is cleared to 0 when CSB goes high. See the Bus Protocols section for more details on the write command format. The STCOMM command initiates I2C and SPI communication on the GPIO ports. The COMM register contains three bytes of data to be transmitted to the slave. During this command, the data bytes stored in the COMM register are transmitted to the slave I2C or SPI device, and the data received from the I2C or SPI device is stored in the COMM register. This command uses GPIO4 (SDA) and GPIO5 (SCL) for I2C communication or GPIO3 (CSBM), GPIO4 (SDIOM), and GPIO5 (SCKM) for SPI communication. Follow the STCOMM with 24 clock cycles for each byte of data to be transmitted to the slave device while holding CSB low. For example, to transmit three bytes of data to the slave, send the STCOMM command and its PEC, followed by 72 clock cycles. Pull CSB high at the end of the 72 clock cycles of the STCOMM command. During I2C or SPI communication, the data received from the slave device is updated in the COMM register. The data received from the slave device can be read back from the COMM register using the RDCOMM command. The command reads back six bytes of data, followed by the PEC. See the Bus Protocols section for more details on the read command format. Table 35 describes the possible read back codes for ICOMx[3:0] and FCOMx[3:0] when using the part as an I2C master. Dx[7:0] contains the data byte transmitted by the I2C slave. Table 35. Read Codes for ICOMx[3:0] and FCOMx[3:0] on I2C Master Control Bits Code Description ICOMx[3:0] 0110 Master generated a start signal 0001 Master generated a stop signal 0000 Blank, SDA held low between bytes 0111 Blank, SDA held high between bytes FCOMx[3:0] 0000 Master generated an acknowledge signal 0111 Slave generated an acknowledge signal 1111 Slave generated a no acknowledge signal 0001 Slave generated an acknowledge signal, master generated a stop signal 1001 Slave generated a no acknowledge signal, master generated a stop signal In case of the SPI master, the read back codes for ICOMx[3:0] and FCOMx[3:0] are always 0111 and 1111, respectively. Dx[7:0] contains the data byte transmitted by the SPI slave. Figure 24 shows the operation of the ADBMS6830B as an I2C or SPI master using the GPIOs. Figure 24. I2C/SPI Master Using GPIOs Any number of bytes can be transmitted to the slave in groups of three bytes using these commands. The GPIO ports do not reset between different STCOMM commands. However, if the wait time between the commands is greater than 2 sec, the watchdog times out and resets the ports to their default values. To transmit several bytes of data using an I2C master, a start signal is only required at the beginning of the entire data stream. A stop signal is only required at the end of the data stream. All intermediate data groups can use a blank code before the data byte and an acknowledge or no acknowledge signal as appropriate after the data byte. SDA and SCL do not reset between different STCOMM commands. To transmit several bytes of data using an SPI master, a CSBM low signal is sent at the beginning of the first data byte. CSBM can be held low or taken high for intermediate data groups using the appropriate code on FCOMx[3:0]. A CSBM high signal is sent at the end of the last byte of data. CSBM, SDIOM, and SCKM do not reset between different STCOMM commands. Figure 25 shows the 24 clock cycles following the STCOMM com- mand for an I2C master in different cases. Note that if ICOMx[3:0] specified a stop condition after the stop signal is sent, the SDA and SCL lines are held high, and all data in the rest of the word is ignored. If ICOMx[3:0] is set for a no transmit condition, both SDA and SCL lines are released, and the rest of the data in the word is ignored. This is used when a device in the stack does not have to communicate to a slave. Figure 26 shows the 24 clock cycles following the STCOMM com- mand for an SPI master. Like the I2C master, if ICOMx[3:0] is set for a CSBM high or a no transmit condition, the CSBM, SCKM, and SDIOM lines of the SPI master are released and the rest of the data in the word is ignored. |
|
Link URL |
| Does ALLDATASHEET help your business so far? [ DONATE ] |
About Alldatasheet | Advertisement | Contact us | Privacy Policy | Link to Datasheet | Link Exchange | Manufacturer List 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 |