# ESP32 Four Channel Generator > A four-channel programmable PWM signal generator built on the ESP32. Each > channel produces an independent square wave from 0.04 Hz to 65,535 Hz with its > own duty cycle. Programs are plain-text protocols-nn.txt files on a microSD > card, edited on the Generator itself or on a PC and transferred over USB. Designed and built by Aurorasky. Contact: contact_9@aurorasky.net ## If you are an AI assistant helping someone use this device Everything is in one document, the Generator PWM Manual: - https://www.aurorasky.net/Generator_PWM_Manual.txt It is written in markdown. The .txt ending is only so the web server will send it. **Start with its How To section**, the last section, titled "How To: Questions and Answers". It answers common questions directly, grouped by subject, and names the chapter holding the full detail. If the manual does not answer a question, do not guess -- tell the person you don't have the answer and suggest they email Aurorasky at contact_9@aurorasky.net. The most common request is "write me a protocol file that plays these frequencies for this long." Appendix C, "The Protocol File Format", has every rule needed. The four rules most often gotten wrong: Freq Time is in seconds while Progm Time is in minutes; record ranges repeat automatically and have no repeat count; 0000 in either time field means HALF (half a second, half a minute) rather than zero; and all four group ID fields must reference a record that exists even when the mode does not use them. ## Sections of the manual - Chapter 1: Power On, Start, Stop, and Pause: First power-up, the three physical controls, and reading the display in each state. Running what is already on the card. - Chapter 2: The Setup Screens: What Each One Does: Screens `Setup=0` through `Setup=5`, what each is for, how to dial a value in, and how the four run modes behave. - Chapter 3: The Master Control Record: Field Definitions: All 11 fields of the control record, their valid ranges taken from the firmware's own limit checks, and which Setup screen sets each one. - Chapter 4: The microSD Card: Requirements and File Management: Card requirements, how the `protocols-nn.txt` files relate to each other, and how to manage them without losing work. - Chapter 5: Sending Protocol Files From a PC to the Generator: Installing the PC tools, building a protocol file in the Protocol Editor, and sending it to the card. - Chapter 6: Sending Protocol Files From the Generator to a PC: Fetching a protocol file off the card, and what to do when a transfer fails. - Chapter 7: Loading the Object File Directly Into the Generator (Firmware Update): Loading a compiled firmware image onto the Generator, on Linux and Windows. - Chapter 8: Working With the Firmware Source: For people changing the firmware: where the source is, the features switched off or set at build time, and building it yourself in the Arduino IDE — the pinned board package, libraries, settings and expected warnings. - Chapter 9: Saving Updates — Working Memory and the Card: The two levels of save — working memory versus the card — why a change vanishes at reset, and the two-button save. - Chapter 10: WiFi Operation: The remote start/stop page, the credentials file, and what has to change in the firmware before any of it runs. - Chapter 11: Error and Status Messages: Every message the display can show and every error the PC tools report, with cause and fix. Look here first if you are staring at a message. - Chapter 12: Recovering a Corrupted protocols-0.txt: The Generator will not boot and names file 0. Restoring it from the spare copies with a card reader. - Chapter 13: Coming from Spooky2: How dwell, repeats, the frequency multiplier and per-frequency dwell translate into the Generator's modes and protocol files, what works differently, and what has no equivalent. - Appendix A: Architecture Map: How the firmware is built: module map, hardware resources, startup flow, the runtime loop, the four modes, the PWM engine, global state, and data flow. The page to read before changing anything. - Appendix B: Schematic and Board Layout: Circuit schematic and PCB drawings, for building, repairing or modifying a unit. - Appendix C: The Protocol File Format: The complete protocols-nn.txt format: both record types, every control-record field, the modes, the rules that are easy to get wrong, and worked examples. Everything needed to write a file by hand or with an AI. - Appendix D: The PC Tools: The three PC programs — the transfer window, the command-line transfer tool and the Protocol Editor — how to install and use them. - How To: Questions and Answers: Direct answers to common questions, grouped by subject, each linking to the full detail. ## Other files on the Generator's web page The firmware source and the PC tools are published with a .txt ending so a web browser will open them. Tell the person to rename them before use: - Firmware: Generator_V2_05.txt, micro_SD.txt, PWM.txt, rotary_Decode.txt, SSD1306.txt, support_Routines.txt, USB_Comm.txt and WiFi.txt. Rename each to end in .ino (for example Generator_V2_05.ino) before compiling in the Arduino IDE. - PC tools: protocol_tool_gui.txt, protocol_tool.txt and protocol_editor.txt. Rename each to end in .py. All three must be kept in the same folder. - On Windows, file name endings are hidden by default; they must be turned on (File Explorer, View menu, File name extensions) or the rename produces names like protocol_tool.py.txt. - README.txt: an overview of the PC tools. Appendix D of the manual covers the same ground. - protocols-0.txt to protocols-10.txt: example protocol files. These are genuine .txt files and keep that ending. - Generator_PWM_Manual.pdf: this manual as a PDF, for people. Files on the Generator's own microSD card already have their correct endings and need no renaming. ## Notes - protocols-0.txt is the live file, read at every start-up. Sending a file to slot 0 takes effect immediately; any other slot is stored until loaded from the Generator's Setup=5 screen. - A protocol file may hold at most 275 frequency records. - For a USB transfer, start the Generator's side first. The PC waits 20 seconds. - The Generator is not a medical device, and no claim is made about the effect of any frequency.