Dubbio su Libreria Rtc

Ciao,stavo testando una Mega + lcd 20x4 + RtcDs1307,avevo attivato l'uscita Sqw del DS1307 con clock 1Hz per far lampeggiare un led .Onestamente rimane acceso fisso,dove sbaglio ?
Allego il codice,Grazie 1000,Mauro

//
// Librerie
//

#include <Wire.h>
#include "RTClib.h"
#include <LiquidCrystal.h>

//
// Includi Variabili,ecc....
//

RTC_DS1307 RTC;
LiquidCrystal lcd(A9,A8,A10,A11,A12,A13);
char lcdBuffer[20];
int buffer_position;

//
// Setup Inizializzazione " Only First Boot "
//

void setup () {
	Serial.begin(57600);
	lcd.begin(20, 4);;
	lcd.setCursor(0,1);  
	lcd.print("        Test        ");
	lcd.setCursor(0,2);
	lcd.print("  Firmware RTC 1.1  ");
	delay(3000);
	lcd.clear(); 
	Wire.begin();
	RTC.begin();
    Ds1307SqwPinMode(1);     //0 Led off - 1 Freq 1Hz - 2 Freq 4096kHz - 3 Freq 8192kHz - 4 Freq 32768kHz
    if (! RTC.isrunning()) {
    	Serial.println("RTC is NOT running!");
    	RTC.adjust(DateTime(__DATE__, __TIME__));
    }
    buffer_position = 0;
}

//
// Cicla all'Infinito
//

void loop () {
	DateTime now = RTC.now();
	lcd.clear();
	sprintf(lcdBuffer, "  [%0d] [%02d/%02d/%04d]  ", now.dayOfTheWeek(), now.day(), now.month(), now.year() );
	lcd.setCursor(0,1);
	lcd.print(lcdBuffer);
	sprintf(lcdBuffer, "  [   %02d:%02d:%02d   ]  ", now.hour(), now.minute(), now.second() );
	lcd.setCursor(0,2);
	lcd.print(lcdBuffer);
	delay(100);
}

Ma il LED lo hai collegato all'uscita SQW ? ? ? ... perché quell'uscita NON credo proprio possa fornire la corrente per accendere un LED ... è nata per essere letta da un pin digitale di una MCU e poi quest'ultima deve agire di conseguenza.

Metti lo schema del circuito che hai realizzato ...

Guglielmo

ma Veramente,io vedo in uscita dal IC un Mosfet,e poi leggo questa descrizione dal Data-Sheet ..
" Square Wave/Output Driver. When enabled, the SQWE bit set to 1, the SQW/OUTpin outputs one of four square-wave frequencies (1Hz, 4kHz, 8kHz, 32kHz). The SQW/OUT pin is open drain and requires an external pullup resistor. SQW/OUT operates with either VCC or VBAT applied. The pullup voltage can be up to 5.5V regardless of the voltage on VCC. If not used, this pin can be left floatin"
Allego schema

Grazie

mauroplus:
ma Veramente,io vedo in uscita dal IC un Mosfet ...

Questo è vero ... mah ... fai una prova, metti solo una resistenza di pull-up e collegati con un multimetro per vedere se effettivamente va da HIGH a LOW con periodo di 1Hz. Così vedi se almeno sta funzionando.

Guglielmo

...e già,da questo pin non esce un bel niente,rimane sempre a 0,in tutti i settaggi,sembra che Ds1307SqwPinMode(x),rimanga sempre off.
Dici che è Guasto Il Ds1307 ??

No, mi sa che manca un passaggio ...
... NON basta impostare la frequenza (bit 0 e bit 1 del registro 7), ma occorre anche abilitarne l'uscita con il bit 4 (SQWE) dello stesso registro.

Il DS1307 è talmente banale che io NON uso mai le librerie, tu che la usi devi andare a vedere se, tra i vari metodi, ce ne è un per abilitare SQW oltre a quello che già usi per modificarne la frequenza!

Guglielmo