Uno I2C problem with MCP3425 SOT23-6 eval board (ADC)
hi,
i have been trying make arduino uno work mcp3425 sot23-6 evaluation board, no success. me out? connected a4 pin sda , a5 pin scl pull-up resistor, , when probe, sda , scl pins, same. somehow sda looks same clock signal without signs of data traffic. checked if there short, couldn't find it. in serial monitor window, don't see anything. here code:
//include wire i2c library
#include <wire.h>
int sensor_address = b1101000;
void setup()
{
//start serial communication @ 9600 baud
serial.begin(9600);
//create wire object
wire.begin();
delay(10);
}
void readsensor(byte *a, byte *b, byte *c)
{
wire.begintransmission(sensor_address);
wire.write(b10011000);
wire.endtransmission();
wire.requestfrom(sensor_address, 3);
while(wire.available() == 0);
*a = wire.read();
*b = wire.read();
*c = wire.read();
}
void loop()
{
byte aa, bb, cc;
readsensor(&aa, &bb, &cc);
serial.print(aa);
serial.print("t");
serial.print(bb);
serial.print("t");
serial.println(cc);
delay(500);
}
here data sheet mcp3425: http://ww1.microchip.com/downloads/en/devicedoc/22072a.pdf
your appreciated. thanks!
i have been trying make arduino uno work mcp3425 sot23-6 evaluation board, no success. me out? connected a4 pin sda , a5 pin scl pull-up resistor, , when probe, sda , scl pins, same. somehow sda looks same clock signal without signs of data traffic. checked if there short, couldn't find it. in serial monitor window, don't see anything. here code:
//include wire i2c library
#include <wire.h>
int sensor_address = b1101000;
void setup()
{
//start serial communication @ 9600 baud
serial.begin(9600);
//create wire object
wire.begin();
delay(10);
}
void readsensor(byte *a, byte *b, byte *c)
{
wire.begintransmission(sensor_address);
wire.write(b10011000);
wire.endtransmission();
wire.requestfrom(sensor_address, 3);
while(wire.available() == 0);
*a = wire.read();
*b = wire.read();
*c = wire.read();
}
void loop()
{
byte aa, bb, cc;
readsensor(&aa, &bb, &cc);
serial.print(aa);
serial.print("t");
serial.print(bb);
serial.print("t");
serial.println(cc);
delay(500);
}
here data sheet mcp3425: http://ww1.microchip.com/downloads/en/devicedoc/22072a.pdf
your appreciated. thanks!
Arduino Forum > Using Arduino > Networking, Protocols, and Devices (Moderator: fabioc84) > Uno I2C problem with MCP3425 SOT23-6 eval board (ADC)
arduino
Comments
Post a Comment