Author Topic: Level Shift  (Read 3118 times)

0 Members and 1 Guest are viewing this topic.

Offline TnixswTopic starter

  • Contributor
  • Posts: 47
  • Country: au
Level Shift
« on: August 22, 2025, 03:18:59 am »
HI all, I am not an engineer by any stretch of the imagination and am having trouble level shifting a system clock signal which is +6V to -12V from some 1970's digital equipment of which a non-obtainium part has failed. I would like to replace this using a modern micro but need to use a 0 - 5V input signal. The actual signal is +6V for about 5uS and -12V for around 1uS - see attached. All I need is to capture as close as possible, the leading edge of the low going pulse. So far from my simple ideas, I am getting what looks like a discharging capacitor causing timing issues.

Any help appreciated, thank you

Tony
 

Offline PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 3438
  • Country: au
Re: Level Shift
« Reply #1 on: August 22, 2025, 03:25:49 am »
I would like to replace this using a modern micro but need to use a 0 - 5V input signal. The actual signal is +6V for about 5uS and -12V for around 1uS - see attached.
0-5v is within +6 to -12 so a simple clamp will do. ie a series R and diodes to V+ and GND, or a series R and a diode+resistor to GND

Or, a resistors only solution also exists, that avoids going > 100mV outside the rails.: 

11k series , 47k to GND, 4k7 to +5V gives -83mV to 4.953V from -12V~+6V, rise time of appx 60ns into 10pF load.
or 11.3k, 51k, 4k7 gives 5mV to 4.970V from -12V~+6V, but a clock signal does not need to be anything like that precise.



All I need is to capture as close as possible, the leading edge of the low going pulse.
Capture by what, to what resolution?
« Last Edit: August 22, 2025, 03:58:37 am by PCB.Wiz »
 

Offline pqass

  • Super Contributor
  • ***
  • Posts: 1193
  • Country: ca
Re: Level Shift
« Reply #2 on: August 22, 2025, 04:51:52 am »
See attached for some solutions (incl. a couple noted by PCB.Wiz).  I like the transistor-based options.   Simulation is here.
 
The following users thanked this post: MathWizard

Offline TnixswTopic starter

  • Contributor
  • Posts: 47
  • Country: au
Re: Level Shift
« Reply #3 on: August 22, 2025, 05:23:59 am »
Capture by what, to what resolution?

Thank you for the reply.

My processor has to have new data ready in an output buffer only during the LO period of the clock signal then as soon the clock goes HI, this data will appear on a common serial bus until the clock goes LO again. With my simple methods producing a skewed low input signal, this is proving a headache. Having the data ready is no problem, it is making sure it is in the buffer only during the 1uS LO clock, so I need an input signal that follows the LO going clock edge as closely as possible to trigger the transfer. Attached is a clock signal showing the relationship with some 1000001 data bits below

I tried a 1N4148 with resistor to ground and get a capacitive discharge type of signal longer than the LO pulse. I'll try the other values you mention.

cheers

Tony
 

Offline TnixswTopic starter

  • Contributor
  • Posts: 47
  • Country: au
Re: Level Shift
« Reply #4 on: August 22, 2025, 05:26:56 am »
Thanks 'pqass' I will try the suggestions.
 

Offline PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 3438
  • Country: au
Re: Level Shift
« Reply #5 on: August 22, 2025, 05:39:43 am »
I tried a 1N4148 with resistor to ground and get a capacitive discharge type of signal longer than the LO pulse. I'll try the other values you mention.

What value resistor did you use, and what load capacitance (scope probe on x10 ? )

What is the rise/fall times of your clock?

If your load C is significant, (10's of pF) you can add a small C in parallel with the 11k series resistor, to shave off some RC rise time effects. About 39% of your load C is ideal, you then match the source fall time.

That will be the fastest leading delay, as there is no Td or Ts effects of an active part.
 

Offline TnixswTopic starter

  • Contributor
  • Posts: 47
  • Country: au
Re: Level Shift
« Reply #6 on: August 22, 2025, 07:02:28 am »
Probe on 10x

I setup the PNP transistor solution using a BC558 (all I had) and got the results in image which is similar to all the tries I have had so far. Clock (yellow), Emitter out (Blue), Processor out (Purple). The processor is just running a small loop to detect HI and LO input. I tried another faulty original board and this one has a slightly faster clock rate. I'll try the resistive solution, but bread-boarded connected by leads to the original IC's might be adding to the problem.
 

Offline PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 3438
  • Country: au
Re: Level Shift
« Reply #7 on: August 22, 2025, 07:26:12 am »
Probe on 10x

I setup the PNP transistor solution using a BC558 (all I had) and got the results in image

Was that with 4k7 and 330 ?

Spice says that should be << 100ns, on leading edge, did you wire it correctly, or does it have a very large load C ?

If I flip the PNP backward, spice gets close to that terrible.
« Last Edit: August 22, 2025, 07:28:21 am by PCB.Wiz »
 

Offline pqass

  • Super Contributor
  • ***
  • Posts: 1193
  • Country: ca
Re: Level Shift
« Reply #8 on: August 22, 2025, 07:49:30 am »
Quote
... Emitter out (Blue), ...

PNP emitter should be tied to +5V, right? 
With the collector as the output and a 330R to ground? 
See the PNP option in the attachment in my last message.

Also, I forgot to mention that the all transistors have "storage charge" which introduces an off delay of typically 1us or so.  I discuss it here.  You can eliminate the delay by just putting a 100pF cap across the base resistor.

Also, another solution may be to just use a 74HC125 buffer (Vcc=+5V) with a 1K resistor on its input.  According to the datasheet, IIK "Input clamp current(2)" is +/-20mA  with "Note (2): The input and output voltage ratings may be exceeded if the input and output current ratings are observed."  i.e. a level shifter that can handle input voltages beyond its supply rails.



 

Offline TnixswTopic starter

  • Contributor
  • Posts: 47
  • Country: au
Re: Level Shift
« Reply #9 on: August 22, 2025, 01:36:14 pm »
Arrrg - long day, you were absolutely correct pqass, reversed transistor. New image attached, looks great. As you also mention there is a 1uS lag on the falling edge but that is of no consequence. Many thanks for your help, I can now move forward.

 

Offline aeg

  • Frequent Contributor
  • **
  • Posts: 506
  • Country: us
Re: Level Shift
« Reply #10 on: August 23, 2025, 01:53:02 am »
Also, another solution may be to just use a 74HC125 buffer (Vcc=+5V) with a 1K resistor on its input.  According to the datasheet, IIK "Input clamp current(2)" is +/-20mA  with "Note (2): The input and output voltage ratings may be exceeded if the input and output current ratings are observed."  i.e. a level shifter that can handle input voltages beyond its supply rails.

This is not a good idea. As stated in Note (1), the +-20mA clamp current is "stress ratings only, which do not imply functional operation of the device". When you exceed the input voltage range of 0V to Vcc, specified in the recommended operating conditions, there is no guarantee that the device will meet the characteristics shown in the datasheet, or that it will even operate as a buffer.

(Edited to be less nasty and more informative)
« Last Edit: August 23, 2025, 02:22:39 am by aeg »
 

Offline pqass

  • Super Contributor
  • ***
  • Posts: 1193
  • Country: ca
Re: Level Shift
« Reply #11 on: August 23, 2025, 03:52:35 pm »
Also, another solution may be to just use a 74HC125 buffer (Vcc=+5V) with a 1K resistor on its input.  According to the datasheet, IIK "Input clamp current(2)" is +/-20mA  with "Note (2): The input and output voltage ratings may be exceeded if the input and output current ratings are observed."  i.e. a level shifter that can handle input voltages beyond its supply rails.

This is not a good idea. As stated in Note (1), the +-20mA clamp current is "stress ratings only, which do not imply functional operation of the device". When you exceed the input voltage range of 0V to Vcc, specified in the recommended operating conditions, there is no guarantee that the device will meet the characteristics shown in the datasheet, or that it will even operate as a buffer.

(Edited to be less nasty and more informative)

I would normally agree but this part is specifically used in 5V to 3.3V level-shifting. 
So adding a 1K input resistor would guarantee no more than 12mA at -12V and 6mA at +6V, which is within spec.
 

Offline aeg

  • Frequent Contributor
  • **
  • Posts: 506
  • Country: us
Re: Level Shift
« Reply #12 on: August 23, 2025, 11:11:09 pm »
I would normally agree but this part is specifically used in 5V to 3.3V level-shifting. 

No, it's not. 74HC125 is not appropriate for 5V to 3.3V level shifting. 74AHC125 has different ESD structure and is appropriate for 5V to 3.3V level shifting. Neither one is OK to routinely handle a -12V input.

So adding a 1K input resistor would guarantee no more than 12mA at -12V and 6mA at +6V, which is within spec.

No, it's not. Spec for functional operation (in recommended operating conditions) is Vi of 0V to Vcc. Not -0.6V to Vcc+0.6V. All functional and parametric characteristics go out the window when you dump current into the substrate through the ESD diodes.
 

Offline bingo600

  • Super Contributor
  • ***
  • Posts: 2316
  • Country: dk
Re: Level Shift
« Reply #13 on: August 24, 2025, 07:55:44 pm »
+6v and -12v ...

Could you sneak in a MAX232 ?

 

Offline PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 3438
  • Country: au
Re: Level Shift
« Reply #14 on: August 24, 2025, 08:20:07 pm »
+6v and -12v ...

Could you sneak in a MAX232 ?
That would be level compatible, but no where near fast enough.
 

Offline ledtester

  • Super Contributor
  • ***
  • Posts: 4275
  • Country: us
Re: Level Shift
« Reply #15 on: August 25, 2025, 12:48:11 am »
+6v and -12v ...

Could you sneak in a MAX232 ?
That would be level compatible, but no where near fast enough.

I was actually looking into trying it or possibly simulating it. I'm holding out hope that it could work since you're only using the receive circuitry.
 

Online langwadt

  • Super Contributor
  • ***
  • Posts: 5854
  • Country: dk
Re: Level Shift
« Reply #16 on: August 25, 2025, 01:12:10 am »
I would normally agree but this part is specifically used in 5V to 3.3V level-shifting. 

No, it's not. 74HC125 is not appropriate for 5V to 3.3V level shifting. 74AHC125 has different ESD structure and is appropriate for 5V to 3.3V level shifting. Neither one is OK to routinely handle a -12V input.

So adding a 1K input resistor would guarantee no more than 12mA at -12V and 6mA at +6V, which is within spec.

No, it's not. Spec for functional operation (in recommended operating conditions) is Vi of 0V to Vcc. Not -0.6V to Vcc+0.6V. All functional and parametric characteristics go out the window when you dump current into the substrate through the ESD diodes.

depends on who you ask, https://assets.nexperia.com/documents/data-sheet/74HC_HCT125.pdf

 

Offline MathWizard

  • Super Contributor
  • ***
  • Posts: 2561
  • Country: ca
Re: Level Shift
« Reply #17 on: August 26, 2025, 07:04:35 am »
So what about trying a cascode amplifier? How much faster would the 2 BJT version be ? I'll have to try that myself in LTSpice.

1us low time is pretty fast, I think the ATmega Arduino family is based off stuff from the 1970's, so yeah maybe that's why common Atmel MCU's are usually too slow for much stuff w/ 1us signals.

But it makes me wonder how anything got done, like in TV's w/ VHF/UHF. Going by op-amps, I guess all these discrete circuits had pretty low gain to get any high speed.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 

- - -
-->