Hello Folks
I'm very new to the whole firmware/software world (I'm hardware electronics engineer) and I'm trying to get a slave device called LTC1427 which is a 10bit current DAC which will be used to vagary the voltage output of a buck boost. This DAC can only receive.
Below is the code that I started to write and got some data coming but I believe the Wire.write commands aren't working correctly. I suspect I'm doing something very silly.
When I say the wire.write commands aren't working correctly what i mean is no matter what hex value I put into the variables the data coming out doesn't change. I'm using an oscilloscope to view that data and clock.
The Wire.beginTransmission does work as I can change these variables and see the difference on the scope.
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
#include <Wire.h>
void setup() // run once, when the sketch starts
{
Wire.begin();
Serial.begin(115200);
Serial.println("All work and no play make Stephen a dull boy!"); // prints hello with ending line break
LTC1427_TX();
}
void LTC1427_TX()
{
byte ADD = 0x2D;
byte value1 = 0x10;
byte value2 = 0xAA;
Wire.beginTransmission(ADD);
Wire.write(0,1); //WR
Wire.write(0,1); //ACK
Wire.write(value1);//Command
Wire.write(0,1); //ACK
Wire.write(value2);//Data TX
Wire.write(0,1); //ACK
Wire.endTransmission();
}
void loop() // run over and over again
{
// do nothing!
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
LTC1427.pdf (206 KB)