mình dùng CCS viet cho PIC 18f4550: hiển thị dòng chữ lên LCD
chân E2: LCD_E
D4: LCD_rs
D5: LCD_WR
4bit data của LCD: D0, D1,D2,D3
CODE mình viết như sau:
#include <18F4550.h>
#define LCD_DB4 PIN_D0
#define LCD_DB5 PIN_D1
#define LCD_DB6 PIN_D2
#define LCD_DB7 PIN_D3
#define LCD_E PIN_E2
#define LCD_RS PIN_D4
#define LCD_RW PIN_D5
#include <LCD.c>
#use delay(clock=20000000)
void main()
{
output_low(LCD_RW); // Set R/W pin on LCD to a low level
lcd_init(); // Initialize the LCD
lcd_putc("\fHello World\n");
lcd_putc("Line Number 2");
while(1);
}
Sao mà ko chạy nữa. các bạn giúp mình với nghe
Cảm ơn nhiều
|