title: Unable to use my LCD display with a PIC16
body: <p>Thanks for stopping by.</p>
  
  <p>I am trying to use my new Midas MC21605G12W LCD display, based on Hitachi HD44. I use a PIC16.</p>
  
  <p>I followed the datasheet thoroughly but couldn't make anything react. The display keeps showing light squares without a blink. No topic on the site could help me further.</p>
  
  <p>I interface via 8bit in parallel, so all my port C is wired to DB0-DB7.</p>
  
  <p>If anyone could tell me anything I did wrong, it would be great.</p>
  
  <p>Thanks in advance for your time :-)</p>
  
  <p>Here is my code:</p>
  
  <pre><code>    #include &lt;stdio.h&gt;
      #include &lt;pic16f18875.h&gt;
  
  
      #define RS LATBbits.LATB5  //data or instruction(LOW))
      #define E LATBbits.LATB7  //chip enable
  
      int i;    //for counters of delays
  
      /******************************MAIN************************************************/      
  
      void main()
          {
          TRISC = 0x00;     //défine in/outs
          TRISB = 0x00;     //Port B is for commands, port C is 
                            //for 8bit data and instructions
          ANSELC = 0x00;
          ANSELB = 0x00;          
          LATC = 0x00;
          LATB = 0x00;
  
      RS=0;                      //we start with instructions
          E=0;                        //enable is initiated at zero
  
      LATC=0b00111100;            //select function
              for (i=0;i&lt;15;i++){}        //setting of the port (delay)
          E=1;                        //enable pulse 
              for (i=0;i&lt;1;i++){}         //ensure it is read
          E=0;
              for (i=0;i&lt;12000;i++){}     //lcd internal operations
  
      LATC=0b00001111;            //display on
              for (i=0;i&lt;15;i++){}
          E=1;
              for (i=0;i&lt;1;i++){}
          E=0;
              for (i=0;i&lt;12000;i++){}
  
      LATC=0x01;                  //clear display
              for (i=0;i&lt;15;i++){}
          E=1; 
              for (i=0;i&lt;1;i++){}
          E=0; 
              for (i=0;i&lt;12000;i++){} 
  
      LATC=0x07;                  //select position of cursor
              for (i=0;i&lt;15;i++){}
          E=1; 
              for (i=0;i&lt;1;i++){}
          E=0;
              for (i=0;i&lt;12000;i++){}
  
      RS=1;                       //now we will send data
  
      LATC=0x41;                  //display "A" (ascii)
              for (i=0;i&lt;15;i++){}
          E=1;
              for (i=0;i&lt;1;i++){}
          E=0;
              for (i=0;i&lt;12000;i++){}
  
      RS=0;
  
          while(1)
          {}
      }
  </code></pre>