The example shows the connection of an alpha-numeric LCD module 2x16 characters to a dsPIC30F microcontroller by using a 4-bit interface. The following code demonstrates usage of the LCD Custom 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 a 4-bit interface is shown in Fig. 13-1.
char text[6] = "mikro"; void main() { //--- PORTB - all digital ADPCFG = 0xFFFF; Lcd_Custom_Config(&PORTB, 3,2,1,0, &PORTD, 0,2,1); Lcd_Custom_Out(1,3, text); Lcd_Custom_Out(2,6, text); Lcd_Custom_Chr(2,7, 'a'); Lcd_Custom_Out(1,10, text); Lcd_Custom_Chr(1,11, 'o'); }//~!