Problems with RTC1307 ( RTClib)

For other supported Arduino products from Adafruit: Shields, accessories, etc.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
patrikk
 
Posts: 34
Joined: Sun Feb 17, 2013 6:13 pm

Problems with RTC1307 ( RTClib)

Post by patrikk »

Hi,

I have a web server running on my Arduino Uno with the ethernet shield and that works fine. but as soon as I have included the RTClib and wire.h the webserver will not show the page anymore. ( my webpage is loaded from the SD card). I have tried using RTClib and wire in a separate sketch and that works fine so what I'm wondering now is the some compatibility issues with using
#include <SPI.h>
#include <Ethernet.h>
#include <SD.h>
#include <Wire.h>
#include "RTClib.h"

those includes together?

I'm also going to add the
#include <Adafruit_MCP23017.h>
#include <Adafruit_RGBLCDShield.h>

at a late stage will I get the same problems then?

User avatar
adafruit_support_bill
 
Posts: 88096
Joined: Sat Feb 07, 2009 10:11 am

Re: Problems with RTC1307 ( RTClib)

Post by adafruit_support_bill »

Sounds like you might be running into a memory problem:
Have a look here: http://learn.adafruit.com/memories-of-an-arduino

patrikk
 
Posts: 34
Joined: Sun Feb 17, 2013 6:13 pm

Re: Problems with RTC1307 ( RTClib)

Post by patrikk »

Thank you! it was a SRAM issue I guess I tested my code with a MEGA and it worked fine.

User avatar
technobly
 
Posts: 118
Joined: Mon Oct 31, 2011 11:06 am

Re: Problems with RTC1307 ( RTClib)

Post by technobly »

Patrikk, try adding this to your code to get an idea of how close you are getting to being out of memory...

Code: Select all

void setup(void) {
  Serial.begin(115200);
  displayFreeRam();
}

void loop(void) {
}

// Borrowed from the Adafruit Debug.cpp library
void displayFreeRam(void)
{
  extern int  __bss_end;
  extern int  *__brkval;
  int free_memory;
  if((int)__brkval == 0) {
    free_memory = ((int)&free_memory) - ((int)&__bss_end);
  }
  else {
    free_memory = ((int)&free_memory) - ((int)__brkval);
  }
  
  Serial.print(F("Free RAM: "));
  Serial.print(free_memory);
  Serial.println(F(" bytes"));
} 

Locked
Please be positive and constructive with your questions and comments.

Return to “Other Arduino products from Adafruit”