5V input to Prop pin question
T Chap
Posts: 4,223
I remember back in the very early days some discussion about using a 1k for 5V inputs to Prop(could have been mistaken), and built many systems that use 5V though a 1k to the Prop pin and have never had a failure. Typically these are normally open, momentary closure for under 1 sec. In some cases the contacts are normally closed, with brief opens for triggers. I have one project that I cannot go visit that is stating that one of the systems using a card reader with normally closed contacts and a 5 second open time is acting strange, it sometimes takes several attempts at the card to work, there is no pattern. I tested this with a short jumper wire and it works fine on my bench systems, so I am wondering if the steady 5v though the newer value of 1.2k over prolonged periods is causing some temporary strangeness. I don't think this is software. The input has a 220k to GND right at the pin so it cannot float.
Over more recent years I see recommendations of 3k etc. In prior experiences, you either kill the input or you don't, there is never a random state. Any thoughts on the resistance causing sporadic failures? I cannot control their 5 second delay time, and this is the only other potential culprit but I cannot see how it would affect anything.
Over more recent years I see recommendations of 3k etc. In prior experiences, you either kill the input or you don't, there is never a random state. Any thoughts on the resistance causing sporadic failures? I cannot control their 5 second delay time, and this is the only other potential culprit but I cannot see how it would affect anything.
PUB PushbuttonsState2(inputpin) | selectinput Case inputpin auxin1 : CurrentSwState2[0] := ina[2] selectinput := 0 auxin2 : CurrentSwState2[1] := ina[5] selectinput := 1 auxin3 : CurrentSwState2[2] := ina[6] selectinput := 2 auxin4 : CurrentSwState2[3] := ina[23] selectinput := 3 If CurrentSwState2[selectinput] <> PrevSWState2[selectinput] 'byte arrays used here if ina[inputpin] == 0 Open delayCounter~ GoZeroClear ser.str(3, String("Open")) w(40_000_000) 'waitcnt shortcut PrevSWState2[selectinput] := CurrentSwState2[selectinput]
Comments
I don't know why these resistors values are so low as if CMOS inputs require current. I typically use 10K values or even 100K and only ever use lower values if the signals are high speed (>1MHz) due to of course the combined capacitance of the input. A value of 1K results in almost 1.5ma flowing through the pin up into the 3.3V supply which can force that up especially during reset. I think the 3.3K value mentioned is the *minimum*, not the required value at all. I have seen Props not booting due to the elevated Vdd observable during reset.
One of the things I have learned in over 40 years of service is to fix any problem I find regardless of how minor or unrelated it may seem to be to the problem I was called in to fix. It's amazing how often fixing that seemingly minor unrelated problem solved the issue. Try using a 3.3K or higher resistor and replace the prop chip.
Hi Chris, I notice in the article that when you address current limit you only give the "safe" limit for resistors but not any guidelines for a practical value. The trouble is as I have noted from my circuits (burn and learn) is that when you have multiple 5V inputs current limited then these very signals can contribute to misoperation of the Prop, especially when it's not drawing a lot of current then the 3.3 rail just gets pushed up to 4V or more (as regulators can't actually pull a line down). The problem is exacerbated during reset and it seems to play havoc with it as the Prop does not respond reliable of at all.
Please put in a recommended operating value, as I said there is no reason why these values can't be much much higher and in most normal circumstances 100K is fine, or at least 10K. But 3.3K should be quoted as "ABSOLUTE MINIMUM" perhaps, as in do not normally do this unless you know what you are doing type thing.
@kwinn: Yes, I will ditto that in bold, when you ignore the little problems in pursuit of the big problems you almost invariably discover the little problem is causing the big problem.
I've used 4.7k resistors on some MCP3201s that I'm clocking at 400 kHz. Works well.
Sandy
Somehow that has morphed into 3.9K being the standard policy value.
Since many of the assumptions for these were made with a a full continuous ON state, I suppose the the 1K value will work well if there is a duty cycle of 50% or less. But it is rather silly to go with the smallest value and waste power when a higher value will both conserve power and work fine.
Too high a value might not provide enough stability if the i/o is over longer wires or subject to RFI interferences. So I suspect that anything above 5K begins to ask for other problems to creep in... depending upon construction.
Loopy, you know your maths right? Why then do you make statements about too high a value might not provide stability? The Propeller chip is constructed using CMOS technology which we are familiar with. Unlike TTL which required more sinking current and had limited fan-out, we know that the limitation with CMOS has eventually to do with capacitance which affects speed. The input capacitance of a CMOS input is a maximum of 10pF, the input resistance is in the order of 100s of megaohms although they will always quote a "leakage" value of 1ua max. So we feed a "100s of megaohm" input with say a whopping (in our minds) 1M resistor. What's that going to do? Will it lack drive? Will it have enough "current"? Those questions are not relevant because of the technology and really only the capacitance is factored in with a time constant of 1M * 10pf * 0.68 = 6.8us so even at this level there is definitely no problem reading switches and 9600 baud data etc. In fact this time constant makes the Prop more resilient to RFI and stray voltages anyway plus we would normally have a pulldown or pullup resistor before the current limit as well which lowers the input impedance. If you do the maths then theoretically the input could withstand 500V although the resistors etc would have to be rated for that!
So you see a higher value resistor has everything going for it and the only time I need something as low as 10K is when I am dealing with > 1MHz signals and even then I'm still on the safe side.
No. Slower rise/fall times mean the input voltage stays longer in the "forbidden zone" near the threshold and oscillations may occur if you don't add a schmitt trigger circuit. I had that problem when I increased the series resistors for my 5V-tolerant inputs for step and charge pump inputs of a stepper motor driver. I had to add software debouncing to avoid false step pulse triggering. With a 1.2k resistor only, everything worked fine.
Peter,
The relevant section is listed below. I used the ratings Chip Gracey gave me for the diodes to calculate the absolute minimum, then specify some allowance for tolerance and use the next highest common resistor value. Is the absolute minimum not what you were looking for?
As a note there are other considerations as well. Sometimes you're interfacing to a pin that has been pulled up and then you inherently create a voltage divider which may not allow the pin to go low enough to be registered as a low.
You weren't mistaken.
I've also been building circuits with the 1K resistor in series with the input, based upon this post:
http://forums.parallax.com/showthread.php/85841-Propeller-Chip-5V-tolerant
Now I guess I need to upgrade my devices... but I haven't had any chips fail for this reason.
Walter
All signals are not perfect and they will hover in that "forbidden zone" either way. But you are talking about a stepper motor driver which may exhibit that problem but I have tested the Prop in this regard. Even just now I connected a 1M resistor from one I/O to another and set it up to output various frequencies while I capture the other input into a buffer at high speeds. I have yet to detect these oscillations as it would be immediately apparent since I am reading the inputs as if they were 4MHz SPI data and what would occur would be irregular patterns. At various settings the data is perfectly preserved.
To really exacerbate the condition I went and added a 0.1uf to the input of the Prop after the 1M resistor, surely now I will see oscillations? Nope, not a sausage.
@Chris: Obviously if the input already has a pullup/pulldown then that would always have to be taken into account but I believe the whole discussion has been about how to connect to Prop pins, that is in their bare n naked state.
Here's a glance at a couple of my captures which were done with a 10kHz excitation signal and capturing this at 4MSPS into a buffer.
Just to reinforce this and maybe make it a bit clearer I have done a dump in binary mode.
I'd say that most regulators can't pull a line down. I've seen a few low power CMOS regulators that advertise being able to sink current. (the pull-down FET is needed for stability at uA loads, might as well boast about it) Also any switching regulator with synchronous rectification can probably sink current as well.
Back directly on topic, I've got an older design that uses 1K inline to 5v outputs and it's been working fine for years. The serial buss operates at a MHz or two, so I felt the speed was needed. I did have an update of that design show a ~4v Vcc line for the prop. I added a 300 ohm load to Vcc as a quick fix. If I ever revise the PCB, I'll use a 1k/2k voltage divider instead of the 1k series resistors.
Marty
Going with a more conservative +-10% for regulators would result in requiring a voltage drop of 5.5 – (2.97 + 0.7) = 1.83V at 500uA or 3660 ohms.
Smarty Marty, I know about those regs too The trouble is that pratically all Prop designs I have seen rarely progress past simple linear regulators, so the "most" particularly refers to the ones that are employed in Prop designs. That ~4V you observed has caused problems for me with trying to reprogram devices and besides the load resistor I have also tried clamps using a 47R + 2 red LEDs in series.
Personally I can't see where really low values of 1K are every necessary though, especially in view of tests I have run, but that's the good thing about already having a resistor there, it's easy to change the value anytime.
Chip Gracy may have recommended 2.6K. But after that, I believe the 3.1K was justified by Beau Schwab in a rather elaborate clean up of some wrong assumptions.
Should we trust Beau after is leading us astray with the 1K value? A lot of things happened in the early days that were not quite right. Also the values for the VGA resistors were not quite right. In fact, my Propeller Protoboard required addition of 100 to 120 ohm SMD to get the color to be really nice.
But that is yet another resistor topic that went on and on. I tend to just follow along in these.
http://tinyurl.com/nf5xj2a
So what's maths and science and observation and testing got to do with it then? Just keep doing it your way.
However for those who are interested I just discovered that I had picked up a 4.7M resistor instead of the 1M and had tested with that!. Hooking this up to the scope shows a reduced amplitude from which I worked out that the inputs are reading more like 10M resistance. Anyway I went back and checked this with a 100K resistor at 10MHz on the scope. So even with the 100K resistor it is very usable even at 10MHz. At 1MHz you can't even tell the difference. Why would I ever want to have voltage translators or 1K resistors "just to be sure"?
I have done quite a bit of testing which I didn't really have time for but I am happy with the 100K as a standard value but if I still want speed then all it takes is a 15pf capacitor in parallel with the 100K as this works at >10MHz and is symmetrical. I've also ran this through LTspice and attached the files. Try this with 50V inputs!