Interrupt on Pin 13?

Hi!
I want to use the SQW signal from a DS1307 as interrupt.
It doesn't work on pin 13, which comes with the builtin LED. It blinks so I assume SQW is ok.
But: SQW as interrupt works on other digital pins (tried on 10)
interrupt on pin 13 works with a direct connection to 5V (through a resistor).
Isn't SQW signal strong enough?

I'm using a Nano Every, I tried with and without internal pull-up resistor.

The SQW output on a DS1307 is open drain and pin 13 on an Nano Every has a 330R resistor and LED to ground. Do you have an external pullup resistor on SQW somewhere to pull the input high?

You will have much less trouble if you pick another pin for the interrupt, and use pin 13 for the LED.

1 Like

Thank you!
I checked the schematics, and I see a mosfet to ground on the chip and a 3k3 pull-up resistor on the module. On high state the chain would be: 3k3 - LED - 330ohm, less than 1mA through the led, however it is pretty bright. This also means something like 2.5V on the GPIO, am I right? I'll try with a pullup.

I use pin13 because all other pins are busy. I could swap with a pushbutton but I like to have the led blinking with SQW to indicate it is on duty.

I bypassed the pullup with some resistors, but even with 1.5K (< 1K when in parallel with 3K3), I barely reach 2.4V. I guess I will have to put a transistor.

You could remove the LED.

According to the Nano Every rev 3.0 schematic (portion below, top left), the LED seems to be the yellow one connected to SCK (pin 13) to ground, through a 330 Ohm resistor. Remove either the LED or the resistor to use the pin normally.

Have you tried RISING or FALLING or CHANGE . ect ?

sure! but since it doesn't reach HI state, it can't detect rise or fall...

would something like that work? Let's assume I disable Nano push-up.

Otherwise I will or
-remove the LED
-change the 330 builtin resistor to rise the value (tricky)
-swap with other GPIO

the schematic above works very well. I can even add a some-hundred-ohm-resistor to lower the LED current, voltage remains above ~3V.
I used a BC550 instead, but it's not critical.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.