5V and the Propeller
cbmeeks
Posts: 634
I'm sure this has been asked many times but how are you guys typically connecting 5V devices directly to the prop?
I'm mostly concerned with the Z80. In the past, I have used BSS138 level shifters between the devices and that seems to be OK but I've never used them for anything high speed.
My design is going to require the propeller be tied directly to the address and data bus of the Z80.
Thanks for any tips.
I'm mostly concerned with the Z80. In the past, I have used BSS138 level shifters between the devices and that seems to be OK but I've never used them for anything high speed.
My design is going to require the propeller be tied directly to the address and data bus of the Z80.
Thanks for any tips.
Comments
If that doesn't work there are level converter circuits and (mostly SMD) chips to do the conversion, but that gets somewhat complex with a bidirectional bus like a data bus.
Oh, I know this is simple Ohm's law but I'm having a difficult time know what to plug in where. Any tips for this newbie is much appreciated. :-D
Thanks
Inside each pin are diodes; one connected to ground, the other connected to 3.3v. If a voltage goes under -0.3v or orver 3.6v one of these diodes will conduct -- you only need to worry about the one connected to 3.3v.
R = E / I
If you look in the Propeller data sheet you'll find the current spec for these diodes at 500uA (0.5mA). Now it becomes easy:
(5.0 - 3.6) / 0.0005 = 2800 (2.8K).
You'll see the 3.3K suggestion because this is the next-highest common resistor value.
Also, keep in mind that when the Propeller microcontroller is powered off, It should not have any low impedance power supplied to any I/O pin. If a 5-volt signal may be present when the Propeller microcontroller is powered off, us a 10K or higher current-limiting resistor.
— David Carrier
Parallax Inc.
Yeah, I believe my design would need to be bi-directional. But I admit, I am really considering using the ZiCog. I just don't know how hard that would be to get going with the BIOS code I would need to use.
I was looking at the Propeddle design and it appears that's what he did. I believe he used a 10k resistor network for the pin connections. However, I don't think he had as many direct pin-to-pin connections as I am thinking of.
Just use a level shifter and call it a day.
Howya goin Beau!
I do believe you have the correct circuit but you neglected to set the resistor values as you are asking 11ma sink current from the input. The pullup is necessary but can be a high value (100k) IMO, the base resistor could be around 10k say, and the collector resistor should be selected to match the rise time desired but if we use a value of around 10k we end up with less then 1ma sink current from the input and of course, zero source current with a rise time of <10ns with a estimated combined 20nF input capacitance.
There's a common misconception that one must use rather low value pullup resistors with the Prop and it is common to see the "recommended minimum value" of 3k3 (IIRC) taken out of context and used. That's why I ran a simulation to confirm that and changing the input capacitance to a very unlikely value of 100pf shows a rise time of only around 60ns measured at 50% of Vdd. What are your thoughts?
BTW, I still use series current limit resistors to receive 5V signals but the values I use are much higher than what we see in many reference circuits, while 10k is common I even use 100k as well and up to 1M for higher voltages etc.
BTW.2, yep, how many people I've seen huffin n puffin up a hill in too high a gear while others are seen over flat ground furiously pedalling "on the spot" in too low a gear
Doing well, thanks for asking ! :-) ... Very busy at my new job which is good thing!
Some would say why not just use a diode/resistor combo ... that in some cases might work, but it suffers being able to go down to the ground rail (or supply rail in an inverted configuration)
Using the transistor solution, the Transistor is "OFF" when the Emitter junction is more positive ( by about 350 mV ) than the Base junction. The transistor solution in my original post will pull the voltage down to about 12mV if the input is taken to ground... in THIS post (slightly improved), the transistor solution will pull the voltage down to about 3mV if the input is taken to ground.
The graphs at the bottom:
Left side is the circuit using a transistor
Right side is the circuit using a diode.
People on these forums have all sorts of personal preferences that vary widely from way too low at 1K to a bit high at 10K ohms. I doubt if 3.3K would fail you, and many claim 10K works well. Simply stick with the 3.9K or higher just in case.
I wasn't previously aware that a 10K resistor might be wisest if the Propeller is shut down while the 5VDC devices remain on.
The level shifter with the 2n3904 is handy. Previously, I have only seen these done with the 2n7000 MOSfet.
Loopy, do your own research and don't just decide which is "better" simply because of personal preferences and then give "advice" to the group saying "Simply stick with....", because that is misleading.
You may note that I have simulated and tested and built circuits with much higher values and in the past have even given evidence that low values have side effects. This is done scientifically rather than by what others say and also note that I referred to the "recommended minimum value" being taken out of context, which it so often is. Like maximum values (esp absolute max) in datasheets you cannot expect to work at these values without side effects. The 3.9k or less will result in more current flowing causing the Vdd supply to be pushed above 3.3V especially during times of low current consumption such as during reset and programming etc. This voltage can even reach 4V easily and there are side effects depending upon the circut. Guess what happens when you have multiple inputs arranged this way!
But defenders of low values of series resistance say that it affects "rise time" but even with 10k input and a large 20nf combined pin capacitance the Prop can still handle signals in the MHz range. Certainly the high-impedance CMOS inputs themselves don't require drive current at any time so then if it were not for the rise time one could use resistors in the megaohm range most of the time and which I do use at times. Calculations, simulations, and testing do not mislead or exhibit personal preference, facts are facts.
Perhaps others with some knowledge in this area of electronics would also like to provide some input on this matter.
Go to the Parallax main page and search for AN010.
Sandy
Hi Sandy, just because it has an APPNOTE designation doesn't make it all encompassing or definitive. Beau himself may well have written this document!
The "at least 4.6k" is not the "preferred value", it is simply saying "this is the limit", nothing else. as you can also see from the appnote that it refers to 25V "RS-232" signals (more like 6V though) using 50k resistors, but once again, the minimum value. Minimum and maximum values should never be translated "recommended" or "preferred", they simply state facts which you must take into account with at least some knowledge of electronics. Those with this knowledge and who actually put it to use would not be "recommending" these values.
There's no "Z80" chip that runs at 3.3V (that I know of) although there are variants and packages other than DIP40. There's also the problem of the EEPROM and other chips. Why anyone would want to use a Prop just to interface to the address and data bus of a Z80 hardware system is beyond me though
http://www.digikey.com/product-detail/en/Z8S18020PSG/269-4301-ND/928984
I looked into those variants and, from what I could tell, none of them will run 100% Z80 code.
I am building a retro console/computer similar to the Propeddle. However, my goal is to use a real Z80 (retro coolness) but also use the prop to emulate the TMS9918 and various sound chips like the AY-3-8910 and SN76489. This console will hopefully run ColecoVision games.
That's why.
Now, I have several of these:
https://www.sparkfun.com/products/12009
What I thought I might do is check out the schematic of those (seem pretty simple) and design something similar for the two-way communication of my 3.3v components and 5v components.
I still have to study the datasheets more, however, to see how feasible that is.
Those are Z180s which are derived from the 80's when Hitachi enhanced the Z80 as a microcontroller (but no internal memory). It's a shrink DIP so it's not as big as the old 68000 or TMS9900 chips.
http://forums.parallax.com/showthread.php/148944-Propeller-Z80-CPM-hybrid
Uhhh...no. But I'm gonna!
Thanks!
I would suggest that you take a look at other Propeller/Z80 hybrid projects to see how they did it. Google "propeller z80" and you will get a list of them. I was looking for a way to replace a very old industrial Z80 board several years ago and found a lot of ideas for interfacing a Prop and Z80 at the time.
allows the Propeller and Z80 to safely connect their IO busses and level translate. Makes 2 channels.
Ingredients:
..1 - Dual common cathode Schottky diode in a SOT23 package, SDM40E20LC.
..2 - 200pf caps (140pf 250pf okay).
..2 - 3.9k resistors (500 10k ok, but 3.9k is a good compromise to make the cap value less of an issue).
This circuit:
1) Runs at 0.1Hz to 30MHz in bidirectional mode without a direction control pin.
2) Applies to an IO bus with +3V on one side and +5V on the other.
3) Virtually no prop delay in either direction. (a tiny amount in picoseconds due to RC).
4) Schottky diode protects the Prop IO pin up to 400ma continuous or 2A peak.
5) PS protection if +3V turns off. As the Prop +3V supply goes to zero the diode clamps current through the 3.9K. Result = 290mv max on the Prop IO pin when +3V is zero and +5V is still on.
6) 200pf cap peaks leading/trailing edges to compensate for parasitics in PropIO, PCB traces, Cjo of diode. As the frequency increases above 5MHz the bypass cap needs to more closely match the circuit parasitic capacitances. The typical Cjo of the diode (Diodes, Inc. SDM40E20LC) is 120pf, Prop IO ~ 8pf, traces/pads/leads ~15pf if going surface mount. So the 200pf should be closer to 140pf. An alternative is to reduce the resistor to 1k or 220 ohms. This is safe since a new diode provides protection instead of the internal Prop diode.
Ive simulated this particular circuit in both directions. Both halves have good levels and clean, fast transitions through respective input thresholds.
Without a description of the Z80 input parameters from the datasheet it wont be precise on the Z80 side; at least not until the input capacitance, VIL/VIH and input currents are taken into account. Can you provide a link to the Z80 datasheet you plan to use?
-
-
The trouble with simulations is that they are too perfect and you have to compensate them accordingly. For instance, the "3V" supply (not 3.3V) will simulate as if it were source and sink in that it can sink current which linear regulators do not do. In this case those capacitive spikes will appear on the "3V" line which if it were the 3.3V supply in practice then that can be causing problems. Of course you could clamp it directly to ground except low voltage zeners are slow and have "soft knees" in that they will leak current near the threshold. I find that LEDs in the forward direction make very good low voltage zeners with two red leds in series having a very sharp knee of 3.2V in this circuit. You can even use a green led with a red led to have a clamp voltage of 3.4V. A single blue led can also be used if it's forward voltage drop is 3.4V or so but certainly the voltage of red, green, and yellow leds is very consistent and you can easily tell what color they are simply by reading the voltage from your meter on the diode setting.
The other problem (which might not be a problem) is that this does not take care of the Vih for any chips that might have a Vih of 0.7Vdd although it seems the standard Z80 and memory are TTL compatible with a Vih of 2V. So this does not translate a 3.3V signal to a 5V signal like a proper level translator otherwise considering certain aspects this circuit should work fine.
You're right but fortunately that's one that doesn't need to be bidirectional so a simple 74HCT gate will drive that pin nicely. I like using the 74HCT86 single exor gates in sot23 packages as you can set them for buffer or invert although I do have those "programmable" gates too.
IIRC the pin spacing was 2mm and it was the standard 0.6" width. Very close to the same size as the 40 pin dips. I think I may even have one or two packed away somewhere.
http://forums.parallax.com/archive/index.php/t-148944.html
and, the ultimate Z80-Propeller project...
http://searle.hostei.com/grant/cpm/