[{"element_type":"user_image","content":"https://cdn-learn.adafruit.com/user_assets/assets/000/002/436/original/GigaNES_Shield_Concept.png?1780951387","metadata":{}},{"element_type":"markdown","content":"\u003ch1\u003eGigaNES: High-Performance NES 🍄 Emulator for Arduino Giga\u003c/h1\u003e\n\n\u003cp\u003eCopyright (c) 2026 Kaled Souky. All rights reserved.\u003c/p\u003e\n\n\u003cp\u003eThis program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.\u003c/p\u003e\n\n\u003cp\u003eThis program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.\u003c/p\u003e\n\n\u003chr\u003e\n\n\u003cp\u003e\u003ca href=\"https://github.com/KaledSouky/GigaNES\"\u003eGigaNES\u003c/a\u003e (developed by \u003cstrong\u003eKaled Souky\u003c/strong\u003e in 2026) is a specialized port of the \u003cstrong\u003eNofrendo\u003c/strong\u003e NES emulator core, custom-engineered for the \u003ca href=\"https://store-usa.arduino.cc/collections/giga/products/giga-r1-wifi\"\u003eArduino Giga R1 WiFi\u003c/a\u003e (\u003ca href=\"https://www.st.com/en/microcontrollers-microprocessors/stm32h747xi.html\"\u003eSTM32H747XI\u003c/a\u003e) and the \u003ca href=\"https://store-usa.arduino.cc/collections/giga/products/giga-display-shield\"\u003eArduino Giga Display Shield\u003c/a\u003e. This project leverages the high-speed \u003cstrong\u003eCortex-M7\u003c/strong\u003e core and low-level STM32 register access to deliver a full-speed, low-latency gaming experience on modern Arduino hardware.\u003c/p\u003e\n\n\u003cp\u003eIn the field of emulation, the \u003ca href=\"https://www.st.com/en/microcontrollers-microprocessors/stm32h747xi.html\"\u003eSTM32H747XI\u003c/a\u003e delivers disruptive performance. Although it is a dual-core SoC, its \u003cstrong\u003e480 MHz Cortex-M7\u003c/strong\u003e core is the true standout: thanks to its \u003cstrong\u003esuperscalar architecture\u003c/strong\u003e and \u003cstrong\u003ezero-latency Tightly Coupled Memory (TCM)\u003c/strong\u003e, it processes video layers and transparencies with a fluidity that popular alternatives simply cannot match. While the \u003cstrong\u003eESP32\u003c/strong\u003e (Xtensa at 240 MHz) or the \u003cstrong\u003eRP2040/RP2350\u003c/strong\u003e (Cortex-M0+/M33 at 150 MHz) often encounter data access bottlenecks, this chip ensures consistent \u003cstrong\u003e60Hz (NTSC)\u003c/strong\u003e emulation, high-fidelity audio via its \u003cstrong\u003e12-bit DAC\u003c/strong\u003e, and imperceptible input lag. This undoubtedly positions this project as the most advanced and powerful NES emulator ever developed for the \u003cstrong\u003eArduino ecosystem\u003c/strong\u003e.\u003c/p\u003e\n\n\u003cp\u003eUnlike typical portable emulation projects based on Single-Board Computers (SBCs) like the Raspberry Pi 5 or Orange Pi, \u003ca href=\"https://github.com/KaledSouky/GigaNES\"\u003eGigaNES\u003c/a\u003e \u003cstrong\u003eoperates entirely on bare-metal hardware\u003c/strong\u003e. While high-performance MPUs rely on a complex Linux operating system layer—which introduces multi-threaded scheduling overhead, driver abstraction, and unpredictable input lag (ranging from 15 to 50 ms)—this project achieves a \u003cstrong\u003enear-zero latency (\u0026lt; 1 ms)\u003c/strong\u003e gaming experience. By avoiding the heavy overhead of an OS kernel, the Cortex-M7 core samples controller inputs through direct low-level register access in a deterministic manner. Furthermore, this MCU-centric design eliminates data corruption risks during sudden power-offs, boots instantly in under a second, and operates with extreme thermal efficiency, delivering a silent, fanless, and robust console experience that modern MPU-based alternatives cannot replicate.\u003c/p\u003e\n","metadata":{"markdown":"# GigaNES: High-Performance NES 🍄 Emulator for Arduino Giga \n\nCopyright (c) 2026 Kaled Souky. All rights reserved.\n\nThis program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.\n\nThis program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.\n\n---\n\n[GigaNES](https://github.com/KaledSouky/GigaNES) (developed by **Kaled Souky** in 2026) is a specialized port of the **Nofrendo** NES emulator core, custom-engineered for the [Arduino Giga R1 WiFi](https://store-usa.arduino.cc/collections/giga/products/giga-r1-wifi) ([STM32H747XI](https://www.st.com/en/microcontrollers-microprocessors/stm32h747xi.html)) and the [Arduino Giga Display Shield](https://store-usa.arduino.cc/collections/giga/products/giga-display-shield). This project leverages the high-speed **Cortex-M7** core and low-level STM32 register access to deliver a full-speed, low-latency gaming experience on modern Arduino hardware.\n\nIn the field of emulation, the [STM32H747XI](https://www.st.com/en/microcontrollers-microprocessors/stm32h747xi.html) delivers disruptive performance. Although it is a dual-core SoC, its **480 MHz Cortex-M7** core is the true standout: thanks to its **superscalar architecture** and **zero-latency Tightly Coupled Memory (TCM)**, it processes video layers and transparencies with a fluidity that popular alternatives simply cannot match. While the **ESP32** (Xtensa at 240 MHz) or the **RP2040/RP2350** (Cortex-M0+/M33 at 150 MHz) often encounter data access bottlenecks, this chip ensures consistent **60Hz (NTSC)** emulation, high-fidelity audio via its **12-bit DAC**, and imperceptible input lag. This undoubtedly positions this project as the most advanced and powerful NES emulator ever developed for the **Arduino ecosystem**.\n\nUnlike typical portable emulation projects based on Single-Board Computers (SBCs) like the Raspberry Pi 5 or Orange Pi, [GigaNES](https://github.com/KaledSouky/GigaNES) **operates entirely on bare-metal hardware**. While high-performance MPUs rely on a complex Linux operating system layer—which introduces multi-threaded scheduling overhead, driver abstraction, and unpredictable input lag (ranging from 15 to 50 ms)—this project achieves a **near-zero latency (\u0026lt; 1 ms)** gaming experience. By avoiding the heavy overhead of an OS kernel, the Cortex-M7 core samples controller inputs through direct low-level register access in a deterministic manner. Furthermore, this MCU-centric design eliminates data corruption risks during sudden power-offs, boots instantly in under a second, and operates with extreme thermal efficiency, delivering a silent, fanless, and robust console experience that modern MPU-based alternatives cannot replicate.\n\n"}},{"element_type":"embed","content":"https://www.youtube.com/watch?v=UeTaBbGmuQU"},{"element_type":"markdown","content":"\u003ch2\u003e1. 👩‍🏫 Technical Specifications: Architecture (v1.0)\u003c/h2\u003e\n\n\u003ch3\u003e1.1 Video System (High-Performance Blitter)\u003c/h3\u003e\n\n\u003cul\u003e\n\u003cli\u003e\n\u003cstrong\u003eM7 Brute Force:\u003c/strong\u003e Due to hardware DMA2D limitations for simultaneous rotation and scaling, the Cortex-M7 core is utilized to perform a high-speed software transformation, bypassing standard HAL overhead.\u003c/li\u003e\n\u003cli\u003e\n\u003cstrong\u003eRotation \u0026amp; Scaling Architecture:\u003c/strong\u003e Adapts the native NES output (256×240) to the MIPI DSI panel (native Portrait 480×800) to achieve a \u003cstrong\u003etrue Landscape orientation\u003c/strong\u003e:\n\n\u003cul\u003e\n\u003cli\u003e\n\u003cstrong\u003eShort Axis:\u003c/strong\u003e The scaled NES height (240×2 = 480) perfectly matches the display's native width.\u003c/li\u003e\n\u003cli\u003e\n\u003cstrong\u003eLong Axis:\u003c/strong\u003e The scaled NES width (256×2 = 512) is centered on the 800px long axis.\u003c/li\u003e\n\u003c/ul\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cstrong\u003eBus Optimization (64-bit Writes):\u003c/strong\u003e To maximize throughput on the memory bus, the system utilizes \u003ccode class=\"inline\"\u003euint64_t\u003c/code\u003e pointers to transfer 4 pixels (16-bit each) per single bus operation.\u003c/li\u003e\n\u003cli\u003e\n\u003cstrong\u003eLoop Unrolling (8x):\u003c/strong\u003e The critical blitter loop is unrolled 8 times to minimize branch overhead, achieving consistent \u003cstrong\u003eBlit times of ~6.0ms\u003c/strong\u003e (consuming only 36% of the total frame time budget).\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003ch3\u003e1.2 Audio System (High-Fidelity Design)\u003c/h3\u003e\n\n\u003cul\u003e\n\u003cli\u003e\n\u003cstrong\u003eSampling Rate (44100 Hz):\u003c/strong\u003e Set to the CD-quality standard to ensure maximum sound accuracy. This frequency captures the full harmonic spectrum of the NES APU and specialized expansion chips (like the VRC6), providing a rich and authentic auditory experience.\u003c/li\u003e\n\u003cli\u003e\n\u003cstrong\u003eDAC Output:\u003c/strong\u003e Utilizes the \u003cstrong\u003eAdvanced DAC\u003c/strong\u003e (DAC0 / Pin A12) integrated into the STM32H7. The system performs precise dynamic mapping from 16-bit signed emulation samples to the 12-bit unsigned hardware output of the peripheral.\u003c/li\u003e\n\u003cli\u003e\n\u003cstrong\u003eStability \u0026amp; Buffer:\u003c/strong\u003e Implements a circular buffer with an \u003cstrong\u003ex8 DMA queue depth\u003c/strong\u003e. This specific \"sweet spot\" balance ensures crisp, glitch-free audio without \"popping\" or latency issues, even during intensive CPU cycles.\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003ch3\u003e1.3 Memory Management (Hybrid Hierarchy)\u003c/h3\u003e\n\n\u003cul\u003e\n\u003cli\u003e\n\u003cstrong\u003eDTCMRAM (128 KB):\u003c/strong\u003e Zero-latency memory directly coupled to the core. Hosts the \u003ccode class=\"inline\"\u003eemu_buf\u003c/code\u003e (256x240) and \u003ccode class=\"inline\"\u003ehw_palette\u003c/code\u003e, eliminating CPU wait states during the scaling process.\u003c/li\u003e\n\u003cli\u003e\n\u003cstrong\u003eInternal SRAM:\u003c/strong\u003e Stores executable code and critical emulator state variables.\u003c/li\u003e\n\u003cli\u003e\n\u003cstrong\u003eExternal SDRAM (8 MB):\u003c/strong\u003e Managed by the FMC (Flexible Memory Controller) for the screen's Double Framebuffer and PRG/CHR ROM bank storage.\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003ch3\u003e1.4 Input Management (Low-Latency NES Controllers)\u003c/h3\u003e\n\n\u003cul\u003e\n\u003cli\u003e\n\u003cstrong\u003eDirect Register Access:\u003c/strong\u003e Bypasses Arduino's \u003ccode class=\"inline\"\u003edigitalWrite\u003c/code\u003e/\u003ccode class=\"inline\"\u003edigitalRead\u003c/code\u003e functions for the original NES controller interface.\u003c/li\u003e\n\u003cli\u003e\n\u003cstrong\u003eAtomic Manipulation:\u003c/strong\u003e Utilizes the \u003cstrong\u003eBSRR\u003c/strong\u003e (Bit Set/Reset Register) for \u003cem\u003eLatch\u003c/em\u003e and \u003cem\u003eClock\u003c/em\u003e lines, ensuring state changes in a single clock cycle.\u003c/li\u003e\n\u003cli\u003e\n\u003cstrong\u003eInstant Capture:\u003c/strong\u003e Data line reading is performed via the \u003cstrong\u003eIDR\u003c/strong\u003e (Input Data Register), eliminating input lag and providing a response identical to the original hardware.\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003ch3\u003e1.5 Storage \u0026amp; SD (Asynchronous Persistence System)\u003c/h3\u003e\n\n\u003cul\u003e\n\u003cli\u003e\n\u003cstrong\u003eLibrary:\u003c/strong\u003e \u003cstrong\u003eSdFat\u003c/strong\u003e in \u003ccode class=\"inline\"\u003eDEDICATED_SPI\u003c/code\u003e mode (50 MHz) for maximum I/O speed.\u003c/li\u003e\n\u003cli\u003e\n\u003cstrong\u003eAuto-Save Engine:\u003c/strong\u003e Emulates the original battery-backed RAM (SRAM) behavior by monitoring writes in the \u003ccode class=\"inline\"\u003e$6000-$7FFF\u003c/code\u003e range. This ensures that \"natural\" game progress is automatically preserved.\u003c/li\u003e\n\u003cli\u003e\n\u003cstrong\u003eZero-Jitter SaveThread:\u003c/strong\u003e An independent RTOS thread manages the creation and updating of \u003cstrong\u003e\u003ccode class=\"inline\"\u003e.sav\u003c/code\u003e\u003c/strong\u003e files in the background. By using a shadow buffer, it ensures that saving does not impact emulation fluidity, eliminating any stuttering or frame drops.\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003ch3\u003e1.6 Dynamic Region Detection\u003c/h3\u003e\n\n\u003cul\u003e\n\u003cli\u003e\n\u003cstrong\u003eHeader Parsing:\u003c/strong\u003e The system analyzes iNES flags to automatically detect NTSC or PAL formats.\u003c/li\u003e\n\u003cli\u003e\n\u003cstrong\u003eHardware Synchronization:\u003c/strong\u003e Dynamically adjusts the MIPI controller \u003cstrong\u003ePixel Clock\u003c/strong\u003e (23.7 MHz for PAL / 28.4 MHz for NTSC) and scanline count, maintaining correct game speed without display resets.\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003ch3\u003e1.7 DMA \u0026amp; Dedicated Hardware Utilization\u003c/h3\u003e\n\n\u003cul\u003e\n\u003cli\u003e\n\u003cstrong\u003eVideo:\u003c/strong\u003e The LTDC/DSI controller utilizes hardware DMA to read the framebuffer from SDRAM autonomously.\u003c/li\u003e\n\u003cli\u003e\n\u003cstrong\u003eAudio:\u003c/strong\u003e The DAC uses internal timers for output cadence, freeing the CPU from the precise timing of audio samples.\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003chr\u003e\n\n\u003ch2\u003e2. 👨‍💻 Software Requirements\u003c/h2\u003e\n\n\u003cp\u003eIn your Arduino IDE, you must have the following packages and libraries installed; if you do not have them, install them using the \u003ca href=\"https://docs.arduino.cc/software/ide-v2/tutorials/ide-v2-board-manager/\"\u003eBoards Manager\u003c/a\u003e and \u003ca href=\"https://docs.arduino.cc/software/ide-v2/tutorials/ide-v2-installing-a-library/\"\u003eLibrary Manager\u003c/a\u003e:\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003e\u003cstrong\u003eThe Arduino Mbed OS Giga Board Package\u003c/strong\u003e\u003c/li\u003e\n\u003cli\u003e\n\u003ccode class=\"inline\"\u003eArduino_H7_Video\u003c/code\u003e (Included in the Arduino Mbed OS Giga Board Package)\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/arduino-libraries/Arduino_GigaDisplay\"\u003eArduino_GigaDisplay\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/arduino-libraries/Arduino_AdvancedAnalog\"\u003eArduino_AdvancedAnalog\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/greiman/SdFat\"\u003eSdFat\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\n\u003ccode class=\"inline\"\u003eSDRAM\u003c/code\u003e (Included in the Arduino Mbed OS Giga Board Package)\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003chr\u003e\n\n\u003ch2\u003e3. 👩‍🔧 Hardware Implementation Details\u003c/h2\u003e\n","metadata":{"markdown":"## 1. 👩‍🏫 Technical Specifications: Architecture (v1.0)\n\n### 1.1 Video System (High-Performance Blitter)\n* **M7 Brute Force:** Due to hardware DMA2D limitations for simultaneous rotation and scaling, the Cortex-M7 core is utilized to perform a high-speed software transformation, bypassing standard HAL overhead.\n* **Rotation \u0026amp; Scaling Architecture:** Adapts the native NES output (256×240) to the MIPI DSI panel (native Portrait 480×800) to achieve a **true Landscape orientation**:\n    * **Short Axis:** The scaled NES height (240×2 = 480) perfectly matches the display's native width.\n    * **Long Axis:** The scaled NES width (256×2 = 512) is centered on the 800px long axis.\n* **Bus Optimization (64-bit Writes):** To maximize throughput on the memory bus, the system utilizes `uint64_t` pointers to transfer 4 pixels (16-bit each) per single bus operation.\n* **Loop Unrolling (8x):** The critical blitter loop is unrolled 8 times to minimize branch overhead, achieving consistent **Blit times of ~6.0ms** (consuming only 36% of the total frame time budget).\n\n### 1.2 Audio System (High-Fidelity Design)\n* **Sampling Rate (44100 Hz):** Set to the CD-quality standard to ensure maximum sound accuracy. This frequency captures the full harmonic spectrum of the NES APU and specialized expansion chips (like the VRC6), providing a rich and authentic auditory experience.\n* **DAC Output:** Utilizes the **Advanced DAC** (DAC0 / Pin A12) integrated into the STM32H7. The system performs precise dynamic mapping from 16-bit signed emulation samples to the 12-bit unsigned hardware output of the peripheral.\n* **Stability \u0026amp; Buffer:** Implements a circular buffer with an **x8 DMA queue depth**. This specific \"sweet spot\" balance ensures crisp, glitch-free audio without \"popping\" or latency issues, even during intensive CPU cycles.\n\n### 1.3 Memory Management (Hybrid Hierarchy)\n* **DTCMRAM (128 KB):** Zero-latency memory directly coupled to the core. Hosts the `emu_buf` (256x240) and `hw_palette`, eliminating CPU wait states during the scaling process.\n* **Internal SRAM:** Stores executable code and critical emulator state variables.\n* **External SDRAM (8 MB):** Managed by the FMC (Flexible Memory Controller) for the screen's Double Framebuffer and PRG/CHR ROM bank storage.\n\n### 1.4 Input Management (Low-Latency NES Controllers)\n* **Direct Register Access:** Bypasses Arduino's `digitalWrite`/`digitalRead` functions for the original NES controller interface.\n* **Atomic Manipulation:** Utilizes the **BSRR** (Bit Set/Reset Register) for *Latch* and *Clock* lines, ensuring state changes in a single clock cycle.\n* **Instant Capture:** Data line reading is performed via the **IDR** (Input Data Register), eliminating input lag and providing a response identical to the original hardware.\n\n### 1.5 Storage \u0026amp; SD (Asynchronous Persistence System)\n* **Library:** **SdFat** in `DEDICATED_SPI` mode (50 MHz) for maximum I/O speed.\n* **Auto-Save Engine:** Emulates the original battery-backed RAM (SRAM) behavior by monitoring writes in the `$6000-$7FFF` range. This ensures that \"natural\" game progress is automatically preserved.\n* **Zero-Jitter SaveThread:** An independent RTOS thread manages the creation and updating of **`.sav`** files in the background. By using a shadow buffer, it ensures that saving does not impact emulation fluidity, eliminating any stuttering or frame drops.\n\n### 1.6 Dynamic Region Detection\n* **Header Parsing:** The system analyzes iNES flags to automatically detect NTSC or PAL formats.\n* **Hardware Synchronization:** Dynamically adjusts the MIPI controller **Pixel Clock** (23.7 MHz for PAL / 28.4 MHz for NTSC) and scanline count, maintaining correct game speed without display resets.\n\n### 1.7 DMA \u0026amp; Dedicated Hardware Utilization\n* **Video:** The LTDC/DSI controller utilizes hardware DMA to read the framebuffer from SDRAM autonomously.\n* **Audio:** The DAC uses internal timers for output cadence, freeing the CPU from the precise timing of audio samples.\n\n---\n\n## 2. 👨‍💻 Software Requirements\n\nIn your Arduino IDE, you must have the following packages and libraries installed; if you do not have them, install them using the [Boards Manager](https://docs.arduino.cc/software/ide-v2/tutorials/ide-v2-board-manager/) and [Library Manager](https://docs.arduino.cc/software/ide-v2/tutorials/ide-v2-installing-a-library/):\n1. **The Arduino Mbed OS Giga Board Package**\n1. `Arduino_H7_Video` (Included in the Arduino Mbed OS Giga Board Package)\n2. [Arduino_GigaDisplay](https://github.com/arduino-libraries/Arduino_GigaDisplay)\n3. [Arduino_AdvancedAnalog](https://github.com/arduino-libraries/Arduino_AdvancedAnalog)\n4. [SdFat](https://github.com/greiman/SdFat)\n5. `SDRAM` (Included in the Arduino Mbed OS Giga Board Package)\n\n---\n\n## 3. 👩‍🔧 Hardware Implementation Details "}},{"element_type":"user_image","content":"https://cdn-learn.adafruit.com/user_assets/assets/000/002/437/original/Connection_Diagram.png?1780952009","metadata":{}},{"element_type":"markdown","content":"\u003ch3\u003e3.1 🔊 Audio \u0026amp; Amplification\u003c/h3\u003e\n\n\u003cp\u003eThe connection diagram features a \u003cstrong\u003ePAM8403\u003c/strong\u003e digital stereo amplifier module. Since the emulator generates a \u003cstrong\u003emonophonic signal\u003c/strong\u003e, only the \u003cstrong\u003eRight Channel\u003c/strong\u003e is used (Input: DAC0/Pin 12 | Output: 3W Speaker). You may use any monophonic (preferred) or stereo amplifier module, provided it operates at \u003cstrong\u003e3.3V\u003c/strong\u003e and offers good noise protection.\u003c/p\u003e\n\n\u003cblockquote\u003e\n\u003cp\u003e⚠️\nIf using a stereo module, \u003cstrong\u003edo not bridge\u003c/strong\u003e the Left and Right inputs or outputs to achieve \"dual mono\" sound. This unnecessarily increases current consumption and may exceed your power supply's capacity, leading to instability or hardware damage.\u003c/p\u003e\n\n\u003cp\u003e💡\nIf you experience audio noise, it is highly recommended to place a \u003cstrong\u003e470 µF (10V) electrolytic capacitor\u003c/strong\u003e and a \u003cstrong\u003e1 nF ceramic capacitor\u003c/strong\u003e in parallel across the power pins (V+ and GND), as close to the module as possible.\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003ch3\u003e3.2 🎮 NES Controllers (Single \u0026amp; Multiplayer)\u003c/h3\u003e\n\n\u003cp\u003eFor a single-player setup, follow the connections shown in \u003cstrong\u003e\u003cem\u003eConnection_Diagram.png\u003c/em\u003e\u003c/strong\u003e. For multiplayer mode, use the following wiring:\u003c/p\u003e\n\n\u003ctable\u003e\n\u003ctbody\u003e\n\u003ctr\u003e\n\u003cth style=\"text-align: left\"\u003eSignal\u003c/th\u003e\n\u003cth style=\"text-align: left\"\u003eArduino Giga Pin\u003c/th\u003e\n\u003cth style=\"text-align: left\"\u003eConnection\u003c/th\u003e\n\u003c/tr\u003e\n\u003c/tbody\u003e\n\u003ctbody\u003e\n\u003ctr\u003e\n\u003ctd style=\"text-align: left\"\u003e\u003cstrong\u003eLATCH\u003c/strong\u003e\u003c/td\u003e\n\u003ctd style=\"text-align: left\"\u003ePin 2\u003c/td\u003e\n\u003ctd style=\"text-align: left\"\u003eConnect to LATCH on \u003cstrong\u003eBOTH\u003c/strong\u003e controllers\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd style=\"text-align: left\"\u003e\u003cstrong\u003eCLOCK\u003c/strong\u003e\u003c/td\u003e\n\u003ctd style=\"text-align: left\"\u003ePin 3\u003c/td\u003e\n\u003ctd style=\"text-align: left\"\u003eConnect to CLOCK on \u003cstrong\u003eBOTH\u003c/strong\u003e controllers\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd style=\"text-align: left\"\u003e\u003cstrong\u003eDATA 1\u003c/strong\u003e\u003c/td\u003e\n\u003ctd style=\"text-align: left\"\u003ePin 4\u003c/td\u003e\n\u003ctd style=\"text-align: left\"\u003eConnect to DATA on \u003cstrong\u003eController 1 ONLY\u003c/strong\u003e\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd style=\"text-align: left\"\u003e\u003cstrong\u003eDATA 2\u003c/strong\u003e\u003c/td\u003e\n\u003ctd style=\"text-align: left\"\u003ePin 5\u003c/td\u003e\n\u003ctd style=\"text-align: left\"\u003eConnect to DATA on \u003cstrong\u003eController 2 ONLY\u003c/strong\u003e\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\n\u003ch3\u003e3.3 💾 MicroSD Card Module \u0026amp; Preparation\u003c/h3\u003e\n\n\u003cp\u003eThis project is tested with the \u003ca href=\"https://www.adafruit.com/product/254\"\u003eAdafruit MicroSD card breakout board+\u003c/a\u003e. Any alternative module must be compatible with \u003cstrong\u003e3.3V\u003c/strong\u003e logic.\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003e\n\u003cstrong\u003eFormat:\u003c/strong\u003e The SD card (up to 32 GB) \u003cstrong\u003eMUST\u003c/strong\u003e be formatted in \u003cstrong\u003eFAT32\u003c/strong\u003e.\u003c/li\u003e\n\u003cli\u003e\n\u003cstrong\u003eFilenames:\u003c/strong\u003e Use the \u003cstrong\u003e8.3 filename rule\u003c/strong\u003e (8 characters or less + \u003ccode class=\"inline\"\u003e.nes\u003c/code\u003e extension). Place all ROMs in the \u003cstrong\u003eroot directory\u003c/strong\u003e.\u003c/li\u003e\n\u003cli\u003e\n\u003cstrong\u003eLogic Levels:\u003c/strong\u003e If using a different module, ensure it has a built-in logic level shifter or is designed for 3.3V operation to match the Arduino Giga's I/O voltage.\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003ch3\u003e3.4 🚨 General Safety \u0026amp; Signal Integrity\u003c/h3\u003e\n\n\u003cblockquote\u003e\n\u003cp\u003e⚠️\n\u003cstrong\u003eOperating Voltage:\u003c/strong\u003e All peripherals must be powered with \u003cstrong\u003e3.3V\u003c/strong\u003e. Do \u003cstrong\u003eNOT\u003c/strong\u003e use 5V, as it will damage the Arduino Giga R1.\u003c/p\u003e\n\n\u003cp\u003e💡\n\u003cstrong\u003eWiring:\u003c/strong\u003e Use \u003cstrong\u003eshort wires\u003c/strong\u003e for all connections (SD, Audio, and NES) to prevent electromagnetic interference (EMI), audio noise, or SD read errors.\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003chr\u003e\n\n\u003ch2\u003e4. 🚀 Usage Instructions\u003c/h2\u003e\n\n\u003cp\u003eGigaNES is structured as a standard \u003cstrong\u003eArduino Sketch\u003c/strong\u003e:\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003e\n\u003cstrong\u003eDownload\u003c/strong\u003e or clone the \u003ca href=\"https://github.com/KaledSouky/GigaNES\"\u003eGigaNES\u003c/a\u003e folder.\u003c/li\u003e\n\u003cli\u003e\n\u003cstrong\u003eOpen\u003c/strong\u003e \u003ccode class=\"inline\"\u003eGigaNES.ino\u003c/code\u003e in the Arduino IDE.\u003c/li\u003e\n\u003cli\u003e\n\u003cstrong\u003eBoard Configuration:\u003c/strong\u003e Ensure you have the Arduino Giga R1 board package installed (\u003cstrong\u003eTools \u0026gt; Board \u0026gt; Arduino Mbed OS Giga Boards\u003c/strong\u003e) and select \u003cstrong\u003eArduino Giga R1\u003c/strong\u003e.\u003c/li\u003e\n\u003cli\u003e\n\u003cstrong\u003eHardware Assembly:\u003c/strong\u003e Connect the \u003cstrong\u003eArduino Giga R1 WiFi\u003c/strong\u003e to the \u003cstrong\u003eGiga Display Shield\u003c/strong\u003e and follow \u003cstrong\u003e\u003cem\u003eConnection_Diagram.png\u003c/em\u003e\u003c/strong\u003e for hardware peripherals. Refer to \u003cstrong\u003eSection 3\u003c/strong\u003e for critical safety and wiring notes.\u003c/li\u003e\n\u003cli\u003eUpload and enjoy!\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003chr\u003e\n","metadata":{"markdown":"### 3.1 🔊 Audio \u0026amp; Amplification\nThe connection diagram features a **PAM8403** digital stereo amplifier module. Since the emulator generates a **monophonic signal**, only the **Right Channel** is used (Input: DAC0/Pin 12 | Output: 3W Speaker). You may use any monophonic (preferred) or stereo amplifier module, provided it operates at **3.3V** and offers good noise protection.\n\n\u0026gt; ⚠️\n\u0026gt; If using a stereo module, **do not bridge** the Left and Right inputs or outputs to achieve \"dual mono\" sound. This unnecessarily increases current consumption and may exceed your power supply's capacity, leading to instability or hardware damage.\n\n\u0026gt; 💡\n\u0026gt; If you experience audio noise, it is highly recommended to place a **470 µF (10V) electrolytic capacitor** and a **1 nF ceramic capacitor** in parallel across the power pins (V+ and GND), as close to the module as possible.\n\n### 3.2 🎮 NES Controllers (Single \u0026amp; Multiplayer)\nFor a single-player setup, follow the connections shown in __*Connection_Diagram.png*__. For multiplayer mode, use the following wiring:\n\n| Signal | Arduino Giga Pin | Connection |\n| :--- | :--- | :--- |\n| **LATCH** | Pin 2 | Connect to LATCH on **BOTH** controllers |\n| **CLOCK** | Pin 3 | Connect to CLOCK on **BOTH** controllers |\n| **DATA 1** | Pin 4 | Connect to DATA on **Controller 1 ONLY** |\n| **DATA 2** | Pin 5 | Connect to DATA on **Controller 2 ONLY** |\n\n### 3.3 💾 MicroSD Card Module \u0026amp; Preparation\nThis project is tested with the [Adafruit MicroSD card breakout board+](https://www.adafruit.com/product/254). Any alternative module must be compatible with **3.3V** logic.\n\n* **Format:** The SD card (up to 32 GB) **MUST** be formatted in **FAT32**.\n* **Filenames:** Use the **8.3 filename rule** (8 characters or less + `.nes` extension). Place all ROMs in the **root directory**.\n* **Logic Levels:** If using a different module, ensure it has a built-in logic level shifter or is designed for 3.3V operation to match the Arduino Giga's I/O voltage.\n\n### 3.4 🚨 General Safety \u0026amp; Signal Integrity\n\n\u0026gt; ⚠️\n\u0026gt; **Operating Voltage:** All peripherals must be powered with **3.3V**. Do **NOT** use 5V, as it will damage the Arduino Giga R1.\n\n\u0026gt; 💡\n\u0026gt; **Wiring:** Use **short wires** for all connections (SD, Audio, and NES) to prevent electromagnetic interference (EMI), audio noise, or SD read errors.\n\n---\n\n## 4. 🚀 Usage Instructions\n\nGigaNES is structured as a standard **Arduino Sketch**:\n\n1. **Download** or clone the [GigaNES](https://github.com/KaledSouky/GigaNES) folder.\n2. **Open** `GigaNES.ino` in the Arduino IDE.\n3. **Board Configuration:** Ensure you have the Arduino Giga R1 board package installed (**Tools \u0026gt; Board \u0026gt; Arduino Mbed OS Giga Boards**) and select **Arduino Giga R1**.\n4. **Hardware Assembly:** Connect the **Arduino Giga R1 WiFi** to the **Giga Display Shield** and follow __*Connection_Diagram.png*__ for hardware peripherals. Refer to **Section 3** for critical safety and wiring notes.\n5. Upload and enjoy!\n\n---"}},{"element_type":"markdown","content":"\u003ch2\u003eDevices \u0026amp; Components\u003c/h2\u003e\n","metadata":{"markdown":"## Devices \u0026amp; Components\n\n\n\n\n\n"}},{"element_type":"parts","content":"\n  \u003cdiv class=\"parts-details\"\u003e\n    \u003cdiv\u003e\n      \u003cspan class=\"parts-quantity\"\u003e1\u003c/span\u003e\u003cspan\u003e x \u003c/span\u003e\n        \u003ca href=\"https://store-usa.arduino.cc/products/giga-r1-wifi\" class=\"parts-name\" target=\"_blank\"\u003e Arduino GIGA R1 WiFi \u003c/a\u003e\n      \u003cdiv class=\"parts-description\"\u003eArduino GIGA R1 WiFi. For ambitious makers with bigger ideas.\u003c/div\u003e\n    \u003c/div\u003e\n  \u003c/div\u003e\n  \u003cdiv class=\"parts-action\"\u003e\n  \u003cdiv\u003e\n      \u003ca href=\"https://store-usa.arduino.cc/products/giga-r1-wifi\" class=\"parts-url btn-primary\" target=\"_blank\"\u003eBuy Now\u003c/a\u003e\n\n  \u003c/div\u003e\n\u003c/div\u003e\n\n  \u003cdiv class=\"clearfix\"\u003e\u003c/div\u003e\n","metadata":{"name":" Arduino GIGA R1 WiFi ","url":"https://store-usa.arduino.cc/products/giga-r1-wifi","description":"Arduino GIGA R1 WiFi. For ambitious makers with bigger ideas.","quantity":"1"}},{"element_type":"parts","content":"\n  \u003cdiv class=\"parts-details\"\u003e\n    \u003cdiv\u003e\n      \u003cspan class=\"parts-quantity\"\u003e1\u003c/span\u003e\u003cspan\u003e x \u003c/span\u003e\n        \u003ca href=\"https://store-usa.arduino.cc/products/giga-display-shield\" class=\"parts-name\" target=\"_blank\"\u003eArduino GIGA Display Shield \u003c/a\u003e\n      \u003cdiv class=\"parts-description\"\u003eWith the Arduino GIGA Display Shield, effortlessly deploy graphic interfaces to your Arduino GIGA R1 WiFi projects using our innovative touch screen solution, which includes a digital microphone, 6-axis IMU, and Arducam® connector, enabling seamless creation of handheld devices or dashboards.\u003c/div\u003e\n    \u003c/div\u003e\n  \u003c/div\u003e\n  \u003cdiv class=\"parts-action\"\u003e\n  \u003cdiv\u003e\n      \u003ca href=\"https://store-usa.arduino.cc/products/giga-display-shield\" class=\"parts-url btn-primary\" target=\"_blank\"\u003eBuy Now\u003c/a\u003e\n\n  \u003c/div\u003e\n\u003c/div\u003e\n\n  \u003cdiv class=\"clearfix\"\u003e\u003c/div\u003e\n","metadata":{"name":"Arduino GIGA Display Shield ","url":"https://store-usa.arduino.cc/products/giga-display-shield","description":"With the Arduino GIGA Display Shield, effortlessly deploy graphic interfaces to your Arduino GIGA R1 WiFi projects using our innovative touch screen solution, which includes a digital microphone, 6-axis IMU, and Arducam® connector, enabling seamless creation of handheld devices or dashboards.","quantity":"1"}},{"element_type":"product","content":"https://www.adafruit.com/product/254","metadata":{}},{"element_type":"product","content":"https://www.adafruit.com/product/2130","metadata":{}},{"element_type":"product","content":"https://www.adafruit.com/product/4445","metadata":{}},{"element_type":"product","content":"https://www.adafruit.com/product/64","metadata":{}},{"element_type":"product","content":"https://www.adafruit.com/product/4474","metadata":{}},{"element_type":"product","content":"https://www.adafruit.com/product/4482","metadata":{}},{"element_type":"markdown","content":"\u003ch2\u003eCode\u003c/h2\u003e\n","metadata":{"markdown":"## Code"}},{"element_type":"button","content":"https://github.com/KaledSouky/GigaNES","metadata":{"button_type":"info","icon":"download","target":"_self","zip_folder":"false"}},{"element_type":"user_image","content":"https://cdn-learn.adafruit.com/user_assets/assets/000/002/440/original/Coffee_Creator_Sticker_by_Ko-fi.gif?1780959601","metadata":{}},{"element_type":"button","content":"https://ko-fi.com/kaledsouky","metadata":{"button_type":"danger","icon":"heart","target":"_self","zip_folder":"false"}}]