2015-04-14 12:55 AM
Hello
I have a nucleo STM32F103, I put a external clock of 25MHz.How can i read a analog signal conected in PB8?Someone can help me??Best regards #analog-input #nucleo-f103rb2015-04-14 05:21 AM
- set ADC configuration, enable adc channels, GPIO set as ''analog mode''
- set DMA channel configuration - transfer analog value to memory through DMA2015-04-14 06:20 AM
ADC analog channels have fixed pin assignments, unlike other peripherals which may have a choice of pins. PB8 is not an ADC channel.
Read the data sheet Section 3 Pin Assignments table and choose an appropriate pin e.g., PA1. Whichever peripheral library you are using will have ADC examples you can adapt for your project. Cheers, Hal2015-04-16 09:40 AM
2015-04-16 10:50 AM
Download the STM32F1 firmware library, there are ADC examples in that.
Ignore the Cube messaging, go to the red download button at the bottom.Not sure it's going to be useful for a 25 MHz signal, but that's either poorly expressed, or unrelated.You have an F103 or F105 part?2015-04-16 10:54 AM
The STM32028 examples should work on your nucleo with simple adaptation.
PB1 is ADC123 channel 9. None of the 7 examples in STM32028 use Channel 9. Which of the 7 examples are you using? Did you change the example channel to channel 9? Unless we see the code, we can only guess what is wrong. Regards, Hal2015-04-16 11:23 PM
Hello
All right Clive1: I have a Nucleo-F103RB but i changed the microcontroller and i put a STM32F I put a external clock at 25MHz. It is very similar to my final product Baird.hal.001: I am using the example with this path ''stsw-stm32028\STM32F10x_AN3116_FW_V1.0.0\Project\ADC Modes\SingleChannelContinuous'' I changed GPIO_ConfigurationGPIO_InitTypeDef GPIO_InitStructure;
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_1;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AIN;
GPIO_Init(GPIOB, &GPIO_InitStructure);
And now I chaged ADC_Channel_14 for ADC_Channel_9
Now all work.
I only have a final question.
can i use Port PB8 for analog adquisition???
Best regards
2015-04-17 03:33 AM
I only have a final question. Can i use Port PB8 for analog acquisition???
Thehttp://www.st.com/st-web-ui/static/active/en/resource/technical/document/datasheet/CD00220364.pdf
says it's not connected to an ADC, so no. Didn't Hal already mention that?