The first thing that appears to me to be missing is the config settings for the device
@ __CONFIG _INTRC_OSC_NOCLKOUT & _WDT_ON & _PWRTE_ON & _MCLRE_OFF & _BODEN_ON
I would also suggest that you use external pullup resistors of around 10K rather than rely on the internal WPU
Bookmarks