![]() ![]() The specifications of LCD 16X2 are discussed below. There are different types of displays available in the market with different combinations such as 8×2, 8×1, 16×1, and 10×2, however, the LCD 16×2 is broadly used in devices, DIY circuits, electronic projects due to less cost, programmable friendly & simple to access. Use project enums instead of #define for ON and OFF.16 X2 displays mostly depend on multi-segment LEDs. #pragma config statements should precede project file includes. #pragma config CP = OFF // Flash Program Memory Code Protection bit (Code protection off) #pragma config WRT = OFF // Flash Program Memory Write Enable bits (Write protection off all program memory may be written to by EECON control) #pragma config CPD = OFF // Data EEPROM Memory Code Protection bit (Data EEPROM code protection off) #pragma config LVP = OFF // Low-Voltage (Single-Supply) In-Circuit Serial Programming Enable bit (RB3 is digital I/O, HV on MCLR must be used for programming) #pragma config BOREN = ON // Brown-out Reset Enable bit (BOR enabled) #pragma config PWRTE = ON // Power-up Timer Enable bit (PWRT enabled) #pragma config WDTE = OFF // Watchdog Timer Enable bit (WDT disabled) #pragma config FOSC = HS // Oscillator Selection bits (HS oscillator) I looked some sample code on google and the code is working for me after some modification LCD_Busy() /* Wait for display controller to process command. LCD_Command(.) /* Configure display controller as wanted. * From this point, display controller is in 4 bit mode,Īnd all commands and data must be transferred as 2 nibbles together. LCD_Nibble(0x2) /* Set display controller into 4 bit mode. LCD_Nibble(0x3) /* Make sure display controller get into 8 bit mode. ![]() ![]() Better is to create and use a separate function to be used only during Reset / Initialize operations: _delay_ms(15) Function LCD_Command(0x33) May be used for this, only if it send a single transfer to the display controller, with no dependency on busy checking, and no attempt to send 2 nibbles together. Data lines D3, D2, D1 and D0 do Not matter, and may be unconnected. To achieve this, there will be needed a function to send a single nibble to the 4 data lines, D7, D6, D5 and D4. This is what is detailed in the Figure 24 attached with message #1. Hi, To make sure that Hitachi HD44780 display controller can be initialized in 4 bit mode, it must be forced into 8 bit mode first. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |