Mikroelektronika MIKROE-724 データシート

ページ / 726
mikroBasic PRO for dsPIC30/33 and PIC24
MikroElektronika
119
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:
program Lcd_Test
‘ LCD module connections
dim LCD_RS as sbit at LATD0_bit
dim LCD_EN as sbit at LATD1_bit
dim LCD_D4 as sbit at LATB0_bit
dim LCD_D5 as sbit at LATB1_bit
dim LCD_D6 as sbit at LATB2_bit
dim LCD_D7 as sbit at LATB3_bit
dim LCD_RS_Direction as sbit at TRISD0_bit
dim LCD_EN_Direction as sbit at TRISD1_bit
dim LCD_D4_Direction as sbit at TRISB0_bit
dim LCD_D5_Direction as sbit at TRISB1_bit
dim LCD_D6_Direction as sbit at TRISB2_bit
dim LCD_D7_Direction as sbit at TRISB3_bit
‘ End LCD module connections
dim text as char[16]
       i as byte
main:
  ADPCFG = 0xFFFF
  text = “mikroElektronika”
  Lcd_Init()
  Lcd_Cmd(_LCD_CLEAR)
  Lcd_Cmd(_LCD_CURSOR_OFF)
  for i = 0 to 17
    Lcd_Chr(1, i, text[i-1])
  next i
end.