What could be causing the unusual issue with PIC16f628a?

  • Thread starter Thread starter mishobg12
  • Start date Start date
Click For Summary
The issue with the PIC16F628A arose when connecting RB4 to +5V, causing all ports to hang at 0 regardless of their configuration. The user tested a simple program to rule out logical errors, but the problem persisted. It was determined that RB4's functionality is limited when low voltage programming (LVP) is enabled, requiring a configuration change. By adding _LVP_OFF to the configuration line, the issue was resolved. The discussion highlights the importance of thoroughly configuring all settings in PIC applications to avoid unexpected problems.
mishobg12
Messages
25
Reaction score
0
Hi,
So I have this strange issue with 16f628a. If I connect RB4 it to +5V, everything hangs, all ports go to 0. It does that no matter whether it is set to input or output.

My program is very complex, so to make sure that it is not because of a logical mistake, I tried with this simple program instead - http://pastebin.com/mDNvixWv . The problem stays.

Is there some sort of trick for this port/controller that I don't know of or am I mistaking somewhere?
 
Engineering news on Phys.org
I don't have time at the moment to look at a data sheet to see everything that this port is capable of doing. My first hunch would be that you need to change something in the configuration bits. This port is probably not set up to do what you think it is.
 
Are you familiar with the configuration bits on PICs? It isn't part of the executable program. They are registers that are set upon programming and cannot be changed during execution.
 
I am familiar with them. But until then I did not know that RB4 can be used only if LVP is disabled trough a configuration bit as you suggested.
So adding _LVP_OFF to my _CONFIGURE line fixed this for me.

Thank you very much again and all the best.
 
You are quite welcome. When I first got started with PICs I decided it is a good idea to configure EVERYTHING even if I didn't think it needed to be in my specific application. Something always come up later so I decided it was just a good idea to list everything in the configure line right away. Maybe it's my obsessive-compulsive nature, but I hate 'loose ends'.
 
I am trying to understand how transferring electric from the powerplant to my house is more effective using high voltage. The suggested explanation that the current is equal to the power supply divided by the voltage, and hence higher voltage leads to lower current and as a result to a lower power loss on the conductives is very confusing me. I know that the current is determined by the voltage and the resistance, and not by a power capability - which defines a limit to the allowable...

Similar threads

Replies
12
Views
3K
Replies
3
Views
2K
  • · Replies 4 ·
Replies
4
Views
7K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 19 ·
Replies
19
Views
7K
  • · Replies 10 ·
Replies
10
Views
3K
  • · Replies 10 ·
Replies
10
Views
4K
  • · Replies 4 ·
Replies
4
Views
32K
Replies
29
Views
5K
Replies
8
Views
3K