We have an nRF52833-based board, software is based on Zephyr and Nordic SDK 2.1.2.
One of the SPI interfaces connected to external flash (Winbond W25Q80DVSNIG)
Board is battery powered, so power draw is an issue.
While debugging board's excessive power consumption, we discovered that pulling down MISO pin (connected to FLASH DO pin) has effect of dramatically reducing sleep current.
For obvious reasons would like to avoid re-spinning the board, so trying to achieve the same effect (MISO being pulled down) in firmware
So, I added "miso-pull-down" to board's DTS file
&spi2 {
compatible = "nordic,nrf-spi";
status = "okay";
pinctrl-0 = <&spi2_default>;
pinctrl-1 = <&spi2_sleep>;
pinctrl-names = "default", "sleep";
miso-pull-down;
cs-gpios = <&gpio0 14 GPIO_ACTIVE_LOW>;
label = "CYCLONE_SPI";
w25q80dv: w25q80dv@0 {
compatible = "jedec,spi-nor";
label = "W25Q80DV";
reg = <0>;
spi-max-frequency = <1000000>;
size = <0x800000>;
has-dpd;
t-enter-dpd = <3000>;
t-exit-dpd = <30000>;
jedec-id = [ef 40 14];
};
};
But instead of being pulled down, the pin seems to float.
Tried "miso-pull-up" - same result.
I have CONFIG_PM=y
CONFIG_PM_DEVICE=y
in prj.conf and low power mode enabled for this interface in boards DTSI file spi2_sleep: spi2_sleep {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 1, 1)>,
<NRF_PSEL(SPIM_MOSI, 1, 2)>,
<NRF_PSEL(SPIM_MISO, 0, 11)>;
low-power-enable;
}
};
I also put the flash itslef to sleep when not in use by sending it command over SPI (0xB9)
but that seems to have only modest effect on sleep current (5-7 uA reduction), comparing to pulling down MISO (30 uA reduction).
Even probing PIN with the scope causes this large power reduction.
So, the question - how do I properly configure SPI controller to pull down MISO pin while in sleep mode (instead of floating it) ?