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
6
votes
2 answers

STM32 ADC Continuous Conv Mode does not automatically start conversion

I am trying to configure ADC over a STM32F411RE in simple Continuous Conv Mode. I used CubeMX to generate the code based on HAL drivers and this is some parts of the generated code which intialize ADC: /* ADC1 init function */ void…
Nixmd
  • 775
  • 5
  • 11
  • 20
6
votes
1 answer

Reading raw audio values from ADC chip on raspberry pi

I wired up the MCP3008 ADC chip to an Electret Microphone and to my pi. I'm reading the input using bit-banging in python, and I'm getting an integer from 0-1024. I followed this tutorial to do the bit-banging:…
Jack Freeman
  • 1,414
  • 11
  • 18
5
votes
4 answers

Calibrating STM32 ADC (VREFINT)

I'm trying to read VDDA on an STM32F042 microcontroller. I'm getting unexpected results with VDD at 3.29V. I must be missing something fundamental. output: VREFINT=1917; VREFINT_CAL=1524; VDDA=2623 mV VREFINT=1885; VREFINT_CAL=1524; VDDA=2668…
iter
  • 4,171
  • 8
  • 35
  • 59
5
votes
1 answer

What is missing to make stm32 ADC DMA work? Transfer Compete does not occur

I am using a stm32f3 discovery board and the HAL from CubeMX. I am trying to use 2 ADC channels at ADC4. I configured DMA in circular mode. Befor the main loop in main, I call: HAL_ADC_Start_DMA(&hadc4, DMA_adc4_buffer, 16); I implemented the…
maze
  • 789
  • 1
  • 7
  • 31
5
votes
2 answers

ADC only working once on ATMEGA324PA

I have some code which should read the values of a couple of ADC pins, each time around the commutator loop. static uint16_t adc0; static uint16_t adc1; void init(void) { ... hw_configure_adcs(); ... } void loop(void) { ... …
fadedbee
  • 42,671
  • 44
  • 178
  • 308
5
votes
3 answers

ADC single conversion on STM32

I'm studying ADC programming on STM32 F103x and starting with the simplest case - single conversion. The internal temperature sensor (connected to ADC1) value is measured and sending it to COM port by using USART. A target seems clear but when I…
lft
  • 113
  • 1
  • 1
  • 12
4
votes
0 answers

Logging data from High Precision AD/DA board using Raspberry Pi 3B

I have a High Precision AD/DA board from waveshare with Raspberry Pi 3B (running on Raspbian). With this setup, I get a sampling rate of above 20KPS at my terminal display. However, I can write only 27 samples in 1s in my CSV file. I am using this…
4
votes
1 answer

Can you use all the ESP32's GPIO pins when the WiFi is working?

I have a weird phenomenon that when I add the WiFi library and all the settings, 2 out of 3 sensors stop working. When I remove the WiFi code it works like it used to. I have an ESP32 devkit v1 board and connected 3 sensors which are a photoresistor…
4
votes
1 answer

Weird problem on STM32 ADC with Interleaved Mode

I am sampling a signal on STM32F3 Discovery board (stm32f303vct6) with two ADCs working in interleaved mode. It works great with a 200kHz 1V sine wave. But when I apply 10kHz 100mV sine wave, I see some interesting patterns. ADCs seem to convert all…
itlki
  • 51
  • 1
  • 6
4
votes
1 answer

GBZ80 - ADC instructions fail test

I've been running Blarggs CPU tests through my Gameboy emulator, and the op r,r test shows that my ADC instruction is not working properly, but that ADD is. My understanding is that the only difference between the two is adding the existing carry…
Triforcer
  • 127
  • 9
4
votes
1 answer

How to obtain the highest sample rate possible in Raspbery Pi using a ADC?

I am working in a project using Raspberry Pi 3 B where I get data from a IR sensor(Sharp GP2Y0A21YK0F) through a ADC MPC3008 and display it in real-time using PyQtgraph library. The datasheet of the ADC says that at 5.0V, the sampling rate is…
Hugo Oliveira
  • 197
  • 2
  • 3
  • 8
4
votes
2 answers

How to read & accumulate sensor values at high frequency, without constantly writing to disk (RPi 2 b+, MCP3304, Python)

I am attempting to use a Raspberry Pi 2 Model B+ to read analog data on IR intensity from a photodiode via an MCP3304 (5v VDD) at a rate of ~ 10kHz three times in a row (0.1 ms between readings, or a rate of 10 ksps) once every second based on an…
drewbles
  • 65
  • 1
  • 9
4
votes
2 answers

How to fix error message "__builtin_avr_delay_cycles expects a compile time integer constant make"?

My program isn't being compiled using a GCC AVR compiler. It's a small game on a microprocessor and an LCD screen. move_delay = 200; _delay_ms( move_delay ); It doesn't like that this _delay_ms is a variable, but it needs to be a variable because I…
James
  • 57
  • 1
  • 1
  • 4
4
votes
2 answers

How to quit the program in while loop using push-button in PyQt

I have the following code which will start after clicking the 'Start' button in PyQt: def Start(self): import time import os import RPi.GPIO as GPIO import datetime GPIO.setmode(GPIO.BCM) DEBUG = 1 os.system('clear') # SPI port on…
lkkkk
  • 1,999
  • 4
  • 23
  • 29
3
votes
2 answers

Why voltage from Raspberry Pi Pico ADC is not equal 0, when nothing is connected to the pin?

I was trying to read some voltages from a sensor, but before doing that, I checked how readings would look like, when nothing is connected to pins. Here's my code based on examples: #include #include "pico/stdlib.h" #include…
pawrok
  • 43
  • 6
1
2 3
40 41