UNO setting up SPI for LTC6804


hello,

http://cds.linear.com/docs/en/datasheet/680412f.pdf
on page 41 of datasheet says:
quote
data link layer
all data transfers on ltc6804 occur in byte groups.
every byte consists of 8 bits. bytes transferred with
themost significant bit (msb) first. csbmustremain low
forthe entire duration of command sequence, including
betweenacommandbyteandsubsequentdata. onawrite
command, data latched in on rising edge of csb.


and on page 35
quote
timing
the 4-wire serial port configured operate in spi
systemusingcpha = 1 andcpol = 1. consequently, data
on sdimust stable during rising edge of sck. the
timing depicted in figure 15. maximum data rate
is 1mbps.


is correct setup ?

code: [select]
spi.setbitorder(msbfirst);
spi.setclockdivider(spi_clock_div32); // should fast enough
spi.setdatamode(spi_mode3);


how calculate data rate mhz ? assuming means can send 10^6 bytes in 1 second 1mbps = 8mhz ?

sidenote: http://arduino.cc/de/reference/spiend pull ss down again?

first check datasheet - 5k pull resistor needed on 1 of spi pins.

secondly spi transfers begin bringing cs low, transfering number of bytes,
set cs high again.

for bus speed mhz wire speed, bits per second, not bytes.  1mhz means
a 1mhz sclk (8 per byte transferred).


Arduino Forum > Using Arduino > Programming Questions > UNO setting up SPI for LTC6804


arduino

Comments

Popular posts from this blog

Convierte tu Raspberry en un NAS. Firmware fvdw-sl 15.3 - Raspberry Pi Forums

How to format a Get Request

avrdude: verification error, first mismatch at byte 0x0000 0x0c != 0x62