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.


Messages - docmur

Pages: [1]
1
OLEDs / Re: NHD-0420CW With PIC32MX Controller
« on: May 12, 2015, 10:06:05 AM »
Done give me a second :-)

Clock Signal Isolated
http://postimg.org/image/fy50lsesv/

Data Signal Isolated
http://postimg.org/image/h8f71y4yb/

Clock and Data
http://postimg.org/image/5epyma6zp/e82e3a85/

Clock and Data Single Byte
http://postimg.org/image/a2f4nh2kd/

Clock and SS
http://postimg.org/image/wkq9616vz/

Data and SS
http://postimg.org/image/hf1nutk4h/

And finally What I was sending to grab the images

    LCD_SS = 0;
    writeSPI1(0x01); //clear display
    writeSPI1(0x02); //return home
    writeSPI1(0x1F);
    LCD_SS = 1;

2
OLEDs / Re: NHD-0420CW With PIC32MX Controller
« on: May 12, 2015, 08:53:32 AM »
Hey Paul

Thanks for your reply. 

I've attached the schematic of how we hooked up the LCD, BS0-3 are grounded.

Below is my full init routine:
Code: [Select]
void init_lcd(void)
{
    LCD_SS_TRIS = 0;
    LCD_SS = 1;

    delay_10us(10000);
    LCD_SS = 0;

    writeSPI1(0x2A); //function set (extended command set)
    writeSPI1(0x71); //function selection A
    writeSPI1(0x03); // disable internal VDD regulator (2.8V I/O). data(0x5C) = enable regulator (5V I/O)
    writeSPI1(0x28); //function set (fundamental command set)
    writeSPI1(0x08); //display off, cursor off, blink off
    writeSPI1(0x2A); //function set (extended command set)
    writeSPI1(0x79); //OLED command set enabled
    writeSPI1(0xD5); //set display clock divide ratio/oscillator frequency
    writeSPI1(0x70); //set display clock divide ratio/oscillator frequency
    writeSPI1(0x78); //OLED command set disabled
    writeSPI1(0x09); //extended function set (4-lines)
    writeSPI1(0x06); //COM SEG direction
    writeSPI1(0x72); //function selection B
    writeSPI1(0x00); //ROM CGRAM selection
    writeSPI1(0x2A); //function set (extended command set)
    writeSPI1(0x79); //OLED command set enabled
    writeSPI1(0xDA); //set SEG pins hardware configuration
    writeSPI1(0x10); //set SEG pins hardware configuration
    writeSPI1(0xDC); //function selection C
    writeSPI1(0x10); //function selection C
    writeSPI1(0x81); //set contrast control
    writeSPI1(0x7F); //set contrast control
    writeSPI1(0xD9); //set phase length
    writeSPI1(0xF1); //set phase length
    writeSPI1(0xDB); //set VCOMH deselect level
    writeSPI1(0x40); //set VCOMH deselect level
    writeSPI1(0x78); //OLED command set disabled
    writeSPI1(0x28); //function set (fundamental command set)
    writeSPI1(0x01); //clear display
    writeSPI1(0x80); //set DDRAM address to 0x00
    writeSPI1(0x0F); //display ON
    LCD_SS = 1;
    delay_10us(10000);

}

void output()
{
    int i;
    writeSPI1(0x01); //clear display
    writeSPI1(0x02); //return home

    for(i=0;i<20;i++)
    {
        writeSPI1(0x1F); //write solid blocks
    }

    writeSPI1(0xA0); //line 2
    for(i=0;i<20;i++)
    {
        writeSPI1(0x1F); //write solid blocks
    }

    writeSPI1(0xC0); //line 3
    for(i=0;i<20;i++)
    {
        writeSPI1(0x1F); //write solid blocks
    }

    writeSPI1(0xE0); //line 4
    for(i=0;i<20;i++)
    {
        writeSPI1(0x1F); //write solid blocks
    }
}

unsigned char writeSPI1(unsigned char byte ){
    /* Make sure the module has been configured */
    if( spi1Config == false ){
        /* Configure the bus -- It's not configured -- */
        init_spi1();
    }
    /* Write the byte to the buffer */
    SPI1BUF = byte;
    /* Wait for the transmission to complete */
#ifndef __SIMULATION
    while( !SPI1STATbits.SPIRBF);
#endif
    /* Clear the buffer by reading it - REQUIRED! */
    return SPI1BUF;
}


Image:
http://postimg.org/image/rg78l29gp/

3
OLEDs / NHD-0420CW With PIC32MX Controller
« on: May 11, 2015, 12:25:06 PM »
Hey Guys

I've been given this LCD to get working with my PIC32MX360F256L microcontroller and I can't for the life of me get anything to happen with it.  I've tried the sample code from the datasheet, I've tried several different Arduino examples and nothing I do will allow this LCD to function normally.  I current have my SPI configured for IDLE high lock and I've tried sampling in the middle and at the end of the CLK.

My configuration is:

SCLK  - SCLK
SDO   - SCO
SDI    - SDI
SS      - LCD_SS

I have everything else hooked up as per the datasheet and yet I can't talk to it no matter what I do.  So far the closest I've gotten was to talk to the LCD using this funciton:

void init_lcd(void)
{
    LCD_SS_TRIS = 0;
    LCD_SS = 1;

    delay_10us(10000);
    LCD_SS = 0;
    delay_10us(5);
    writeSPI1(0x01); //clear display
    writeSPI1(0x02); // Return home
    writeSPI1(0x06);
    writeSPI1(0x00);
    writeSPI1(0x0C); //display ON
    delay_10us(10000);
    LCD_SS = 1;
}

this code made a garbage characters show up, but it did turn on the screen.

I have my SPI setup in 8 bit format, I've also tried to bit bang the interface over the SPI lines.

Thanks

Docmur

Pages: [1]