Specialist Supplier of Crystals & Frequency Control Componentssales@mecxtal.com.cn0755-26500570
MERLIN home / Rednote / Digital Interfaces and Clock Division

Why the MCP795W20 trim sign lives in the hour register when using a SaRonix-eCera G9 crystal

The MCP795W20 stores trim direction separately from magnitude. Microchip's register summary places the eight-bit TRIMVAL magnitude in OSCTRIM but places TRIMSIGN in bit 7 of RTCHOUR. On a board whose 32.768 kHz SaRonix-eCera G9 crystal has already been qualified for startup and load, set TRIMSIGN for a slow oscillator and clear it for a fast oscillator as documented. Do not place a two's-complement signed value into OSCTRIM, and do not overwrite the entire hour register with 0x80 just to set the sign.

For example, in 24-hour mode an RTCHOUR value of 0x14 represents 14:00 hours with the sign bit clear. To set only the sign in this example, preserve the lower seven bits and OR the read value with 0x80, yielding 0x94. Write the trim magnitude separately. Under the documented normal trim formula, a measured error of approximately 10 ppm slow gives a magnitude of 10 times 32768 times 60 divided by 1000000 times two, or about 9.83, rounded to approximately 10. Coarse trim has a different step and application interval, so do not reuse this example in coarse mode.

Avoid a read-modify-write across an hour rollover and follow the product's time-update procedure. Verify the hour format, hour value, sign and magnitude afterward. If another task can set the clock, serialize those operations rather than assuming the read and write are atomic. Measure long enough to confirm the correction direction and remaining error, with temperature, load and trim mode recorded. Treat the archived G9 sheet as component selection evidence, separate from RTC register behavior and the measured result.

Related selection guide: MERLIN Crystal Timing: Starting an MCU from a 32 kHz RTC Output: MCP795B20 vs MCP795W20 at Cold Boot

Resource link: https://www.mecxtal.com.cn/en/handbook/mcp795b20-boot-clock-host-start.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.