Adafruit_ST7735 not working on pin PA1
Posted: Tue Jun 08, 2021 8:06 am
I'm have a working project on a STM32F411, using the Adafruit ST7735 TFT display and their official TFT library. I've configured the TFT pins to be CS=PB10, RST=PB1 and DC=PB2, also the internal SCLK1 and MOSI1 pins PA5 and PA7. This is all working fine.
Now we need to rewire the display to different pins. We want to use CS=PA1, RST=PA2, DC=PA3. But when I do so the display stops working. Just white screen.
I've narrowed it down to the CS pin. RST and DC seem happy on the new pins PA2 and PA3 and if I put CS back to PB10 it works again. It just wont work with CS on PA1.
Looking on the oscilloscope the CS pin is constant low when its not working. On a working pin the CS pin seems to have some data on it.
I've made a test sketch and can control PA1 pin as an output, high, low, pwm all work fine.
I can't understand why the Adafruit_ST7735 library seems to be having issue outputting to PA1?
I found some threads suggesting special pins for JTAG need to be disabled but this didn't include PA1.
Possibly Serial TX/RX using PA0/PA1 but I disabled my serial and still no luck.
Seems strange also that if I connect the CS pin to +3.3v that the screen doesn't work. I thought CS was meant to select the SPI device when high? I wasn't expecting to see data on that pin.
So, does PA1 have some special usage that prevents some libraries using it?
Further tests show it not working on PA0 either. It works on PB4 but not PB1. What's going on?
Now we need to rewire the display to different pins. We want to use CS=PA1, RST=PA2, DC=PA3. But when I do so the display stops working. Just white screen.
I've narrowed it down to the CS pin. RST and DC seem happy on the new pins PA2 and PA3 and if I put CS back to PB10 it works again. It just wont work with CS on PA1.
Looking on the oscilloscope the CS pin is constant low when its not working. On a working pin the CS pin seems to have some data on it.
I've made a test sketch and can control PA1 pin as an output, high, low, pwm all work fine.
I can't understand why the Adafruit_ST7735 library seems to be having issue outputting to PA1?
I found some threads suggesting special pins for JTAG need to be disabled but this didn't include PA1.
Possibly Serial TX/RX using PA0/PA1 but I disabled my serial and still no luck.
Seems strange also that if I connect the CS pin to +3.3v that the screen doesn't work. I thought CS was meant to select the SPI device when high? I wasn't expecting to see data on that pin.
So, does PA1 have some special usage that prevents some libraries using it?
Further tests show it not working on PA0 either. It works on PB4 but not PB1. What's going on?