View Single Post
Old 05-04-2012, 05:06 PM   #1
doremon217
Nhập môn đệ tử
 
Tham gia ngày: Mar 2012
Bài gửi: 9
:
Giúp mình hiển thị LCD

Mình muốn test thử hiện thị 1 vài kí tự lên LCD dùng pic16f877a. Code mình biên dịch bằng Picc Compiler và mô phỏng trên Proteus đều chạy bình thường. Song khi mình nạp và test trên bo mạch thì không thấy hiện kí tự nào. LCD vẫn sáng. Các bạn có thể chỉ cho mình xem sai ở chỗ nào không. Xin cảm ơn.
Đây là code mình viết:

#include "C:\Program Files\PICC\Projects\LCD hien thi.h"
#define LCD_ENABLE_PIN PIN_D0
#define LCD_RS_PIN PIN_D1
#define LCD_RW_PIN PIN_D2
#define LCD_DATA4 PIN_D4
#define LCD_DATA5 PIN_D5
#define LCD_DATA6 PIN_D6
#define LCD_DATA7 PIN_D7
#define LCD_TYPE 2
#include <lcd.c>


void main()
{
lcd_init();
setup_adc_ports(NO_ANALOGS);
setup_adc(ADC_OFF);
setup_psp(PSP_DISABLED);
setup_spi(SPI_SS_DISABLED);
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
setup_timer_1(T1_DISABLED);
setup_timer_2(T2_DISABLED,0,1);
setup_comparator(NC_NC_NC_NC);
setup_vref(FALSE);

// TODO: USER CODE!!

lcd_gotoxy(1,1);
lcd_putc("dadada");
delay_ms(100);
lcd_putc("\f");
lcd_gotoxy(5,2);
lcd_putc("okfafakdfa");
delay_ms(100);
lcd_putc("\f");

}
doremon217 vẫn chưa có mặt trong diễn đàn   Trả Lời Với Trích Dẫn