N64 '''Clock Timing''' originates from two quartz crystal resonators that supply reference clocks to [[wikipedia:Phase-locked loop|phase-locked loop]] (PLL) clock synthesizers, which generate the system clocks used throughout the console. These reference inputs are designated X'tal1 (X1) and X'tal2 (X2) in the Macronix MX8350 datasheet. X1 is the clock source for the [[Reality Coprocessor|Reality Coprocessor's]] [[Video Interface]], [[Audio Interface]], and [[Video DAC|video encoder]]. X2 provides a reference clock which is synthesized to drive [[RDRAM]], from which downstream clocks for all non-AV systems are derived. Video and audio subsystem clocks derive from X1; all other system clocks derive from X2. X1 varies by region to account for differing broadcast standards. == Crystal 1 (X1) == A quartz crystal resonator on the N64 motherboard supplies the X1 reference clock to the clock synthesizer (U7 or U17)Early boards use the 8-pin Macronix MX8330MC at U7; later revisions substitute with MX9911MC. "Funtastic"-era and later models consolidate U7 and U15 into a single 14-pin MX8350 synthesizer at U17. in order to generate the VI clock frequency (VCLK). The N64 utilizes AT-cut crystals sourced from Daishinku Co., Ltd. (KDS)Corroborated by [https://gbhwdb.gekkio.fi/ Game Boy hardware database] explicitly identifying identical crystals as Daishinku Co., Ltd. (est. 1959 as Daiwa Shinku Kogyosho), [https://commons.wikimedia.org/wiki/File:Nintendo-Famicom-Motherboard-BL.jpg "KDS" markings on Famicom and NES resonators], and an [https://fcc.report/FCC-ID/BKEHAC013/3265207.pdf FCC report] indicating an ongoing supplier relationship between Nintendo and Daishinku. Crystals identical in appearance and marking convention to those positively identified as KDS crystals have been confirmed to appear on at least Game Boy, SNES, Virtual Boy, N64, and Game Boy Color hardware. with a baseline frequency tolerance of ±30 ppmX1 and X2 are visually identified as AT-49 hermetically sealed through-hole AT-cut crystal resonators from [https://commons.wikimedia.org/wiki/File:Nintendo-N64-Motherboard-Top.jpg N64 motherboard photography (Evan-Amos, Wikimedia Commons)], consistent with KDS AT-49 appearance and lot encoding ([https://www.kds.info/wp-content/uploads/2015/11/2011-2012_032_en.pdf KDS AT-38/AT-49 Datasheet]). Base grade frequency tolerance is given at ±30 ppm.; derived signals inherit this proportional error. === Crystal Frequency Derivation === [[File:CCIR-1990-Rep.624-4-Table.png|thumb|alt=Chrominance sub-carrier frequencies. M/NTSC: 3,579,545 ± 10 Hz; M/PAL: 3,575,611.49 ± 10 Hz ; B/PAL: 4,433,618.75 ± 5 Hz|Chrominance sub-carrier frequencies. M/NTSC: 3,579,545 ± 10 Hz; M/PAL: 3,575,611.49 ± 10 Hz ; B/PAL: 4,433,618.75 ± 5 Hz. Image from: [http://handle.itu.int/11.1004/020.1000/4.283 CCIR Report 624-4 (1990), Table II]]] Each regional broadcast standard defines a horizontal line frequency (f_H), from which the chrominance subcarrier frequency (f_{SC})The television broadcast standard-specific frequency that carries color information in composite video signals. Also referred to as color subcarrier or colorburst. Note that "burst" refers specifically to the sample of this subcarrier transmitted during the back porch to establish a phase and frequency reference. is derived as a fixed rational multiple. The X1 resonant frequency is specified as 4 × f_{SC}. All frequencies are given in hertz (Hz). {| class="wikitable" style="text-align: center;" ! Standard !! f_H !! f_{SC} : f_H !! f_{SC} !! X1 |- | '''NTSC''' || \frac{2{,}250{,}000}{143} || f_{SC} = \frac{455}{2} f_H || \frac{315}{88} \times 10^6 || \frac{315}{22} \times 10^6 |- | '''PAL''' || 15{,}625 || f_{SC} = \left(\frac{1135}{4} + \frac{1}{625}\right) f_H || \frac{17{,}734{,}475}{4} || 17{,}734{,}475 |- | '''MPAL''' || \frac{2{,}250{,}000}{143} || f_{SC} = \frac{909}{4} f_H || \frac{511{,}312{,}500}{143} || \frac{2{,}045{,}250{,}000}{143} |} Converted to decimal (Hz): {| class="wikitable" style="text-align: center;" ! Standard !! f_H !! f_{SC} : f_H !! f_{SC} !! X1 |- | '''NTSC''' || 15,734.2657 || 227.5 f_H || 3,579,545.4545 || 14,318,181.8182 |- | '''PAL''' || 15,625 || 283.7516 f_H || 4,433,618.75 || 17,734,475 |- | '''MPAL''' || 15,734.2657 || 227.25 f_H || 3,575,611.8881 || 14,302,447.5524 |} === Clock Synthesis === [[File:MX8350-Table.png|thumb|alt=MX8350 functional description and frequency table.|MX8350 functional description and frequency table. Image from: [http://www.datasheet.hk/view_download.php?id=1145313&file=0069%5Cmx8350_566191.pdf IC-ON-LINE - Macronix MX8350 datasheet mirror]]] [[File:MX8330 video maths.png|thumb|alt=MX8330MC description. FSEL (frequency select) logic and Revision E notice|MX8330 description. FSEL (frequency select) logic and Revision E notice. Image from: [https://wiki.console5.com/tw/images/e/e3/MX8330.pdf Console5 - Macronix MX8330MC datasheet mirror]]] The PLL clock synthesizer (Macronix MX8330MC / MX9911MC / MX8350) derives the necessary clocks from the X1 crystal input: * '''FSC''': Chrominance subcarrier = X1 ÷ 4 * '''VCLK''': Video clock = X1 × multiplier ÷ 5 '''FSEL (NTSC/!PAL)''':This pin is marked FSEL on the MX8330MC and MX9911MC datasheets; the equivalent pin on the MX8350 is referred to as '''NTSC/!PAL''' (! = active low). Input pin; tied high or low. Selects the VCLK multiplier: {| class="wikitable" style="text-align: center;" ! Standard !! FSEL Pin State !! Multiplier |- | '''NTSC, MPAL''' || High || 17× |- | '''PAL''' || Low || 14× |} Video clock frequency is calculated as: VCLK = \frac{X1 \times \text{Multiplier}}{5} All values in MHz: {| class="wikitable" style="text-align: center;" ! Standard !! FSC (f_{SC}) !! Crystal 1 (X1) !! FSEL (NTSC/!PAL) !! Multiplier !! Divider !! VCLK |- | '''NTSC''' || 3.57954545 || 14.31818182 || High || 17 || 5 || 48.68181818 |- | '''PAL''' || 4.43361875 || 17.734475 || Low || 14 || 5 || 49.65653 |- | '''MPAL''' || 3.57561189 || 14.30244755 || High || 17 || 5 || 48.62832167 |} ==== MX8330MC pinout ==== {| class="wikitable" style="text-align: center;" |+ ! Name !! Pin !! !! Pin !! Name |- | FSO/5 || 1 || || 8 || FSC |- | GND || 2 || || 7 || FSEL |- | FSO || 3 || || 6 || OSCIN |- | VDD || 4 || || 5 || OSCOUT |} ==== MX9911MC pinout ==== {| class="wikitable" style="text-align: center;" |+ ! Name !! Pin !! !! Pin !! Name |- | FSO/5 || 1 || || 8 || FSC |- | GND || 2 || || 7 || FSEL |- | N.C.Because the Rambus Signaling Level FSO pin is internally not connected (N.C.) on MX9911MC, it can only be used at U7 for AV reference clocks. It exclusively outputs TTL and is incapable of RSL. || 3 || || 6 || OSCIN |- | VDD || 4 || || 5 || OSCOUT |} ==== MX8350 pinout ==== {| class="wikitable" style="text-align: center;" |+ ! Name !! Pin !! !! Pin !! Name |- | FSC || 1 || || 14 || !RESET |- | GND || 2 || || 13 || OSC1 IN |- | VCLK || 3 || || 12 || OSC1 OUT |- | VDD || 4 || || 11 || GND |- | OSC2 IN || 5 || || 10 || TEST |- | OSC2 OUT || 6 || || 9 || VDD |- | NTSC/!PAL || 7 || || 8 || RCLK |} == Crystal 2 (X2) == A second quartz crystal resonator (X2) produces another reference clock which is synthesized by the PLL clock generator and routed to RDRAM. X2 is multiplied by 17On early boards using MX8330MC, this multiplier requires FSEL to be tied high on X2's paired discrete synthesizer. On boards with MX8350, this is a fixed 17× multiplier regardless of NTSC/!PAL pin state. to produce RCLK,RCLK is distributed via Rambus Signaling Level (RSL), a low-voltage swing interface, via the synthesizer's '''FSO''' (MX8330MC) or '''RCLK''' (MX8350) pin. This is distinct from the Transistor-Transistor Logic (TTL) '''FSO/5''' (MX8330MC) or '''VCLK''' (MX8350) pin. from which all non-AV system clocks are derived, including the MasterClock (MClock).See [[SysAD_Interface]]. All values in MHz: {| class="wikitable" style="text-align:center;" |- ! Clock !! Derivation !! Fraction !! Decimal |- | '''X2''' || n/a || \frac{250}{17}The MX8350 datasheet specifies an RCLK of 250 MHz and a multiplier of 17. || 14.7058823529 |- | '''RCLK''' || X2 × 17 || 250 || 250 |- | '''MClock''' || RCLK ÷ 4 || \frac{125}{2} || 62.5 |- | '''[[VR4300|CPU]]''' || MClock × \frac{3}{2} || \frac{375}{4} || 93.75CPU clock multiplier set via [[VR4300]] DivMode (Divide Mode) static pin inputs. 93.75 MHz is the nominal operating frequency. |- | '''[[Serial Interface]]''' || MClock ÷ 4 || \frac{125}{8} || 15.625 |- | '''[[Game_Pak|Cartridge]] / [[PIF]]''' || SI ÷ 8 || \frac{125}{64} || 1.953125 |} === [[VR4300]] Clock Domains === The NUS-CPU itself generates clock domains using an integrated PLL, referenced to the MClock input. This clock architecture is described in the NEC VR4300 documentation: * '''PClock''': Principal operating frequency; generated from MClock via PLL using DivMode configuration pins (sampled on cold reset). Frequency is divided by 4 in low-power mode. * '''SClock''': Internal system interface clock; normally equal to MClock. Reduced in tandem with PClock in low-power mode. * '''TClock''': Transmit clock output for external agents. Always equal to MasterClock regardless of DivMode setting. {| class="wikitable" style="text-align:center" |- ! DivMode (1:0) !! MClock : PClock !! MClock (MHz) !! PClock (MHz) |- | 0b00DivMode value 0b00 is marked RFU (Reserved for Future Use) in the VR4300 User's Manual. In the MTI R4300i documentation, this mode is indicated to use a 1:1 ratio. || 1 : 1 || 62.5 || 62.5 |- | 0b01 || 1 : 1.5 || 62.5 || 93.75 |- | 0b10 || 1 : 2 || 62.5 || 125 |- | 0b11 || 1 : 3 || 62.5 || 187.5 |} The [https://n64brew.dev/wiki/File:VR4300-Users-Manual.pdf VR4300 manual] also notes: "The maximum value of PClock is the same as the maximum internal operating frequency of each product regardless of the frequency ratio." The higher DivMode ratios exceed the nominal operating specification of an umodified N64 CPU. == References == * [http://handle.itu.int/11.1004/020.1000/4.283 ITU Digital Collection - CCIR Report 624-4 (1990)] * [https://wiki.console5.com/wiki/File:N64_NUS-CPU-03-04.pdf Console5 Tech Wiki - RDC - NUS-CPU-03/04 Schematic (mirror)] * [https://www.datasheetarchive.com/datasheet/MX8330/Macronix-International?term=MX8330 Datasheet Archive - Macronix MX8330MC datasheet (mirror)] * [https://www.datasheetarchive.com/datasheet/MX9911/Macronix-International?term=mx9911 Datasheet Archive - Macronix MX9911MC datasheet (mirror)] * [https://www.datasheetarchive.com/datasheet/MX8350/Macronix-International?term=MX8350 Datasheet Archive - Macronix MX8350 datasheet (mirror)] * [https://www.datasheetarchive.com/datasheet/0a2c800efae9bfe2 Datasheet Archive - KDS America - Quartz Crystals - AT-49, AT-38, UM-5, UM-1, UM-2, HC-49/U, p.6 (1993) (mirror)] * [https://www.kds.info/wp-content/uploads/2015/11/2011-2012_032_en.pdf KDS - AT-38/AT-49 Miniature Crystal Resonators datasheet (2011)] * [https://n64brew.dev/wiki/File:VR4300-Users-Manual.pdf NEC - VR4300 User's Manual (mirror)] * [https://ultra64.ca/files/documentation/silicon-graphics/SGI_R4300_RISC_Processor_Specification_REV2.2.pdf ultra64.ca - MIPS Technologies Inc. - R4300 RISC Processor Specification, Revision 2.2 (mirror)] * [https://assemblergames.org/viewtopic.php?t=25918 assemblergames.org - eb1560 et al - Mapping N64 Overclockability] * [https://patents.google.com/patent/US6310814B1 Google Patents - US6310814B1, ''Rambus DRAM (RDRAM) apparatus and method for performing refresh operations''] * [https://patents.google.com/patent/US3283170A Google Patents - US3283170A, ''Coupling transistor logic and other circuits''] * [https://gbhwdb.gekkio.fi/ Game Boy hardware database - Gekkio et al ] * [https://fcc.report/FCC-ID/BKEHAC013/3265207.pdf FCC - Test Report No. : 11319287S-A-R2] * [https://commons.wikimedia.org/wiki/File:Nintendo-N64-Motherboard-Top.jpg Wikimedia Commons - Evan-Amos - Nintendo-N64-Motherboard-Top.jpg] * [https://commons.wikimedia.org/wiki/File:Nintendo-Famicom-Motherboard-BL.jpg Wikimedia Commons - Evan-Amos - Nintendo-Famicom-Motherboard-BL.jpg] * [https://github.com/meauxdal/N64-Refresh-Rate-Reference github.com - meauxdal - N64 Video Timing Reference] == Footnotes == [[Category:Motherboard components]]