View Single Post
Old 28-10-2012, 09:34 AM   #89
ntquang_1992
Nhập môn đệ tử
 
Tham gia ngày: Mar 2012
Bài gửi: 2
:
lỗi hiển thị lcd+dsPic

Cho em hỏi đoạn code dsPic4011 xuất ra lcd không biết bị gì mà lcd hiển thị sai, khi e xuất chữ "QUANG" thì nó bị giật giật và không đủ chữ nó chỉ có "QANG" nhiều lúc nó còn dịch trái nữa, có khi nào bị lỗi phần cứng không ạ, e viết bằng mikroC
sbit LCD_RS at LATB0_bit;
sbit LCD_EN at LATB2_bit;
sbit LCD_D4 at LATB4_bit;
sbit LCD_D5 at LATB5_bit;
sbit LCD_D6 at LATB6_bit;
sbit LCD_D7 at LATB7_bit;

sbit LCD_RS_Direction at TRISB0_bit;
sbit LCD_EN_Direction at TRISB2_bit;
sbit LCD_D4_Direction at TRISB4_bit;
sbit LCD_D5_Direction at TRISB5_bit;
sbit LCD_D6_Direction at TRISB6_bit;
sbit LCD_D7_Direction at TRISB7_bit;
char txt1[] = "Quang";
void main() {
ADPCFG = 0xFFFF; // Configure AN pins as digital I/O
TRISB.F1=0;
LATB1_bit=0;
Lcd_Init(); // Initialize LCD
Lcd_Cmd(_LCD_CLEAR); // Clear display
Lcd_Cmd(_LCD_CURSOR_OFF); // Cursor off
while(1)
{
Lcd_Out(2,3,txt1); // Write text in second row
Delay_ms(2000);
}

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