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'.
 
Very basic question. Consider a 3-terminal device with terminals say A,B,C. Kirchhoff Current Law (KCL) and Kirchhoff Voltage Law (KVL) establish two relationships between the 3 currents entering the terminals and the 3 terminal's voltage pairs respectively. So we have 2 equations in 6 unknowns. To proceed further we need two more (independent) equations in order to solve the circuit the 3-terminal device is connected to (basically one treats such a device as an unbalanced two-port...
suppose you have two capacitors with a 0.1 Farad value and 12 VDC rating. label these as A and B. label the terminals of each as 1 and 2. you also have a voltmeter with a 40 volt linear range for DC. you also have a 9 volt DC power supply fed by mains. you charge each capacitor to 9 volts with terminal 1 being - (negative) and terminal 2 being + (positive). you connect the voltmeter to terminal A2 and to terminal B1. does it read any voltage? can - of one capacitor discharge + of the...
Thread 'Weird near-field phenomenon I get in my EM simulation'
I recently made a basic simulation of wire antennas and I am not sure if the near field in my simulation is modeled correctly. One of the things that worry me is the fact that sometimes I see in my simulation "movements" in the near field that seems to be faster than the speed of wave propagation I defined (the speed of light in the simulation). Specifically I see "nodes" of low amplitude in the E field that are quickly "emitted" from the antenna and then slow down as they approach the far...
Back
Top