Circuit design questions....
Don M
Posts: 1,653
I had previously posted this in the General Forum but now feel it would be better served in the Propeller Forum. Moderators please delete the thread in the General Forum.
A. Regarding the Propeller-
1. Am I correct that it a good idea to have 4 caps surrounding the Prop tied between Vcc and ground?
2. If so what is a good value? .1uF ceramic or 1 uF tantalum?
3. Should there be a cap on the Vcc of the EEPROM as well? If so what value?
The Propeller will have all 4 power pins and ground pins tied together under the IC. The Propeller will be using a 5 Mhz (80 Mhz) crystal so no over-clocking. The EEPROM will be located next to the Propeller.
B. Regarding the attached circuit diagrams-
I want to help insure that the transistor stays biased off to keep the relay from being accidently energized. Assume that the pin labeled RLY_UP is connected to one of the Propeller pins.
Which design is better?
The ground resistor connected from base to ground...
or the ground resistor connected from the Propeller pin to ground...
I would tend to lean toward the first design but would like to hear other opinions. The resistor values I have chosen are 1K each. The transistor is a 2N3904.
A. Regarding the Propeller-
1. Am I correct that it a good idea to have 4 caps surrounding the Prop tied between Vcc and ground?
2. If so what is a good value? .1uF ceramic or 1 uF tantalum?
3. Should there be a cap on the Vcc of the EEPROM as well? If so what value?
The Propeller will have all 4 power pins and ground pins tied together under the IC. The Propeller will be using a 5 Mhz (80 Mhz) crystal so no over-clocking. The EEPROM will be located next to the Propeller.
B. Regarding the attached circuit diagrams-
I want to help insure that the transistor stays biased off to keep the relay from being accidently energized. Assume that the pin labeled RLY_UP is connected to one of the Propeller pins.
Which design is better?
The ground resistor connected from base to ground...
or the ground resistor connected from the Propeller pin to ground...
I would tend to lean toward the first design but would like to hear other opinions. The resistor values I have chosen are 1K each. The transistor is a 2N3904.
Comments
If you must use 1K values then I would use the first circuit, the conventional one as the Prop's I/O will only be sourcing 2.5ma rather than 5.8ma with the second arrangement. Of course you could change the pull-down to 10K.
The basic requirement for decoupling is that the power pins see a low-inductance path to a high-frequency capable decoupling capacitor. In practice this means a decoupling cap close to each pin (within 1cm) - sharing caps between pins is OK if they are close enough usually.
To keep inductance low use wide power traces directly over a ground plane if possible. People often say the decoupling should be a combination of cap values like 0.1u, 1u, 100u, but usually that's overkill for a purely digital circuit (I tend to use 0.22u and 10u for the prop) - with mixed analog and digital it all matters more. If you are controlling high current switched loads then you'll need more decoupling for that (such as LED arrays), especially larger cap values to deal with larger current loads. Ultimately at lower frequencies the regulator chip does the decoupling of course, so the lower frequency decoupling caps are bolstering the performance of the regulator.
And in general the higher the current consumption of a chip (and thus its current fluctuations) the more capacitance its power-rails should see. The EEPROM is low power, 0.1u would be OK and if its close to the prop it can share a cap with it.
But basically don't skimp on decoupling to save a couple of cents, a few ceramic caps are cheap!
Hi Mark, I just see this base resistor being added to a lot of circuits that are hard-wired to I/O pins that are always an output in operation. I wanted to help others to see that this resistor is essentially redundant as any of the issues you mentioned (which I'm well aware of) are taken care of by the much lower value series resistor being pulled down to ground when it's not active. Yes, it's only a 1 cent resistor and one can put it in, but without it in this type of circuit one is no worse off.
In the first circuit, (voltage limited configuration) the resistors form a voltage divider from ground to the input voltage. As long as the ratio on the resistor divider is enough that the transistors base 'sees' the required B-E voltage then the transistor will turn "on". In this configuration with the right ratios you could make an effective comparator if your input voltage varied or had various levels that needed to be distinguished this would be the circuit to use.
In the second circuit, (current limited configuration) both of the resistors in series form a pull-down across the B-E only if the input is floating. When the pin is active high or low, the B-E junction is only current limited from the input voltage. This configuration is better suited for driving a higher current load.
The first circuit requires slightly less I/O drive current than the second circuit, but depending on the load of the transistor and the Hfe of the transistor, that I/O current might be necessary for adequate load current drive.
Conclusion: In most cases either circuit would work, but it's important to understand the subtle differences and how they could be applied.
@Peter Jakacki - "I just see this base resistor being added to a lot of circuits that are hard-wired to I/O pins that are always an output in operation... ...essentially redundant" - not necessarily true ... the default I/O state is an input until the software has a chance to take control, so during a power-up or even (a power down) the pins can be left floating. A resistor to ground on such external pins is a good safety measure to ensure that the device operates in a 'known' state.
I used a 1N4001 diode as the catch diode.
Here's a snippet from the 2N3904 data sheet. It looks as though I am within spec.
Any further comments in this regard are surely appreciated.
Hi Beau,
I hope I have the last word on this matter (just joking, consider it a debate) which is of very little matter but everything I hear about why it "needs" to be there is specious in my opinion (without intending offense). A bipolar transistor will not turn on simply because it is floating (MOS will), you could actually count it a feature if you like. The BJT as you know is a current device and with limited gain there is no way it's going to turn on the output unless you pump enough current into it's base. Microamps (assuming sufficient voltage etc) will only allow 100's of microamps through the collecter but with such a low input resistance and in-circuit you just don't get stray voltages that are ever capable of turning on a BJT in a power switch configuration.
There are plenty of good safety measures that I employ in my designs, but I don't go in for stuff that I have calculated can have no benefit, a little maybe yes, but none, no. If I were using a MOSFET
instead then I would definitely put that resistor in, no arguments whatsoever.
So, it won't hurt with, but it definitely won't hurt without it either.
Cheers,
Peter
"I hope I have the last word on this matter" - hello, you forget it's me your talking to ;-)
"A bipolar transistor will not turn on simply because it is floating" - Here I disagree ... I have seen plenty of times where a single touch to nothing but the transistors base will cause it to pick-up noise. In most cases 50/60Hz. As a kid, I exploited this into t touch sensor with what I called a 'super transistor'. Basically 4 or 5 transistors all configured together as one Darlington. All collectors connected together, the first stage base is the touch input, all other stages, the emitter of the preceding stage connects to the base of the next stage and so on.
Now days you could almost get one transistor with enough Hfe to count for all 4 or 5 that I used, so this boils down to stray interference entering the base of the transistor that MIGHT have enough current to turn the transistor 'on', unless you specifically bias the transistor off with an external resistor. Now as you said it might not be 'on' that much, and not enough to power a significant load but from the perspective that I try to keep in a design, letting it float any amount is a waste current and is a bad design practice. But that's my opinion.
Hey! I did that too with the "super transistor" thing as a kid, exactly the same thing, wow.
But floating and touching with your big grubby finger coupled to your body which is soaking up all kinds of electrical noise is not the same thing. Look, in-circuit and in close proximity to the driver there is no way of turning that transistor on unless you come up to it with your big finger and even then you have to be lucky as this might just result in a few measly milliamps flowing through the collector (for the few msecs before the driver switches in). It just isn't an issue at all (he says with a cheeky laugh). Of course if we want to play it safe we can, but I don't go around with aluminum foil wrapped on my head just in case of evil radiation (and grubby fingers).
Last word? Oh, that's right! I'm talking to Beau
Rs485 question;
Ive been using an sn75176 with the prop and using a 2n2222 transistor for level shifting on the transmit and control pins and a 3k resistor on the rx line back to the prop. Looking at the data sheet it looks like minimum voltage for control and transmit is 2v so can I drive the SN75176 directly from the prop?
Thank you for your support.
Bill