Quite apart from the pin maximum current limit mentioned elsewhere (perhaps 20 mA source / 25 mA sink) the ports have finite effective resistance and will always drop SOME voltage when any current is drawn. For a 16F84 (data sheet happens to be nearby) the spec sheet says Vout_low will be 0.6v at 6.5 mA and Vout_high will be Vcc-0.7v at 3 mA. These are worst case values. The results are NOT linear with current but may be roughly extrapolated as if they were. Also your PIC version may have somewhat different specs but this applies with appropriate figures plugged in. In this case you have two pins involved so both will drop voltage due to their internal resistance. You have 0.2 volts drop and from the above it appears that Vout_high sags at about twice the voltage per mA that Vout_low does. From the spec sheet Vlow will rise at about 0.1V/mA Vhi will drop at about 0.2 V/mA Two pins in series will drop about 0.3V/mA You are getting 0.2V drop suggesting about 0.2/0.3 = 0.666 mA The pot resistance to achieve this would be about R = V/I = 4.75/0.666 = 7.1k Probably a 10K pot (maybe 5k but less likely). Are you using a 10K (or 5k) pot ? If so the result is very well explained by the above. An eg 100K pot would greatly reduce the affect. If you are using a much higher value pot then the cause may lie elsewhere. As noted elsewhere - if you can drive the pot with 1 port pin only then the above effect will be reduced. If you have the choice then typing one end to Vcc and driving the other rend with a low pin will result in less drop as above (as the low driver has a lower drive resistance as may be seen from the above specs). Russell McMahon IF the value was in fact 0.25 V at 20 mA say then as you report 0.2v unexplained drop the current appears to be the order of 0.2/0.25 x 20 mA /2 = 8 mA. This would occur with a pot of resistance of 4.75/0.008 = 600 ohms. Sounds unlikely - are you using a 1K pot or thereabouts? If so, a much higher value would produce a lesser drop. If the value is already much higher than this then this doesn't seem to be the cause. ----- Original Message ----- From: "Micro Eng" To: Sent: Tuesday, May 07, 2002 2:17 AM Subject: [PIC]:output voltage less than expected > Ran into a strange problem, that might be explained away, but not sure yet > since I am still investigating it. > > 16F877 is the chip, using 4 bits of a port, each pair tied to a pot, and the > centertap of each pot tied togeher and then to the analog input port. > > I measured the voltage on a port with the bit set, and it was about 4.95 > volts. Problem is across the pot it only measures 4.75 when its attached to > the two pins (bsf on one, bcf on the other). I have the other two bits for > the other pot set as outputs so should be hi-Z as seen by the device. > > I haven't yet isolated the other pot, but wonder if there is some leakage > currents going on that cause the current output to exceed the limits of the > chip and thus limit the output voltage? Or what can cause the voltage to > change like this. Seems to be load dependant, but not sure yet... > > > _________________________________________________________________ > Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp. > > -- > http://www.piclist.com hint: To leave the PICList > mailto:piclist-unsubscribe-request@mitvma.mit.edu > > > -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu