nRF52840_Breakout_MDBT50Q icon indicating copy to clipboard operation
nRF52840_Breakout_MDBT50Q copied to clipboard

SPI issue without V_BUS supplied

Open deldipso opened this issue 5 years ago • 1 comments

I notified, the SPI doesn't seems to work if the USB is not plugged (or more directly V_BUS not supplied, it works if V_BUS only is supplied). So it is not working with a battery or an external power supply on VIN or VBAT if I make a simple project with just SPI. By not working I means the CLK and MOSI does toggle anymore in that situation. Just the CSB but it is controlled as a simple digital output pin. This is not an power supply issue. I even unplugged my SPI sensor, I see CLK and MOSI with USB but no anymore with external supply.

SPI CFG: SPI.begin(); SPI.setClockDivider(SPI_CLOCK_DIV64); SPI.setDataMode(SPI_MODE2); SPI.setBitOrder(LSBFIRST);

For an unknow reason, once I started to used the analogWrite() function, the SPI starts to work in any case, which is the workaround I currently use. It seems there is like a GPIO pin initialization issue when V_BUS is not supplied and the SPI only is used without analogWrite()...

deldipso avatar Feb 06 '20 15:02 deldipso

@deldipso I have checked this issue without the USB plugged in and I have found that the problem was with the GND pin. If there is only VIN connected to the 3V3 power supply - there is a problem, that you have mentioned. But if you connect the GND pin from the power supply too - all is OK(by the way it's a correct way of powering).

Maybe, in your case there is something else or whatever, but in my case SPI worked correctly without USB plugged in.

Antdigapony avatar Jun 03 '21 08:06 Antdigapony