Frequently Asked Questions

Why isn't PortB, pin 3, working?

I write to the port by using :

#byte portb 0x06
	
portb=0xff

All pins on portB for high, except for pin3. What's wrong here?


Topic posted by Peter Smith on the user forums, April 28, 2000.

I'm guessing here that you're using an 16F87X. I had no end of problems with this device until I read the manual. I then found that B3 is linked with the low voltage programming feature, and if you have LVP enabled, you can't use B3 (and a few others).

You'll find that if you use something like

#fuses xt,nowdt,noprotect,put,nowrt,nolvp

everything will start working. The nolvp bit at the end is the most important.


C-Aware IDE Demo
Embedded C Learners Kit
C Workshop Compiler