What could be causing the unusual issue with PIC16f628a?

  • Thread starter Thread starter mishobg12
  • Start date Start date
AI Thread 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'.
 
While I was rolling out a shielded cable, a though came to my mind - what happens to the current flow in the cable if there came a short between the wire and the shield in both ends of the cable? For simplicity, lets assume a 1-wire copper wire wrapped in an aluminum shield. The wire and the shield has the same cross section area. There are insulating material between them, and in both ends there is a short between them. My first thought, the total resistance of the cable would be reduced...
Hi all I have some confusion about piezoelectrical sensors combination. If i have three acoustic piezoelectrical sensors (with same receive sensitivity in dB ref V/1uPa) placed at specific distance, these sensors receive acoustic signal from a sound source placed at far field distance (Plane Wave) and from broadside. I receive output of these sensors through individual preamplifiers, add them through hardware like summer circuit adder or in software after digitization and in this way got an...
I am not an electrical engineering student, but a lowly apprentice electrician. I learn both on the job and also take classes for my apprenticeship. I recently wired my first transformer and I understand that the neutral and ground are bonded together in the transformer or in the service. What I don't understand is, if the neutral is a current carrying conductor, which is then bonded to the ground conductor, why does current only flow back to its source and not on the ground path...
Back
Top