¡Hola! Bienvenido a CircuitBread. En el tutorial anterior, analizamos la unidad de matriz de temporizadores (TAU) RL78 y creamos una función de retraso de microsegundos. delay_us()
y una función de retardo de milisegundos para crear una biblioteca de retardo. delay_ms()
y una función de retardo de microsegundos delay_us()
. Como se prometió, este tutorial conecta un dispositivo ampliamente utilizado por aficionados con el MCU RL78/G14.
Por el título del tutorial, ya está claro que se debe usar una pantalla LCD 1602. La razón principal por la que elegí este dispositivo es que ahora es barato y fácil de comprar. Sin embargo, no puedo encontrar un tutorial con buenas instrucciones sobre cómo programar e interactuar con la MCU RL78. La segunda razón es que CircuitBread tiene un tutorial para este dispositivo que interactúa con una MCU PIC escrito por Sergey “Programación C integrada con PIC18F14K50 – 18. Uso de una pantalla LCD de 1602 caracteres con el controlador HD44780”. Para ver cómo funciona la pantalla LCD y las funciones que la controlan, consulte el tutorial de Sergey.
Una tercera razón para elegir este dispositivo es que después de observar la funcionalidad, parece que podría ser portado para trabajar con una MCU RL78 si sabe cómo configurar los GPIO RL78 y conoce la funcionalidad de retraso ya mencionada. tutorial anterior. Me gustaría mencionar de antemano que este tutorial se centra realmente en la migración de funciones que Sergey escribió para MCU PIC a MCU RL78. No cubriré el funcionamiento de la pantalla LCD y sus funciones, ya que solo haría que el tutorial fuera más largo. Si desea obtener información sobre el funcionamiento y la funcionalidad de la pantalla LCD, consulte el tutorial de Sergey Programación en C integrada con PIC18F14K50 – 18. Uso de la pantalla LCD de 1602 caracteres con el controlador HD44780.
Tabla de contenido
diagrama de circuito
Antes de comenzar a portar la funcionalidad, verifiquemos las conexiones de hardware entre el 1602 LCD y el RL78/G14 FPB. Vea el esquema a continuación.
Como se puede ver en la Figura 1, los pines primero (VSS) y segundo (VDD) de la pantalla LCD son para alimentación.Normalmente, el voltaje de funcionamiento de la pantalla LCD es 5V
. Sin embargo, algunas pantallas LCD funcionan en las siguientes condiciones: 3.3V
. Así que asegúrate de tener: 5V
Verifique la versión y luego conéctese VSS
idea VDD
pines LCD GND
idea TARGET_VCC
Cada uno está conectado al terminal RL78/G14 FPB.La Figura 2 muestra el contenido del encabezado. TARGET_VCC
, GND
y Port 1 pins
está conectado a

de V0
El pin se utiliza para establecer el contraste de la pantalla LCD. Conectándolo al terminal de limpieza de un potenciómetro o recortador de 10kΩ como se muestra en la Figura 1, el contraste de la pantalla LCD se puede ajustar fácilmente.
de RS
Los pines que son entradas de datos/comandos están conectados a pines P14
Microcontrolador RL78/G14 RW
Los pines para la entrada de lectura/escritura solo están conectados. GND
Esto se debe a que los datos solo se envían desde la MCU a la pantalla LCD.de E
Conecte el pin de la pantalla LCD que es la entrada del reloj al pin. P15
del microcontrolador RL78/G14.
Solo se utilizan 4 bits de la interfaz paralela de 8 bits de la pantalla LCD.así que eso es todo D4-D7
Los pines se utilizan y conectan P10-P13
Clavija MCU RL78/G14.
de A
y K
El pin es para la fuente de alimentación de retroiluminación LCD. Conectar. A
idea K
fijarlo a TARGET_VCC
idea GND
Cada uno está conectado al terminal RL78/G14 FPB. No olvide agregar una resistencia en serie como se muestra en el esquema (22-47 Ω sería ideal, pero usé una resistencia de 100 Ω).



La figura 3 muestra la conexión real entre RL78/G14 FPB y 1602 LCD. Ignore los otros componentes (LED e interruptores) en la imagen. Estos están ahí para que puedas usarlos fácilmente si quieres probar algo. Eso es todo por el hardware. Pasemos a la descripción funcional.
Portabilidad de la funcionalidad LCD
A continuación se muestra una lista de funciones del tutorial de Sergey. De hecho, solo hay 7 funciones en el tutorial “Programación en C integrada con PIC18F14K50 – 18. Uso de LCD de 1602 caracteres con controlador HD44780”.Sin embargo, agregué lcd_clear()
Use una función para que sea más fácil borrar la visualización del código de muestra más tarde.
void lcd_init(uint8_t cursor, uint8_t blink); // Initialize the LCD
void lcd_command(uint8_t command); // Send the command to the LCD
void lcd_send(uint8_t value, uint8_t rs); // Send any data to the LCD
void lcd_write(char *s); // Write the string at the LCD
void lcd_data(uint8_t data); // Send the character to the LCD
void lcd_set_cursor(uint8_t x, uint8_t y); // Set cursor at the specified position
void lcd_create_char(uint8_t addr, uint8_t *data); // Create a custom character
void lcd_clear(void); // Clear the screen
Primero, lcd_init()
Esto se debe a que es la primera función llamada para inicializar la pantalla LCD. Aquí está la definición de la función en el tutorial de Sergey:
void lcd_init(uint8_t cursor, uint8_t blink) // Initialize LCD
{
lcd_command(0x30); // Try to use 8-bit interface
__delay_us(4200); // Delay for command implementation
lcd_command(0x30); // Try 8-bit interface one more time
lcd_command(0x28); // Set 4-bit interface, two lines
lcd_command(0x08); // Turn off the display
lcd_command(0x01); // Clear the display and reset the address to 0
__delay_us(4200); // Delay for command implementation
lcd_command(0x06); // Cursor move direction from left to right
lcd_command(0x0C | (cursor << 1) | blink); // Turn on display, set the cursor and blinking parameters
}
Hay dos funciones que se utilizan internamente. lcd_init()
función, lcd_command()
y __delay_us()
función.de lcd_command()
La función es una de las funciones de la pantalla LCD, así que déjela como está.pero vamos a intercambiar __delay_us()
Combine esta función con la función de retraso de microsegundos creada en el tutorial anterior.cambiamos line 4
y line 9
así que nuestro nuevo lcd_init()
La definición de función de RL78 MCU es la siguiente.
void lcd_init(uint8_t cursor, uint8_t blink) // Initialize LCD
{
lcd_command(0x30); // Try to use 8-bit interface
delay_us(4200); // Delay for command implementation
lcd_command(0x30); // Try 8-bit interface one more time
lcd_command(0x28); // Set 4-bit interface, two lines
lcd_command(0x08); // Turn off the display
lcd_command(0x01); // Clear the display and reset the address to 0
delay_us(4200); // Delay for command implementation
lcd_command(0x06); // Cursor move direction from left to right
lcd_command(0x0C | (cursor << 1) | blink); // Turn on display, set the cursor and blinking parameters
}
bien sigamos adelante lcd_command()
función. Dentro del cuerpo, como se muestra a continuación, lcd_command()
Solo hay una línea que llama a la función. lcd_send()
función.de lcd_send()
La función es también una de las funciones de la pantalla LCD. Así que no hay necesidad de cambiar nada. lcd_command()
función.vamos a lcd_send()
función.
void lcd_command(uint8_t command) // Send command to LCD
{
lcd_send(command, 0); // Issue lcd_send function with RS = 0
}
Si está familiarizado con las MCU PIC, notará: lcd_send()
Las siguientes funciones utilizan PORTC
MCU PIC18F14K50.alfiler RC0-RC3
para pines de datos D4-D7
, RC4
con el fin de RS
alfiler, y RC5
con el fin de E
alfiler. Para el esquema que se muestra en la Figura 1, usamos: Port 1
del microcontrolador RL78/G14. Conectado los pines de datos LCD D4-D7
en el pasador P10-P13
Microcontrolador RL78/G14, RS
alfiler a alfiler P14
y E
alfiler a alfiler P15
. Entonces, cambiemos las siguientes líneas de código en función de estas conexiones.
void lcd_send(uint8_t value, uint8_t rs) // Send any data to LCD
{
LATCbits.LC4 = rs; // Set RS pin (data/command)
LATCbits.LC5 = 1; // Set E pin high to start the pulse
LATC &= 0xF0; // Clear the lower nibble of the LATC (set RC0-RC4 low)
LATC|=(value & 0xF0) >> 4; // Send the upper nibble of the "value" to LCD
__delay_us(1); // Delay needed by the driver
LATCbits.LC5 = 0; // Set E pin low to finish the pulse
__delay_us(1); // Delay needed by the driver
LATCbits.LC5 = 1; // Set E pin high to start the pulse
LATC &= 0xF0; // Clear the lower nibble of the LATC (set RC0-RC4 low)
LATC |= value & 0x0F; // Send the lower nibble of the "value" to LCD
__delay_us(1); // Delay needed by the driver
LATCbits.LC5 = 0; // Set E pin low to finish the pulse
__delay_us(40); // Delay more than 37 us to implement the command
}
- En línea 3 cambio
LATCbits.LC4
AP1_bit.no4
. - En las líneas 4, 8, 10 y 14 cambia:
LATCbits.LC5
AP1_bit.no5
. - En las líneas 5, 6, 11 y 12 cambia:
LATC
AP1
. - En las líneas 7, 9 y 13 cambia:
__delay_us(1)
Adelay_1us()
.también puede ser usadodelay_us(1)
. - En la línea 15 cambiar:
__delay_us(40)
Adelay_us(40)
.
Aquí está la definición de la nueva función. lcd_send()
Características de la MCU RL78:
void lcd_send(uint8_t value, uint8_t rs) // Send any data to LCD
{
P1_bit.no4 = rs; // Set Port RS pin (data/command). P14 assigned to LCD RS pin.
P1_bit.no5 = 1; // Set E pin high to start the pulse. P15 assigned to LCD E pin.
P1 &= 0xF0; // Clear the lower nibble of P1 (set P10-P13 low)
P1 |= (value & 0xF0) >> 4; // Send the upper nibble of the "value" to LCD
delay_1us(); // Delay needed by the driver
P1_bit.no5 = 0; // Set E pin low to finish the pulse
delay_1us(); // Delay needed by the driver
P1_bit.no5 = 1; // Set E pin high to start the pulse
P1 &= 0xF0; // Clear the lower nibble of P1 (set P10-P13 low)
P1 |= value & 0x0F; // Send the lower nibble of the "value" to LCD
delay_1us(); // Delay needed by the driver
P1_bit.no5 = 0; // Set E pin low to finish the pulse
delay_us(40); // Delay more than 37 us to implement the command
}
porque usamos Port 1
Se agregó un código de inicialización a RL78/G14 para LCD (” line 3
y line 4
en el código de abajo) Port 1
en el lcd_init()
El uso de una función elimina la necesidad de inicializar el puerto. r_main.c
Archivo.Así que aquí está el actualizado. lcd_init()
Esta función es para RL78 MCU.
void lcd_init(uint8_t cursor, uint8_t blink) // Initialize LCD
{
PM1 = 0; // Use RL78/G14 Port 1 pins as LCD Pins. Set the entire Port 1 pins as outputs.
P1 = 0; // Set the entire Port 1 pins to LOW.
lcd_command(0x30); // Try to use 8-bit interface
delay_us(4200); // Delay for command implementation
lcd_command(0x30); // Try 8-bit interface one more time
lcd_command(0x28); // Set 4-bit interface, two lines
lcd_command(0x08); // Turn off the display
lcd_command(0x01); // Clear the display and reset the address to 0
delay_us(4200); // Delay for command implementation
lcd_command(0x06); // Cursor move direction from left to right
lcd_command(0x0C | (cursor << 1) | blink); // Turn on display, set the cursor and blinking parameters
}
confirmado lcd_write()
, lcd_data()
, lcd_set_cursor()
Todo el código dentro del cuerpo de estas funciones parece no tener nada que ver con los periféricos MCU RL78 o las funciones de retardo. Por lo tanto, puede utilizar estas funciones tal como están sin modificaciones.
void lcd_write(char *s) // Write the string at the LCD
{
uint8_t i = 0; // Characters counter
while (s[i]) // While s[i] is not 0 (end of the string is C)
{
lcd_data(s[i]); // Send the character to LCD
i++; // Increment the characters counter
}
}
void lcd_data(uint8_t data) // Send command to LCD
{
lcd_send(data, 1); // Issue lcd_send function with RS = 1
}
void lcd_set_cursor(uint8_t x, uint8_t y) // Set cursor at the specified position
{
if (y > 2) // If we try to set the line number more than 2
y = 2; // Set the line #2
if (x > 16) // If we try to set the position number more than 16
x = 16; // Set the position #16
lcd_command(0x80 | ((y - 1) << 6) | (x - 1)); // Set the cursor position at the LCD
}
debería ser capaz de usar lcd_create_char()
ejecutará la función sin ningún cambio. C99
estándar de lenguajeSin embargo, el lenguaje estándar predeterminado del compilador es C90
. Por lo tanto, la variable de bucle for debe declararse fuera del bucle.
void lcd_create_char(uint8_t addr, uint8_t *data) // Create a custom character
{
if (addr > 7) // If the address is higher than 7
addr = 7; // Then set address as 7
lcd_command (0x40 | addr << 3); // Set the address of the CGRAM
for (uint8_t i = 0; i < 8; i ++) // Loop to send all 8 bytes
{
lcd_data (data[i]); // Send data to LCD
}
}
Aquí está la nueva definición de función para lcd_create_char()
Características de la MCU RL78:
void lcd_create_char(uint8_t addr, uint8_t *data) // Create a custom character
{
if (addr > 7) // If the address is higher than 7
addr = 7; // Then set address as 7
lcd_command (0x40 | addr << 3); // Set the address of the CGRAM
uint8_t i;
for (i = 0; i < 8; i++) // Loop to send all 8 bytes
{
lcd_data (data[i]); // Send data to LCD
}
}
Pero si desea cambiar el estándar de idioma a: C99
Haga clic derecho en el nombre del proyecto y C/C++ Project Settings
.

puedo encontrar Language standard
los siguientes ajustes C/C++ Build >> Settings >> Compiler >> Source
.

Ahora la última función. lcd_clear()
que no estaba incluido en el tutorial de Sergey, lcd_init()
función.El código en el cuerpo es en realidad solo lcd_command(0x01)
y delay_us(4200)
.
void lcd_clear(void) // Clear the display and reset the address to 0
{
lcd_command(0x01);
delay_us(4200);
}
biblioteca LCD
no queremos hacer el nuestro r_main.c
Poner todas estas funciones dentro alarga r_main.c
. Así que creo una biblioteca para poder importar la biblioteca cada vez que uso la pantalla LCD 1602 en mi proyecto. Simplemente cree el encabezado y los archivos fuente y comprímalos como lo hizo en el tutorial anterior.
En su archivo de encabezado, incluya el siguiente archivo de encabezado y declaraciones de función.
/***********************************************************************************************************************
Includes
***********************************************************************************************************************/
#include "iodefine.h"
#include "iodefine_ext.h"
#include "r_cg_macrodriver.h"
/***********************************************************************************************************************
Global functions
***********************************************************************************************************************/
void lcd_init(uint8_t cursor, uint8_t blink); // Initialize the LCD
void lcd_command(uint8_t command); // Send the command to the LCD
void lcd_send(uint8_t value, uint8_t rs); // Send any data to the LCD
void lcd_write(char *s); // Write the string at the LCD
void lcd_data(uint8_t data); // Send the character to the LCD
void lcd_set_cursor(uint8_t x, uint8_t y); // Set cursor at the specified position
void lcd_create_char(uint8_t addr, uint8_t *data); // Create a custom character
void lcd_clear(void); // Clear the screen
Luego guárdalo como 1602_LCD.h
.
Para los archivos de origen, incluya el encabezado. 1602_LCD.h
y delay.h
.Contiene delay.h
Esto se debe a que algunas de las funciones de la pantalla LCD utilizan la función de retardo. Luego copie y pegue todas las funciones de la pantalla LCD.
#include "1602_LCD.h"
#include "delay.h"
void lcd_init(uint8_t cursor, uint8_t blink) // Initialize LCD
{
PM1 = 0; // Use RL78/G14 Port 1 pins as LCD Pins. Set the entire Port 1 pins as outputs.
P1 = 0; // Set the entire Port 1 pins to LOW.
lcd_command(0x30); // Try to use 8-bit interface
delay_us(4200); // Delay for command implementation
lcd_command(0x30); // Try 8-bit interface one more time
lcd_command(0x28); // Set 4-bit interface, two lines
lcd_command(0x08); // Turn off the display
lcd_command(0x01); // Clear the display and reset the address to 0
delay_us(4200); // Delay for command implementation
lcd_command(0x06); // Cursor move direction from left to right
lcd_command(0x0C | (cursor << 1) | blink); // Turn on display, set the cursor and blinking parameters
}
void lcd_command(uint8_t command) // Send command to LCD
{
lcd_send(command, 0); // Issue lcd_send function with RS = 0
}
void lcd_send(uint8_t value, uint8_t rs) // Send any data to LCD
{
P1_bit.no4 = rs; // Set Port RS pin (data/command). P14 assigned to LCD RS pin.
P1_bit.no5 = 1; // Set E pin high to start the pulse. P15 assigned to LCD E pin.
P1 &= 0xF0; // Clear the lower nibble of P1 (set P10-P13 low)
P1 |= (value & 0xF0) >> 4; // Send the upper nibble of the "value" to LCD
delay_1us(); // Delay needed by the driver
P1_bit.no5 = 0; // Set E pin low to finish the pulse
delay_1us(); // Delay needed by the driver
P1_bit.no5 = 1; // Set E pin high to start the pulse
P1 &= 0xF0; // Clear the lower nibble of P1 (set P10-P13 low)
P1 |= value & 0x0F; // Send the lower nibble of the "value" to LCD
delay_1us(); // Delay needed by the driver
P1_bit.no5 = 0; // Set E pin low to finish the pulse
delay_us(40); // Delay more than 37 us to implement the command
}
void lcd_write(char *s) // Write the string at the LCD
{
uint8_t i = 0; // Characters counter
while (s[i]) // While s[i] is not 0 (end of the string is C)
{
lcd_data(s[i]); // Send the character to LCD
i++; // Increment the characters counter
}
}
void lcd_data(uint8_t data) // Send command to LCD
{
lcd_send(data, 1); // Issue lcd_send function with RS = 1
}
void lcd_set_cursor(uint8_t x, uint8_t y) // Set cursor at the specified position
{
if (y > 2) // If we try to set the line number more than 2
y = 2; // Set the line #2
if (x > 16) // If we try to set the position number more than 16
x = 16; // Set the position #16
lcd_command(0x80 | ((y - 1) << 6) | (x - 1)); // Set the cursor position at the LCD
}
void lcd_create_char(uint8_t addr, uint8_t *data) // Create a custom character
{
if (addr > 7) // If the address is higher than 7
addr = 7; // Then set address as 7
lcd_command (0x40 | addr << 3); // Set the address of the CGRAM
uint8_t i;
for (i = 0; i < 8; i++) // Loop to send all 8 bytes
{
lcd_data (data[i]); // Send data to LCD
}
}
void lcd_clear(void) // Clear the display and reset the address to 0
{
lcd_command(0x01);
delay_us(4200);
}
Guarde el archivo de origen como 1602_LCD.c y comprima el encabezado y los archivos de origen. Puede descargar la biblioteca LCD desde:
archivo de proyecto
Ahora es el momento de probar. Vamos a crear un proyecto e importar la biblioteca.
Código de muestra de RL78/G14 FPB y 1602 LCD
Espero que la creación de un nuevo proyecto ya no sea un problema para usted, ya que ya está trabajando en el octavo tutorial. Pero si olvidó cómo hacerlo, consulte el tutorial donde creé mi primer proyecto Renesas RL78 – 3. Primer proyecto >> Creación de un proyecto en e2 Studio. Además, no olvide desactivar el temporizador de vigilancia y activar el reloj fSUB (consulte este tutorial sobre cómo activar fSUB). Deshabilitar Power Target From The Emulator (MAX 200mA)
.
Ahora tienes un proyecto vacío. Lo siguiente que debe hacer es incluir la biblioteca de retardo y LCD. Inserta estas líneas (#include "delay.h"
, #include "1602_LCD.h"
) incluyen e importan las bibliotecas de retardo y LCD entre los comentarios generados por el generador de código. Si olvidó cómo importar la biblioteca, consulte el tutorial anterior.




La importación de la biblioteca ahora está completa. Aquí está el código de ejemplo:
/***********************************************************************************************************************
* DISCLAIMER
* This software is supplied by Renesas Electronics Corporation and is only intended for use with Renesas products.
* No other uses are authorized. This software is owned by Renesas Electronics Corporation and is protected under all
* applicable laws, including copyright laws.
* THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING THIS SOFTWARE, WHETHER EXPRESS, IMPLIED
* OR STATUTORY, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED.TO THE MAXIMUM EXTENT PERMITTED NOT PROHIBITED BY
* LAW, NEITHER RENESAS ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES SHALL BE LIABLE FOR ANY DIRECT,
* INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY REASON RELATED TO THIS SOFTWARE, EVEN IF RENESAS OR
* ITS AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
* Renesas reserves the right, without notice, to make changes to this software and to discontinue the availability
* of this software. By using this software, you agree to the additional terms and conditions found by accessing the
* following link:
* http://www.renesas.com/disclai...
*
* Copyright (C) 2011, 2021 Renesas Electronics Corporation. All rights reserved.
***********************************************************************************************************************/
/***********************************************************************************************************************
* File Name : r_main.c
* Version : CodeGenerator for RL78/G14 V2.05.06.02 [08 Nov 2021]
* Device(s) : R5F104ML
* Tool-Chain : GCCRL78
* Description : This file implements main function.
* Creation Date: 06/12/2022
***********************************************************************************************************************/
/***********************************************************************************************************************
Includes
***********************************************************************************************************************/
#include "r_cg_macrodriver.h"
#include "r_cg_cgc.h"
/* Start user code for include. Do not edit comment generated here */
#include "delay.h"
#include "1602_LCD.h"
/* End user code. Do not edit comment generated here */
#include "r_cg_userdefine.h"
/***********************************************************************************************************************
Global variables and functions
***********************************************************************************************************************/
/* Start user code for global. Do not edit comment generated here */
/* End user code. Do not edit comment generated here */
void R_MAIN_UserInit(void);
/***********************************************************************************************************************
* Function Name: main
* Description : This function implements main function.
* Arguments : None
* Return Value : None
***********************************************************************************************************************/
void main(void)
{
R_MAIN_UserInit();
/* Start user code. Do not edit comment generated here */
delay_us_TAU_Init();
lcd_init(0, 0);
PM5_bit.no2 = 0;
while (1U)
{
lcd_set_cursor(1, 1);
lcd_write("Hello Renesas");
lcd_set_cursor(1, 2);
lcd_write("from BreadMan :)");
P5_bit.no2 = 1;
delay_ms(1000);
lcd_clear();
P5_bit.no2 = 0;
delay_ms(1000);
}
/* End user code. Do not edit comment generated here */
}
/***********************************************************************************************************************
* Function Name: R_MAIN_UserInit
* Description : This function adds user code before implementing main function.
* Arguments : None
* Return Value : None
***********************************************************************************************************************/
void R_MAIN_UserInit(void)
{
/* Start user code. Do not edit comment generated here */
EI();
/* End user code. Do not edit comment generated here */
}
/* Start user code for adding. Do not edit comment generated here */
/* End user code. Do not edit comment generated here */
Line 57
, line 58
y line 60
inicializar el TAU
utilizada en delay_us()
Funciones, inicialización de LCD y configuración de pines P52
como salida respectivamente. Dentro del cuerpo de un ciclo while infinito, imprime: “Hello Renesas”
1602 LCD Línea 1 (Líneas 64-65), Pantalla “from BreadMan :)”
Línea 2 (líneas 66 a 67), establezca el pin P52
HIGH
(línea 68), después de un retraso de 1 segundo, borre la pantalla y configure el PIN. P52
LOW
(líneas 69-71). Todo este proceso se repite después de un retraso de 1 segundo. line 72
.

solo copia el codigo line 57
A line 73
Pégalo dentro de la función principal, entre los comentarios generados por el generador de código. A continuación, cree el proyecto y cargue el código en el FPB RL78/G14. y la salida es:



¡Así que eso es todo por ahora! Espero que disfrutes este tutorial. Nuevamente, si desea obtener más información sobre el funcionamiento de la pantalla LCD y sus capacidades, consulte el tutorial de Sergey: Programación en C integrada con PIC18F14K50 – 18. Uso de una pantalla LCD de 1602 caracteres con el controlador HD44780. Si aún tiene alguna pregunta, no dude en dejarla en la sección de comentarios a continuación o envíenos un mensaje. ¡Nos vemos en el tutorial! ¡Adelante Feliz Año Nuevo! 🙂