Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A low-cost microcontroller can keep an FM-player interface responsive while an EEPROM preset write progresses by running each job as a short, resumable state-machine step. A simple loop calls the jobs in turn; they do not run simultaneously, and the method does not provide fixed periodic timing.

What cooperative multitasking means on a microcontroller

Small embedded systems must divide limited Flash, RAM, and CPU time among their features. In a cooperative design, each task does a bounded piece of work, saves its progress in state variables, and returns control. A scheduler loop then calls other tasks before revisiting it.

This interleaving creates the appearance of multitasking, not true simultaneous execution. Unlike an RTOS that can preempt a task and save or restore its execution context, a cooperative task yields at points chosen by its designer. If a task runs too long before returning, other work waits.

How the FM-player example works

The example combines button reading and FM-radio input or service logic with an EEPROM-write state machine. Rather than performing a preset write as one long operation, the write advances through four steps over successive calls. Between those calls, the loop can run the player task, allowing it to keep handling inputs while the write progresses.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Sale
ICSTATION FM Receiver Module, DC 3V-5V Radio Receiver Module with LCD Display DSP PLL Digital Radio Circuit Board 76.0MHz-108.0MHz Stereo Board
  • Mini stereo FM receiver module adopts advanced DSP and PLL technology ensure high quality broadcast receiving performance
  • Blue backlight LCD display and potentiometer regulate the volume and frequency easy to operation
  • On-board 2X3W stereo audio amplifier chip enable you to DIY FM radio easily, no extra audio amplifier circuit needed
  • Working Voltage: DC 3-5V, Frequency Range: 50Hz-18KHz, Output Power: 500mW, Board Size: 75 X 45 X 30mm/2.95 X 1.77 X 1.18inch

The four-step division is an illustration of the pattern, not a complete implementation recipe: the article description does not supply the step-by-step code, circuit, radio module, or board details needed to reproduce a particular player.

Structure each task as a resumable state machine

Each task needs a way to remember what it should do next. On every invocation, it examines its current state, performs a small action, updates that state, and returns. The scheduler invokes it again later, where it resumes from the recorded point.

Rank #2
MiOYOOW DIY Bluetooth Speaker Kit with FM Radio for School and Home Use
  • 🎵【All-in-One Audio Experience】: Enjoy music in multiple ways with Bluetooth, U-Disk, TF card, and 3.5mm AUX input. For Bluetooth playback, turn on Bluetooth on your phone, search for "JQ BT," and connect to the speaker. You can also play music from a USB flash drive or TF card without using your phone. For FM radio, crimp a 3 cm wire as the FM antenna and install it on the Bluetooth receiver.
  • 🎵【Digital FM Radio with Auto Search】: Press the "Mode" button to switch to FM Radio mode. Press the "▶️||" button to automatically scan and store available stations in your area as P01, P02, P03, and so on. With the power-off memory function, the radio automatically saves the current station when powered off and restores the same station when turned on again.
  • 🎵【Music-Sync LED Lights & Remote Control】: The digital display shows the current playback mode, volume, and radio frequency. Twelve LED lights flash in sync with your music, while the button on the back lets you adjust the responsiveness of the light effects. The included remote control allows you to adjust the volume, switch modes, and change channels. A creative DIY project and a fun gift for music lovers, makers, and electronics enthusiasts.
  • 🎵【Hands-On Soldering Experience】: This DIY electronics kit features 12 rows of through-hole LED components, providing a practical way to develop soldering skills while learning about electronic components and circuits. Build a functional audio device from the ground up and gain hands-on experience combining electronics theory with practical assembly. Please note that this soldering kit requires a basic understanding of electronics and soldering skills.
  • 🎵【Updated English User Manual】: A paper English instruction manual is included with the kit. Scan the QR code on the manual to access the PDF installation guide. Due to an updated Bluetooth board version, some assembly instructions have been revised. You can also find the User Manual on the Amazon product page under Product Guides and Documents.
  1. Identify the work. Separate the player’s input and radio-service work from the EEPROM preset-write work.
  2. Divide long operations. Break work such as a preset write into steps that can finish promptly instead of holding the loop until the whole operation completes.
  3. Record progress. Use state variables to identify the next step and any information needed to continue.
  4. Return control. Do not wait inside a task for another task to run; finish the current step and let the scheduler call the other work.
  5. Choose the call order. Call the relevant task functions repeatedly from the main loop, in an order and at a frequency that suit the data flow and responsiveness the system needs.

The design only works as intended if each state-machine call and the functions it calls return within the planned time. A single lengthy operation hidden inside a state can still delay every other task.

What a simple scheduler can and cannot guarantee

A loop that repeatedly calls a fixed set of task functions is easy to understand and has low overhead. Its simplicity does not mean it provides a rigid schedule: execution time varies with the work each state performs, so a task’s next call may not occur at a fixed interval.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
2 PCS DIY Radio Kit, Icstation FM Radio Kit 76MHZ-108MHZ Soldering Project Radio Module DIY Kits Electronic Solder Practice Kit for Back to School STEM Labs Physics Educational 15 Ages+ and Adults
  • 📻【Trainning Electronical Soldering Skills】 DIY FM radio soldering kits will help you understand the basics of working with printed circuit boards, at the same time, it will help you become familiar with a variety of electronic components, develop good soldering skills, suitable for high school students and 15 age+ groups.
  • 📻【Low power consumption】 With digital automatic gain control (AGC) circuitry makes receive signal more stable! In addition, low power consumption, a total current of about 19mA when powered by two AA batteries.
  • 📻【Power failure memory function】 FM 76-108MHz,work voltage:DC3V. in addition, it supports radio station memory function, the next time you turn on the device, it will automatically return to the last time you turned off the radio station and volume.
  • 📻【Clear silk screen for component installation】 There are clear silk screen for component installation on PCB to help you solder it, Particularly suitable for use epoxy PCB soldering students use rather than for general use paper-based board!
  • 📻【Icstation Supports Wholesale】 This product is DIY kits, not the end product! This Soldering Project requires basic electronic knowledge and hands-on ability. We have uploaded the user guide on the Amazon page at Technical Specification. At the same time, icstation has long been engaged in Electronics Related Products wholesale and retail business.

The original article offers a qualitative timing guideline that a state should typically finish within a couple of milliseconds at most. This is design guidance, not a measured benchmark or a guarantee for a particular microcontroller. Measure and validate timing on the target hardware when response deadlines matter.

How the design should grow with the system

As features accumulate, scheduling becomes a design decision rather than just a loop. Identify subsystems, decompose them into functions and state machines, group related functions into tasks, then decide their call order and frequency based on data flow and throughput. Deterministic call order can make the flow of work easier to follow, but tasks still need clear rules for sharing information.

Rank #4
Sale
Facmogu FM Radio Receiver, Professional Si4730 Radio Receiver Mini Fm Tuner
  • 【Professional FM Radio Receiver】-- Facmogu FM radio receiver adopts professional Si4730 radio chip for better reception, higher signal sensitivity and better resistance to electrical interference. Also comes with 33ft long cable retractable antenna, you can position the antenna windowsill or rooftop(magnetic base helps you fix the antenna position), you can enjoy clear signal reception and explore various radio stations and enjoy your favourite programmes on different channels anytime, anywhere
  • 【Support Global Frequency】-- Our Mini FM radio receivers feature a total of three sets of frequencies that support worldwide use, covering the standard FM radio bands of 64-108 MHz, 76-108 MHz and 87-108 MHz, ensuring that a wide range of stations
  • 【Auto & Manual Search & Memory Function】-- Professional FM radio receiver with one rotary knob and two buttons which is very easy to use. Long press the rotary button to enter the manual frequency tuning function, long press the ATS button to enter the automatic station search function, long press the VHF to select the country frequency (three groups of frequencies, worldwide use), short press the VHF to store the station
  • 【Minimalist Design】-- FM radio receiver is compact and sturdy with an black alloy case. Although there are few buttons, we have integrated almost all the adjustment functions above the rotary knob, you can easily control all the functions with this one knob.Long press the knob to enter the manual FM function, and short press the knob to enter the volume function, rotate the knob to adjust the volume or the station without any complicated buttons
  • 【Package Content】-- 1 x FM radio receiver, 1 x USB -C cable, 1 x AV cable, 1 x 3.5mm audio cable, 1 x 10m retractable antenna, 1 x user manual. *Note: Combined with amplifiers, CD players and speakers, it delivers immersive sound performance to ensure an enjoyable listening experience

Related state machines may exchange status and data through shared variables, flags, buffers, or queues. Those mechanisms need deliberate ownership and update rules; otherwise, a task may act on stale or partially updated information.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

When to use a cooperative loop or an RTOS

A small cooperative scheduler can suit a feature-rich but resource-constrained 8- or 16-bit system when the tasks are manageable and the timing needs are not strict. It is not automatically simpler overall: building, validating, and maintaining many state machines can take more engineering effort than adopting an off-the-shelf RTOS as complexity rises.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Diymore DIY FM Radio Kit, Soldering Practice Electronics Project, Transparent Case, with PCB, Speaker, Digital Display, for Beginners & STEM Learning
  • DIY Soldering Kit: Build your own FM radio from scratch using a transparent plastic case and a double-sided epoxy circuit board designed for easy soldering.
  • High-Performance Radio Module: Features noise cancellation, bass enhancement, high sensitivity, low noise, and strong anti-interference for clear FM reception.
  • Easy Button Controls: Intuitively operate channel switching, volume adjustment, channel clearing, and rescan/preset storage with simple button-press controls.
  • Multiple Versions Available: Choose from a basic version, a version with digital display, or a version with digital display and charging module to suit your needs.
  • Versatile Applications: Ideal for school teaching, STEM learning, hobby development, scientific research, DIY enthusiasts, and makes a great gift for beginners.
Decision factor Why it matters
Timing and response requirements A basic loop has no rigid periodicity. Requirements for predictable intervals or strict deadlines call for more deliberate scheduling design.
Resource limits Compare the Flash, RAM, and CPU demands of the approach against the system’s available budget; the article gives no measured overhead comparison.
Subsystem count and complexity A few short state machines can remain approachable, while many interacting subsystems increase decomposition and coordination work.
Communication and synchronization Consider how often tasks need to share status or data and whether variables, flags, buffers, or queues are sufficient for that interaction.
Engineering and maintenance effort Compare the work to design and validate cooperative state machines with the effort to use and maintain an RTOS for the same application.

Make this choice early enough to shape the system architecture. A simple scheduler is a useful pattern, but it is not a substitute for meeting explicit timing requirements or planning how a growing set of tasks will interact.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.