Marc:

It is my experience that half the AD parts expect bits on the SPI to be LSb 
first, the other half expect bits on the SPI bus to be MSb first, and the 
third half have a configuration bit that allows the part to respond to 
either bit order by configuration. 

But you need to understand the default and maybe flip the first (or all) 
configuration words end-for-end.

So, figure out if you have the SPI clock phase set correctly.

Then figure out which way the SPI in your BBB sends bit order.

Then figure out what the part wants.

Then and only then, configure the part.
I note that this part needs to be configured correctly, before it will 
reply.

Read the data sheet on the part until you understand it, and find all the 
little "gotchas" in the spec.

Being an AD part, they will be there.

--- Graham

==

On Sunday, February 12, 2017 at 3:27:14 PM UTC-6, Marc M wrote:
>
> Hello,
> I have a board with an AnalogDevices AD5592r connected to the 
> BeagleBoneBlack on SPI1.
>
> I have built Linux version 4.9.1 with the default configuration and edited 
> the device tree file to add SPI1 support.  HDMI is disabled.
>
> I have configured the device tree overlay to enable the SPI1 port:
> spi1_default: spi1_default {
> pinctrl-single,pins = <
> /* SPI 1 */
> 0x190 (PIN_INPUT | MUX_MODE3) /* mcasp0_aclkx.spi1_sclk */
> 0x194 (PIN_INPUT | MUX_MODE3) /* mcasp0_fsx.spi1_d0 */
> 0x198 (PIN_OUTPUT | MUX_MODE3) /* mcasp0_axr0.spi1_d1 */
> 0x19C (PIN_OUTPUT_PULLUP | MUX_MODE3)   /* spi CS0 */
> 0x1B4 (PIN_OUTPUT_PULLUP | MUX_MODE7)   /* spi CS1 */
> >;
> };
>
> Also added the device to the port:
> &spi1 {
> cs-gpios = <0>;
> pinctrl-names = "default";
> pinctrl-0 = <&spi1_default>;
> status = "okay";
>
>     ad5592r@0 {
> compatible = "adi,ad5592r";
> reg = <0>;
> spi-max-frequency = <1000000>;
> spi-cpol;
>
> channel-modes = /bits/ 8 <
> CH_MODE_DAC
> CH_MODE_ADC
> CH_MODE_DAC_AND_ADC
> CH_MODE_DAC_AND_ADC
> CH_MODE_ADC
> CH_MODE_GPIO
> CH_MODE_GPIO
> CH_MODE_GPIO
> >;
> };
> };
>
> This is all as defined on the AD Wiki:
>
> https://wiki.analog.com/resources/tools-software/linux-drivers/iio-dac/ad5592r
>
> The driver is coming up as I can see it loaded:
> ad5592r                 3001  0
> ad5592r_base            5903  1 ad5592r
>
>
>
> Using a bus monitor I can see that the BBB is trying to talk to the AD 
> device but there is no response.... has anyone out there successfully 
> communicated with AD5592r over SPI1 ?
>
>
> <https://lh3.googleusercontent.com/-P509sHB-C3o/WKDSnpwSM0I/AAAAAAAAACQ/b3izD722E-cOsHAqjEobGExpRaKj8DE9gCLcB/s1600/AD5592_SPI_trace.png>
>
> Really trying to understand what is going on here and what would make 
> there be no response from the device when using the kernel driver.
>
> Thanks
> Marc
>
>

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/3d1d4c73-8aaf-4ac5-bbf3-513b44f523e8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to