Several things:
1) First your crystal is connected incorrectly based on the text file. On a 16F628 the crystal needs to be tied to pins 15 and 16. (see datasheet for details)
2) Depending on your baud rate you may want to move the speed of your crystal up. At 9600 baud I usually use 16 mhz crystal.
3) Here is an example of a typical Device programming Options :
@ DEVICE pic16F628, HS_OSC ' System clock Options
@ DEVICE pic16F628, WDT_ON ' Watch Dog Timer
@ DEVICE pic16F628, PWRT_ON ' Power-on timer
@ DEVICE pic16F628, BOD_ON ' Brown-out detector
@ DEVICE pic16F628, MCLR_OFF ' Master Clear Options
@ DEVICE pic16F628, LVP_OFF ' Low-voltage programming
@ DEVICE pic16F628, CPD_OFF ' Data Memory Code Protect
@ DEVICE pic16F628, PROTECT_OFF ' Program Code Protections
NOTE: If you noticed above I have clock option set to HS not XT. At 16mhz this is considered High-Speed.
4) When using a crystal don't forget to define the speed:
DEFINE OSC 16 ' 16mhz XTAL
5) The word "SYMBOL" is unneeded when you are defining constants. Use the follwing instead:
line1 CON 128
6) TRISB=%11111111 ' PORTB all Inputs
TRISB=%00000000 ' PORTB all Outputs
TRISB = %00000001 ' PORTB.0 PIN input for button
These things should help get you running.




Bookmarks