Specialist Supplier of Crystals & Frequency Control Componentssales@mecxtal.com.cn0755-26500570
MERLIN home / Rednote / Low-Frequency Timing and System Power

Diodes PT7C4339D crystal RTC: Which alarm can fire at second 37 each minute?

Use Alarm 1. Both PT7C4339D alarms use the same calendar timebase derived from the 32.768 kHz crystal, but their compare fields are not interchangeable. Alarm 1 can compare seconds and therefore match second 37 of every minute. Alarm 2 has no seconds register; the vendor explicitly says its once-per-minute option occurs at second 00. Improving crystal accuracy cannot move that alarm's compare condition to second 37.

Read the masks in the vendor's order

Table 5 orders the bits as A1M4, A1M3, A1M2 and A1M1. The 1110 combination compares seconds alone. The BCD seconds field occupies the low seven bits of register 07h, so second 37 corresponds to 37h with A1M1 clear. Each of the other three bytes carries its own mask bit. Do not write 1110 as a single nibble into one register. Setting all four masks to one instead selects an event every second, irrespective of the stored value 37.

Alarm 2 uses three masks, A2M4 through A2M2. Its 111 combination corresponds to second 00 of every minute. Copying a four-byte Alarm 1 configuration into the Alarm 2 address region would touch different functions. If one job needs a particular second and another needs the minute boundary, allocate Alarm 1 to the former first; do not let software treat the two alarm channels as equivalent resources.

Test the comparison and the shared pin separately

On a controlled board without other pending jobs, record the actual seconds and A1F over at least three minutes. Clear the latched A1F by writing zero to that flag after recording each event; an uncleared flag is not a fresh match. If the design needs a pin interrupt as well, check INTCN and the corresponding A1IE separately. The match flag and the shared SQW/INT pin are two observations, and another active alarm can already hold that line asserted. In the test record, save the expected second, mask order and register readback rather than just writing 'once per minute'. An alarm at each minute boundary is useful, but it does not satisfy this requirement.

Related selection guide: MERLIN Crystal Timing: Diodes PT7C4339D Crystal RTC: Can an Apparent January 1 Power-On Date Be Trusted?

Resource link: https://www.mecxtal.com.cn/en/handbook/dio-018.html

WeChat

MERLIN · TIMING COMPONENTS

Scan with WeChat to contact Sales

Add our WeCom contacts from your usual WeChat app.

On desktop, scan with your phone. On mobile, save the QR image and select it from your album in WeChat Scan.