I can't help with the PICStart+ programming for an 18F2331, but I do see a few potential problems.
#byte port_b=0x81 should be #byte port_b=0xF81.
Also you should have HS VS XT as your #fuses option for a 20MHz crystal. XT provides a lower drive
level, which may not be providing enough drive signal for your 20MHz crystal.
For help with CCS C code, config options, etc.. check here http://www.ccsinfo.com/forum/
Bookmarks