afarhan / ubitxv6

uBitx v6 Arduino sketch
77 stars 49 forks source link

display not working when touch connected #8

Open jzkmath opened 4 years ago

jzkmath commented 4 years ago

I am currently building a uBitx clone and found that when I hooked up the display it would only go white. it would only function properly if i disconnected one of the SPI lines from the touch controls. Turns out the reason is that in nano_gui.cpp, you don't disable the touch SPI during boot up, which leaves the CS line low. I was able to fix this issue by moving the xpt2046_Init() to the top of displayInit(void){}

It is a good idea to make sure all CS pins are pulled high before sending any SPI communications so as to ensure that you are only communicating with one SPI device at a time.