3 Replies Latest reply on Jul 21, 2015 8:01 PM by user_517963414

    PSoC4 GLCD Initialisation

    user_517963414

      Hello,

         

      I'm currently working with the PSoC4 Pioneer Kit and trying to interface a GLCD with two KS0108 Controllern on it.
      I connected the data-port (8 bit) to Port2, a control-port (including chip-select 1 and 2, RS and RW signals) to port P1.1-P1.4, the Enable-signal to P1.0 and the Reset-Signal to +5V (the board is currently running on 5V).
      V0 is tied to VLCD with an 1K potentiometer for contrast adjustment. K and A are directly connected to GND and +5V.
      I always measured 4,7V but it should still be inside the range of the display.

         

      This is my code:

         

      #define CHIP1   0x02
      #define CHIP2   0x01
      #define CHIP12  0x00
      #define DESELCT 0x03

         

      #define LOW     0x00
      #define HIGH    0x01

         

      void Toggle_EnableSignal()
      {
          ControlPortE_Write(LOW);
         
          CyDelayUs(5);
         
          ControlPort_Write(HIGH);
         
          CyDelayUs(5);
      }

         

      void P6800_SendCommandPacket(uint8 chip, uint8 cmd)
      {
          ControlPort_Write((chip << 2));
         
          DataPort_Write(cmd);
         
          Toggle_EnableSignal();   
      }

         

      void P6800_SendDataPacket(uint8 chip, uint8 data)
      {
          ControlPort_Write((chip << 2) | 0x02);
         
          DataPort_Write(data);
         
          Toggle_EnableSignal();   
      }

         


      int main()
      {   
          CyDelay(3000);   
         
          P6800_SendCommandPacket(CHIP1, 0x3E); // dsp off
          CyDelay(100);
          P6800_SendCommandPacket(CHIP1, 0xC0); // start line
          CyDelay(100);
          P6800_SendCommandPacket(CHIP1, 0x3F); // dsp on
          CyDelay(100);
          P6800_SendCommandPacket(CHIP1, 0x40); // col select
          CyDelay(100);
          P6800_SendCommandPacket(CHIP1, 0xB8); // page select
         
          CyDelay(50);   
         
          P6800_SendDataPacket(CHIP1, 0xFE);          // print the letter P
          P6800_SendDataPacket(CHIP1, 0x22);  
          P6800_SendDataPacket(CHIP1, 0x22);
          P6800_SendDataPacket(CHIP1, 0x22);
          P6800_SendDataPacket(CHIP1, 0x1C);
          P6800_SendDataPacket(CHIP1, 0x3E); 
         
         
          CyGlobalIntEnable; /* Enable global interrupts. */

         

          /* Place your initialization/startup code here (e.g. MyInst_Start()) */
         
          for(;;)
          {
              /* Place your application code here. */
          }
      }

         

      I measured the signals directly on the display-pins and everything seemed finde. But I only get a blue screen (backlight is on).
      The delays originally have been shorter than this but I wanted to be on the save side.

         

      I hope you can help me with my problem.

         

      Best regards