cancel
Showing results for 
Search instead for 
Did you mean: 

Wrong wiring for SPI? and SPI (MISO) not responding

MBolo.1
Associate III

Hello to everyone,

Were to start? Let me first try do describe the setup.

1. Using and STM32F446 chip on a custom board. The board has 2-32pins slots: Slot A and B.

2.For communication I'm using the SPI protocol.

3.For slot A using PE12(CKL); PE13(MISO)PE14(MOSI) and for slot B PB13(SCK), PB14(MISO) and PB15(MOSI)

4 Each slot has another 4 ADS connected in Slave Mode.

The interesting part.

First I tried to communicate with the first ADS from the slot A and after a bunch attempts and fails I start checking the schematics I found this Error in schematics

SPI_COnnections.JPG

MISO is connected to MOSI! that means that those 4 ADS from Slot A can not be used for moment. I decided to use the Slot B because that one looks connected properly and here I was going nowhere. I was just not getting any response from the ADS , below is the picture from logic annalizer

Capture3.JPG  a quick explanation: according to the documentation the ADS comunicates i 2 byte format. First tels what to do :Read or Write and the second the Address of the register.

So I decided to start with the basic one, READ the ID register (I named it numBytes ,read=0x20 and ID=0x00)  spi_ buf is just a buffer were the return info should be placed and here were it comes the best the return response on MISO from ADS is always 0.

Can anyone:

1. Explain why the Slot A has that weird wiring? Only thing that I found in documentation of STM is that in Master-Master mode the MOSI and MISO are bidirectional lines.

2. Why on the Slot B even with right wiring still no response from the ADS?

If any questions you have regardless the setup will try to response.

Thank you .

1 REPLY 1
TDK
Guru

Initialize the pins as GPIO outputs and toggle them manually and verify they show up on your logic analyzer. That will ensure you're monitoring what you think you're monitoring.

 

Ensure pins are correctly initialized. We're only getting a glimpse of the wiring here.

 

After that, if the chip is powered, it should respond. Issue is probably in the details somewhere.

 

Who designed the board? That's who you should ask about slot A issues. You can't swap MISO/MOSI on STM32F4. On some other families you can. Could also be wired correctly and just mis-labeled.

If you feel a post has answered your question, please click "Accept as Solution".