Hi,
Have you disconnected the hardware from the PIC and verified with a scope or whatever that what you think is a software bug really is a software bug and not a problem with your hardware.
If PortB.2 doesn't go high then try something simple, connect a LED to it and do something like:
Code:
TRISB.2 = 0 'PortB.2 as output
Main:
PortB.2 = 1
Pause 100
PortB.2 = 0
Pause 100
Goto Main
Now, does it toggle? If not, double check the ADC and comparator settings in case you have some other functions multiplexed on PortB.2 (I haven't checked). If it still doesn't work, try another pin, perhaps you've fried PortB.2....
Then, when you have that going, move on to the PWM part and get that going - THEN when you know that the software is doing what you think you want (which usually isn't what you really need....), go on and connect the bridge.
/Henrik.
Bookmarks