title: LCD follows commands but doesn't display characters
body: <p>I have programmed an Atmega-16 Microcontroller to interface a LM016L LCD display. The program is as follows:</p>
  
  <pre><code>#include &lt;avr/io.h&gt;
  #include &lt;util/delay.h&gt;
  #define MrLCDsCrib PORTB
  #define DataDir_MrLCDsCrib DDRB
  #define MrLCDsControl PORTD
  #define DataDir_MrLCDsControl DDRD
  #define LightSwitch 5
  #define ReadWrite 7
  #define BiPolarMood 2
  
  void Check_IF_MrLCD_isBusy(void);
  void Peek_A_Boo(void);
  void Send_A_Command(unsigned char command);
  void Send_A_Character(unsigned char character);
  
  int main(void) {
      DataDir_MrLCDsControl |= 1 &lt;&lt; LightSwitch | 1 &lt;&lt; ReadWrite | 1 &lt;&lt; BiPolarMood;
      _delay_ms(15);
  
      Send_A_Command(0x01); //Clear Screen 
      _delay_ms(20);
      Send_A_Command(0x38); //8-bit mode
      _delay_ms(20);
      Send_A_Command(0b00001110); // cursor on
      _delay_ms(20);
      Send_A_Command(0x0F); // cursor blinking
      _delay_ms(20);
  
      Send_A_Character(0x4E); //N
      _delay_ms(20);
      Send_A_Character(0x65); //e
      _delay_ms(20);
      Send_A_Character(0x77); //w
      _delay_ms(20);
  
  
      while (1) {}
  }
  
  void Check_IF_MrLCD_isBusy() {
      DataDir_MrLCDsCrib = 0;
      MrLCDsControl |= 1 &lt;&lt; ReadWrite;
      MrLCDsControl &amp;= ~1 &lt;&lt; BiPolarMood;
  
      while (MrLCDsCrib &gt;= 0x80) {
          Peek_A_Boo();
      }
      DataDir_MrLCDsCrib = 0xFF;
  }
  
  //Peek_A_Boo() writes the data to or from the LCD that are waiting to be written 
  void Peek_A_Boo() {
      MrLCDsControl |= 1 &lt;&lt; LightSwitch;
      asm volatile("nop");
      asm volatile("nop");
      MrLCDsControl &amp;= ~1 &lt;&lt; LightSwitch;
  }
  
  void Send_A_Command(unsigned char command) {
      Check_IF_MrLCD_isBusy();
      MrLCDsCrib = command;
      MrLCDsControl &amp;= ~ ((1 &lt;&lt; ReadWrite) | (1 &lt;&lt; BiPolarMood));
      Peek_A_Boo();
      MrLCDsCrib = 0;
  }
  
  void Send_A_Character(unsigned char character) {
      Check_IF_MrLCD_isBusy();
      MrLCDsCrib = character;
      MrLCDsControl &amp;= ~ (1 &lt;&lt; ReadWrite);
      MrLCDsControl |= 1 &lt;&lt; BiPolarMood;
      Peek_A_Boo();
      MrLCDsCrib = 0;
  }
  </code></pre>
  
  <p>When I send commands to the LCD like making the cursor to blink, it works perfectly fine. But when the function Send_A_Character() is called to write the characters to the screen, it doesn't work. I cannot make LCD to display anything on the screen. There is no syntax error on the above code. If anyone of you could point out a logical error that is preventing LCD to display anything on the screen, that would be great. I've even tried increasing the delays at each points to 2 seconds but that didn't work. </p>