1 2 3 Previous Next 38 Replies Latest reply on Dec 4, 2012 12:50 AM by user_49271930

    INTERFACING JHD12864E TO PSOC3

    sivananda.reddy

       Hi to all....

         

         iam beginner to Psoc3...recently i tried to interface JHD12864E graphical LCD to psoc3...here, iam mentioning the steps that i did to interface it....

         

                  1) I have taken 8 GPIOS of psoc3 (PORT6 of first touch starter kit) for connecting to DB0 to DB7 of JHD12864E.

         

                  2) and i have taken 6 another GPIOS to various control pins of JHD12864E...

         

                                                                   RS--->P4[6],    RW--->P4[4],    ENABLE---->P12[3],   

         

                                                                   CS1----> P4[5], CS2----->P4[7],   RESET---->P2[7],

         

                                                and named each pin as shown above....

         

      and i connected the power pins of JHD12864E as follows....

         

                                             pin 1----> GND,  Pin2---->+5V,   Pin3---> the varying end of 10K variable resistor,

         

                                            Pin  18---> connected to one end of 10K variable resistor, and other end of variable resistor connected to ground.                       Pin 19---->+5V,  and   Pin20------> GND

         

                3) here iam mentioning the source code which i have written..............

         

       

         

       

         

      #include <device.h>

         

       

         

      void main()

         

      {

         

          /* Place your initialization/startup code here (e.g. MyInst_Start()) */

         

       

         

          /* CyGlobalIntEnable; */ /* Uncomment this line to enable global interrupts. */

         

         

         

         

         

         //RESET of GLCD//

         

         RESET_Write(0);

         

          CS1_Write(0);

         

         CS2_Write(0);

         

         RESET_Write(1);

         

         CS1_Write(1);

         

         CS2_Write(1);

         

         ENABLE_Write(1);

         

         CyDelay(1);

         

         ENABLE_Write(0);

         

         

         

         //First half DISPLAY ON//  //to turn ON the first half of this LCD the data through the pins should be like this//

         

         CS1_Write(1);               // CS1=1, CS2=0, RS=0(for instruction), RW=0 (to write),// 

         

                                     //and DB0=7,DB6=0,DB5=1,DB4=1,DB3=1,DB2=1,DB1=1,DB0=1//

         

         CS2_Write(0);               //ENABLE Should be falling edge//

         

         RS_Write(0);

         

         RW_Write(0);

         

         PRT0DB_Write(0x3F);

         

         ENABLE_Write(1);

         

         CyDelay(1);

         

         ENABLE_Write(0);

         

         

         

         

         

         //Second half DISPLAY ON//     //to turn ON the first half of this LCD the data through the pins should be like this//

         

         CS1_Write(0);                  // CS1=0, CS2=1, RS=0(for instruction), RW=0 (to write),//

         

         CS2_Write(1);                  //and DB0=7,DB6=0,DB5=1,DB4=1,DB3=1,DB2=1,DB1=1,DB0=1//

         

         RS_Write(0);                    //ENABLE Should be falling edge//

         

         RW_Write(0);

         

         PRT0DB_Write(0x3F);

         

         ENABLE_Write(1);

         

         CyDelay(1);

         

         ENABLE_Write(0);

         

         

         

         //first half Y Adress //    DB7=0,DB6=1, DB5 TO DB0 is to give the Y address

         

         CS1_Write(1);

         

         CS2_Write(0);

         

         RS_Write(0);

         

         RW_Write(0);

         

         PRT0DB_Write(0x60);

         

         ENABLE_Write(1);

         

         CyDelay(1);

         

         ENABLE_Write(0);

         

         

         

         //second half Y Adress //

         

          CS1_Write(0);

         

         CS2_Write(1);

         

         RS_Write(0);

         

         RW_Write(0);

         

         PRT0DB_Write(0x60);

         

         ENABLE_Write(1);

         

          CyDelay(1);

         

         ENABLE_Write(0);

         

       

         

         //first half X page select// DB7=1,DB6=0,DB5=1,DB4=1,DB3=1, DB2 TO DB0 is to give x address//

         

          CS1_Write(1);

         

         CS2_Write(0);

         

         RS_Write(0);

         

         RW_Write(0);

         

         PRT0DB_Write(0xBB);

         

         ENABLE_Write(1);

         

          CyDelay(1);

         

         ENABLE_Write(0);

         

         

         

         //second half X page select//

         

          CS1_Write(0);

         

         CS2_Write(1);

         

         RS_Write(0);

         

         RW_Write(0);

         

         PRT0DB_Write(0xBB);

         

         ENABLE_Write(1);

         

          CyDelay(1);

         

         ENABLE_Write(0);

         

       

         

        //first half Start line

         

         //CS1_Write(1);

         

         //CS2_Write(0);

         

         //RS_Write(0);

         

         //RW_Write(0);

         

         //PRT0DB_Write(0xD0);

         

         //ENABLE_Write(1);

         

         //ENABLE_Write(0);

         

         

         

         //second half start line

         

         //CS1_Write(0);

         

         //CS2_Write(1);

         

         //RS_Write(0);

         

         //RW_Write(0);

         

         //PRT0DB_Write(0xD0);

         

         //ENABLE_Write(1);

         

         //ENABLE_Write(0);

         

       

         

      //first half write data// TO WRITE DATA RS=1, RW=0

         

       CS1_Write(1);

         

         CS2_Write(0);

         

         RS_Write(1);

         

         RW_Write(0);

         

         PRT0DB_Write(0xAA);

         

         ENABLE_Write(1);

         

          CyDelay(1);

         

         ENABLE_Write(0);

         

       

         

        //second half write data// 

         

         CS1_Write(0);

         

         CS2_Write(1);

         

         RS_Write(1);

         

         RW_Write(0);

         

         PRT0DB_Write(0xAA);

         

         ENABLE_Write(1);

         

          CyDelay(1);

         

         ENABLE_Write(0);

         

      }

         

       

         

      /* [] END OF FILE */

         

      and I kept all the pins driving mode as STRONG...

         

      after doing this, my GLCD backlight is turning ON......but it is not displaying any data.......

         

      so, can any one help me how to interface it correctly to Psoc3, so that i can send various data to display in the intended position of GLCD......here iam attaching the "topdesign" page of my workspace

        1 2 3 Previous Next