Skip to main content
Bounty Ended with 50 reputation awarded by SF.
added 333 characters in body
Source Link
Nia
  • 136
  • 3

Yes, however, you need to short the two smd capacitors on the back of the PCB right by the Audio output jack (labeled C34 and C48 for me, one for each channel).

You will get an output range from 0-1V. You can keep the sample values constant and get a constant voltage. For example, using a 16bit mode and only the sample value 0 you get a constant 0.5V (0 = mid point in a signed 16bit range).

However, since this was designed for audio, you you can't just set an output value like you could on an adc. You need to fill a sample buffer with the sample values that you want. If you want to change the values then you need to wait until the previous buffer has been played.

For source code, see the (in rasperian) included: /opt/vc/src/hello_pi/hello_audio/audio.c

Just change the sample value for each channel to what you want, for example to 0x7FFF for max (1V), use:

for(j=0; j<nchannels; j++)
{
    if (bitdepth == 32)
        *p++ = 0;
    *p++ = 0x7FFF;
}

Yes, however, you need to short the two smd capacitors on the back of the PCB right by the Audio output jack (labeled C34 and C48 for me, one for each channel).

You will get an output range from 0-1V. You can keep the sample values constant and get a constant voltage. For example, using a 16bit mode and only the sample value 0 you get a constant 0.5V (0 = mid point in a signed 16bit range).

However, since this was designed for audio, you you can't just set an output value like you could on an adc. You need to fill a sample buffer with the sample values that you want. If you want to change the values then you need to wait until the previous buffer has been played.

Yes, however, you need to short the two smd capacitors on the back of the PCB right by the Audio output jack (labeled C34 and C48 for me, one for each channel).

You will get an output range from 0-1V. You can keep the sample values constant and get a constant voltage. For example, using a 16bit mode and only the sample value 0 you get a constant 0.5V (0 = mid point in a signed 16bit range).

However, since this was designed for audio, you can't just set an output value like you could on an adc. You need to fill a sample buffer with the sample values that you want. If you want to change the values then you need to wait until the previous buffer has been played.

For source code, see the (in rasperian) included: /opt/vc/src/hello_pi/hello_audio/audio.c

Just change the sample value for each channel to what you want, for example to 0x7FFF for max (1V), use:

for(j=0; j<nchannels; j++)
{
    if (bitdepth == 32)
        *p++ = 0;
    *p++ = 0x7FFF;
}
Source Link
Nia
  • 136
  • 3

Yes, however, you need to short the two smd capacitors on the back of the PCB right by the Audio output jack (labeled C34 and C48 for me, one for each channel).

You will get an output range from 0-1V. You can keep the sample values constant and get a constant voltage. For example, using a 16bit mode and only the sample value 0 you get a constant 0.5V (0 = mid point in a signed 16bit range).

However, since this was designed for audio, you you can't just set an output value like you could on an adc. You need to fill a sample buffer with the sample values that you want. If you want to change the values then you need to wait until the previous buffer has been played.