I've been trying to show some characters on a LM015L LCD but I wasn't able to do it.

I've written the following code in C:

// LCD module connections
sbit LCD_RS at LATD0_bit;
sbit LCD_EN at LATD1_bit;
sbit LCD_D4 at LATD2_bit;
sbit LCD_D5 at LATD3_bit;
sbit LCD_D6 at LATD4_bit;
sbit LCD_D7 at LATD5_bit;

sbit LCD_RS_Direction at TRISD0_bit;
sbit LCD_EN_Direction at TRISD1_bit;
sbit LCD_D4_Direction at TRISD2_bit;
sbit LCD_D5_Direction at TRISD3_bit;
sbit LCD_D6_Direction at TRISD4_bit;
sbit LCD_D7_Direction at TRISD5_bit;
// End LCD module connections

void main() {

 Lcd_Init(); // Initialize LCD
 Lcd_Cmd(_LCD_CLEAR); // Clear display
 Lcd_Cmd(_LCD_CURSOR_OFF); // Cursor off

 Lcd_Out(1, 1, "microcontrollers"); // Display "StudentCompanion"
 Lcd_Out(2, 1, "lab.com"); // Display "Thermometer"


I've designed the following circuit in Proteus:

enter image description here

After I run the simulation the LCD turns on but nothing is shown on it.


1 Answer 1


The code uses the pins differently to how the circuit is drawn, so it does not work as the circuit and code do not match. And the LCD drive voltage pin (the contrast pin) is also not connected (but simulators may ignore such details).

  • \$\begingroup\$ Any idea on how I should draw the circuit / change the code so that it will work? It's actually my first time writing code for a microprocessor \$\endgroup\$
    – t3nsa
    May 20, 2022 at 19:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.