cancel
Showing results for 
Search instead for 
Did you mean: 

ADC3 channel 7 in discoveryf4 board

s239955_stm1_st
Associate II
Posted on January 03, 2015 at 13:43

hi

i want to test an example in

http://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=2&ved=0CCMQFjAB&url=http://tech.munts.com/MCU/Frameworks/ARM/stm32f4/libs/STM32F4xx_DSP_StdPeriph_Lib_V1.1.0/Project/STM32F4xx_StdPeriph_Examples/Library_Examples.html&ei=2-GnVJ3BLtbWapjsgbgI&usg=AFQjCNEjB2BBkaj7RwcjAQ3zP9XtKQeb5g&sig2=qUX...

that explains ADC3 using channel7 with DMA

there is Configure ADC Channel7 pin as analog input

  GPIO_InitStructure.GPIO_Pin = GPIO_Pin_9;

  GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AN;

  GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL ;

  GPIO_Init(GPIOF, &GPIO_InitStructure);

now i can not find

GPIOF_pin_9 on the discovery board

what should i do now? can i replace it with another pin from another port?

#!winning-rtfm
8 REPLIES 8
Posted on January 03, 2015 at 14:48

The examples target the EVAL series boards, not the DISCOVERY ones.

You should review the

http://www.st.com/st-web-ui/static/active/en/resource/technical/document/user_manual/DM00039084.pdf

to understand the free/available pins on the board, or more generally from the part

http://www.st.com/st-web-ui/static/active/en/resource/technical/document/datasheet/DM00037051.pdf

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

i did not found any information in none of above doc's

only thing i found is in the stdperiph_lib :(in the stm32f4xx_adc.c)

  *          ===================================================================

  *                                   How to use this driver

  *          ===================================================================

  *          1.  Enable the ADC interface clock using

  *                  RCC_APB2PeriphClockCmd(RCC_APB2Periph_ADCx, ENABLE);

  *     

  *          2. ADC pins configuration

 

  *               - Enable the clock for the ADC GPIOs using the following function:

 

  *                   RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOx, ENABLE);   

  *                - Configure these ADC pins in analog mode using GPIO_Init();  

  *

  *          3. Configure the ADC Prescaler, conversion resolution and data

  *              alignment using the ADC_Init() function.

  *          4. Activate the ADC peripheral using ADC_Cmd() function.

  *

dose it means than i can change it to any port and any pin?

something like

  GPIO_InitStructure.GPIO_Pin = GPIO_Pin_6;

  GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AN;

  GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL ;

  GPIO_Init(GPIOE, &GPIO_InitStructure);

if not, what should i do?

i could not find any information in above doc's

----------------------------------------------------------------------------

and another question:

in the discovery board, do i need to connect any VDD or VSS for +Vref and or -Vref?

again, i did not find any information in the discovery stm32f4 manual!
Posted on January 03, 2015 at 18:29

i could not find any information in above doc's

 

 

and another question:

 

in the discovery board, do i need to connect any VDD or VSS for +Vref and or -Vref?

 

again, i did not find any information in the discovery stm32f4 manual!

Yeah, you're going to get a lot better at reading documentation and schematic. The PIN information IS in the User Manual. The STM32 CPU is powered via 3V, the +VREF is 3V the -VREF is GROUND, they are already connected and functioning.

0690X00000605E7QAI.png

You need to adapt code targeting the EVAL board to use pins that are available on the DISCO board.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
s239955_stm1_st
Associate II
Posted on January 03, 2015 at 19:07

ok

thanks

i saw that(ADC123) in the manual, but i needed to know corresponding GPIO pins with ADC3 and

Indeed

i couldn't understand that what is that(ADC123) ?

i mean that in the enabling RCC, which ADC should i Enable ?

  RCC_APB2PeriphClockCmd(RCC_APB2Periph_ADC3, ENABLE);

this is very vague for me!

what is ADC123 ?

ADC3, ADC2 or ADC1 ?
s239955_stm1_st
Associate II
Posted on January 03, 2015 at 19:26

sorry

another quotation

if i had to change the ADC3, how should i find ADC_DR Address?

i need to find it to config DMA peripheral Base Address
Posted on January 03, 2015 at 19:28

ADC123 means the pins are routed to all three ADC input muxs. ADC1, ADC2 and ADC3

Not all ADC input pins connect to all the ADC, but rather a subset. You should refer to the pin tables in the DATA SHEET to see the options for specific parts and pin outs. The

http://www.st.com/st-web-ui/static/active/en/resource/technical/document/reference_manual/DM00031020.pdf

will also describe the ADC pin mux.

PC1 and PC2 being specific pins identified in the USER MANUAL as available on your board, and being Channels 11 and 12 respectively. They might be confusing, but they are not vague.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on January 03, 2015 at 19:30

if i had to change the ADC3, how should i find ADC_DR Address?

Suggest you use (uint32_t)&ADC3->DR and let the compiler do the work. Pretty sure I've posted several ADC examples over the years.

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

thank you very much

yes 🙂

really confusing!