PDA

View Full Version : Problem



StoneColdFuzzy
- 15th January 2009, 20:15
PIC16F628A, RB4 does nothing, no matter what. Changed programs from simple to complex many times. Tried 3 different ICs and still nothing. All other ports work OK. What else could be wrong?


main:

high portb.4
pause 500
low portb.4
pause 500
goto main

Fredrick
- 15th January 2009, 20:41
Try to add this in the beginning of your program

CMCON = 7

And read the PBP manual page 10, 2.5.1
If it still does´t work, check the config bits.

Darrel Taylor
- 15th January 2009, 20:52
It could be the LVP (Low Voltage Programming).

Try adding ...

@ DEVICE LVP_OFF
But then, that is a PBP default, so it should already be there.
<br>

elec_mech
- 15th January 2009, 23:41
StoneColdFuzzy,

Could you post all your code up to your main routine? If we could see what intializations you've done, we might be able to better help. I assume you've set your TRISD register for pin 4 as an output. That leaves comparator pins, which Fredrick addressed, and possibly analog pins - sorry, I don't have the datasheet right in front of me. I'll also make the assumption that you've doubled-checked your wiring. That cost me a mistake for the longest time this week as Darrel can atest to.

Archangel
- 16th January 2009, 00:11
PIC16F628A, RB4 does nothing, no matter what. What else could be wrong?

Could be a breadboard problem, could be you have mistaken which pin is RB4 (I have done that), could be an inverted polarity LED you are using or a bad one or open resistor or other wiring error. Without seeing the breadboard and the exact code we are shooting in the dark.

StoneColdFuzzy
- 16th January 2009, 02:07
You'd think after 5 years of doing this I'd know to watch the config bits, One wrong click was all it took. It was in fact the LVP. Thanks for the replies!

That was the whole main routine that I had last tried. I cut everything else out to work on the problem.

Damn, I feel silly.

~ Dave

Archangel
- 16th January 2009, 02:28
Damn, I feel silly.

~ Dave
We have all been there Dave.