User manual

Table Of Contents
118
mikoC PRO for PIC32
MikroElektronika
mikroICD Debugger Example
Here is a step-by-step mikroICD Debugger Example.
First you have to write a program. We will show how the mikroICD works using this example:
// Lcd module connections
sbit LCD_RS at LATD0_bit;
sbit LCD_EN at LATD1_bit;
sbit LCD_D4 at LATB0_bit;
sbit LCD_D5 at LATB1_bit;
sbit LCD_D6 at LATB2_bit;
sbit LCD_D7 at LATB3_bit;
sbit LCD_RS_Direction at TRISD0_bit;
sbit LCD_EN_Direction at TRISD1_bit;
sbit LCD_D4_Direction at TRISB0_bit;
sbit LCD_D5_Direction at TRISB1_bit;
sbit LCD_D6_Direction at TRISB2_bit;
sbit LCD_D7_Direction at TRISB3_bit;
// End Lcd module connections
char text[] = “mikroElektronika”;
char i;
void Move_Delay() {
Delay_ms(500);
}
void main() {
ADPCFG = 0xFFFF;
Lcd_Init();
Lcd_Cmd(_LCD_CLEAR);
Lcd_Cmd(_LCD_CURSOR_OFF);
for(i = 1; i < 17; i++) {
Lcd_Chr(1, i, text[i-1]);
}
}