This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nRF52 SPI clock tri-state

I use arduino to program a nRF52832 board. I had problems to move a running project with a ST7789 SPI display to the nRF52832. I use the Adafruit lib to drive the display:

name=Adafruit ST7735 and ST7789 Library
version=1.6.0
author=Adafruit
maintainer=Adafruit <[email protected]>
sentence=This is a library for the Adafruit ST7735 and ST7789 SPI displays.
paragraph=This is a library for the Adafruit ST7735 and ST7789 SPI displays.
category=Display
url=github.com/.../Adafruit-ST7735-Library

What I learnt is that spi-clock is on P0.12 and mosi is on P0.13.

What caused problems was, that it seems that the spi-clock goes to a tristate mode in between packets. I now use a work around to declare pin 0.13 as output and set it to high level. Is it a special feature to have this tri-state or is there an error in the library?

  • I haven't played with the library specific, but it is common to disable a peripheral when not in use to save current consumption. When a peripheral is disabled (e.g. spi) then the pin will fall back to the gpio configuration (which by default is high impedance disconnected = floating), so you may need to set the gpio to your preferred level to ensure it has a fixed values between spi transacation (which may depend on the spi mode that is used) or you can place a pull-up on the pin.

    Kenneth

Related