I've never used PIC Basic, so I could be wrong. But just taking a look at the code, I'm seeing things missing that I would think would need to be present in any language for the pic. There is no where that you tell it to set up any Port B pins as output. All pins are defaulted to input until explicitly told to be output. Secondly, when you issue the command HIGH 0 and LOW 0, are those supposed to have pin numbers specified? Like should it be HIGH RB0, LOW RB0? just saying HIGH 0 and LOW 0 seems ambiguous, as Port A and Port B both have pin 0's. It goesn't look like you are specifying anything at all for ports.