Part Number: DRV2665
Hello Everyone,
We are trying to use a DRV 2665 for running a 1µF Piezoactuator at 10Hz or lesser. We have setup the example circuit, are able to communicate with the IC via I2C(100khz), able to change the Status and Gain register.
The program is setup as an infinite loop - Read from 0x01 and 0x02, print values via serial (band rate 115200). Write 0x2C and 0x0E to respective registers, read values again after writing and print. Intention is to drive DRV2665 via Analog Input (from voltage source)
The register values change back to default values after the loop ends and restarts. The likely cause is that the IC undergoes a reset without any explaination.
Our experience is very similar to another user (Thread name - DRV2665 Override Bit by Chris Vogt) He solved the problem by ordering more ics and found that his existing code worked with the replacements, indicating that the first batch of ICs might have been defective.
#define reg_DRV_Status 0x02
#define reg_DRV_Gain 0x01
#define reg_DRV_FIFO 0x0B
#define data_DRV_Status 0x0E
#define data_DRV_Gain 0x2C
#define data_DRV_H 0x7F
#define data_DRV_L 0x00
void i2c_write(int , int, int, int);
void setup()
{
}
void loop() {
// Reading config
Serial.println("DRV Gain Value");
i2c_read(ADDR_DRV, reg_DRV_Gain);
Serial.println("DRV status Value");
i2c_read(ADDR_DRV, reg_DRV_Status);
i2c_write(ADDR_DRV, reg_DRV_Status, 0x00, 0x00);//Exit Standby mode
i2c_write(ADDR_DRV, reg_DRV_Gain, 0x2C, 0x00);//Choose Analog Mode
i2c_write(ADDR_DRV, reg_DRV_Gain, 0x2D, 0x00);//Set gain to 50V
i2c_write(ADDR_DRV, reg_DRV_Status, 0x0C, 0x00);//Set timeout to 20 ms
i2c_write(ADDR_DRV, reg_DRV_Status, 0x0E, 0x00);//Set override to 1
//i2c_write(ADDR_DRV, reg_DRV_FIFORO, data_DRV_FIFORO, 0);
Serial.println("W DRV Gain Value");
i2c_read(ADDR_DRV, reg_DRV_Gain);
Serial.println("W DRV status Value");
i2c_read(ADDR_DRV, reg_DRV_Status);
}
void i2c_write(int address, int reg_ister, int data8, int data16)
{
if (address == ADDR_AMC)
{
Wire.beginTransmission(address);
Wire.write(reg_ister);
Wire.write(data8);
Wire.write(data16);
//Serial.println("W 16bit");
} else {
Wire.beginTransmission(address);
Wire.write(reg_ister);
Wire.write(data8);
//Serial.println("W 8bit");
}
Wire.endTransmission(true);
//delay(delay_led);
}
void i2c_read(int address, int reg_ister)
{
Wire.beginTransmission(address);
Wire.write(reg_ister);
Wire.endTransmission(false);
if (address == ADDR_AMC)
{
Wire.requestFrom(address, 2, true);
} else {
Wire.requestFrom(address, 1, true);
}
while(Wire.available()) // slave may send less than requested
{
byte c = Wire.read(); // receive a byte as character
Serial.println(c); // print the character
}
//delay(delay_led);
}
Relevant info:
1. Our breakout boards do not have a thermal pad to connect the base to ground. The datasheet "recommends" it be connected to ground and a heatspreader. Can this be a reason for the IC to reset?
2. Does making a circuit on a breadboard reset the IC? I ask as the Datasheet specifically mentions that distance to capacitors must be as short as possible. We expected degraded output voltage and frequency response (which can be minimised on a PCB), but do not expect the IC to reset as a result.
Do you have any suggestions to rectify the problem or perhaps suggestions as to where a cause for this behavior lie?
With Kind Regards,
Aditya Bhuvaneshwaran