I think I have broke it
.....
Jason, glad that you're now sorted.
I don't use the MikroElectronica boards or IDE, but a more general PIC-related "gothcha" are the fuses - these are outside your actual program but they configure various features of the PIC.
One that can be a show-stopper, and give symptoms just like you had experienced, is the setting that tells the PIC which clock source - can be an external xtal, an actual external oscillator, a ceramic resonator, an external RC network or maybe an internal oscillator. Despite having a perfect program, if that fuse wrongly set, then absolutely nothing will happen as there'll be no ticks ...
Another fuse gotcha is if you inadvertently enable the watchdog timer ("WDT"). The WDT is a safety feature designed to catch programs that get stuck in an un-expected loop - you have to tickle it periodically to let it know you're still alive (the WDT acts just like the dead-man's handle in a loco cab). If you find your program starts OK and then keeps re-starting its always worth checking if you have an un-expected WDT active.
Last fuse to pay attention to (as it can cost £$) are the code protection fuse(s). DON'T set this unless you really mean to! If, like us, you manufacture and sell kit which uses embedded PICs, and the code is your intellectual property, you want to prevent un-scrupulous potential competitors cloning your kit, then when all is fully debugged, the production PICs are programemd with the CP fuse set - this stops anyone reading them and can also have the side-effect of preventing you from re-programming them yourself.
Dave