các anh có thể cho e biết là có thể lập trình giao tiếp với LCD 4 bit mà các chân dữ liệu từ D4-D7 ứng với LATB8-LATB11 của dspic 33fj12mc202 được không ạ.e làm mãi mà vẫn ko thể được.mong các anh chỉ giáo e với.
![20](http://dientuvietnam.net/forums/images/smilies/20.gif)
// LCD module connections sbit LCD_RS at LATB5_bit; sbit LCD_EN at LATB6_bit; sbit LCD_D4 at LATB8_bit; sbit LCD_D5 at LATB9_bit; sbit LCD_D6 at LATB10_bit; sbit LCD_D7 at LATB11_bit; sbit LCD_RS_Direction at TRISB5_bit; sbit LCD_EN_Direction at TRISB6_bit; sbit LCD_D4_Direction at TRISB8_bit; sbit LCD_D5_Direction at TRISB9_bit; sbit LCD_D6_Direction at TRISB10_bit; sbit LCD_D7_Direction at TRISB11_bit; // End LCD module connections void main(){ ADPCFG = 0xFFFF; // Configure AN pins as digital I/O Lcd_Init(); // Initialize LCD Lcd_Cmd(_LCD_CLEAR); // Clear display Lcd_Cmd(_LCD_CURSOR_OFF); // Cursor off Lcd_Out(1,1,"dSPIC33FJ12mc202"); Lcd_Out(2,1,"TEST LCD 16x2 OK"); while(1); }
Comment