mikroC

making it simple...

mikroC - C Compiler for Microchip PIC microcontrollers

Library Example (default pin settings)

char *text = "mikroElektronika";

 

void main() {

 

TRISB = 0;

// PORTB is output

Lcd_Init(&PORTB);

// Initialize LCD connected to PORTB

Lcd_Cmd(Lcd_CLEAR);

// Clear display

Lcd_Cmd(Lcd_CURSOR_OFF);

// Turn cursor off

Lcd_Out(1, 1, text);

// Print text to LCD, 2nd row, 1st column

}//~!

 

Hardware Connection

PIC LCD

PIN7D7

PIN6D6

PIN5D5

PIN4D4

PIN3E

PIN2RS

PIN1

PIN0

PIC MCU

any port (with 8 pins)

PIN0 PIN1 PIN2 PIN3 PIN4 PIN5 PIN6 PIN7

LCD contrast

+5V

 

1

Vss Vdd Vee RS R/W E D0 D1 D2 D3 D4 D5 D6 D7

m i k roel E kt ron i k a

 

 

page

 

MikroElektronika: Development tools - Books - Compilers

201