I've been trying to get IRQ working with this RTC for a couple of weeks but with no luck. What happens is that when I power on my SBC the RTC drives IRQ low despite the fact I've disabled IRQ in the init routine of the chip.
I've connected IRQ to the MPU (WDC65C02 1MHz) and it is pulled up (measured resistance between pin 5 on RTC and VCC and it is 3.3 kOhm). KS and Vbaux are grounded and PWR and RST are pulled up and not connected to anything else.
My init routine looks like this:
Code:
21 >8000 0f rtcreg .byte wr_crb ;control B
22 >8001 08 .byte wr_seca ;alarm sec
23 >8002 09 .byte wr_mina ;alarm min
24 >8003 0a .byte wr_hrsa ;alarm hour
25 >8004 0b .byte wr_dowa ;alarm date/day
26 >8005 0c .byte wr_wdms ;watchdog msecs * 10
27 >8006 0d .byte wr_wds ;watchdog secs
28 >8007 0f .byte wr_crb ;control B
29 =8 n_rtcreg =*-rtcreg
34 >8008 80 rtcparm .byte wr_irqoff ;updates on & WDT IRQs off
35 >8009 00 .byte wr_secap ;no alarm secs IRQ
36 >800a 00 .byte wr_minap ;no alarm min IRQ
37 >800b 00 .byte wr_hrsap ;no alarm hour IRQ
38 >800c 00 .byte wr_dowap ;no alarm date/day IRQ
39 >800d 01 .byte wr_wdmsp ;10 ms underflows LSB
40 >800e 00 .byte wr_wdsp ;10 ms underflows MSB
41 >800f 00 .byte wr_crbpa ;updates & WDT IRQs off
56 .8010 INITRTC
57 .8010 a0 07 LDY #N_RTCREG-1
58 .8012 L10
59 .8012 b9 08 80 LDA RTCPARM,Y
60 .8015 be 00 80 LDX RTCREG,Y
61 .8018 9d a0 7f STA IO_RTC,X
62 .801b 88 DEY
63 .801c 10 f4 BPL L10
64 .801e 60 RTS
When this code is run, interrupts are turned off. If I understand the datasheet right all IRQs should be turned off but updates of internal to external registers should be enabled.
Yeah, some of you might recognise the constants
. I got a bit desperate when nothing worked and starting to copy code that is supposed to work. Still doesn't work unfortunately. I tried the same setup with another DS1511Y and got the same results. If it matters I bought both from digi-key.
If I disconnect the IRQ line, I can set the time/date and read it as well. I just can't get interrupts to work.
Has anyone here experienced anything like this with the DS1511Y?