Questions tagged [adc]

An analog-to-digital converter (ADC) is a device that converts a continuous signal to a series of digital numbers. Prefer tag [audio-aliasing], if appropriate.

An ADC samples a continuously variable physical quantity (eg light, sound, position, voltage, etc) and periodically outputs a digital value for it.

601 questions
1
vote
1 answer

STM32F334R8: ADC with DMA

Could someone provide me a basic code that just implements ADC with DMA for STM32 please ? I'd like to compare it to my solution that doesn't work. Thank you.
Ats
  • 21
  • 2
1
vote
1 answer

HAL_ADC_PollForConversion - what exactly is it for?

I've been tinkering around STM32 (F103RB) for a couple of weeks now and one thing I don't get is HAL_ADC_PollForConversion function purpose. I mean, I don't see any impact of this function on ADC readings. Here's my code example: Version 1 (with…
Dawid W
  • 47
  • 1
  • 5
1
vote
1 answer

STM32F334R8: ADC with DMA too slow

I can measure signals and write in memory with DMA but speed is too slow (60 KSPS) while the ADC clock (same as system clock) is at 16 MHz.. I measure the speed but measuring a square signal at the ADC input. I use a vary basic code with HAL easy to…
Ats
  • 21
  • 2
1
vote
0 answers

Using esp32 adc1_get_raw() inside vTaskSuspendAll() leads to assert failed

The program needs to take several consecutive ADC measurements without interruption and the WiFi task interferes with that, that is why the scheduler needs to be suspended. However, I get the following runtime error when I run the code below: assert…
daneil
  • 11
  • 3
1
vote
1 answer

12-bit ADC in MSP430FR2476 seems to only work in 10-bit mode

Here is the problem: I am trying to initialize the 12-bit built-in ADC on MSP430FR2476, but no matter what I do it seems to work at 10 bits. I change the resolution bits in a control register and alas, to no avail. No matter what I have tried…
1
vote
0 answers

Why is a memory location only written to once in an interrupt callback when using ADC and DMA transfers with a STM32F3?

I'm looking to get my STM32F303 discovery board to continuously read from a temperature sensor using the ADC and DMA transfers to a memory location, but during the interrupt callback, the memory location appears to only have been written to once and…
tdot123
  • 11
  • 1
1
vote
1 answer

stm32 SPI receive only mode need a transmit?

sorry in advance, i am new at this kind of projects. I tried to implement a connection to an ADC (LTC1609) via SPI. I just want to get the data from the ADC as quick as possible. The ADC has just a output-line, so i chose the "read only mode". But i…
T0K4M4K
  • 11
  • 2
1
vote
0 answers

Implementing AD7606 driver for Raspberry Pi 4b

I am trying to implement ADC AD7606 device driver for Linux on Raspberry Pi 4B+ to make possible to read data from all channels as fast as it possible via SPI. The kernel version is v5.10.83 and the kernel was compiled and installed with support…
Aro Math
  • 11
  • 2
1
vote
0 answers

Share GPIO pins between two instances of the SPI Linux driver for AD7606 ADC

I'm trying to enable two instances of AD7606 SPI driver for AD7606C. In order for ADC to start the conversion GPIO pins for CONVST (conversion start), interrupt pin (BUSY pin) and RESET pin have to be defined in the device tree for the driver to…
1
vote
1 answer

Why is this code not working for mcp3008? (from official adafruit site)

I'd like some help to debug the example code provided by adafruit. I have connected a potentiometer and an analog servo motor which when using the python2 script give me values just fine. I took from this site:…
1
vote
0 answers

Arduino Uno analogRead with ADC register

I'm trying to read to calculate the capacitance with the Arduino Uno. I did this successfully with the Arduino function. unsigned long starttime = 0; unsigned long endtime = 0; double C = 0; float n = 3.0; //time constant float resistor = n *…
BeneKunz
  • 43
  • 6
1
vote
2 answers

ESP32 I2S in nanoFramework

I'm trying to replicate a C++ project I found for sampling sound data on the ESP32 using I2S, but using C# and nanoFramework. In the ADCSampler.cpp file the following headers are loaded #include #include "driver/i2s.h" #include…
CobyC
  • 2,058
  • 1
  • 18
  • 24
1
vote
1 answer

PIC16 not updating ADC values

Can somebody help to explain why my code or setup not updating the ADC values of a 10K-potentiometer please? I use MPLAB XPRESS PIC16F18877 board and MPLAB MCC to generate the code. The voltage result only gets updated once after resetting the…
1
vote
1 answer

On python, how do I compare CurrentValue to previousValue and output max

I have always used Arduino IDE but now, I am using MuEditor. I used Arduino IDE and it was easier to compare the current value to its previous value, and output max value after a certain period. Code from the Arduino is shown below. int sample1 = 0;…
Sam
  • 115
  • 3
1
vote
2 answers

When using signed int, does my value always start from zero?

I have been diving into and reading endless internet forums and pages trying to find an answer to this, but have had no luck, so here we are. For reference, I am using an A/Dconverter and I am changing the value of the A/Dconverter using a variable…
C_GNARWIN
  • 13
  • 3