The example shows the connection of an alpha-numeric LCD module 2x16 characters to a dsPIC30F microcontroller by using an 8-bit interface. The following code demonstrates usage of the LCD 8-bit Library routines. The example covers the initialization of the LCD module and instructions for contolling and writing the module. The realization is carried out by using the mikroC compiler for dsPIC30F microcontrollers. The interconnection of the LCD module and a dsPIC30F device by using an 8-bit interface is shown in Fig. 13-2.
Fig. 13-2 Interconnection of the LCD module and a dsPIC30F device by using a 8-bit interface
void main(){ //--- PORTB - all digital ADPCFG = 0xFFFF; Lcd8_Custom_Config(&PORTB, 7, 6, 5, 4, 3, 2, 1, 0, &PORTD, 0, 1, 2); Lcd8_Custom_Cmd(LCD_CLEAR); Lcd8_Custom_Cmd(LCD_CURSOR_OFF); Lcd8_Custom_Out(1, 1, "mikroElektronika"); Lcd8_Custom_Chr(2, 1,'c'); Lcd8_Custom_Chr_CP('?'); Lcd8_Custom_Out_CP("for_dsPIC"); }//~!