MikroElektronika PIC Microcontrollers PIC16 Ficha de datos Pagina 176

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 194
  • Tabla de contenidos
  • SOLUCIÓN DE PROBLEMAS
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 175
Programming PIC Microcontrollers in BASIC - mikroElektronika
LCD connects to microcontroller via 4-bit or 8-bit bus (4 or 8 lines). R/W signal is on the ground, because
communication is one-way (toward LCD). Some displays have built-in backlight that can be turned on with RD1 pin via
PNP transistor BC557.
Our following example prints text on LCD via 4-bit interface. Assumed pin configuration is default.
program LCD_default_test
dim Text as char[20]
main:
TRISB = 0 ' PORTB is output
LCD_Init(PORTB) ' Initialize LCD at PORTB
LCD_Cmd(LCD_CURSOR_OFF) ' Turn off cursor
Text = "mikroelektronika"
LCD_Out(1, 1, Text) ' Print text at LCD
end.
Our second example prints text on LCD via 8-bit interface, with custom pin configuration.
program LCD8_test
http://www.mikroelektronika.co.yu/english/product/books/picbasicbook/07.htm (10 sur 16)05/11/2004 02:27:46
Vista de pagina 175
1 2 ... 171 172 173 174 175 176 177 178 179 180 181 ... 193 194

Comentarios a estos manuales

Sin comentarios