Pages: [1]   Go Down
Author Topic: I2C conflict  (Read 759 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi all! smiley I'm new on this forum and I started recently working on Arduino UNO board with the Ethernet Shield.
In my project I use the Ethernet.h library to send data to a PC and the library SPI.h to save the same data on the SD card.
With these library my project works perfectly, like I desire; but when I only add the directive
#include <Wire.h>
to communicate with a DS1307 Real Time Clock, then the program compiles correctly and it loads on the chip, but the program don't save data to SD or send them through ethernet.
I repeat: to the working sketch I only insert the include directive, no instruction.
I think this could be some kind of conflict: does anyone have had the same problem or have an idea on know how to solve it?
Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 212
Posts: 8967
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

It's easy to run out of SRAM.  I'd recommend you find one of the many functions that reports available SRAM and see if that number goes down a lot when you add the Wire library.
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

It's easy to run out of SRAM.  I'd recommend you find one of the many functions that reports available SRAM and see if that number goes down a lot when you add the Wire library.
Hey!! THANKS! I used the last function described at:
http://playground.arduino.cc/Code/AvailableMemory
and deleting some global variables I've been able to include the wire library smiley
Thank you again!!
Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 212
Posts: 8967
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Another quick way to save SRAM is change:
Code:
Serial.print("String Constant");
to
Code:
Serial.print(F("String Constant"));

The F() macro prevents the string constant from being copied to SRAM during initialization.  It works with string constants and almost all the .print() and .println() functions (Serial, LCD, client...)
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok, I'll test it smiley you are an Arduino guru smiley-grin
Logged

Pages: [1]   Go Up
Jump to: