cancel
Showing results for 
Search instead for 
Did you mean: 

More than one chip on SPI bus?

NicRoberts
Senior

STM32WB55 NUCLEO

I have 2 ADXL362s on SPI1.

They both have their own separate chip select GPIO pins.

They are both configured the same.

They are both in the same orientation (on the same breadboard).

The output of both is processed using the same logic.

One of them gives expected results, the other is consistent but wrong!

 

Just as a sanity check, I am OK to run two sensors on the same SPI bus as long as I'm clear which chip is selected?

26 REPLIES 26

What SPI clock frequency you run ?

4 MHz

Have you verified that none of the CS pins, especially PA9, is connected to onboard peripherals ?

PA9 does have a number alt functions but I have it configured as a GPIO output. When I scope it its acting as expected, PA9 in the lower trace & is going low & high as expected (see image in last post to Andrew) 

 

The question was whether the Nucleo board has anything connected on PA9 ...

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.

Ahhh right, the user manual says its function is TIM17_CH1. I'm confused here as the scope trace shows it acting as implemented as a GPIO output.

You really need to look at the schematics to see if anything else is connected.

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.

From the schematic I cant see that PA9 is connected to any other peripherals or devices on the board

wb55pa9.jpg

> Ahhh right, the user manual says its function is TIM17_CH1. I'm confused here as the scope trace shows it acting as implemented as a GPIO output.

I suppose the user manual refers to the demo firmware the board came with. This is most probably not true for your own firmware. Only one "alternate function" of a GPIO can be active at any given time.

You can always check the effective settings in the debugger, stopping the application after initialisation, reading out the respective peripheral registers, and compare it with the reference manual.

Have you tried to capture a complete "false" transmission with a logic analyser, including MISO, MOSI, SCLK, and boths /CS signals ?

NicRoberts
Senior

Well I just cant find the problem so have switched to I2C sensors which all work fine.