cancel
Showing results for 
Search instead for 
Did you mean: 

GPIO port on fly selection mechanism in stm32f4xx

armindavatgaran
Associate III
Posted on June 05, 2015 at 09:41

Hello

If i want to connect output of an ADC(analog to digital converter) to two different ports, e.g. GPIOA and GPIOB, and to modify this selection by means of software code(no hardware modification needed), how is it possible?

Is it adequate to connect ADC output to all of the intended pins and choose desired channel by modification of GPIO pins mode(input/output)?

Thanks.

 
7 REPLIES 7
armindavatgaran
Associate III
Posted on June 05, 2015 at 16:00

May configuring the unused(undesired) port pins in input floating mode be a solution, any other idea? 

Posted on June 05, 2015 at 17:04

An external ADC? I'm not sure I follow your logic here, or what the problem is.

You can code software to do a host of things, for the internal ADC you can select which channel (pin) you want to convert.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
es131245
Associate II
Posted on June 05, 2015 at 17:14

ADC channels are made for that. Pins are fixed but there are like 12 of them! Check the datasheet pinouts.

To configure use alternative function mode. There are examples in libraries.

armindavatgaran
Associate III
Posted on June 05, 2015 at 18:03

I try to clarify my problem:

I should connect digital output of a 60Msps ADC to two different ports, one of them as a gpio and the other in alternate function mode.

If i want to use port1(e.g. GPIO) at a time, isn't there any concern about the other port that is connected to the bus?how should it be configured to avoid any interaction with active port?Is any need for analog switches or multiplexers?

 

Posted on June 05, 2015 at 18:13

60Msps seems a bit high

If you have a digital signal coming into the STM32 via two pins, you'd really want both in ''input'' mode, either explicitly configured as such, or in AF mode where the peripheral is expecting the pin to be an input. ie USART1_RX

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
armindavatgaran
Associate III
Posted on June 05, 2015 at 20:13

I think this is helpful:

http://www.eevblog.com/forum/microcontrollers/gpio-port-on-fly-selection-mechanism/

Posted on June 05, 2015 at 20:41

Perhaps, but I honestly don't see how your method is going to function in a remotely useful/practical way. Thought about reading via the DCMI, or a FIFO device attached thereto, it's rated at 54 MHz?

Think about the problem you're *actually* trying to solve, and solve that.

The data has to go somewhere, and you need to be able to process it.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..