wire not working after interrupt

So I have a DS8523 RTC that I would like to use to wake up the processor after an alarm goes off. There is a library for the 8523 that is available but as far as I can tell it does not support setting an alarm. So I went into an area of programming I have very little experience with. I have used wire library to create the functions I need. Setting and reading various registers on the 8523. I am now at the point of testing this to make sure it does what I want it to do. What I have found is that for an initial pass the code works well and the interrupt is execute appropriately, but after that the wire no longer works and the program hangs. I can't imagine that this is an unusual need to use the wire and to execute interrupts repeatedly. Can you look at my code an see if there is anything that will fix this problem? Thanks.

Code is in attached file: pcf8523_Test.ino

pcf8523_test.ino (9.53 KB)

I guess your problem is not that Wire is not working but that you loop in the interrupt service routine. You configured attachInterrupt to fire an interrupt when pin 3 is in state LOW. If that's the case the Arduino wakes up (if you put it to sleep before), enters the ISR, there it sets a boolean flag variable, leaves the ISR and enters it again because pin 3 is still LOW. So you either have to clear the interrupt signal in the PCF8523 during the ISR or configure the interrupt pin to fire on edges only (FALLING is probably the correct value for your case).