Using 5V peripherals on 3.3V axoloti


#1

I'm looking to use some led matrix or lcd display with the axoloti.

However, most peripherals that I found need 5 volt to be powered. How can I do this?

I found some info on level shifting in the euxoloti thread, but since that concerns analog CV inputs, and I need only digital outputs I was hoping this is not needed.

I found this example, using a MAX7219 to drive an 8X8 led matrix. But the MAX7219 datasheet states it needs at least 4V to operate. Furthermore I'm wondering if the 0-3.3V digital outputs of the axoloti can correctly drive the MAX7219.

Thanks a lot! :smile:


#2

hi,
this was a sunday afternoon project of mine. the max7219 work but sometimes it lost a "BIT"…the datasheet recommend for 3V operations the MAX6951…you can also try to connect the max7219 to axo's 5V supply and check, if the IC responds by the 3,3V SPI commands.


#3

If you just need 5V power, there are +5V pins that I think you could use. In my experience, digital inputs built for 5V would also accept 3.3V and still switch properly.

I recently bought a couple of these: https://www.sparkfun.com/products/10168
They are easy to connect and program, don't use up lots of output pins, and display monochrome graphics. You can buy very cheap variations e.g. with an ebay search for "lcd 5110".


#4

Thanks for the replies guys.

@paul Ah, I didn't notice this was you. Nice job!

@BambiF Good suggestion, I will definitely consider it. I think it might be a bit too much for what I want to do though.

So 3.3V --> 5V will probably work fine.
a) What about 5V --> 3.3V for eg. SPI? Should I put a resistor in between?
b) For I2C both master and slave use the same line for sending, should I put a resistor here?


#5

you can't, there isn't any link to my forum name but thanks.
a) the midi-box project by ucapps uses a 74HC541 Level shifter/buffer for the 3,3V VS 5V issue.


#6

I don't know the best way off-hand. Some general keywords to look for would be: level shifting, voltage divider, zener diode.

The datasheet of the microcontroller built into the Axoloti (I think that's the right one... confirm yourself please) says something about "5V tolerant I/Os". BUT this apparently isn't true for all of the pins. You should be able to find the 5V tolerant ones in the datasheet.

In general, uC inputs have protection diodes built in, so putting a 10k resistor in between should be safe, I think. No guarantees... @paul's 74HC5411 suggestion sounds more like the proper way to do it.


#7

The correct datasheet for the axoloti microcontroller is this one.
Starting from page 45 it lists almost all pins as FT, which means 5V tolerant.
Not sure why we can't use 5V then, (as @johannes said here)?

Since the 74HC5411 only works in one direction, it's not a plausible solution for I2C I guess.


#8

When driving from 3.3V -> 5V, it depends on the device if it will (reliably) work or not, and you can look this up in the datasheets.

First, for the 3.3V device, look up "output high voltage" (VOH) and "output low voltage" (VOL). In case of the axoloti:
VOH >= (VDD - 0.4) = 2.9V (for 3.3V supply)
VOL <= 0.4V
This means the axoloti will output at least 2.9V when high, and at most 0.4V when low.

For the 5V device, you have to look for "input high voltage" (VIH) and "input low voltage" (VIL). For many devices, it will be something like (CMOS standard):
VIH >= 0.7*VDD = 3.5V (for 5V supply)
VIL <= 0.3*VDD = 1.5V
This means that the chip needs to see at least 3.5V to guarantee it interprets it as high. That is a problem, because axoloti only guarantees to output 2.9V. Of course in practice axoloti might output more (close to 3.3V), and the 5V chip might be more sensitive, so it just might work in some situations. But that is not really a solution, because when for example the temperature changes it might change the levels and stop working.

For the low state this example would work, because the axoloti outputs at most 0.4V, and the target chip accepts anything below 1.5V as low.

Some 5V chips have much better characteristics, for example VIH >= 2.0 V is common (TTL standard), which the axoloti will easily drive.

So, in conclusion, you need to look at the datasheet :smile:


#9

Are you sure? Axoloti description says STM32F427, your link is for STM32F405xx & STM32F407xx.


#10

According to the datasheet all IO pins except PA4 and PA5 are indeed 5V tolerant.
If I recall correctly my motivation to recommend 3.3V only, was influence on ADC performance, it is sensitive to injected current, but a closer look indicates it's only sensitive for negative currents.
All ADC-capable pins are configured as analog inputs at startup.


The Xylobox Wavetable Synthesizer (hardware + patches)
#11

@kassu Thanks for the in depth explanation! Really useful info. :smiley:

@BambiF You're right. I didn't have my axoloti this afternoon and based myself on the linker script, which is called "STM32F407xG.ld". The pins are the same though.

@johannes So that means we can safely use the axoloti with 5V peripherals, as long as the peripheral has a VIH >=2.9V? Or is there still something else to take into account?


#12

Early (very limited) prototypes from before 2015 used the '407, all production has the '427.

To drive 5V logic that requires VIH>2.9V, you could configure the output as open-drain, and connect an external pull-up resistor to 5V. Should be fine unless high switching speeds are required.

For I2C, use external pull-ups to +5V for both SDA and SCL, I2C is open-drain anyway.


#13

Do you think this topic could be why I am not getting much out of
Sharp GP2Y0A60SZLF Analog Distance Sensor 10-150cm, 5V ?


#14

I don't think this topic is relevant for the GP2Y0A60SZLF
I have posted some diagnostics here: https://sebiik.github.io/community.axoloti.com.backup/t/axoloti-and-sensors/726/37


#15

Hi. I saw you posted about some nokia lcd monochrome display you are using with axoloti. Does it work? Is it easy to install and program. Im really interested in getting a small display to use with axoloti.


#16

I've used a variation of this: http://www.ebay.de/itm/White-Blue-84-48-Nokia-5110-LCD-Display-Screen-Modul-Module-fur-Arduino-DIY-/272550404978?var=&hash=item3f75452372:m:mXvp1iJ6jT86JUi7rDXHRCw

Cheap and easy to used. I have not used it with the Axoloti though, only with ATMega32u4.


#17

Oh i see. I have a feeling that its not. Very simple to use with axoloti. Thanks for answering!


#18

If it is logic level conversion, I can suggest these PCBs from Sparkfun -


They are only $3, have four channels of bi-directional conversion and are very small. They also link to the schematic if you just want to incorporate the circuit into your designs.