Quote Originally Posted by Fredrick View Post
The PIC is on a Velleman K8048 Programmer and Experiment board.
http://www.velleman.be/ot/en/product/view/?id=350903

Yes i have a pull up resistor..

If the code is identical why does it hangs with the first code?
Pull up resistor on MCLR?

What about PortB.0?
If you've got nothing on it, it might be floating and confusing your program somehow.

As far as the identical goes, what I meant was 'functionally identical', I didn't mean identical as in 'the same' or 'equal'.

And I don't know why.
If it works with the 2nd code, go with it.