Announcement

Collapse
No announcement yet.

ST7775R driver

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    OK, please try the attached PmmC

    There are a few other things to do as well.

    The last lot of init stuff should be ok, but you need to add "INIT_TABLE_16BIT_INDEX_REG_MODE" in there, as the first entry of the init table.

    The gram should be more like, note you don't need any 0x00's

    Code:
    #DATA
    byte GRAM_sm
    //  WRITE_CONTROL_CONSTANT, ST7775_DRAM_H, Note, these may not be needed
    //  WRITE_DATA_BYTE, _VX1,
    //  WRITE_CONTROL_CONSTANT, ST7775_DRAM_V,
    //  WRITE_DATA_BYTE, _VY1,
        WRITE_CONTROL_CONSTANT, ST7775_RAM_HEND, // 0x36
        WRITE_DATA_BYTE, _VX2,
        WRITE_CONTROL_CONSTANT, ST7775_DRAM_HSTART, // 0x37
        WRITE_DATA_BYTE, _VX1,
        WRITE_CONTROL_CONSTANT, ST7775_DRAM_VEND, // 0x38
        WRITE_DATA_BYTE, _VY2,
        WRITE_CONTROL_CONSTANT, ST7775_DRAM_VSTART, // 0x39
        WRITE_DATA_BYTE, _VY1,
        WRITE_EXIT
    #END
    Attached Files
    Mark

    Comment


    • #17
      Hi Mark,

      Thank you very much for helping me!

      I will try to put 0's everywhere.


      "In post #7 and other places you say "the screen it still is white", in post #13 you say "It looks like the displays is initializated but some params must be wrong because it only displays with color." The display being white tends to indicate it is not being initialized at all, it's just the backlight coming on. Whe you say 'displays with color' what exactly do you mean?"
      Sorry, there I wanted to write " it only displays with white", I wrote the incorrect word.


      P.S. Why the torture changing displays all the time?
      Yes it is but it is not my decision.

      Comment


      • #18
        So, tu sum up.
        I load the pmmc
        and then I change de gram part and add the "INIT_TABLE_16BIT_INDEX_REG_MODE.
        The code looks like:
        Code:
        #platform "GOLDELOX"
        #inherit "4DGL_16bitColours.fnc"
        
        //=============================================
        //=============================================
        // 4D Systems
        // GOLDELOX-GFX2
        // display specifics for ST7775R
        // Version 1.0
        // 30/11/2017
        //=============================================
        //=============================================
        #constant _DISPLAY_X_MAX        175  //width
        #constant _DISPLAY_Y_MAX        219  //heigTh
        #constant _256_COLOURS          0x34
        #constant _65K_COLOURS          0x74
        #constant _262K_COLOURS         0xB4
        //=============================================
        // write device state machine constants
        // The values are fixed, do not change.
        // used in GRAM state machine tables
        //=============================================
        #CONST
            WRITE_CONTROL_CONSTANT     0
            WRITE_DATA_CONSTANT        1
            WRITE_CONTROL_BYTE         2
            WRITE_DATA_BYTE            3
            WRITE_EXIT                 0xFF
        #END
        
        //=============================================
        // GRAM rectangle control register addresses
        // the values represent the addresses of the
        // internal register address holding register
        // and are fixed.
        //=============================================
        #CONST
            _VX1                     0x80
            _VY1                     0x81
            _VX2                     0x82
            _VY2                     0x83
        #END
        
        //=============================================
        // ST7775R  Registers
        //=============================================
        #CONST
            // ST7775R LCD Controller Commands
            ST7775_DRAM_H       0x20//Horizontal DRAM Address set
            ST7775_DRAM_V       0x21//Vertical DRAM Address set
            ST7775_GRAM         0x22//Write\read data to\from GRAM
            ST7775_NVM_ID       0xD2//NVM ID Code
            ST7775_NVM_CTRL     0xD9//NVM Control Status
            ST7775_NVM          0xDF//NVM Write Command
            ST7775_SOFT_RES     0x28//Software Reset
            ST7775_DRAM_HSTART  0x37//Horizontal start address
            ST7775_RAM_HEND     0x36//Horizontal end address
            ST7775_DRAM_VSTART  0x39//Vertical start address
            ST7775_DRAM_VEND    0x38//Vertical end address
        #END
        //=============================================
        // end
        //=============================================
        
        //===========================================================
        // GRAM state machine for ST7775R
        //===========================================================
        #DATA
        byte GRAM_sm
        
            WRITE_CONTROL_CONSTANT, ST7775_RAM_HEND, // 0x36
            WRITE_DATA_BYTE, _VX2,
            WRITE_CONTROL_CONSTANT, ST7775_DRAM_HSTART, // 0x37
            WRITE_DATA_BYTE, _VX1,
            WRITE_CONTROL_CONSTANT, ST7775_DRAM_VEND, // 0x38
            WRITE_DATA_BYTE, _VY2,
            WRITE_CONTROL_CONSTANT, ST7775_DRAM_VSTART, // 0x39
            WRITE_DATA_BYTE, _VY1,
            //WRITE_CONTROL_CONSTANT, ST7775_DRAM_H, //Note, these may not be needed
            //WRITE_DATA_BYTE, _VX1,
            //WRITE_CONTROL_CONSTANT, ST7775_DRAM_V,
            //WRITE_DATA_BYTE, _VY1,
            WRITE_EXIT
        #END
        
        //===========================================================
        // initialization for the ST7775R
        // using 33 bytes
        //===========================================================
        #DATA
            byte INIT_tbl
            _DISPLAY_X_MAX,                        // width:  176-1
            _DISPLAY_Y_MAX,                        // height: 220-1
            ST7775_GRAM,                           // write access register  0x22=GRAM Read/Write Port
            ST7775_GRAM,                           // read access register
            INIT_TABLE_16BIT_INDEX_REG_MODE,
            // now the display initialization table
            2,0x01,     0x01,0x1C,//Driver Output Control
            2,0x02,     0x01,0x00,//LCD Driving Control
            2,0x03,     0x00,0x30,//Entry Mode
            2,0x08,     0x08,0x08,//Display Control 2
            2,0x0C,     0x00,0x00,//RGB Display Interface Control 1
            2,0x0F,     0x0E,0x01,//Frame Market Position
        
            2,0x10,     0x00,0x00,//Power Control 1
            2,0x11,     0x10,0x00,//Power Control 2
            2,0xFF,     0x00,0x03,//NVM Commamd Enable
            2,0xB0,     0x14,0x11,
            2,0xB1,     0x02,0x02,
            2,0xB2,     0x03,0x13,
        
            2,0x30,     0x00,0x00,//Gate Scan Control
            2,0x31,     0x00,0xdb,//Vertical Scroll Control 1
            2,0x32,     0x00,0x00,//Vertical Scroll Control 2
            2,0x33,     0x00,0x00,//Vertical Scroll Control 3
            2,0x34,     0x00,0xdb,//Partial Driving Control 1
            2,0x35,     0x00,0x00,//Partial Driving Control 2
            2,0x36,     0x00,0xaf,//Horizontal Address End Position  --->0x00,0x085 segun truly
            2,0x37,     0x00,0x00,//Horizontal Address Start Position
            2,0x38,     0x00,0xdb,//Vertical Address End Position
            2,0x39,     0x00,0x00,//Vertical Address Start Position
        
            2,0xFF,     0x00,0x03,//NVM Commamd Enable
            2,0x50,     0x00,0x00,//Gamma Control 1      0x02,0x03
            2,0x51,     0x03,0x0,//Gamma Control 2      0x00,0x09
            2,0x52,     0x01,0x03,//Gamma Control 3      0x00,0x05
            2,0x53,     0x20,0x11,//Gamma Control 4      0x10,0x21
            2,0x54,     0x07,0x03,//Gamma Control 5      0x06,0x02
            2,0x55,     0x00,0x00,//Gamma Control 6      0x00,0x03
            2,0x56,     0x04,0x00,//Gamma Control 7      0x07,0x03
            2,0x57,     0x01,0x07,//Gamma Control 8      0x05,0x07
            2,0x58,     0x20,0x11,//Gamma Control 9      0x10,0x21
            2,0x59,     0x07,0x03,//Gamma Control 10
            2,0x20,     0x00,0x00,//Horizontal DRAM Address set
            2,0x21,     0x00,0x00,//Vertical DRAM Address set
            2,0x07,     0x10,0x17,//Display Control 1
            INIT_TABLE_END                // 0xFF,dont forget this !
        #END
        
        
        func main()
          disp_Init(INIT_tbl, GRAM_sm);   // initialize the display
          while(!media_Init())            // initialize the SD Card
                putstr("Drive not mounted...");
                pause(1000);
                gfx_Cls();
                pause(100);
          wend
          repeat
          print("hello");
          pause(2000);
          media_SetSector(0x0000, 0x0000);
          media_Video(2,1);
          pause(2000);
          forever
        endfunc
        I am assuming that the board it is well soldered by the manufacturer. I am doubting if the pins do good contact because it is being very diffucult to work with this TFT

        Comment


        • #19
          Hello,

          Something I've achived.
          Click image for larger version

Name:	IMG_20171205_131241.jpg
Views:	1
Size:	875.5 KB
ID:	60870
          After this, I will create a Github place with examples of drivers for Goldelox. I will post here the direction in a week.
          Thank you very much!!!!!!!!!!!!!!!!!
          Now, I have to put the correct register in order to play the video well.

          Comment

          Working...
          X