2015-10-11 06:07 AM
This is relation to my previous forum post [DEAD LINK /public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/STM32F030F4%20ADC%20strange%20behaviour¤tviews=31]here:
I tried to simplify the test case as much as possible and here are the results. I'm sampling a single channel PA4 with clock set to ADC_CLOCK_SYNC_PCLK_DIV4 and sample time of ADC_SAMPLETIME_71CYCLES_5 GPIO is set in ''ANALOG'' mode and no pullups. Input signal is a voltage of 0.3V. Here is what I get on the scope when I'm measuring directly on the PA4 pin. (See attached image). It looks like that during the sample stage, the input it pulled up to 0.7V. My input circuit is given also in the attached image. What am I missing here? #adc #stm32f0 #dma2015-10-11 09:27 PM
What happens if you disconnect the opamp (i.e. remove the series 500R resistor)?
JW2015-10-22 01:17 AM
The input pin floats up to VCC, and the ADC measures 0xFFF value. But I don't have pullups enabled on the input pin (they are defined as Analog mode, no pull up or pull down)
2015-10-22 03:14 AM
So there's something which overcomes the 1kOhm pulldown... Either short on your board (check short to neighbouring pins first, then to any track which would come close to the track carrying the signal in question); or you don't have properly set GPIO (post the GPIO registers content).
JW2015-10-26 08:04 AM
My GPIO register is set properly
GPIO_InitStruct.Pin = GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_4; GPIO_InitStruct.Mode = GPIO_MODE_ANALOG; GPIO_InitStruct.Pull = GPIO_NOPULL; HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); I unsoldered the resistors which form an input divider, and left PA4 pin floating. When I do this, the pin floats up to 3.8V during sample phase when ADC is running, and dips to 3.3V during conversion phase. I only have a 3.3V supply on the board, and I'm baffled how can this be true... When I set this pin to be output, it correctly goes between 0 and 3.3V when I toggle output states. The pin also works completely normal when used as a digital input.2015-10-26 08:13 AM
3.8V ?? Are you sure you have everything using the same ground potential?
2015-10-26 08:44 AM
I only have one GND plane on the entire board..
I just realized that there are two pins PA9 and PA10 that are used in I2C mode, that are connected externally to a 5V I2C bus, using 10K pullups, but these two are defined as OD pins. Can this somehow create issues? Other than this there is no obvious problem on the board. I don't know where this voltage of 3.8V comes from. It definitely ONLY appears during sampling phase when the sampling CAP is connected to a sampling PIN. This happens on ALL analog pins, not just one.2015-10-26 09:03 AM
Not sufficiently familiar with the F0 to know the FT status of those pins. But basically if you put higher voltages on the pins, it will float the internal power ring via the ESD protection diodes.
2015-10-26 09:13 AM
Quick update.
I removed the two 10K pull-ups for the I2C to 5V, and now I have perfectly running ADC peripheral. Wow, I have to figure out how to make the I2C to work, but I don't know why is this a problem if the I2C pins are defined as OD. It shouldn't matter at all...2015-10-26 03:12 PM
How is VDDIO2 connected?
JW