include "hwreg-p16f628.h" // 16f628 config // enable internal oscillator FOSC2,FOSC1,FOSC0 = 100 // disable watchdog WDT = 0 // enable power up timer PWRTE = 0 // use MCLR as RA5 MCLRE = 0 // disable brown-out detect BODEN = 0 // low voltage prog disabled LVP = 0 // data memory not protected CPD = 1 // code memory not protected CP1,CP0,CP1,CP0 = 1111 // // see section 14.1 of PIC16F26X ref manual // microchip document name 40300b.pdf pragma cpu_config 0x3F10 include "hd44780.bas" //---------------------------------------------------------------------- //---------------------------------------------------------------------- proc main() byte x, y, ch int j // set PORTA to digital I/O instead of analog CMCON = 7 hd44780_init() x = 0 y = 0 ch = 0 while 1 do x += 1 if x > 15 then x = 0 y += 1 if y > 1 then y = 0 endif endif hd44780_set_pos(x, y) hd44780_putchar(ch) ch += 1 for j=0 while j<100 step j+=1 do delay_m4clk 250 done done endproc //---------------------------------------------------------------------- //---------------------------------------------------------------------- proc intserv() endproc