cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F4 SPI high level 5V

Scarlet
Associate III

Sorry, I have another question to ask everyone. I'm currently using the Nucleo F429ZI with SPI interface to receive 12-bit encoded data from another ADC. The Vdrive of that ADC can provide 3.3V or 5V for driving. However, the high level of the STM32F429ZIT6 is 3.3V. If I want the SPI high level to be 5V, what methods can I use to achieve this?

Originally, I was researching GPIO's Open Drain to use an external 5V to accomplish this, but in CubeIDE, the SPI is set to Push-Pull. So I would like to ask, when using STM32, how can I achieve a 5V high level if the SPI requires it?

Scarlet_0-1713766357977.png

 

28 REPLIES 28

Most 5 Volt logic inputs have a specification of 0.7 * VCC = 3.5 Volt for an input to be recognized high. An output from a 3.3 Volt device however is recognised as high nearly in all cases. There are two cases were I would place a 3.3-5 Volt level translator:

1. If minimum quiesent current is needed. At 3.3 Volt the input buffer of the 5 Volt device will draw "substantial" current

2. The device is sold commercial and some ppm non-functional devices is inacceptable

There are 3.3 -> 5.5 Volt level translators, e.g. 74LVC1T45

Ok, so for 3v3 -> 5V level , can use AHCT types, like: 595-SN74AHCT1G86DCKR (mouser, 20ct );

at VDD 5V , for this gate of course . (I use it also for this  3v3 -> 5V conversion at hi speed.)

at 2ns/div:

AScha3_0-1713883757832.png

 

If you feel a post has answered your question, please click "Accept as Solution".

I am currently focused primarily on processing speed.

74LVC1T45 can convert 5V to 3.3V, but it may not interpret 3.3V as a high voltage and output 5V.

Got it, I'll test it using this method. Thanks.

SofLit
ST Employee

Hello,

What is the part number of that ADC? Keeping the IOs as output push-pull, you don't have to add any external hardware if VIHmin (ADC IOs) < VDD of your MCU. 

Most of STM32 IOs are 5 volt tolerant. You need just to check the pin (FT or not).

You can attach the ADC datasheet so we can confirm.

 

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

@Scarlet wrote:

I am currently focused primarily on processing speed.


You actually seem to be focussing on transfer speed rather than processing speed ?

🤔

To improve the overall application performance, can you start processing the early data before the transfer has completed?

74LVC1T45 has dual supply voltage nad so it can do 3.3V to 5 v with a 3.3 and 5 Volt supply.

I used the ADC is AD7366[1].

If I want to use a higher SPI frequency, I need to provide Vdrive 5V, but the MCU output high is 3.3V, which is less than 0.7 * 5V ADC input high voltage.

Scarlet_1-1713921476282.png

Scarlet_0-1713921421625.png

 

[1] AD7366 datasheet

Looking at the ADC’s datasheet page 4, VINH min = 0.7 x Vdrive = 3.5V > VDD MCU. So indeed you need to adapt the voltage of the IO externally in the direction from STM32 to the ADC.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

This is my current architecture:

Scarlet_8-1713923304004.png

 



You actually seem to be focussing on transfer speed rather than processing speed ?


The processing time include

1. Tick MCU

2. MCU to ADC check

3. ADC convert

4. SPI serial read time

5. MCU output 12bit ADC data

Scarlet_7-1713923113234.png

 

This is the time it currently takes for the MCU to obtain ADC 12-bit information:

Blue is CNVST, Yellow is SCK

Scarlet_5-1713922981575.png

So, SPI transfer time only the part of processing time.

 


To improve the overall application performance, can you start processing the early data before the transfer has completed?


I plan to experiment with various methods to reduce processing time.

e.g. DMA, to determine if data acquisition time can be reduced without involving instructions and the CPU