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

ST7735 gfx demo ?

Dear Members,

I saw ST7735_DC_PIN and ST7735_SS_PIN, which one should I connect to my LCD it has only CS pin ?

                                  ON LCD board
ST7735_SCK_PIN 47 --> P1.15       PIN 3     SCK

ST7735_MOSI_PIN 45 --> P1.13      PIN 4     MOSI SDA

ST7735_MISO_PIN 46 --> P1.14      PIN 6(RS) MISO

ST7735_SS_PIN 44 --> P1.12        PIN 7     CS

ST7735_DC_PIN 42 --> P1.10       PIN 7     CS

VDD                                 PIN 5 RES
                                         PIN 1 GND
                                         PIN 2 VCC
VDD                                 PIN 8 LEDA

Thanks

  • Hello, 

    I'm not sure this is the correct forum to ask. Have you read the manual of the display?

    Kind regards,
    Øyvind

  • How to wire this LCD ?

    Where can I connect RES, RS ?

    It has ST7735 chipset but I'm not sure on how to wire it with sdk_config.h

    // <o> ST7735_SCK_PIN - Pin number  <0-47>


    #ifndef ST7735_SCK_PIN
    #define ST7735_SCK_PIN 47
    #endif

    // <o> ST7735_MISO_PIN - Pin number  <0-47>


    #ifndef ST7735_MISO_PIN
    #define ST7735_MISO_PIN 46
    #endif

    // <o> ST7735_MOSI_PIN - Pin number  <0-47>


    #ifndef ST7735_MOSI_PIN
    #define ST7735_MOSI_PIN 45
    #endif

    // <o> ST7735_SS_PIN - Pin number  <0-47>


    #ifndef ST7735_SS_PIN
    #define ST7735_SS_PIN 44
    #endif

    // <o> ST7735_DC_PIN - Pin number  <0-47>


    #ifndef ST7735_DC_PIN
    #define ST7735_DC_PIN 42
    #endif

  • Hello, 

    What version of the nRF5 SDK are you using? You need to look in the datasheet of the display to find the function of each pin.

    If this is a SPI device, remember that SS (Slave Select) = CS (Chip Select). I don't know what RS, RES or DC do. Searching DevZone, I found the following thread which might be of interest: https://devzone.nordicsemi.com/f/nordic-q-a/53165/gfx-example-not-working-with-st7735-lcd

    From examples\peripheral\gfx\pca10040\blank\config\sdk_config.h (nRF5 SDK v16.0.0) I found the following config settings:

    // <e> ST7735_ENABLED - st7735 - ST7735R TFT controller
    //==========================================================
    #ifndef ST7735_ENABLED
    #define ST7735_ENABLED 1
    #endif
    // <h> SPI_CONFIGURATION - SPI configuration
    
    // <o> ST7735_SCK_PIN - Pin number  <0-47> 
    
    
    #ifndef ST7735_SCK_PIN
    #define ST7735_SCK_PIN 25
    #endif
    
    // <o> ST7735_MISO_PIN - Pin number  <0-47> 
    
    
    #ifndef ST7735_MISO_PIN
    #define ST7735_MISO_PIN 24
    #endif
    
    // <o> ST7735_MOSI_PIN - Pin number  <0-47> 
    
    
    #ifndef ST7735_MOSI_PIN
    #define ST7735_MOSI_PIN 23
    #endif
    
    // <o> ST7735_SS_PIN - Pin number  <0-47> 
    
    
    #ifndef ST7735_SS_PIN
    #define ST7735_SS_PIN 22
    #endif
    
    // <o> ST7735_IRQ_PRIORITY  - Interrupt priority
     
    
    // <i> Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice
    // <0=> 0 (highest) 
    // <1=> 1 
    // <2=> 2 
    // <3=> 3 
    // <4=> 4 
    // <5=> 5 
    // <6=> 6 
    // <7=> 7 
    
    #ifndef ST7735_IRQ_PRIORITY
    #define ST7735_IRQ_PRIORITY 6
    #endif
    
    // </h> 
    //==========================================================
    
    // <o> ST7735_SPI_INSTANCE
     
    // <0=> 0 
    // <1=> 1 
    // <2=> 2 
    
    #ifndef ST7735_SPI_INSTANCE
    #define ST7735_SPI_INSTANCE 0
    #endif
    
    // <o> ST7735_TAB_COLOR  - Color of the tab attached to the screen.
     
    // <0=> INITR_GREENTAB 
    // <1=> INITR_REDTAB 
    // <2=> INITR_BLACKTAB 
    // <3=> INITR_144GREENTAB 
    
    #ifndef ST7735_TAB_COLOR
    #define ST7735_TAB_COLOR 0
    #endif
    
    // <o> ST7735_DC_PIN - Pin number  <0-47> 
    
    
    #ifndef ST7735_DC_PIN
    #define ST7735_DC_PIN 19
    #endif
    
    // <o> ST7735_HEIGHT - ST7735 height  <0-162> 
    
    
    #ifndef ST7735_HEIGHT
    #define ST7735_HEIGHT 160
    #endif
    
    // <o> ST7735_WIDTH - ST7735 width  <0-132> 
    
    
    #ifndef ST7735_WIDTH
    #define ST7735_WIDTH 128
    #endif
    
    // </e>
    
    // </h> 
    //==========================================================
    

    I also recommend looking at the drivers of the ST7735:
    components\drivers_ext\st7735\st7735.c

    The API reference in our Infocenter: https://infocenter.nordicsemi.com/topic/sdk_nrf5_v16.0.0/group__st7735__config.html

    When you have connected correctly, have a loot at the GFX Library sample.

    Kind regards,
    Øyvind

Related