2024-04-21 11:22 PM
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?
2024-04-22 09:11 AM
Hello @Scarlet ,
It's possible to setup the configuration described and speaking about 5V tolerant pins only in input mode.
When the output mode is enabled, the GPIO is no more 5V tolerant.
It could work based on next principle for I2C. Taking into consideration that problematic could be difference between VDD and VDDx, which should never exceed 3.6 V:
2024-04-22 09:38 AM
>The Vdrive of that ADC can provide 3.3V
So use this 3v3 setting and you are on the safe side.
>If I want the SPI high level to be 5V, what methods can I use to achieve this?
Only for inputs (here) can use a voltage divider, like 2k - 3k3 -gnd. So input at 3v3 max.
Or a 5v tolerant gate as level shifter at 3v3 VDD (VHC or UHC series have such ).
2024-04-22 09:39 AM
2024-04-22 06:01 PM - edited 2024-04-23 05:12 AM
Because this ADC can use a higher SPI frequency with a Vdrive of 5V, I want to try if it's possible to reduce processing time.
2024-04-22 07:39 PM
Hi @Imen.D,
Originally, I planned to use the Open Drain method to provide external 5V, but in CubeIDE, the SPI setting is configured as Push Pull. I cannot guarantee that when outputting a high level, the 5V won't flow to the STM32 VDD 3.3V.
2024-04-22 09:17 PM - edited 2024-04-22 09:43 PM
Or a 5v tolerant gate as level shifter at 3v3 VDD (VHC or UHC series have such ).
I will check the level shifter aspect. I plan to use the MAX14850AEE for voltage conversion, but this is not the optimal solution. However, I will further research this area. Thanks.
Only for inputs (here) can use a voltage divider, like 2k - 3k3 -gnd. So input at 3v3 max.
The voltage divider is like this?:
2024-04-22 11:36 PM - edited 2024-04-23 02:06 AM
>The voltage divider is like this?: yes, but without the short to 5V . :)
But need lower impedance resistors, at 2k /3k3 it might work up to 10MHz - but never 50MHz.
+
as level shifter gates i use something like this :
SN74LVC1G86 (single XOR gate ; at mouser 20ct , 595-SN74LVC1G86DCKR )
so need one for every line :
At 50MHz this is the way to go ; LVC gate can switch in 1.3ns at 3v3 (50pF load), so perfect here.
2024-04-23 01:48 AM
Open drain and about 50 Mhz is probably no good combination, either current hungry or with bad waveforms.
2024-04-23 05:28 AM
I've noticed that something I said earlier could be misunderstood.
I'm currently outputting SCK from MCU to ADC, and then transferring ADC data back to the MCU.
So, the method of converting MISO from 5V to 3.3V is feasible, but if it's MCU SCK from 3.3V to 5V for the ADC, might need a different approach.
Thank you so much.