I am running a 16F1688 on 3V. I am using it to switch on and off another device from a port pin. The other device takes about 5 mA which is causing the voltage supplied to drop to 2.4 V.
Is this normal?
Like all similar devices it is claimed to supply up to 25 mA from the port pins.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks for the replies. I had not noticed that, and it is quite significant when working at 3 volts.
I will have to use a transitor switch to switch the supply. (I'm using a 16F1788 - these numbers are all so similar for quite different devices).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The voltage drop (droop?) being seen is quite normal for PICs and most CMOS Logic devices with push-pull outputs. The greater the load the more the voltage drop. so it is more than just a constant .600mV drop related to a transistor junction. The droop is slightly less when sinking than with sourcing.
I have never seen a PIC or PIC Variant (Picaxe,etc) that will actually source or sink the advertised 25ma at anything near the PIC supply voltage. About the most I could ever get with actual testing is about 19.5ma with the PIC powered at 5V. The voltage droop was nearly 2.2 volts.
With a 3V supply you will never get near 25ma @ 3V on an output pin. Likwise, with a 5V supply you will never get near 25ma @ 5V on an output pin, This info is all hidden deep in the datasheet in the Electrical Specifications.
This applies to nearly all micros, not just PICs.
I generally try to keep the current load on the microcontroller to a miminum by usng either small FETS or bipolar transistors as switches for loads over 10ma, or when the I/O voltage must be maintained. Line Drivers and Level Shifters can also be very useful and can save a lot of grief..
Also consider that each I/O port has a maximum current rating and that the PIC itself has a maximum current rating. Most PICs are rated at ~100ma total current, but check the datasheet to be sure.
For Example: With Eight LEDs all on at the same and each drawing 15ma, the total current will exceed the max current rating of most PIC's. If they are all on the same PORT, the I/O port could easily be damaged, causing all kinds of strange or intermittent problems like no output, wrong timer speeds or flaky peripheral operation. A blown Port could also show up as excessive current draw when no I/Os are turned on or connected to a load.
I have a PIC 16F1829 here on my desk that draws about 40 ma when powered up. The only noticable symptom was that the serial baud rates were off by about 10 percent ( timer problem?) One of the I/O ports got overloaded at one time. .
Speaking of LED's... there is really no good reason to always drive them at 15 ma by using the 330R resistor "recommened" by certain microcontroller suppliers. A 1K or 2K2 resistor reduces the current significantly and in most cases the reduced light intensity is barely noticable, especially with red LEDs and with the modern hi-intensity LEDs. When driving directly from an I/O pin use the highest value resistor that still gives adequate lamp intensity for the application.
Bill
Last edit: William Roth 2015-10-13
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I was quite surprised at the amount of droop at 5mA. I normally only take 200uA from the pins and it is not an issue, but I will definitely measure this voltage drop in future. There doesn't seem to be any guide to voltage out versus current in the PIC datasheets (there is for transistors) despite the datasheets being several hundred pages long.
I've added a BC557 to do the switching and the voltage drop at 5mA is hardly measurable.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Older data sheets have charts but the newer ones tend not to. I often refer to a PIC16F877A data sheet for this type of info (reference attachment). It's just a reference since it's not guarenteed to match a newer part exactly but it helps.
You always have the option of using an external pull-up and then to drive the pin high just change it to an input. This puts the pin in High Impedance mode and the external pull-up supplies the voltage. You just have to size the resistor so when you make the pin an output and drive it low, you don't exceed the sink current. This may or may not work per your application but it is an option to consider. Also not as clean in software but once again, just an option.
I am running a 16F1688 on 3V. I am using it to switch on and off another device from a port pin. The other device takes about 5 mA which is causing the voltage supplied to drop to 2.4 V.
Is this normal?
Like all similar devices it is claimed to supply up to 25 mA from the port pins.
0.6 Volt fall in the transistor junction...
Did you mean 16F688?
As JackJames pointed out, that's normal per the data sheet. See attached.
Thanks for the replies. I had not noticed that, and it is quite significant when working at 3 volts.
I will have to use a transitor switch to switch the supply. (I'm using a 16F1788 - these numbers are all so similar for quite different devices).
I would recommend an opto relay much easier to use, but, I do have a few of them in my tray. :-)
Depends on what you need to do. If you have to drive a relay use just one transistor.
If you have to interface with a logic circuit that does not recognize the level you have to use a 'logic level converter' like this:
http://www.ebay.com/itm/5V-to-3-3V-Two-Channel-IIC-I2C-Logic-Level-Converter-Bi-Directional-Module-New-/281680165821?hash=item4195723bbd
Hi,
The voltage drop (droop?) being seen is quite normal for PICs and most CMOS Logic devices with push-pull outputs. The greater the load the more the voltage drop. so it is more than just a constant .600mV drop related to a transistor junction. The droop is slightly less when sinking than with sourcing.
I have never seen a PIC or PIC Variant (Picaxe,etc) that will actually source or sink the advertised 25ma at anything near the PIC supply voltage. About the most I could ever get with actual testing is about 19.5ma with the PIC powered at 5V. The voltage droop was nearly 2.2 volts.
With a 3V supply you will never get near 25ma @ 3V on an output pin. Likwise, with a 5V supply you will never get near 25ma @ 5V on an output pin, This info is all hidden deep in the datasheet in the Electrical Specifications.
This applies to nearly all micros, not just PICs.
I generally try to keep the current load on the microcontroller to a miminum by usng either small FETS or bipolar transistors as switches for loads over 10ma, or when the I/O voltage must be maintained. Line Drivers and Level Shifters can also be very useful and can save a lot of grief..
Also consider that each I/O port has a maximum current rating and that the PIC itself has a maximum current rating. Most PICs are rated at ~100ma total current, but check the datasheet to be sure.
For Example: With Eight LEDs all on at the same and each drawing 15ma, the total current will exceed the max current rating of most PIC's. If they are all on the same PORT, the I/O port could easily be damaged, causing all kinds of strange or intermittent problems like no output, wrong timer speeds or flaky peripheral operation. A blown Port could also show up as excessive current draw when no I/Os are turned on or connected to a load.
I have a PIC 16F1829 here on my desk that draws about 40 ma when powered up. The only noticable symptom was that the serial baud rates were off by about 10 percent ( timer problem?) One of the I/O ports got overloaded at one time. .
Speaking of LED's... there is really no good reason to always drive them at 15 ma by using the 330R resistor "recommened" by certain microcontroller suppliers. A 1K or 2K2 resistor reduces the current significantly and in most cases the reduced light intensity is barely noticable, especially with red LEDs and with the modern hi-intensity LEDs. When driving directly from an I/O pin use the highest value resistor that still gives adequate lamp intensity for the application.
Bill
Last edit: William Roth 2015-10-13
I was quite surprised at the amount of droop at 5mA. I normally only take 200uA from the pins and it is not an issue, but I will definitely measure this voltage drop in future. There doesn't seem to be any guide to voltage out versus current in the PIC datasheets (there is for transistors) despite the datasheets being several hundred pages long.
I've added a BC557 to do the switching and the voltage drop at 5mA is hardly measurable.
Older data sheets have charts but the newer ones tend not to. I often refer to a PIC16F877A data sheet for this type of info (reference attachment). It's just a reference since it's not guarenteed to match a newer part exactly but it helps.
You always have the option of using an external pull-up and then to drive the pin high just change it to an input. This puts the pin in High Impedance mode and the external pull-up supplies the voltage. You just have to size the resistor so when you make the pin an output and drive it low, you don't exceed the sink current. This may or may not work per your application but it is an option to consider. Also not as clean in software but once again, just an option.