[riot-notifications] [RIOT-OS/RIOT] SPI MISO of SPI0 should be pulled down in FRDM-KW41Z (#11460)

Tomás Herrera notifications at github.com
Sat Apr 27 01:04:29 CEST 2019




My FRDM-KW41Z was reseting when communicating with the on-board FLASH (AT45DB041E) via SPI. I was using this configuration to init:
```

/* from board.h */
#define FLASH_SPI_DEV 	FRDM_NOR_SPI_DEV
#define FLASH_SPI_MODE 	SPI_MODE_0
#define FLASH_SPI_CS 	FRDM_NOR_SPI_CS
#define FLASH_SPI_CLK	FRDM_NOR_SPI_CLK

spi_init(FLASH_SPI_DEV);
spi_init_cs(FLASH_SPI_DEV,FLASH_SPI_CS);
```
Reading the datasheet of the AT45DB041E it stated: 

> The SO pin will be in a high-impedance state whenever the device is deselected (CS is deasserted).

When I probed the MISO pin, it was floating, and for some reason, the chip did not reset when measuring it with and osciloscope, and it sometimes worked fine if I sticked my finger on the MISO pin.

Crearly a floating pin problem on an input pin... I have had these symptoms back when I used PIC18.

This solved the problem:

```
spi_init(FLASH_SPI_DEV);
gpio_init(GPIO_PIN(PORT_C,18),GPIO_IN_PD);
spi_init_cs(FLASH_SPI_DEV,FLASH_SPI_CS);

```
I tried changing things in cpu/kinetics/spi.c but it wasnt compiling..

ps: I tried this on 2 different FRDM-KW41Z boards with same results.
ps2: I am using a RIOT branch I dont know if this is solved in HEAD, since I need to use KW41Z wireless transceiver. The last commit of the repo is Dec 17 2018: 09ad33f05f458d93d150c6c34501615e63e39fd9



-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/issues/11460
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190426/572cfc08/attachment.html>


More information about the notifications mailing list