mikroC

making it simple...

mikroC - C Compiler for Microchip PIC microcontrollers

Library Example (custom pin settings)

char

*text = "mikroElektronika";

 

 

 

 

void

main() {

 

 

 

 

TRISB

=

0;

//

PORTB

is

output

TRISD

=

0;

//

PORTD

is

output

//Initialize LCD at PORTB and PORTD with custom pin settings Lcd8_Config(&PORTB,&PORTD,3,2,0,0,1,2,3,4,5,6,7);

Lcd8_Cmd(Lcd_CURSOR_OFF);

//

Turn off cursor

Lcd8_Out(1, 1, text);

//

Print text at 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

 

MikroElektronika: Development tools - Books - Compilers

207