On 18.02.2013 20:12, capiman26061973 wrote: > ...
> I control CS on my own. CPOL=1, CPHA=0, FrameLength (or 12)
> data is sampled/captured on CLK going from HIGH to LOW.
>
> Problem is, that first bit (D11) is not going as highest bit
> into receive data, but it is one bit shifted.
> ...
> Is there some bit to control such behavior in hardware,
> or is the only way to discard the bit and shift the value
> manually by software?
Comparing the datasheet of the sensor to the UM of LPC2101 (don't have
LPC812 UM handy), I would try CPOL=0, CPHA=1...
It uses only a CS and CLK, and sends data to uC.
Data from uC to sensor IC is not needed, sending only dummy data,
to get SPI running.
I control CS on my own. CPOL=1, CPHA=0, FrameLength (or 12)
data is sampled/captured on CLK going from HIGH to LOW.
Problem is, that first bit (D11) is not going as highest bit
into receive data, but it is one bit shifted.
I think this comes from an additional clock cycle
at the beginning, when AS5045 is sending data.
Is there some bit to control such behavior in hardware,
or is the only way to discard the bit and shift the value
manually by software?
I am currently using a FrameLength of 13 bits,
so i get the bit i discard plus the 12 bit of the sensor,
and second 13 bits, which contains status and dummy bits.
(2 times 10 bits would also be possible, minimum 19 bits)