I’m trying to write a square wave to a DAC (MCP4725) using the Wire library (I2C). When I call Wire.setSpeed with high clock speeds, it doesn’t seem to work.
Calling Wire.setSpeed(CLOCK_SPEED_100KHZ)
produces a 47HZ wave which is audible from my speaker. Calling Wire.setSpeed(CLOCK_SPEED_100KHZ)
produces an identical 47HZ wave. I’ve tried this both with constants and passing in integer values. I’ve confirmed that setSpeed
works with lower clock speeds: setSpeed(10000)
produces a 27HZ wave and setSpeed(5000)
produces a 20HZ wave.
Has anyone else run into issues setting higher clock speeds?