2015-01-03 04:43 AM
hi
i want to test an example in 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-rtfm2015-01-03 05:48 AM
The examples target the EVAL series boards, not the DISCOVERY ones.
You should review thehttp://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 parthttp://www.st.com/st-web-ui/static/active/en/resource/technical/document/datasheet/DM00037051.pdf
.2015-01-03 08:44 AM
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!
2015-01-03 09:29 AM
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. You need to adapt code targeting the EVAL board to use pins that are available on the DISCO board.
2015-01-03 10:07 AM
ok
thanks i saw that(ADC123) in the manual, but i needed to know corresponding GPIO pins with ADC3 andIndeed
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 ?2015-01-03 10:26 AM
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 Address2015-01-03 10:28 AM
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 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.2015-01-03 10:30 AM
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.2015-01-03 11:14 AM
thank you very much
yes :) really confusing!