CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

hardware -- mixing 5V and 3.3V stuff

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
teletype-guy



Joined: 11 Oct 2005
Posts: 8
Location: AZ

View user's profile Send private message Visit poster's website

hardware -- mixing 5V and 3.3V stuff
PostPosted: Sat Mar 16, 2013 5:31 pm     Reply with quote

Part 1:

Hi folks: There does not seem to be a place for hardware topics here (Darren?), so I am sticking this here in case it is of any interest, and also so I can point someone here from another thread.

I have been using 5V pics and 74HC logic for years, and, like others, found the need to migrate to a 3.3V micro, but still need to interface with 5V control signals as needed. Or the other way around: A 5V micro talking to 3.3V peripherals. It is a bit more complicated than it might seem at first. So a few things I have learned:

A cmos logic family like HC or LV (or the old metal-gate-4000-series) has two inherent diodes on each input: a diode that clamps negative-going signals (K-to-input/A-to-gnd), and a diode that clamps positive-going signals (A-to-input/K-to-vcc). While these are part of the semi process, they also help keep the signals clamped (eg: under/overshoot due to inductance in the input trace). These diodes can be handy: I often use a 47K series input resistor on an HC gate so I can handle an input signal of up to +/-15V from an external input (cheap 232 input...) -- the diodes clamp to a safe level for the gate and the current is way-limited.

CMOS Logic families that run at both 5V and 3.3V:
Both HC and LV can (but HC does not provide AC specs at 3.3). AHC is similar to HC but a little faster (more radiated emi, more current drive resulting in more undershoot...). AC is some oddball family nobody seems to use. A fav of mine, LV-A can also do 3.3 or 5 (more detail below).

The LV-A family from TI (eg: TI's 74LV00A instead of NXP's 74LV00) REMOVES the upper clamp diode from the inputs. This is so it can be run at 3.3V and is 5V-TOLERANT on the inputs. When you see any chip listing 5V-TOL inputs (not just logic chips but some PICs and peripheral chips), it means the upper clamp diode is gone and usually any input over about 6V will toast the chip.

CMOS Logic families that run only at 3.3V: LVX is a good sub for LV, but only runs at 3.3. LVC and LCX are faster with a lot more current drive.

When running at 3.3V, families that ARE 5V-tolerant:
LV-A, AHC (except transceivers?), LVX, LVC, LCX, LVT

When running at 3.3V, families that are NOT 5V-tolerant:
LV, HC, AC, ALVC


Part 2 coming up...
teletype-guy



Joined: 11 Oct 2005
Posts: 8
Location: AZ

View user's profile Send private message Visit poster's website

hardware -- mixing 5V and 3.3V stuff (part 2)
PostPosted: Sat Mar 16, 2013 5:56 pm     Reply with quote

Part 2:

Logic levels for "real" cmos are 30% and 70% of VCC. So,
at 5V-vcc: max-low and min-high levels are 1.5V and 3.5V
at 3.3V-vcc: max-low and min-high levels are 1.0V and 2.3V
(at 3.3V it is sometimes called LVCMOS).

"Real" cmos families include: 4000, HC, AC, AHC, LV-A (approx), LVX

Logic levels for "TTL-compatible-input" cmos are the same for:
5V-vcc (called TTL-input), and 3.3V-vcc (called LVTTL),
however, the max-low and min-high levels are the same: 0.8V and 2.0V

"TTL-compatible-input" cmos families include:
HCT, AHCT, ACT, LV (at 3.3V), LVC, LCX, ALVC, LVT


Part 3 coming up...
teletype-guy



Joined: 11 Oct 2005
Posts: 8
Location: AZ

View user's profile Send private message Visit poster's website

hardware -- mixing 5V and 3.3V stuff (part 3)
PostPosted: Sat Mar 16, 2013 6:36 pm     Reply with quote

Part 3:

OK, the first two parts were background detail. Here is what I do for 5V, 3.3V, and conversions:

5V-only systems: HC is ancient now, but it is still an awesome family. Not too fast and not too much current drive -- keeps signals clean and emi and crosstalk low. Newer option: LV-A (or maybe LV, or AHC, or VHC).

3.3V-only systems: HC will run, but has no AC specs. Newer option: LV-A or LVX (or maybe LV, or AHC, or VHC).

Faster 3.3V-only (more emi...): LVC, or LCX

Converting 5V CMOS to 3.3V voltage levels:
5V cmos output (eg: HC, AHC, AC), to 3.3V-powered cmos (w/ 5V-tolerant inputs)
>>> Use: LV-A, LVX, LVC, or LCX, (maybe AHC) running on 3.3V
(>>> DO NOT USE: HC, AC, LV, or ALVC)

Converting 5V TTL to 3.3V voltage levels:
5V ttl output (eg: LS), to 3.3V-powered cmos (w/ 5V-tolerant inputs)
>>> Use: LVC, or LCX running on 3.3V
(>>> DO NOT USE: HC, AHC, AC, LV-A, LVX, LV, or ALVC)

Converting 3.3V LVCMOS to 5V voltage levels:
3.3V LVCMOS output (VOH is 3.0V min; lightly-loaded) (eg: LV-A, LVX, LV, LVC, LCX HC, AHC, or AC)
to 5V TTL input (VIH is 2.0V min) (LVCMOS conversion – some delta-ICC input current when VOH only reaches 3.0V)
>>> Use: AHCT running on 5V (standard or schmitt).
(>>> DO NOT USE: HCT or ACT)

Converting 3.3V LVTTL to 5V voltage levels:
3.3V LVTTL output (VOH is 2.4V min.) (eg: LVT)
to 5V TTL input (VIH is 2.0V min) (even-more delta-ICC input current when VOH only reaches 2.4V)
>>> Use: AHCT running on 5V (standard or schmitt).
(>>> DO NOT USE: HCT or ACT)

Hope this helps -- gil smith
temtronic



Joined: 01 Jul 2010
Posts: 9246
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Sat Mar 16, 2013 7:22 pm     Reply with quote

great...

so HC cmos is 'ancient'... sigh...I have tubes of them in the shop !!!

AND

I used to repair ASR-33s as well....
Man , I feel like a dinosaur...

I did see that Sparkfun has some 5v<->3v convertors which would eliminate 99% of the 'MM/SD' card won't work problem we see here weekly !!

it might be nice to have a 'hardware' forum.....

hth
jay
teletype-guy



Joined: 11 Oct 2005
Posts: 8
Location: AZ

View user's profile Send private message Visit poster's website

the bottom-line on 3.3-to-5v conversion
PostPosted: Sat Mar 16, 2013 10:53 pm     Reply with quote

Hi Jay:

So I'll have to call you when my ASR33 needs a tweak! I also have M14s, 15s, 28s, 31s, 35s, 43s...

I think the sparkfun 5-3V converters are just a mosfet/pullup design, like the app note NXP put out for converting different voltage I2C busses. Fine for a 400KHz i2c bus, but the pullup design leads to slow rise times, so it is not a good design for general logic conversion. I would not use it for an SD card or other hi-speed spi interface.

MY BOTTOM-LINE ON 3.3-to-5V:

- 3.3-to-5V: 3.3v signal connects to 5v-powered AHCT gate (or HCT in a pinch, with a bit more transient power consumption), and then to 5V pic inputs. Alternatively, if a 5v-powered-pic input is "ttl-compatible" when running at 5V, it will work fine without an interface gate -- look at the dc spec sheet, as every pin is different.

- 5-to-3.3V: 5v signal connects to a 3.3v-powered LV-A gate, or to a peripheral input, which is 5V-tolerant.

gil
Ttelmah



Joined: 11 Mar 2010
Posts: 19552

View user's profile Send private message

PostPosted: Sun Mar 17, 2013 3:03 am     Reply with quote

One of the best 'overviews', is:
<http://www.interfacebus.com/voltage_threshold.html>

Which shows input thresholds and output levels for the commonest families (they miss things like DTL...). Follow the link on the page to the bus threshold levels, and to the glue logic family selection guide as well.

I'll 'raise you', some strips of metal cased DTL logic on my shelf. However the oldest stuff I have predates me. Things like coherers (my uncle was a radio amateur before WWII, and went straight into radar at the start of the war).

Best Wishes
teletype-guy



Joined: 11 Oct 2005
Posts: 8
Location: AZ

View user's profile Send private message Visit poster's website

PostPosted: Sun Mar 17, 2013 10:38 am     Reply with quote

Hey ttelmah:

Yeah, that's a good little chart for input voltages, though I disagree with the cmos levels a bit. To really study it in detail you have to look at the output level range of the source logic as well, though you can simplify it if you presume that lightly-loaded cmos outputs are pretty-much gnd-to-vcc, which makes it easy to match a 3.3v cmos signal to a 5v-powered ttl-compatible-input like an AHCT gate (or some pic pins directly).


Metal-cased dtl -- that sounds like something to hang onto. Very little dtl or rtl around anymore. I have some ceramic i4004 parts I quite like.

gil
gpsmikey



Joined: 16 Nov 2010
Posts: 588
Location: Kirkland, WA

View user's profile Send private message

PostPosted: Sun Mar 17, 2013 10:52 am     Reply with quote

temtronic wrote:
great...

so HC cmos is 'ancient'... sigh...I have tubes of them in the shop !!!

jay


Hey, don't feel bad, I still have boxes of tubes stashed away (yes, vacuum tubes - back when the plate supply helped weed out the careless :-) )

mikey
_________________
mikey
-- you can't have too many gadgets or too much disk space !
old engineering saying: 1+1 = 3 for sufficiently large values of 1 or small values of 3
Ttelmah



Joined: 11 Mar 2010
Posts: 19552

View user's profile Send private message

PostPosted: Sun Mar 17, 2013 11:33 am     Reply with quote

Yes, you have to look at all the other links and output tables as well. On the CMOS, there is a bit of a 'problem' here that in the early days, the manufacturers disagreed with themselves, and some of the early specs changed with time. I have three early Motorola data sheets for individual members of the 4000 series chips, that disagree with each other over the thresholds...

Still use valves. For some stuff like radar they are still the best thing. A friend runs a company getting them custom made in central Europe. Has over 3E6 in stock!.

Best Wishes
bkamen



Joined: 07 Jan 2004
Posts: 1615
Location: Central Illinois, USA

View user's profile Send private message

PostPosted: Sun Mar 17, 2013 1:19 pm     Reply with quote

Don't feel bad -- I have an old US military portable tube tester on my shelf...

AND -- I have (2) 100W class-AB audio amps from 1959.

You guys aren't alone.

:D

BTW, there are some 74 series style logic IC's that convert between voltages that are nice if you need them:

SN74LVC2G17DBV

dual input->output level converters.

-ben
_________________
Dazed and confused? I don't think so. Just "plain lost" will do. :D
teletype-guy



Joined: 11 Oct 2005
Posts: 8
Location: AZ

View user's profile Send private message Visit poster's website

PostPosted: Sun Mar 17, 2013 8:04 pm     Reply with quote

Quote:
BTW, there are some 74 series style logic IC's that convert between voltages that are nice if you need them:

SN74LVC2G17DBV

dual input->output level converters.


Hey Ben: Yeah those are handy, but I have always stayed away from specialized or single-sourced parts that may not be around when I need to source them for a pcb build, especially when I can use a garden variety 74xx00/04/whatever to do the same thing.

The smaller 1-gate or 2-gate packages are handy sometimes though, especially if you just need one inversion or level-conversion, and can squeeze in a sot-23.

gil
bkamen



Joined: 07 Jan 2004
Posts: 1615
Location: Central Illinois, USA

View user's profile Send private message

PostPosted: Mon Mar 18, 2013 7:42 am     Reply with quote

teletype-guy wrote:
Quote:
BTW, there are some 74 series style logic IC's that convert between voltages that are nice if you need them:

SN74LVC2G17DBV

dual input->output level converters.


Hey Ben: Yeah those are handy, but I have always stayed away from specialized or single-sourced parts that may not be around when I need to source them for a pcb build, especially when I can use a garden variety 74xx00/04/whatever to do the same thing.

The smaller 1-gate or 2-gate packages are handy sometimes though, especially if you just need one inversion or level-conversion, and can squeeze in a sot-23.

gil



yea, that was just an example -- not by any means a 'rule'...

Cheers,

-Ben
_________________
Dazed and confused? I don't think so. Just "plain lost" will do. :D
asmboy



Joined: 20 Nov 2007
Posts: 2128
Location: albany ny

View user's profile Send private message AIM Address

PostPosted: Mon Mar 18, 2013 9:00 am     Reply with quote

i should post this anonymously but.......

confession:

i got out of a design jam

( i inherited) by meeting in the middle.

i HAD to add a 3.3v part to a 5v design.

the design had an adjustable 5v regulator and i changed
the set point to 4.0v

problem solved

NOW everybody can pile on
Very Happy Very Happy Very Happy
Ttelmah



Joined: 11 Mar 2010
Posts: 19552

View user's profile Send private message

PostPosted: Mon Mar 18, 2013 9:50 am     Reply with quote

Lucky to have the adjustable reg. Smile

We have suggested this on some other threads in the past, with 'tricks' like adding a couple of diodes to drop just over a volt. Many of the 5v PIC's for example are rated for 4v operation at full clock rates. Can be a much simpler solution....

Best Wishes
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group