2012-10-06 02:50 AM
Hi, I just bought an evaluation board STM3240G-EVAL
I tried to modify the example provided by ST called ''ADC3_DMA'' but I could not change the pin from what I acquire the signal
For example I wanted to go from pin PF9 to PC4 and I modified the GIPIOF in GPIOC and pin number GPIO_InitStructure.GPIO_Pin = GPIO_Pin_9 as GPIO_InitStructure.GPIO_Pin = GPIO_Pin_4;
but it does not work ....
I attached the main file in this post
what is wrong? please help me, even sending me a main with the corrections to change the pin. :D thanks #stm3240g-eval2012-10-06 03:05 AM
For example I wanted to go from pin PF9 to PC4 and I modified the GPIOF in GPIOC and pin number...
RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_DMA2 | RCC_AHB1Periph_GPIOF, ENABLE); RCC_APB2PeriphClockCmd(RCC_APB2Periph_ADC3, ENABLE); If you change the GPIO pin/port, you should not forget to enable the clock for the new port.
2012-10-06 03:12 AM
Even though I always use the same port GPIOF still does not work, for example if I change only the pin to PF8 to pinPF9 still does not work! I have to change some settings in the DMA? can take a look at the main I have attached to this post? please
________________ Attachments : main.c : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HtTy&d=%2Fa%2F0X0000000aQc%2F7P8iElrPORqAc_1wUsYFvJ4It6tuvr1UpnJrnuwos8o&asPdf=false2012-10-06 05:02 AM
I suggest to try the original example, and follow the sequence of initialization.
When changing the ADC channel, you need to replace the associated GPIO initialization, and all references to the ADC channel(s). And if this ADC channel is bound to a GPIO pin on another port, you additionally need to enable the clock to this port. Cross-check with the reference manual. The related information is spread across several chapters, however (GPIO, ADC). The pin assignment is found in the datasheet, which is separate at ST, for what reason so ever. I do not have the STM3240G-EVAL board, so I can't reproduce your example directly.2012-10-07 02:30 AM
thanks :)
you have been very kindly. tomorrow I will be able to test your advice on my board.I'll let you know how it went! thank you again.2012-10-07 07:09 AM
PC4 does not use ADC3
You will need to address the ADC unit, and channel, as they relate to the specific pin you are using.2012-10-07 07:16 AM
where can I find this information?
where I can see which pins using the ADC1, ADC2 and the ADC3?one last question you know a site or a book with some good tutorial for STM32 microcontroller family?thank you again! :)you've been very kind!2012-10-07 07:55 AM
Take a look in the Eval board reference manual UM1461 available on ST's web site for this device. Table 3.18 plus other connector tables define pin assignments. Many of the ADC3 pins are common with other possible uses such as USB and Ethernet.
Family tutorials are sales brochure oriented. Read the reference manuals and datasheets for the devices being programmed. Application tutorials are also available on the web site. Cheers, Hal2012-10-07 07:57 AM
where can I find this information? where I can see which pins using the ADC1, ADC2 and the ADC3?
The data sheet for the specific chip you are using, and more generally the reference manual for the series. Pay particular attention to the pin association and routing with respect to specific peripherals, channels, etc.http://www.st.com/internet/com/TECHNICAL_RESOURCES/TECHNICAL_LITERATURE/DATASHEET/DM00037051.pdf
Most everything specific to the STM32 part can be found on ST's site under the various ''Design Support'' tabs. You might need to look at a couple of the parts and boards to collect everything that is useful. Review the firmware examples. Information generally related to the ARM parts, and the core, can be found on ARM's site. Documentation for the M3 and M4 Cortex will be useful. For a different perspective, ie not raw data sheets and documentation, you might want to get one of Joseph Yiu's books on the Cortex Mx series parts.2013-04-10 07:59 AM