Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - EdAverill

Pages: [1]
1
Just got this display, wired it into the SPI on my MSP430, and I see pixel draws appear.. then immediately vanish.

My code is based off some code I was sent, plus a C translation of the Basic code examples.

Initialization:

void LCD_Init(void)
{
    int nCount = 0;

    // NOTE - these setup values were taken directly from example code
    // provided by the vendor, CHANGE THEM AT YOUR OWN RISK

    static unsigned char LCDInitArray[] =
        { 0xA1, 0xAE, 0xC8, 0xA2, 0x2F, 0x26, 0x81, 0x15, 0xAF, 0x00};

    for(nCount = 0; LCDInitArray[nCount] != 0; nCount++)
        SendCommandToLCD(LCDInitArray[nCount]);

    // At this point the LCD shouldbe ready for use

    return;
}

My test draw routine:

void LCD_Draw(unsigned char chValue)
{
    int i,j;
    char foo[1];

    unsigned char page = 0xB0;
     SendCommandToLCD(0x40);
    for(i=0;i<8;i++){
        SendCommandToLCD(page);
        SendCommandToLCD(0x10);
        SendCommandToLCD(0x00);
        for(j=0;j<128;j++){
            foo[0] = chValue;
            SendDataToLCD(foo, 1);
            __delay_cycles(10);
            }
        page++;
        }
    SendCommandToLCD(0xAF);

    return;
}

SendCommandToLCD() sends a command byte to the LCD, and SendDataToLCD() sends a data byte.

I should see a nice, filled block on the display, but what I see is that a block will appear briefly then vanish - almost as if the RESET line went low.  The scope shows RESET is high, A0 toggles properly, and SPI SCLK and SIMO are running properly.

Any idea as to why I don't see the display maintain its contents?

Ed Averill


Pages: [1]