pcf8593 rtc -- can't reset alarm

I am building an aquarium monitor, and one function will be to provide an audible alert every 12 hours for feeding. I have a pcf8593 wired up to a Moteino, and I'm trying to use the Arduino library available.
I wired the rtc reset pin high.

The setup() code for the rtc is as follows.

   attachInterrupt(1, setAlarm, FALLING);    //rtc interrupt is active low, on pin 3
   rtc.initClock();
   rtc.setDate(2, 7, 1, 0, 15 );  //this is irrelevant for fish tank
   rtc.setTime(12, 00, 00);       //clock initially set to noon    
   
   feedHour = 13;
   rtc.setAlarmTime(12, 02, 00);       //set for a feeding alarm at 20:00 (8:00 P.M.)
   rtc.setAlarmMode(RTCC_ALARM_DAILY);

This is set, for debug, to activate the alarm in 2 minutes, which it does. The interrupt handling code is as follows.

void setAlarm()
{
   Serial.println("Alarm triggered");
  
   detachInterrupt(1);
  
   rtc.clearAlarm();
   wait(1000);                                               //same as delay, but based on my own timer
   feedHour = (feedHour + 12) % 24; 
   rtc.setAlarmTime(12, 04, 00);                    //reset for next feeding (debug at the moment)
   rtc.setAlarmMode(RTCC_ALARM_DAILY);
   attachInterrupt(1, setAlarm, FALLING);
}

I put the delay in because it is in the example code, without explanation.
However, when the interrupt is activated, I get "Al" on the monitor, and the microcontroller hangs up. I suspect it has not gotten some communication back from the rtc.

None of the examples provides a reset of the alarm, and I can't find any other code which explains this.

Thanks in advance for any information on this.

Problem solved.

By commenting out single code lines, I finally concluded that trying to attach an interrupt from inside the interrupt procedure doesn't work. The same old lesson: keep the contents of interrupt routines to a bare minimum.

I get "Al" on the monitor, and the microcontroller hangs up.

There are several things seriously wrong with your ISR setAlarm().

Interrupts are automatically disabled when the ISR is being executed, so several operations within the ISR are failing. First, can not do serial printing from with an ISR because it relys on interrupts. Second, Millis() also depends on interrupts and the count will not progress within an ISR. Finally, the writing of the alarm functions depends on i2c and that too relys on interrupts.

Take a look at Nick Gammons interrupt tutorial.

Also, you should not detach and attach the interrupt. The external interrupt is disabled and reenabled with the general treatment of interrupts when entering and exiting the ISR.

I suggest that you simply set a flag with the interrupt and poll for it in loop. When you see that it is set, do the serial printing and the reseting of the alarm. Alternatively, just poll the interrupt pin, and when you see it is LOW , clear the alarm interrupt, and execute a setAlarm function which is not an ISR, but simply a function called when the interrupt pin is sensed LOW.