🪔 Diwali Break: Orders placed now will ship from 25th November 2026. Place your order today — we'll get it to you right after we're back!
Project Hub /IoT & Connected Devices/Smart Energy / Water Metering/GPIO Functions on STM8S using Cosmic C and SPL – Blinking and Controlling LED with Push Button
GPIO Functions on STM8S using Cosmic C and SPL – Blinking and Controlling LED with Push Button
Intermediate
OTHER CONTROLLER
₹500 – ₹1,500
3 – 6 Hours
Partial Kit

GPIO Functions on STM8S using Cosmic C and SPL – Blinking and Controlling LED with Push Button

Learn how to perform general GPIO functions on the STM8S microcontroller using Cosmic C and the Standard Peripheral Library (SPL) by blinking an onboard LED and controlling an external LED with a push-button.

Originally published on CircuitDigest
View original tutorial

Parts You'll Need

This project is sourced from another site, not written by us — this list is our best match of their components against what we stock, not a verified bill of materials. Always check the original blog (linked above) for the actual parts list before buying.

We don't carry yet: Other Dev Board (Indusboard / Maixduino / misc)
USB Host / Programmer (ISP/USBasp)

Browse all components

How It Works

Why Build This

Master foundational microcontroller register configurations and GPIO pin management required for advanced embedded systems coursework.
Gain practical experience utilizing industry-standard toolchains like Cosmic C and the STM8S Standard Peripheral Library for hardware control.
Develop reliable embedded logic for reading digital inputs from mechanical switches and driving digital outputs like status LEDs.

Real-World Application

Understanding GPIO configuration, input reading, and output driving is foundational for all embedded systems, serving as the basis for reading sensors, driving indicators, and interfacing with external peripherals in industrial and consumer electronics.

Skills You'll Learn

GPIO configuration
digital input reading
digital output driving
peripheral library utilization
firmware compilation and flashing
switch debouncing logic

Safety Precautions

No specific precautions noted for this build — always follow general electronics safety practices.

Frequently Asked Questions

The ST-Link programmer connects your development PC to the STM8S103F3 board, allowing you to transfer the compiled Cosmic C firmware code into the microcontroller's memory.
The SPL provides a set of pre-written functions that abstract complex register configurations, making it easier and faster to initialize and control GPIO pins without looking up every memory address manually.
No, the components can be powered directly from the voltage supply pins of the STM8S development board, provided current-limiting resistors are used to protect the LEDs.

Gallery

This page is part of Kitkraft's Project Hub — a curated collection of electronics & robotics projects gathered from the maker community to help students and hobbyists discover and learn to build. Kitkraft does not claim authorship of the original project, and makes no representation as to the accuracy, completeness or safety of third-party source material. The summary and "How It Works" explanation above are AI-generated, rewritten with reference to the original tutorial — not a reproduction of it. Full credit and a direct link to the original source are provided above. If you're the original creator and have a concern about how your work is represented here, please contact us and we'll address it promptly.

Kitkraft Project Hub — curated from the maker community, credited at the source.
PRJ-00220