mikroC

mikroC - C Compiler for Microchip PIC microcontrollers

making it simple...

Library Example (default pin settings)

char *text = "mikroElektronika";

 

void main() {

 

TRISB = 0;

// PORTB is output

TRISC = 0;

// PORTC is output

Lcd8_Init(&PORTB, &PORTC);

// Initialize LCD at PORTB and PORTC

Lcd8_Cmd(Lcd_CURSOR_OFF);

// Turn off cursor

Lcd8_Out(1, 1, text);

// Print text on LCD

}

 

Hardware Connection

PIC MCU

any port (with 8 pins)

Control Port

PIN0

PIN2 PIN3

E

R/W

RS

LCD contrast

Data Port

PIN0 PIN1 PIN2 PIN3 PIN4 PIN5 PIN6 PIN7

+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

 

206

MikroElektronika: Development tools - Books - Compilers