sankarAMP2 wrote: Mon Mar 02, 2020 1:47 pm
hello @.rpv
blink ok, Serial ok but SPI not working.
i am trying to run graphics test code from adafruit its compiling but not able to get anything on display.
I kept like this.
Code: Select all
#define TFT_MISO PB14
#define TFT_MOSI PB15
#define TFT_CLK PB13
#define TFT_CS PB12
#define TFT_DC PD9
#define TFT_RST PD8
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_MOSI, TFT_CLK, TFT_RST, TFT_MISO);
as I am new to this core Want to know how to set SPI.
could you please explain me how to select SPI? multiple SPI slaves on single SPI
according to adafruit's code, your constructor call will force library to use SOFTWARE spi implementation
and if this kind of init doesn't work, you need to check your connections, pin defines erc, cuz it cant be issued by hardware spi defines
to use this library with HW SPI you need to call contructor with SPIClass instance (and define your own instance with proper pins set like
SPIClass MySPI(MOSI, MISO, SCLK);) or use it with only cs/cd pins and prepare preconfigured SPI instance (with SPI.setMOSI(...)/setMISO(...) etc)
to select slave you need to set pin, connected to slave CS you need to communicate, LOW and others have to be HIGH
but most spi libraries will set LOW configured CS pin automatically, so you usually just need to set all CS pins HIGH at setup()