Author Topic: 10K pullup on signal takes 1us to take it back high  (Read 3482 times)

0 Members and 1 Guest are viewing this topic.

Offline alank2Topic starter

  • Super Contributor
  • ***
  • Posts: 2185
10K pullup on signal takes 1us to take it back high
« on: May 05, 2018, 02:22:32 am »
I am finally working on some AVR code for me Z80 with AVR I/O project.  It is currently on 3 pcb's using arduino type stackable header separating the boards.  The bottom PCB is the Z80 with the 10K pullups on certain control lines.  Middle PCB is SRAM.  The top PCB is the AVR pcb and it pulls some of the Z80 signals low.

The waveform below is the WAIT signal.  Pulled up to 5V by 10K resistor on the Z80 board.  On the AVR board when the right IORQ is asserted, it triggers a flip flop that outputs to a logic level mosfet.  You can definitely see it snap down, but when releasing it looks like it might take around 1us to get all the high again.  If I change the 10K to something smaller, I'm assuming it will have a faster rise time?

I had a similar problem when using the AVR to assert a signal by switching it between HiZ and output low.  Well, that part goes fine.  If I take it from output low directly back to HiZ, there seems to be a sort of bounce effect where it goes high, then bounces low a few times.  If I set the AVR PORT high first (output high), then next instruction switch it to HiZ/input which makes the PORT become a pullup, then disable the PORT/pullup, it is then smooth.  Is this because I was sinking it and just slammed up a wall with the HiZ?  Does doing the output high first give it the 50K or so pullup when switching to HiZ so it doesn't bounce?

My logic analyzer is connected via 12" or so cables to the header on the top/AVR board.
 

Offline C

  • Super Contributor
  • ***
  • Posts: 1346
  • Country: us
Re: 10K pullup on signal takes 1us to take it back high
« Reply #1 on: May 05, 2018, 03:16:09 am »

TTL has different current capability for outputs in low state vs high state.
You use pull-up resistors because an output low can overcome the pull-up.
You can have a pull-up on a normal output.

As you lower pull-up resistor value, you are also loosing number of TTL inputs that can be connected.

A normal TTL output uses transistors for both directions of change. It takes current to make a logic level change.

When you have a long bus that uses TTL you might see resistor pack containing 330/220 resistors terminating the line.
A step up from this is active termination, a resistor connected to a voltage level between logic high & low.

Open collector logic is slower than Tri-state where you have active in both directions.
For tri-state logic, good design is having logic level be what you want before going tri-state.

For your Z80 wait input, why not drive it both ways?
Not hard to have a logic gate combine a bunch of wait outputs if you need this.
Then pull-up is just to hold logic level and not used to make a change.

C
 

Offline alank2Topic starter

  • Super Contributor
  • ***
  • Posts: 2185
Re: 10K pullup on signal takes 1us to take it back high
« Reply #2 on: May 05, 2018, 03:34:13 am »
The Z80 I'm using is CMOS.

I was trying to have the signals setup so that more than component could pull it to ground...
 

Offline DaJMasta

  • Super Contributor
  • ***
  • Posts: 2298
  • Country: us
    • medpants.com
Re: 10K pullup on signal takes 1us to take it back high
« Reply #3 on: May 05, 2018, 04:30:42 am »
Smaller resistor will be faster rise time, but a totem pole driver instead of a single mosfet would allow you to drive the line high as well.  You can also try to reduce the capacitance of the control line, which will lower the RC time constant - though I think in your case the control line is under 100pF, and it's just the relatively weak pullup that's making the charge slow.  Many serial data lines that require a pullup will go with half that as a baseline pullup value, with considerably less recommended for high speed operation... so maybe try 4.7k and if it's still too slow, swap to 3.3k or 2.2k.
 

Offline Ian.M

  • Super Contributor
  • ***
  • Posts: 12864
Re: 10K pullup on signal takes 1us to take it back high
« Reply #4 on: May 05, 2018, 07:37:42 pm »
From risetime=2.2*R*C, it looks like you've got 45pF of capacitance on that line - which is pretty good going for a three board stack.   Obviously you can reduce the pullup as has been suggested, but another option would be to use current mirrors hung off the +5V rail.  One MMPQ2907A quad PNP could pull up three lines with one resistor to set the current, and a small capacitor B-E to minimise crosstalk.  If you go for the same 0.5mA it takes to hold the line low with the 10K pullup resistor, you'll speed up the rise time by a factor of 2.2
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19528
  • Country: gb
  • 0999
Re: 10K pullup on signal takes 1us to take it back high
« Reply #5 on: May 05, 2018, 08:03:57 pm »
A current mirror is a good idea. If you have a CD4007 handy then you might be able to use that, but it won't be as good as the MMPQ2907A mentioned above.

Is there any reason why a push-pull line driver, such as the 74HCT241 or 74HCT244 can't be used? They can be set to a high impedance state, if the line needs to be controlled by something else.
 

Offline alank2Topic starter

  • Super Contributor
  • ***
  • Posts: 2185
Re: 10K pullup on signal takes 1us to take it back high
« Reply #6 on: May 05, 2018, 09:31:20 pm »
I changed it to 3.3K and it rises much better now.  I'll have to lookup a current mirror and see what it does!
 

Offline Ian.M

  • Super Contributor
  • ***
  • Posts: 12864
Re: 10K pullup on signal takes 1us to take it back high
« Reply #7 on: May 05, 2018, 10:48:09 pm »
Here's a comparison of different pullups in LTspice.  Sorry I couldn't post it earlier as my PC was down for maintenance and I was posting on a Raspberry Pi.

 

Offline maginnovision

  • Super Contributor
  • ***
  • Posts: 1963
  • Country: us
Re: 10K pullup on signal takes 1us to take it back high
« Reply #8 on: May 06, 2018, 05:16:50 am »
Just for reference the standard pullups on the z80 based computer I'm working with are 2k to 5 volts
 

Offline alank2Topic starter

  • Super Contributor
  • ***
  • Posts: 2185
Re: 10K pullup on signal takes 1us to take it back high
« Reply #9 on: May 06, 2018, 03:23:18 pm »
Interesting.  The few schematics I've seen showed 10K.  It is much cleaner now at 3.3K.
 

Offline Ian.M

  • Super Contributor
  • ***
  • Posts: 12864
Re: 10K pullup on signal takes 1us to take it back high
« Reply #10 on: May 06, 2018, 04:01:40 pm »
Looking at it further, there's excessive interaction if you try to use one quad PNP array as a three way current mirror.  Any means of fixing that pushes up the parts count excessively. A better approach would be to use it as two separate current mirrors each with their own current set resistor, which also means you don't need a B-E capacitor so the parts count per line pulled up only goes up by 50% to 1/2  MMPQ2907A  + 1 resistor.
 

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 16621
  • Country: us
  • DavidH
Re: 10K pullup on signal takes 1us to take it back high
« Reply #11 on: May 06, 2018, 09:41:53 pm »
There are all kinds of ways to do a current pull-up especially if the output does not need to go all the way to the positive supply.  A single PNP transistor and resistor can do it if you have an auxiliary supply higher than the logic supply.

I wonder how well a JFET with shorted gate and source would work.  But even a cheap J113 JFET is more expensive than a bipolar transistor and a couple of resistors.

 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19528
  • Country: gb
  • 0999
Re: 10K pullup on signal takes 1us to take it back high
« Reply #12 on: May 15, 2018, 11:31:01 am »
Here's a comparison of different pullups in LTspice.  Sorry I couldn't post it earlier as my PC was down for maintenance and I was posting on a Raspberry Pi.
The trouble with that schematic is it uses non-standard symbols.

Here's a version which should work on all LTSpice installs.

Sorry it took so long by the way.
 

Offline Ian.M

  • Super Contributor
  • ***
  • Posts: 12864
Re: 10K pullup on signal takes 1us to take it back high
« Reply #13 on: May 15, 2018, 12:51:31 pm »
Sorry I forgot to check if all symbols were in the standard install. 

swSPST is only being used as a symbol for a time dependent resistor - you could have just pasted in EuropeanResistor.asy from Misc and set its value to the R= expression on the GIF.   Alternatively, save this as swSPST.asy:
Code: [Select]
Version 4
SymbolType CELL
LINE Normal -15 0 -33 0
LINE Normal 1 -15 -15 0
LINE Normal 15 0 0 0
LINE Normal 31 0 15 0
CIRCLE Normal 3 -13 -1 -17
CIRCLE Normal 2 2 -2 -2
PIN -32 0 NONE 8
PINATTR PinName 1
PINATTR SpiceOrder 1
PIN 32 0 NONE 8
PINATTR PinName 2
PINATTR SpiceOrder 2
« Last Edit: May 15, 2018, 12:54:15 pm by Ian.M »
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19528
  • Country: gb
  • 0999
Re: 10K pullup on signal takes 1us to take it back high
« Reply #14 on: May 15, 2018, 02:00:58 pm »
Sorry I forgot to check if all symbols were in the standard install. 

swSPST is only being used as a symbol for a time dependent resistor - you could have just pasted in EuropeanResistor.asy from Misc and set its value to the R= expression on the GIF.   Alternatively, save this as swSPST.asy:
Code: [Select]
Version 4
SymbolType CELL
LINE Normal -15 0 -33 0
LINE Normal 1 -15 -15 0
LINE Normal 15 0 0 0
LINE Normal 31 0 15 0
CIRCLE Normal 3 -13 -1 -17
CIRCLE Normal 2 2 -2 -2
PIN -32 0 NONE 8
PINATTR PinName 1
PINATTR SpiceOrder 1
PIN 32 0 NONE 8
PINATTR PinName 2
PINATTR SpiceOrder 2
I didn't know about that.

Yes, the ordinary European resistor symbol can be used. To avoid confusion I drew a switch symbol inside the box.
 

Offline Ian.M

  • Super Contributor
  • ***
  • Posts: 12864
Re: 10K pullup on signal takes 1us to take it back high
« Reply #15 on: May 15, 2018, 02:33:57 pm »
Incidentally, there's a much simpler way to set up a source to control a current controlled switch (csw.asy) - simply set its internal resistance to -1 and short it, then use the current through is as the control for the switch.   +1V source voltage gives +1A through it, so you can simply use 0V for open and 1V for closed without needing a negative threshold voltage.   

I see you already know the trick of swapping Ron and Roff to get the opposite switch action - that's very useful if you are modelling a two way switch.

A while back, I took examples\Educational\Vswitch.asc and modified it to use a current controlled switch with a shorted negative resistance source controlling it, as a reminder of how to easily set it up.
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19528
  • Country: gb
  • 0999
Re: 10K pullup on signal takes 1us to take it back high
« Reply #16 on: May 15, 2018, 11:01:37 pm »
Incidentally, there's a much simpler way to set up a source to control a current controlled switch (csw.asy) - simply set its internal resistance to -1 and short it, then use the current through is as the control for the switch.   +1V source voltage gives +1A through it, so you can simply use 0V for open and 1V for closed without needing a negative threshold voltage.   

I see you already know the trick of swapping Ron and Roff to get the opposite switch action - that's very useful if you are modelling a two way switch.

A while back, I took examples\Educational\Vswitch.asc and modified it to use a current controlled switch with a shorted negative resistance source controlling it, as a reminder of how to easily set it up.
I did use a shorted voltage source, with a positive resistance, at one point, but it offended my OCD sensibilities seeing a voltage with a short across it. I think you're right though: it's less messy to use a shorted voltage source, rather than all those external resistors. Next time I'll ignore the OCD side of me.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf