0

I have a STM32G071 Nucleo Board and also the IC itself.

In CubeIDE, I set a pin as ADC and activate DMA and enable the DMA continuous request in the ADC settings. After executing the code and starting ADC, there is always 1 V on this pin no matter if the pin is connected to the plant (circuit) or the ADC pin is open. Why there is 1V on this pin when the DMA continuous request is enabled?

I could not find any information on the datasheet as well. Below is the schematic of the Nucleo Board.

https://www.st.com/content/ccc/resource/technical/layouts_and_diagrams/schematic_pack/group0/89/90/f2/80/b8/a8/49/6d/MB1360-G071RB-C01_Schematic/files/MB1360-G071RB-C01_Schematic.pdf/jcr:content/translations/en.MB1360-G071RB-C01_Schematic.pdf

SalPaz
  • 95
  • 3
  • 11
  • 1
    You forgot to ask a question. Edit in the question you would like to be answered. – Justme May 17 '20 at 12:44
  • 2
    Please show the ADC input circuit, including the 'plant'. – Bruce Abbott May 17 '20 at 15:59
  • 1
    It's unclear if the pin has in fact been correctly configured by code that is actually running. But even if it has been, ADC's of the sort used in MCU's load the pins they are monitoring, in some configurations rather substantially and it's not a foregone conclusion that the load would be "towards ground" vs towards some other implicit level. You may need an analog driver strong enough to impose the proper voltage on the load represented by the ADC. In theory that load is also of a pulsed nature, so looking with a scope may be worthwhile. – Chris Stratton May 17 '20 at 19:28
  • @BruceAbbott: It does not matter if the pin is connected to the plant or not. (or if the pin has no connection). In any case, there is 1V on the ADC pin. So including the plant, does not help, I guess. – SalPaz May 18 '20 at 13:12
  • @ChrisStratton The problems exist even when the pin has no connection to any part of the circuit. I simply use CubeIDE and enabled an ADC and DMA; also set the DMA in continuous mode and request continuously. Moreover, the signal voltage on the pin has DC level of 840mV – SalPaz May 18 '20 at 13:43
  • 1
    That doesn't contradict any part of the above comment. – Chris Stratton May 18 '20 at 13:52
  • @ChrisStratton I guess I did not understand what you mean. Anyway, thank you for your comment. – SalPaz May 18 '20 at 14:24
  • 1
    Without the driving circuit and configuration details this will probably get closed, since there's no way to tell if the behavior you are seeing is any different from reasonable expectation. – Chris Stratton May 18 '20 at 15:19
  • below is the link to the schematic of the Nucleo Board (STM32G071RB). Let's assume PA0 as ADC when there is no connection to this pin: https://www.st.com/content/ccc/resource/technical/layouts_and_diagrams/schematic_pack/group0/89/90/f2/80/b8/a8/49/6d/MB1360-G071RB-C01_Schematic/files/MB1360-G071RB-C01_Schematic.pdf/jcr:content/translations/en.MB1360-G071RB-C01_Schematic.pdf – SalPaz May 18 '20 at 16:25
  • The schematic of the nucleo board is not what is needed, there's nothing interesting there. You need to supply your *driving circuit* and your ADC and pin configuration. – Chris Stratton May 18 '20 at 16:36

1 Answers1

1

After executing the code and starting ADC, there is always 1 V on this pin no matter if the pin is connected to the plant (circuit) or the ADC pin is open. Why there is 1V on this pin when the DMA continuous request is enabled?

The STM32G4 ADC does its conversion by switching capacitors of various sizes (binary weighted) across the input. The internal circuit is similar to this:-

enter image description here

With a very high impedance or open circuit input the capacitors will not get properly charged, but will produce a voltage on the input that jumps around while the ADC is operating. A multimeter will show the average voltage, which is dependent on leakage currents in the ADC.

To work properly with a very high impedance input, you must buffer the signal with eg. an op amp or instrumentation amplifier, like this:-

schematic

simulate this circuit – Schematic created using CircuitLab

Resistor R1 is required if you want the input voltage to be zero when the plant is not connected, otherwise EMI and leakage currents in the op amp may cause it to 'float' to a higher voltage.

Bruce Abbott
  • 55,540
  • 1
  • 47
  • 89