Trouble with newhaven LCD display (C-12864A1Z) with PSOC 4 development kit

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

Hi,

   

 

   

Im having huge trouble trying to interface the newhaven LCD display which has a ST7565P LCD driver to the PSOC 4.

   

http://www.newhavendisplay.com/nhdc12864a1zfsbfbwhtt-p-3895.html

   

 

   

I have an SPI block and 3 output pins on my "top design"

   

3 output pins - Reset, A0, CS

   

On the SPI, i used the mosi (SCL) to connect to the SCL on the LCD, while miso(SDA) to the data pin on the LCD

   

I have an initialization code that runs like this... I basically took this off newhaven's website..

   

 

   

int main()
{
    /* Initialization */
    XBEE_Start();                //starts the Xbee UART
    SPI_Start();
    LCD_Initialization();

   

 

   

...................

   

}

   

void comm_out(unsigned char j) //Command Output Serial Interface
{
    unsigned int n;
    CS_Write(0);
    A0_Write(0);                //A0 = Command
    for(n=0; n<8; n++){
         j <<=1;
     SPI_mosi_s_Write(0);
     SPI_miso_s_Write(j);
     CyDelayUs(1);
     SPI_mosi_s_Write(1);
    }
    CS_Write(1);
}

   

void LCD_Initialization(void)
{
    comm_out(0xA0);                        //RAM->SEG output = normal
    comm_out(0xAE);                        //Display OFF
    comm_out(0xC0);                        //COM scan direction = normal
    comm_out(0xA2);                        //1/9 bias
    comm_out(0x2F);                        //power control set
    comm_out(0x21);                        //resistor ratio set
    comm_out(0x81);                        //Electronic volume command (set contrast)
    comm_out(0x2F);                        //Electronic volume value (contrast value)
}

0 Likes
3 Replies
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

I would recommend you take a look at the SPI examples in PSOC

   

Creator, on start page, "Find Example Project" link.

   

 

   

Then adapt the command and init code you have to send in the

   

example approach. Make sure you meet and startup/init timing the

   

display has from power up.

   

 

   

Regards, Dana.

0 Likes
rola_264706
Level 8
Level 8
50 likes received 25 likes received 10 likes received

Dear Amos : Here is a program that supports this controller. ST7565P

0 Likes
rola_264706
Level 8
Level 8
50 likes received 25 likes received 10 likes received

Dear Amos : Here is a program that supports this controller. ST7565P Just change the controller type in the main.c it is set for nokia now but it should work with your display.  Also change the wiring to agree with the unit.

0 Likes