0

DS3231 RTC Breakout fake sqw falling edge
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

DS3231 RTC Breakout fake sqw falling edge

by jchex on Wed Sep 07, 2016 12:00 pm

Hi,
I am using this board https://learn.adafruit.com/adafruit-ds3 ... c-breakout in a project which uses also an arduino Due and Udoo Neo computer.
The RTC is connected over the i2c bus to the Due and to the UDOO. The SQW output of the RTC is pulled up with 10k resistor to its VDD pin and it is also connected to the UDOO and to the DUE. The SQW is programmed to 1Hz square wave.
The idea is to acknowledge the falling edges of the wave in both Due and UDOO by means of hardware interrupts. The interrupt routines are working well and they are triggered with 1 second between two consecutive interrupts. The problem is that sometimes one interrupt is detected exactly 500ms after the previous one, and sometimes UDOO detect this fake edge and the DUE does not, and sometimes the DUE detects it and the UDOO does not. This problem makes it impossible to synchronize the time between this two devices.
Have you seen a problem like these before? Could it be an electrical problem (in pull up resistor, connections), the devices are connected by means of a veroboard and wires. Could some noise during the rising edge (or just before or just after) be interpreted as a falling edge?

Thanks in advance,
j

jchex
 
Posts: 1
Joined: Wed Sep 07, 2016 11:04 am

Re: DS3231 RTC Breakout fake sqw falling edge

by hiduino on Wed Sep 07, 2016 1:41 pm

You may need to use a stronger pull-up. Try 4.7K ohms.

hiduino
 
Posts: 814
Joined: Sat Sep 01, 2012 7:05 pm

Re: DS3231 RTC Breakout fake sqw falling edge

by pepsiplease69 on Sun Mar 19, 2017 4:35 pm

I just verified that I'm able to trigger interrups very cleanly off of the falling edge of the SQW pin on this RTC at the desired 1Hz frequency.

I made use of the internal pull up only.

So I connected the SQW to pin 5 for example and I did the following.
Code: Select all | TOGGLE FULL SIZE
pinMode ( 5, INPUT_PULLUP );
attachInterrupt ( 5, sqw_isr, FALLING);


And my isr routine is getting called at the 1Hz rate I wanted.

My setup is:

Adafruit Bluefruit LE Feather M0
Adafruit DS3231 RTC FeatherWing

Just adding here for information only.

I wasn't sure whether the internal pull-up would be sufficient until I had proven it out for myself.

pepsiplease69
 
Posts: 24
Joined: Wed Oct 21, 2015 2:50 pm

Please be positive and constructive with your questions and comments.