I wanted to write a few words on a LCD Display 2x16, I already have the code that I will expose here, but I do not know why this gives me an error:
HD44780 ERROR: Neither 'Set DDRAM ADDRESS' nor '' Set CGRAM ADDRESS ' instruction was issued prior to the write instruction.
It has already appeared in other projects and I do not know what it means or what I can do wrong. Here is my code:
#include "sdcc_reg420.h"
#define LCD_PORT P1
#define En P3_5
#define RS P3_1
#define RW P3_0
void LCD_comando(unsigned char comando);
void LCD_init (void);
void LCD_date(char letra);
//void inicio ();
void LCD_init (void) //inicialização do LCD
{
LCD_comando(0b00111000); //duas linhas e caracteres 5x7
LCD_comando(0b00001111); //cursor ON,DisplayON, Piscar ON
LCD_comando(0b00000001); //Limpar o LCD
LCD_comando(0b00000110); //modo de entrada de dados: em incremento e Shift total off
LCD_comando(0b10000000); //modo de entrada de dados: endreço inicial da memoria DDRAM
}
void LCD_comando(unsigned char comando)
{
LCD_PORT=comando;
RS=0;
RW=0;
En=0;
En=1;
}
void LCD_date(char letra)
{
LCD_PORT=letra;
RS=1;
RW=0;
//En=0;
En=1;
}
void main (void)
{
LCD_date(' ');
LCD_date(' ');
LCD_date('B');
LCD_date('O');
LCD_date('M');
LCD_date('B');
LCD_date('A');
LCD_date('S');
LCD_date('T');
LCD_date('I');
LCD_date('C');
LCD_date('O');
LCD_date(' ');
LCD_date(' ');
LCD_date(' ');
LCD_date(0);
LCD_comando(0b11000000);
LCD_date(' ');
LCD_date(' ');
LCD_date('A');
LCD_date('N');
LCD_date('A');
LCD_date(' ');
LCD_date('C');
LCD_date(' ');
LCD_date('M');
LCD_date('A');
LCD_date(' ');
LCD_date(' ');
}
The IDE I'm using is the 8051 MCU, I appreciate your help.