Nothing works on ADC or DAC
The ADC-DAC Pi Zero is a 2 Channel ADC and 2 Channel DAC for the Raspberry Pi
09/08/2024
Posted by:
Toinou
I tried also the tests and i get this :
Starting Test
open_adc(): PASSED
open_dac(): PASSED
set_dac_raw() channel 1: FAILED
read_adc_raw() channel 1: FAILED
set_dac_raw() channel 2: FAILED
read_adc_raw() channel 2: FAILED
set_dac_voltage() channel 1: FAILED
read_adc_voltage() channel 1: FAILED
set_dac_voltage() channel 2: FAILED
read_adc_voltage() channel 2: FAILED
read_adc_voltage() Differential Mode Channel 2 - 1: FAILED
read_adc_voltage() Differential Mode Channel 1 - 2: FAILED
close_adc(): PASSED
close_dac(): PASSED
One or more Tests FAILED
So the SPI is well enable on my rpi but the dac or the adc always has 0V.
I'm using a RPI 4 model B
09/08/2024
Posted by:
andrew
The ADC and DAC failing the tests suggests that it is a problem with either the SPI bus or the power going to the ADC DAC Pi.
Can you try disabling and re-enabling the SPI bus in raspi-config, just in case something went wrong when it was originally enabled? We have an SPI tutorial in our knowledge base that can help you with using raspi-config.
Try checking the 3.3V and GND pins on the ADC DAC Pi with a multimeter to make sure power is getting to the board.
You could also try checking the solder joints on the 40 pin GPIO header to make sure there are no dry joints or stray strands of solder bridging any of the pins.
09/08/2024
Posted by:
Toinou
09/08/2024
Posted by:
andrew
I have uploaded a test program to our GitHub repository that should work for performing a loopback test.
spiloopback.c
Save the code as spiloopback.c and compile it using:
gcc -o spiloopback spiloopback.c
Remove the ADC DAC Pi and link the MOSI and MISO pins together with a jumper wire. MOSI and MISO are pins 19 and 21 on the GPIO header.
Run the program:
sudo ./spiloopback
If the SPI bus is working it should return:
SPI loopback test passed!
If it fails it will return:
SPI loopback test failed!
Sent: 0xAA 0x55 0xFF 0x00
Received: 0x00 0x00 0x00 0x00
If the test fails try setting up a clean installation of Raspberry Pi OS on a spare SD card, enable the SPI bus and run the test again on the new installation. That will allow you to narrow the issue down to being a software issue with Linux or a hardware issue with the Raspberry Pi.
13/08/2024
Posted by:
Toinou
13/08/2024
Posted by:
andrew
Note: documents in Portable Document Format (PDF) require Adobe Acrobat Reader 5.0 or higher to view.
Download Adobe Acrobat Reader or other PDF reading software for your computer or mobile device.