CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

PIC as unwanted resistive load

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Bryan



Joined: 23 Apr 2005
Posts: 73

View user's profile Send private message Send e-mail AIM Address

PIC as unwanted resistive load
PostPosted: Tue Jun 21, 2005 9:47 pm     Reply with quote

I have created a circuit using a PIC with another separate DC circuit powered by the same 5V power supply. I am running into a problem because the PIC is acting as a resistive load in parallel with my DC circuit that is separate from the PIC. If you cannot picture this think of one voltage supply hooked to 2 different resistors, one for my separate DC circuit and the other as the PIC with both grounds common, and it is easy to see how this is happening. I verified this using my multimeter. My question is, does anyone know how to separate these 2 circuits without using two power supplies? I know it must be possible, and I cannot proceed with my project until I learn how because my particular application is resistive sensitive.
kender



Joined: 09 Aug 2004
Posts: 768
Location: Silicon Valley

View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger

PostPosted: Tue Jun 21, 2005 10:46 pm     Reply with quote

It's a little difficult to envision your problem. Does the +5V supply droop when you connect all the load? If it does, then your power supply doesn't supply enough current.

In your particular case, why is the PIC in parallel with the other load bad? Is it a power consumption issue? Is it a noise issue?

Nick
Ttelmah
Guest







PostPosted: Wed Jun 22, 2005 3:21 am     Reply with quote

I suspect the other circuit, has a varying resistance, that he wants to use as a 'measure'. Hence the parallel consumption of the PIC, represents an error 'term'.
If this is the case, then there is nothing whatsover that can be done to get rid of the 'problem'. The PIC draws power, and without a seperate supply, has to source it from the rail.
However there may be ways of making the term 'acceptable'. The current drawn by a PIC varies with frequency, so lowering the speed of the PIC, might reduce the error to an acceptable level.
The other thought, is to make the consumption of the PIC circuit constant. You can run most PICs happily off less than 5v. If a resistor is added from the supply to the PIC circuit, and then an op-amp is added to measure the voltage drop across this resistor, and adjust the base drive on a common-emitter transistor, to keep this drop constant, then the current drawn by the PIC, and this transistor, would remain a constant value, allowing any change caused by the other circuit, to still be detected and measured. Effectively you turn the seperate cicuit into a constant current system.

Best Wishes
sseidman



Joined: 14 Mar 2005
Posts: 159

View user's profile Send private message

Re: PIC as unwanted resistive load
PostPosted: Wed Jun 22, 2005 6:44 am     Reply with quote

Bryan wrote:
I have created a circuit using a PIC with another separate DC circuit powered by the same 5V power supply. I am running into a problem because the PIC is acting as a resistive load in parallel with my DC circuit that is separate from the PIC. If you cannot picture this think of one voltage supply hooked to 2 different resistors, one for my separate DC circuit and the other as the PIC with both grounds common, and it is easy to see how this is happening. I verified this using my multimeter. My question is, does anyone know how to separate these 2 circuits without using two power supplies? I know it must be possible, and I cannot proceed with my project until I learn how because my particular application is resistive sensitive.


One voltage supply hooked to two resistors in parallel should not cause any problems, so long as the power supply can source enough current, and it shouldn't be necessary to isolate either part of your circuit. If the circuits are in series, then you have a problem.

If you are measuring some signal from the DC circuit with your PIC circuit, they often need to share a ground. While I don't think that isolation will fix your problem (based on your description), if you insist on isolating the grounds, you can use an isolated DC-to-DC converter (not all DC-to-DC converters are isolating, so be careful picking a part), and any signals that need to pass from circuit to circuit need to go through opto-isolators. Passing a digital signal through an opto-isolator is fairly straightforward, but passing analog signals can be tricky (and often expensive), and once again, part selection will be key.
Bryan



Joined: 23 Apr 2005
Posts: 73

View user's profile Send private message Send e-mail AIM Address

PostPosted: Wed Jun 22, 2005 2:07 pm     Reply with quote

Thank you for the insight guys. My problem is not one of sourcing enough current or voltage, the problem is that I need the resistance of the secondary circuit (one not involving to the PIC) to be unchanged by outside sources (aka the PIC circuit). Since both are connected to the positive rail this creates a parallel connection and the resistances I am trying to measure in the secondary circuit drop drastically (basic equivalent resistance principles). All I want is a separate voltage divider circuit that consists of 2 resistors in series so I can check the voltage drops across each of them powered from a 5V source (which I am currently sharing with the PIC which should be completely separate). If you think about this, the PIC acts as a resistor now that is in parallel with my voltage divider circuit and this throws off all my calculations for my particular application since I need those series resistances to be unchanged by another "resistor" in parallel (the PIC). I just cannot figure out how to deliver 5V to each circuit (PIC and voltage divider) without them interacting since they have a common negative rail. As long as the PIC's resistance stays constant durign operation I could determine this value and factor it in, but I would rather find a better way to resolve the issue. Does this clarify?
treitmey



Joined: 23 Jan 2004
Posts: 1094
Location: Appleton,WI USA

View user's profile Send private message Visit poster's website

PostPosted: Wed Jun 22, 2005 4:06 pm     Reply with quote

That is what Ttelmah was getting at(see above). As long as the resistor(PIC) is know, you can figure it into the voltage divider. To keep it know, (in a steady state), he is powering the PIC with a constant current source.

Right Ttelmah?
sseidman



Joined: 14 Mar 2005
Posts: 159

View user's profile Send private message

PostPosted: Wed Jun 22, 2005 4:24 pm     Reply with quote

Bryan wrote:
Does this clarify?


Not really. The PIC circuit sucks current, which seems to impact voltages in your other circuit, but sharing a ground is not the source of your troubles. Picture a voltage divider in parallel to your pic circuit. Let's say the voltage divider is 2 10K resistors. Both the PIC and the divider are wired to the same 5V source. The voltage between the resistors will be 2.5 V, regardless of whether the PIC is there or not. In fact, you can keep adding voltage dividers in parallel to the original cicuit. So long as you can source enough current, the voltage across ALL the dividers (2 10K resistors) will be 2.5 volts, even if you have 100 dividers in parallel. Also, I still don't understand what your circuit is. Is it really just a voltage divider??

If the Pic is truly in parallel with your voltage divider, it CAN'T change the output voltage of the divider. Take the 2 10K resistor divider above. The output voltage will be 2.5 volts. Now, take a 20K resistor, and place this in parallel with the divider (rail to rail). The output of the divider will still be 2.5V. Keep adding 20K resistors in parallel, and the output will remain 2.5 volts, until your voltage source can no longer supply enough current. Vcc will drop, but it will ALWAYS be the current going through the divider times 20K.

Perhaps if you explained what this cricuit is, we can be of more help.

Is the PIC measuring the voltage across the divider?? If so, then perhaps the input inpedance of the A to D isn't high enough with respect to your circuit. This would change the voltage you're reading, to be sure. It still has nothing to do with sharing a ground!! You can take the output of the divider, feed that to an op-amp follower (signal going to + input, and the - input tied directly to the op amp output). You can probably use a single suppy op amp, and I'd recommend using one with a FET input for high input impedance. Now take the output of the op amp, and connect that to the a/d. Also, if you don't like the op amp approach, you can try using smaller resistors in your divider (this isn't necessary if you go with the op amp). Try dropping them by at least an order of magnitude-- more likely two orders of magnitude. So, if you're using 200K resistors, move to 5K resistors. Maximum recommended impedance of a circuit plugged into the PIC A/D is something like 10K. Are you exceeding this? The op amp follower described will fix this up quick.

If something like this is the problem, it's not analagous to having a resistor in parallel to your divider-- it's much more like having a resistor in parallel to ONE of the resistors in your divider--- and there's a tremendous difference. The problem isn't that the divider is in parallel to the PIC-- its that you're plugging the output of the divider into the pic.
sseidman



Joined: 14 Mar 2005
Posts: 159

View user's profile Send private message

PostPosted: Wed Jun 22, 2005 4:40 pm     Reply with quote

Ttelmah wrote:
I suspect the other circuit, has a varying resistance, that he wants to use as a 'measure'. Hence the parallel consumption of the PIC, represents an error 'term'.
If this is the case, then there is nothing whatsover that can be done to get rid of the 'problem'. The PIC draws power, and without a seperate supply, has to source it from the rail.


Seems to me like the ouput impedence of his divider is simply too high, and when he plugs it in to a pin on the pic. There are definitely ways to deal with this, one being to buffer with an op amp, another is to use smaller resistors.

By the way, the OP can convince himself that this is the case by pulling any connections between his circuit and the PIC that aren't power and ground. If the problem is as I describe it, this will "fix" his problem, as he will see if he measures the voltage with a multimeter-- yet the grounds and power are still tied together.
asmallri



Joined: 12 Aug 2004
Posts: 1634
Location: Perth, Australia

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Wed Jun 22, 2005 7:33 pm     Reply with quote

Hi Bryan,

I am obviously not understanding the true topology of your circuit. An ideal +5V supply is a very low impendance source. Ideally the output impedance of the souce = 0R.

Your two ciruits, as I understand your description of them, are in parallel with this 0R impedance. Your non PIC circuit should see the power rail inputs as a 0R source impedance. From the measurement circuits perspective, the PIC appears as a xxxOhm load in parallel with the 0R output impedance of the power supply. The resulting parallel impedance is 0R (unchanged). Therefore the "load" the messurement circuit sees is also unchanged. If this is not the case then the low impedance source for your 5 volt supply is not low impedance and this is where you need have a look at what is going on.
_________________
Regards, Andrew

http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!!
Bryan



Joined: 23 Apr 2005
Posts: 73

View user's profile Send private message Send e-mail AIM Address

PostPosted: Wed Jun 22, 2005 9:52 pm     Reply with quote

I just connected the circuit up again as described and everything seemed normal - I measured approximtely 10k across the 10k resistor (within tolerance). Then I turned on the power supply without changing anything else and as soon as power came on the resistance JUMPED up drastically to somewhere close to 100k. Then once power was turned off there was a 2-3 second delay before the resistance returned to its nominal value once again (a cap discharging?). The power down time seems consistent with how long it takes the PIC to power off I/O pins when an LED/LCD are connected to them so I can see when they power down. This makes me wonder what role it is playing in all this. Anyone have any clue how turning on a power supply could make resistance shoot through the roof like that?
asmallri



Joined: 12 Aug 2004
Posts: 1634
Location: Perth, Australia

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Wed Jun 22, 2005 10:24 pm     Reply with quote

You cannot measure resistance this way. Conceptually, a multimeter measures resistance by passing a (constant) current through the device under test (DUT) and measuring the voltage across the device. Knowing the current and resultant votage the instrument can calculate resistance. Alternatively the multimeter can put a constant voltage across the DUT, measure the current and then derive the resistance from these two values.

What you are doing is injecting a current from the power supply and the results you are recording are completely meaningless. If you want to measure the effective resistance in this scenario you need two multimeters, one measuring current through the DUT and the other measuring voltage across the DUT. Then you an calculate the resistance.

To summarize, the values you are reading are rubbish.
_________________
Regards, Andrew

http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!!
treitmey



Joined: 23 Jan 2004
Posts: 1094
Location: Appleton,WI USA

View user's profile Send private message Visit poster's website

PostPosted: Thu Jun 23, 2005 7:45 am     Reply with quote

I think we are all "on the same page". You were just reading resistance while the circuit was powered.
I think your set now. Do you have more questions?

btw. you can indirectly read the resistance(while powered up) by reading the voltage drop and current through the resistor and using ohms law. R=V/I
Guest








PostPosted: Thu Jun 23, 2005 10:20 am     Reply with quote

Thanks for the help everyone. Looks like everything is cleared up now. I didn't realize that you couldn't directly test the resistance of a resistor with power on due to how the multimeter is designed, but that is a good tidbit to know. Thanks again!
sseidman



Joined: 14 Mar 2005
Posts: 159

View user's profile Send private message

PostPosted: Thu Jun 23, 2005 12:03 pm     Reply with quote

Anonymous wrote:
Thanks for the help everyone. Looks like everything is cleared up now. I didn't realize that you couldn't directly test the resistance of a resistor with power on due to how the multimeter is designed, but that is a good tidbit to know. Thanks again!


It gets even worse than that. Unless you're sure that the resistor is isolated within the circuit, you shouldn't be measuring the resistance in the circuit with a multimeter at all, power on or power off. For reliable measurements, you genrally need to pull one of the resistor leads. Otherwise, you're measuring the effective resistance of the resistor you're trying to measure in parallel with every other effective path through the circuit.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group