somedev sit at around 0.8V when the unit is not running, whereas the earlier version of the bela has the default analog out voltage for the non-running bela sitting politely at zero volts.
That's a consequence of the new DAC. In general, we didn't guarantee much in terms of what would happen with I/Os while the program is not running. The following changes to the core code should keep the outputs at 0V after you've run any Bela program once:
diff --git a/core/Es9080_Codec.cpp b/core/Es9080_Codec.cpp
index 72ce4ced..f80d1c37 100644
--- a/core/Es9080_Codec.cpp
+++ b/core/Es9080_Codec.cpp
@@ -44,7 +44,7 @@ Es9080_Codec::Es9080_Codec(int i2cBus, int i2cAddress, AudioCodecParams::ClockSo
initI2C_RW(i2cBus, i2cAddress, -1);
// toggle reset pin
- gpio.open(resetPin, Gpio::OUTPUT);
+ gpio.open(resetPin, Gpio::OUTPUT, false);
gpio.clear();
usleep(1000);
gpio.set();
@@ -58,7 +58,7 @@ Es9080_Codec::Es9080_Codec(int i2cBus, int i2cAddress, AudioCodecParams::ClockSo
Es9080_Codec::~Es9080_Codec()
{
disable();
- gpio.clear();
+ //gpio.clear();
}
McaspConfig& Es9080_Codec::getMcaspConfig()
@@ -742,6 +742,7 @@ int Es9080_Codec::disable()
int Es9080_Codec::reset()
{
+ return 0;
// RESET & PLL REGISTER1: AO_SOFT_RESET | PLL_SOFT_RESET
if(writeRegister(192, 0xC0))
return 1;
diff --git a/core/I2c_Codec.cpp b/core/I2c_Codec.cpp
index edb05e60..edc41434 100644
--- a/core/I2c_Codec.cpp
+++ b/core/I2c_Codec.cpp
@@ -1004,10 +1004,10 @@ int I2c_Codec::stopAudio()
if(enableLineOut(false))
return 1;
if(InitMode_noInit != mode && InitMode_noDeinit != mode) {
- if(writeRegister(0x25, 0x00)) // DAC power/driver register: power off. For whatever reason, executing this also turns off the BCLK output
- return 1;
- if(writeRegister(0x03, 0x11)) // PLL register A: disable
- return 1;
+ //if(writeRegister(0x25, 0x00)) // DAC power/driver register: power off. For whatever reason, executing this also turns off the BCLK output
+ //return 1;
+ //if(writeRegister(0x03, 0x11)) // PLL register A: disable
+ //return 1;
}
running = false;
Can you tolerate having the outputs at 0.8V for the first 10 seconds after boot until the first Bela program runs?