I'm not sure why this happened,I. using PIC16F1828 DIP version MCU,without the LCD code,the MCU works fine,after adding the LCD code in,which I copy from my other project using PIC16F877A,the MCU keep reset itset,after few reset there are nothing happed to the MCU,the oscillation is still running,below are the code

#CONFIG
__config _CONFIG1, _FOSC_HS
#ENDCONFIG
Define LOADER_USED 1
Define OSC 20
TRISC.0 = 0
i var word
for i = 1 to 10
PORTC.0 = 1
pause 500
PORTC.0 = 0
pause 200
next i

DEFINE LCD_DREG PORTB ' Set LCD Data Port
DEFINE LCD_DBIT 4 ' Set Starting Data Bit(0 or 4) if 4-bit bus
define LCD_RSREG PORTC ' Set LCD Register Select Port
define LCD_RSBIT 6 ' Set LCD Register Bus
define LCD_EREG PORTC
define LCD_EBIT 3 ' Set LCD Enable Port
define LCD_Bits 4 ' Set LCD Bus size(4 or 8 Bits)
define LCD_LINES 2 ' Set Number of lines on LCD
define LCD_COMMANDUS 1500 ' Set Command delat time in us
define LCD_DATAUS 44 ' Set data delay time in us
wind_speed var word
wind_speed = 2345
pause 500
mainloop:
PORTC.0 = 1
lcdout $fe,1,dec(wind_speed)
pause 2000
PORTC.0 = 0
lcdout $fe,1,"Wait "
pause 1000
goto mainloop
end






the first for..next loop is to test weather the MCU is running or not,is the LCD code is disable,it can run to the low part of the code,but once the LCD code is enable,it will reset itself a few times than stop operating,but the oscillator is still running normally