EasyManua.ls Logo

Linear Technology LTC6804-1 - Page 57

Default Icon
78 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
LTC6804-1/LTC6804-2
57
680412fc
For more information www.linear.com/LTC6804-1
Talk to a SPI Slave Connected to LTC6804
This example uses a single LTC6804-1 device which has a
SPI device connected to it through GPIO3 (CSBM), GPIO4
(SDOM) and GPIO5 (SCKM). In this example, the LTC6804
device sends out 3 bytes of data B0 = 0x55, B1 = 0xAA
and B2 = 0xCC to the SPI slave device in the following
format: CSB low – B0 – B1 – B2 – CSB high
1. Write data to COMM register using WRCOMM command
a. Pull CSBM low
b. Send WRCOMM command (0x07 0x21) and its PEC
(0x24 0xB2)
c. Send
COMM0 = 0x85, COMM1 = 0x50 ([CSBM low]
[B0] [CSBM low]),
COMM2 = 0x8A, COMM3 = 0xA0 ([CSBM low]
[B1] [CSBM low]),
COMM4 = 0x8C, COMM5 = 0xC9 ([CSBM low]
[B2] [CSBM high])
and PEC = 0x89 0xA4 for the above data.
d. Pull CSB high
2. Send the 3 bytes of data to SPI slave device using
STCOMM command
a. Pull CSB low
b. Send STCOMM command (0x07 0x23) and its PEC
(0xB9 0xE4)
c. Send 72 clock cycles on SCK
d. Pull CSB high
3. Data transmitted to slave during the STCOMM com
-
mand is stored in the COMM register. Use the RDCOMM
command to retrieve the data.
a.
Pull CSB low
b. Send RDCOMM command (0x07 0x22) and its PEC
(0x32 0xD6)
c. Read COMM0-COMM5 and the PEC for the 6 bytes
of data. The read back data in this example would
look like:
COMM0 = 0x755F, COMM1 = 0x7AAF, COMM2 =
7CCF, PEC = 0xF2BA
d. Pull CSB high
Note: If the slave returns data, this data will be placed in
COMM0-COMM5.
Figure 27 shows the activity on GPIO3 (CSBM), GPIO5
(SCKM) and GPIO4 (SDOM) ports of SPI master for 72
clock cycles during the STCOMM command in the above
example.
operaTion
Figure 27. LTC6804 SPI Communication Example
680412 F27
SDOM (GPIO4)
SCKM (GPIO5)
CSBM LOW
0x55 0xAA 0xCC
CSBM (GPIO3)
SCK
CSBM HIGH
LAST CLOCK OF
STCOMM COMMAND