Hello,
I am using an Arduino Due as Master and AD7150 as Slave, SDA1 is connected to SDA and SCL1 to SCL. I am using the same GND and also 10k pull-up resistors.
I am using a oscilloscope to read the values of SCL and SDA and both of them are at 3.3V (HIGH).
The AD7150 is using only one channel.
I wrote a very simple program to configure the registers.
Do you think it is a code issue or hardware?
I believe because the SCL is not pulsing, SDA cannot send any data, that is why I suspect of SCL.
A part from what I wrote of connections, I am using the 3.3V for the AD7150 (powered by the Due) and GND (from the Due too).
Master and slave are not sharing the same supply (master 5V, slave 3.3V), does that matter?
Thank you a lot!
CODE:
#include <Wire.h>
int chip_addr = 0x48; //AD7150 adress
#define ch1_SetupR_addr 0x0B //Setup register address for Ch1
#define ConfigR_addr 0x0F //Configuration register
void configAll(){
Wire.beginTransmission(chip_addr);
Wire.write(ConfigR_addr);
Wire.write(177); //0b1011001
Wire.endTransmission();
Wire.beginTransmission(chip_addr);
Wire.write(ch1_SetupR_addr);
Wire.write(203); //0b11001011
Wire.endTransmission();
}
void setup() {
Serial.begin (9600);
Wire.begin();
pinMode(SDA1, INPUT);
pinMode(SCL1, INPUT);
configAll();
Serial.println("First config Done");
}
void loop() {
delay(1000);
Serial.println("HI boss");
}