Hello,
I've been trying for a while to integrate a ATWINC1500-MR210BP1954 (from Digi-Key ATWINC1500-MR210PB1954) module in my custom board with a STM32L151. Project is done with STM32Cube environment. For debugging purposes I am only trying a simple code, sending a command with SPI and checking that response is the good one.
The problem is that I am not getting the right SPI response in my custom board but when I use a NUCLEO-L152 evaluation board with a ATWINC1500 module (same one), I get the correct response.
SPI config is the following : CPOL = 0, CPHA = 0, 8bits, MSB First, 1 MBit/s (using MSI RC with prescaler 2). This settings were made according to the module data sheet p. 21
https://ww1.microchip.com/downloads/en/DeviceDoc/70005304D.pdfCode in main.c is the same for my custom board and for the Nucleo except for the pin numbers for CS, RST and Enable.
This SPI message is the same as p121 :
https://ww1.microchip.com/downloads/en/DeviceDoc/ATWINC15x0-Wi-Fi-Network-Controller-Software-Design-Guide-DS00002389D.pdf
To wake up the chip the MCU sends : 0xC4 0x80 0x01 0x00
I get the following responses :
NUCLEO+Module(alone) : 0x00 0xC4 0x00 0xF3 0x01 0x00 (yes, good reponse)
ATWINC in my custom board : 0x01 0x88 0x06 0x00 0x00 0x00
I checked the signal in my oscilloscope.
In both cases the MCU is transmitting correctly in the MOSI line.
I found what, I think, is a problem in the MSIO line in my custom board :
" alt="" class="bbc_img" />
Looking at the last bit : MISO line is shifting from 1 to 0 when clocks rises to 1. In CPOL=0 and CPHA=0 the readings are done exactly when clock is rising to 1. Sometimes I get a 0x88 and sometimes a 0x089. Like there is some kind of delay ?
The slave appears to be listening (MISO message ok) because it sends back the same amount of bites and a response close to the one it should be. I guess the slave response gets somehow delayed. I guess the problem is somewhere in my board.
SPI lines are about 10 cm and length equal.
" alt="" class="bbc_img" />
And just for you info, I have the same behavior with another custom board, with another ATWINC1500 module and even using another SPI peripherial. I also tried to hand solder a module to my custom board with only the strict minimum lines (SPI_CFG, 3xSPI, CS, RST, EN, VDDIO, VBAT and GND). Same strange behavior.
Do you have any recommendations ? Where should I look (soft, hard)? I am really desperate, I do not know even where to look now.. All suggestion are welcome. If you need more schematics or info just ask.
Thanks for your help.
JPM
P.S.:First post here. I've been in the forum many times before (here is where I read many advices before buying my oscilloscope) and I enjoy Dave's Youtube channe!