Level Shifting questions

For questions and comments on programming in general. And for any items that don't fit into the forums below.

Moderators: Benj, Mods

Post Reply
User avatar
Steve001
Valued Contributor
Valued Contributor
Posts: 1189
Joined: Wed Dec 31, 2008 3:37 pm
Has thanked: 460 times
Been thanked: 523 times
Contact:

Level Shifting questions

Post by Steve001 »

Morning

I am working on a project that has a 3.3 Volt IC - MPU9250 9-axis (9DOF) accelerator, gyroscope, and digital compass (magnetometer)
My Breakout Board spec is:

VCC......3.6 to 6V supply (on-board 3.3V regulator)
GND......0V
SCL......I2C serial clock
SDA......I2C serial data
EDA......Auxiliary I2C master serial data
ECL......Auxiliary I2C Master serial clock
AD0......I2C Slave Address LSB (AD0)
INT......Interrupt digital output (totem pole or open-drain)
NCS.....Chip select (SPI mode only)
FSYNC..Frame synchronization digital input. Connect to GND if unused.

I have a few uncertainties as not done a great deal with I2C or SPI I know level shifters exist, do i need them ? could i get away by putting the pull up resistors on the 3.3 Volt side ? as 3.3 Volts will still be detected as a "High" or this this a bit iffy ?

i am also wanting to use the INT to monitor when the IC Detects movement , and unsure I2C or SPI , but if i go SPI i have the chip select voltage isse again

Or should i just use a shifter ?

https://uk.rs-online.com/web/p/voltage- ... s/7092545/

Steve
Success always occurs in private and failure in full view.

mnf
Valued Contributor
Valued Contributor
Posts: 1188
Joined: Wed May 31, 2017 11:57 am
Has thanked: 70 times
Been thanked: 439 times
Contact:

Re: Level Shifting questions

Post by mnf »

Hi Steve,

Depends on the chip limits - but I would use a level-shift. They are easy to use, and in my experience, work very well. There are various options depending on the number of signals needing shifted (and also speed).
You could also use a voltage divider - using a couple of resistors - but this is just one-way (so i2c 5v mcu to 3.3v) 3.3v would probably be recognised as high by most MCUs?
If the chip limits allow it - things may work well without. But 5v into 3.3v may release the magic white smoke that makes all electronics work?

Martin

kersing
Valued Contributor
Valued Contributor
Posts: 2045
Joined: Wed Aug 27, 2008 10:31 pm
Location: Netherlands
Has thanked: 553 times
Been thanked: 1081 times
Contact:

Re: Level Shifting questions

Post by kersing »

Why not use a controller that runs on 3v3 and forgo any level shifting?
“Integrity is doing the right thing, even when no one is watching.”

― C.S. Lewis

User avatar
Steve001
Valued Contributor
Valued Contributor
Posts: 1189
Joined: Wed Dec 31, 2008 3:37 pm
Has thanked: 460 times
Been thanked: 523 times
Contact:

Re: Level Shifting questions

Post by Steve001 »

Hi Martin
mnf wrote:
the magic white smoke
- thats what i am trying to avoid, been there done that :lol:
Have been looking at it this afternoon, decided for a couple of Quid might as well better safe than sorry - trying to do it on the cheep dosnt always work
kersing wrote:
Why not use a controller that runs on 3v3 and forgo any level shifting?
Got other things that are 5 Volts connected to my micro
any recommendation of a level shifter (DIP preferred) , considering the one above from RS

Steve
Success always occurs in private and failure in full view.

mnf
Valued Contributor
Valued Contributor
Posts: 1188
Joined: Wed May 31, 2017 11:57 am
Has thanked: 70 times
Been thanked: 439 times
Contact:

Re: Level Shifting questions

Post by mnf »

Try the TXS0108E - doesn't seem to be available in PDIP package - but there are breakouts available (https://www.amazon.co.uk/AZDelivery-Bi- ... 5v+to+3.3v) for experimentation.

For i2c (or UART to bluetooth for example) the very cheap 4 channel bi-directional boards work well - they might not be quick enough for SPI.. (for example https://www.amazon.co.uk/ARCELI-Channel ... al-Shifter )

Less ICs available in DIP package - see: https://uk.farnell.com/w/c/semiconducto ... -style=dip

Martin

User avatar
Steve001
Valued Contributor
Valued Contributor
Posts: 1189
Joined: Wed Dec 31, 2008 3:37 pm
Has thanked: 460 times
Been thanked: 523 times
Contact:

Re: Level Shifting questions

Post by Steve001 »

Thank You i will go have a look at those
'
Steve

:Edit

Just had a nosey on a site i use for various bit and bats must admit i didnt check here first
(Not as cheep as Amazon, but at least you have access to support, drawings, schematics etc.)

https://www.artekit.eu/products/breakou ... -breakout/

this was also linked

https://www.artekit.eu/using-logic-level-converters/
Success always occurs in private and failure in full view.

mnf
Valued Contributor
Valued Contributor
Posts: 1188
Joined: Wed May 31, 2017 11:57 am
Has thanked: 70 times
Been thanked: 439 times
Contact:

Re: Level Shifting questions

Post by mnf »

i hadn't seen the artekit site before - I usually use CPC (sometimes microchip - but postage is a bit severe for small orders) - but looks very useful. Links to docs etc make life much easier!

Martin

Post Reply