NHD-C160100DiZ-FSW-FBW w/PIC18F47J53

Comments

3 comments

  • Michael_L

    Are you issuing a hard reset when you initialize the display?  Take a look at the code below that we use for one of our testers and try and use these initialization values and sequence.  Also note the hard reset at the beginning:

    void C160100DiZ_Init(void)
    {
    GPIO_WriteBit(GPIOC, RES, Bit_RESET);
    graphic_delay(10);
    GPIO_WriteBit(GPIOC, RES, Bit_SET);
    GPIO_SetBits(GPIOC, CS1);
    GPIO_SetBits(GPIOC, nRD);
    GPIO_SetBits(GPIOC, RS);
    GPIO_SetBits(GPIOC, nWR);
    ST7528i_Start();
    ST7528i(Slave);
    ST7528i(Send_Command);
    ST7528i(0x48); //set partial display duty
    ST7528i(0x64);
    ST7528i(0xA0); //ADC: normal
    ST7528i(0xC8); //SHL: COM reverse
    ST7528i(0x40); //set initial display line
    ST7528i(0x00); //set initial display line = 0x00
    ST7528i(0x44); //set initial COM0 register
    ST7528i(0x00);
    ST7528i(0xAB); //start oscillator
    ST7528i(0x26); //select regulator resistor ratio
    ST7528i(0x81); //set electronic volume
    ST7528i(0x1C); //contrast value
    ST7528i(0x56); //select LCD bias
    ST7528i(0x64); //select DC-DC step-up
    graphic_delay(2000);
    ST7528i(0x2C); //set power control
    ST7528i(0x66); //select DC-DC step-up
    graphic_delay(2000);
    ST7528i(0x2E); //set power control
    graphic_delay(2000);
    ST7528i(0x2F); //set power control
    ST7528i(0xF3); //bias power save
    ST7528i(0x00); //bias power save
    ST7528i(0x96); //select FRC and PWM mode
    ST7528i(0x38); //mode set
    ST7528i(0x75); //mode set (FR and BE)

    ST7528i(0x80); //begin Gray Scale level settings
    ST7528i(0x00);
    ST7528i(0x81);
    ST7528i(0x00);
    ST7528i(0x82);
    ST7528i(0x00);
    ST7528i(0x83);
    ST7528i(0x00);
    ST7528i(0x84);
    ST7528i(0x06);
    ST7528i(0x85);
    ST7528i(0x06);
    ST7528i(0x86);
    ST7528i(0x06);
    ST7528i(0x87);
    ST7528i(0x06);
    ST7528i(0x88);
    ST7528i(0x0B);
    ST7528i(0x89);
    ST7528i(0x0B);
    ST7528i(0x8A);
    ST7528i(0x0B);
    ST7528i(0x8B);
    ST7528i(0x0B);
    ST7528i(0x8C);
    ST7528i(0x10);
    ST7528i(0x8D);
    ST7528i(0x10);
    ST7528i(0x8E);
    ST7528i(0x10);
    ST7528i(0x8F);
    ST7528i(0x10);
    ST7528i(0x90);
    ST7528i(0x15);
    ST7528i(0x91);
    ST7528i(0x15);
    ST7528i(0x92);
    ST7528i(0x15);
    ST7528i(0x93);
    ST7528i(0x15);
    ST7528i(0x94);
    ST7528i(0x1A);
    ST7528i(0x95);
    ST7528i(0x1A);
    ST7528i(0x96);
    ST7528i(0x1A);
    ST7528i(0x97);
    ST7528i(0x1A);
    ST7528i(0x98);
    ST7528i(0x1E);
    ST7528i(0x99);
    ST7528i(0x1E);
    ST7528i(0x9A);
    ST7528i(0x1E);
    ST7528i(0x9B);
    ST7528i(0x1E);
    ST7528i(0x9C);
    ST7528i(0x23);
    ST7528i(0x9D);
    ST7528i(0x23);
    ST7528i(0x9E);
    ST7528i(0x23);
    ST7528i(0x9F);
    ST7528i(0x23);
    ST7528i(0xA0);
    ST7528i(0x27);
    ST7528i(0xA1);
    ST7528i(0x27);
    ST7528i(0xA2);
    ST7528i(0x27);
    ST7528i(0xA3);
    ST7528i(0x27);
    ST7528i(0xA4);
    ST7528i(0x2B);
    ST7528i(0xA5);
    ST7528i(0x2B);
    ST7528i(0xA6);
    ST7528i(0x2B);
    ST7528i(0xA7);
    ST7528i(0x2B);
    ST7528i(0xA8);
    ST7528i(0x2F);
    ST7528i(0xA9);
    ST7528i(0x2F);
    ST7528i(0xAA);
    ST7528i(0x2F);
    ST7528i(0xAB);
    ST7528i(0x2F);
    ST7528i(0xAC);
    ST7528i(0x32);
    ST7528i(0xAD);
    ST7528i(0x32);
    ST7528i(0xAE);
    ST7528i(0x32);
    ST7528i(0xAF);
    ST7528i(0x32);
    ST7528i(0xB0);
    ST7528i(0x35);
    ST7528i(0xB1);
    ST7528i(0x35);
    ST7528i(0xB2);
    ST7528i(0x35);
    ST7528i(0xB3);
    ST7528i(0x35);
    ST7528i(0xB4);
    ST7528i(0x38);
    ST7528i(0xB5);
    ST7528i(0x38);
    ST7528i(0xB6);
    ST7528i(0x38);
    ST7528i(0xB7);
    ST7528i(0x38);
    ST7528i(0xB8);
    ST7528i(0x3A);
    ST7528i(0xB9);
    ST7528i(0x3A);
    ST7528i(0xBA);
    ST7528i(0x3A);
    ST7528i(0xBB);
    ST7528i(0x3A);
    ST7528i(0xBC);
    ST7528i(0x3C);
    ST7528i(0xBD);
    ST7528i(0x3C);
    ST7528i(0xBE);
    ST7528i(0x3C);
    ST7528i(0xBF);
    ST7528i(0x3C); //end Gray Scale level settings

    ST7528i(0x38); //mode set
    ST7528i(0x74); //mode set (FR and BE)
    ST7528i(0xAF); //display ON
    ST7528i_Stop();
    }
    0
  • Ipsum

    I modified my program so that the reset line is held low for 10ms and then brought high right before the initialization is written. It still doesn't seem to display anything, but I have a few questions.

    What is nRD, RS, and nWR in this code segment you gave me? Are these lines to the LCD? I know chip select needs to be pulled low, but I don't know what lines those other bits would be.

    GPIO_SetBits(GPIOC, nRD);
    GPIO_SetBits(GPIOC, RS);
    GPIO_SetBits(GPIOC, nWR);

    Is there some kind of minimum communication clock rate? Am I ok running this at 10k Hz? Do I need to finish sending the init sequence in some number of seconds?

    Thanks!

    0
  • Michael_L

    Please disregard those lines of code, there are simply left there from other code snippets from another initialization sequence.  Those pins don't connect to anything on this display.


    The ST7528 datasheet does not give a minimum for I2C clock frequency, only a max of 400kHz.  Therefore, I would think you can communicate at any speeds lower than that, even as low as 10kHz.  Is there any way to try, say, 100kHz with your setup?  Also, what value pullups are you using?  Can you try 10kΩ? Is it possible to make your I2C lines shorter?

    0

Please sign in to leave a comment.