Documentos de Académico
Documentos de Profesional
Documentos de Cultura
El PRO mikroC para PIC proporciona una biblioteca para la comunicacin con los LCD
(controladores compatibles con HD44780) a travs de la interfaz de 4 bits. Un ejemplo
de conexiones Lcd se da en el esquema de la parte inferior de esta pgina.
Para la creacin de un conjunto de caracteres personalizados Lcd utilizar caracteres Lcd
personalizada de herramientas.
Descripc
in:
Ejemplo:
extern sbit
sfr LCD_RS:
Registrar
Seleccion
ar lnea.
extern sbit
sfr LCD_EN:
Habilitar
lnea.
extern sbit
sfr LCD_D7;
Datos 7
lnea.
extern sbit
sfr LCD_D6;
Datos 6
lnea.
extern sbit
sfr LCD_D5;
Datos de
5 lneas.
extern sbit
sfr LCD_D4;
Datos de
4 lneas.
extern sbit
sfr LCD_RS_Dire
ction;
Registrar
Select
pin
direccin.
sbit LCD_RS_Direction en T
RISB4_bit;
extern sbit
sfr LCD_EN_Dire
ction;
Habilitar
direccin
pin.
sbit LCD_EN_Direction en T
RISB5_bit;
extern sbit
sfr LCD_D7_Dire
ction;
Datos 7
pin
direccin.
sbit LCD_D7_Direction en T
RISB3_bit;
extern sbit
sfr LCD_D6_Dire
ction;
Datos de
6 pines
direccin.
sbit LCD_D6_Direction en T
RISB2_bit;
extern sbit
sfr LCD_D5_Dire
Datos 5
pines
sbit LCD_D5_Direction en T
RISB1_bit;
ction;
direccin.
extern sbit
sfr LCD_D4_Dire
ction;
Datos de
4 pines
direccin.
sbit LCD_D4_Direction en T
RISB0_bit;
Rutinas Biblioteca
Lcd_Init
Lcd_Out
Lcd_Out_Cp
Lcd_Chr
Lcd_Chr_Cp
Lcd_Cmd
Lcd_Init
Prototipo
Devolucione
s
Nada.
Descripcin
Requiere
Ejemplo
Lcd_Out
Prototipo
Devolucione
s
Nada.
Descripcin
Requiere
Ejemplo
Lcd_Out_Cp
Prototipo
Devolucione
s
Nada.
Descripcin
Requiere
Ejemplo
Lcd_Out_Cp ("Aqu!");
Lcd_Chr
Prototipo
void Lcd_Chr
( carbn fila, carbn columna, carbn out_char);
Devolucione
s
Nada.
Descripcin
Requiere
Ejemplo
Lcd_Chr_Cp
Prototipo
Devolucione
s
Nada.
Descripcin
Requiere
Ejemplo
Lcd_Cmd
Prototipo
Devolucione
s
Nada.
Descripcin
Ejemplo
Propsito
_LCD_FIRST_ROW
_LCD_SECOND_ROW
_LCD_THIRD_ROW
_LCD_FOURTH_ROW
_LCD_CLEAR
Borrar pantalla
_LCD_RETURN_HOME
_LCD_CURSOR_OFF
Apague cursor
_LCD_UNDERLINE_ON
Subrayar cursor en
_LCD_BLINK_CURSOR_ON
_LCD_MOVE_CURSOR_LEFT
_LCD_MOVE_CURSOR_RIGH
T
_LCD_TURN_ON
_LCD_TURN_OFF
_LCD_SHIFT_LEFT
_LCD_SHIFT_RIGHT
Ejemplo Biblioteca
El cdigo siguiente muestra el uso de las rutinas Lcd Biblioteca:
Cdigo Copiar al portapapeles
sbit LCD_EN_Direction at
sbit LCD_D4_Direction at
sbit LCD_D5_Direction at
sbit LCD_D6_Direction at
sbit LCD_D7_Direction at
// Conexiones del mdulo
TRISB5_bit;
TRISB0_bit;
TRISB1_bit;
TRISB2_bit;
TRISB3_bit;
LCD End
// variable de bucle
// Funcin utilizada para el
// Puede cambiar la velocidad de
alfileres // Configurar un AS / S
// Deshabilitar los comparadores
Lcd_Init ();
// Inicializar LCD
Lcd_Cmd (_LCD_CLEAR);
Lcd_Cmd (_LCD_CURSOR_OFF);
Lcd_Out (1,6, txt3);
// Borrar pantalla
// Cursor fuera
// Escribir texto en primera fila
Delay_ms (2000);
// Texto en movimiento
para (i = 0; i <4; i ++) {
veces
Lcd_Cmd (_LCD_SHIFT_RIGHT);
Move_Delay ();
}
mientras que (1) {
de (i = 0; i <8; i ++) {
veces
Lcd_Cmd (_LCD_SHIFT_LEFT);
Move_Delay ();
}
para (i = 0; i <8; i ++) {
veces
Lcd_Cmd (_LCD_SHIFT_RIGHT);
Move_Delay ();
}
}
}