hello everyone
In mid-November, I have designed a shield based on arduino.I have wrote two posts.http://forum.allaboutcircuits.com/t...-back-integrates-a-variety-of-sensors.103659/ and http://forum.allaboutcircuits.com/threads/arduino-shield-with-magnetometer-clock-and-oled.103193/ I have to debug a week.However, it does not work.The OLED display and bluetooth is ok.
Here is my sch,
Here is my pcb
Time is always parked in the 45:85:85,I know this is the wrong data.I use two leonardo to test.Unfortunately, I still did not get the correct data.Then,I suspect that the IIC on my leonardo is broken.
I've used other IIC devices, I put GY-30 connected to leonardo, and the code I‘ve been used,it can't work.I borrowed a Duemilanove from others.The GY-30 can work,and the DS1307 in my shield doesn't work.Now I have no idea.anyone can help me,and anyone can upload code about DS1307 base on arduino,In order to confirm the problem in my code or on my PCB.
Thanks
dreamtale
In mid-November, I have designed a shield based on arduino.I have wrote two posts.http://forum.allaboutcircuits.com/t...-back-integrates-a-variety-of-sensors.103659/ and http://forum.allaboutcircuits.com/threads/arduino-shield-with-magnetometer-clock-and-oled.103193/ I have to debug a week.However, it does not work.The OLED display and bluetooth is ok.
Here is my sch,
Here is my pcb
Code:
void setup() {
Wire.begin();
Serial.begin(57600);
}
void loop() {
if (Serial.available()) { // Look for char in serial que and process if found
command = Serial.read();
if (command == 84) { //If command = "T" Set Date
setDateDs1307();
getDateDs1307();
Serial.println(" ");
}
else if (command == 81) { //If command = "Q" RTC1307 Memory Functions
delay(100);
if (Serial.available()) {
command = Serial.read();
// If command = "1" RTC1307 Initialize Memory - All Data will be set to 255 (0xff).
// Therefore 255 or 0 will be an invalid value.
if (command == 49) {
// 255 will be the init value and 0 will be cosidered an error that
// occurs when the RTC is in Battery mode.
Wire.beginTransmission(clockAddress);
// Set the register pointer to be just past the date/time registers.
Wire.write(byte(0x08));
for (int i = 1; i <= 27; i++) {
Wire.write(byte(0xff));
delay(100);
}
Wire.endTransmission();
getDateDs1307();
Serial.println(": RTC1307 Initialized Memory");
}
else if (command == 50) { //If command = "2" RTC1307 Memory Dump
getDateDs1307();
Serial.println(": RTC 1307 Dump Begin");
Wire.beginTransmission(clockAddress);
Wire.write(byte(0x00));
Wire.endTransmission();
Wire.requestFrom(clockAddress, 64);
for (int i = 1; i <= 64; i++) {
test = Wire.read();
Serial.print(i);
Serial.print(":");
Serial.println(test, DEC);
}
Serial.println(" RTC1307 Dump end");
}
}
}
Serial.print("Command: ");
Serial.println(command); // Echo command CHAR in ascii that was sent
}
command = 0; // reset command
delay(100);
}
I've used other IIC devices, I put GY-30 connected to leonardo, and the code I‘ve been used,it can't work.I borrowed a Duemilanove from others.The GY-30 can work,and the DS1307 in my shield doesn't work.Now I have no idea.anyone can help me,and anyone can upload code about DS1307 base on arduino,In order to confirm the problem in my code or on my PCB.
Thanks
dreamtale