Hi gang. I am trying to port some simple code running on the SC20100 board using the built in 1.8 inch display (ST7735) over to the same SPI display from adafruit (1.8 inch TFT, ST7735 chip, product 358). I am using the graphics code example for this board from the GHI tutorials section. Can’t seem to get the screen to work properly when switching over to the adafruit version, the backlight turns on OK but that’s it. The ST7735 code example (modified to use other GPIO pins and CS ) initializes the spi as follows:
var spi = SpiController.FromName(SC20100.SpiBus.Spi3);
var gpio = GpioController.GetDefault();
st7735 = new ST7735Controller( spi.GetDevice(ST7735Controller.GetConnectionSettings (SpiChipSelectType.Gpio, gpio.OpenPin(SC20100.GpioPin.PC13))), //CS pin. gpio.OpenPin(SC20100.GpioPin.PA0), //RS pin. gpio.OpenPin(SC20100.GpioPin.PE9) //RESET pin. ); var backlight = gpio.OpenPin(SC20100.GpioPin.PA14); backlight.SetDriveMode(GpioPinDriveMode.Output); backlight.Write(GpioPinValue.High); st7735.SetDataAccessControl(true, true, false, false); //Rotate the screen. st7735.SetDrawWindow(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT); st7735.Enable();
Sniffing the SPI using a “smartscope” analyser, I get this…
It’s looking like the speed maybe too fast, but I don’t know how to set the spi bus speed using the code example format above, looks like it’s being set to some kind of default.
I’ve also tried using SPI4 instead of 3, no difference in results.
As you’ve probably figured out, I’m a newbee at this…