Stufin
Home Quick Cart Profile

STM8S103F3P6 Development Board

Buy Now on Stufin

Microcontroller Core

8-bit STM8S103F3P6 processor core with 16 MHz operating frequency

Memory

8 KB Flash memory, 1 KB RAM, and 640 bytes EEPROM

Interfaces

USART, SPI, I2C, 10-bit ADC, and 5-channel DMA

GPIO

17 GPIO pins, including 8 high-current output pins

Power Management

Low power consumption, with a typical current consumption of 15 mA at 16 MHz

Operating Voltage

2.95 to 5.5 V

Development Board Features

Board Size

53.5 x 24.5 mm

Power Options

On-board USB connector for programming and debugging, as well as a battery holder for power supply

Programming Interface

In-system programming (ISP) and in-application programming (IAP) support

Debugging Tools

On-board ST-Link/V2 debugger and programmer

Expansion Options

2x20-pin header for expansion boards and peripherals

LED Indicators

3 user LEDs for status indication and debugging

Functionalities

The STM8S103F3P6 Development Board is designed to support a wide range of applications, including

IoT projects and prototyping

Robotics and automation

Industrial control systems

Consumer electronics

Smart home devices

Wearable devices

Advantages

Ease of use

The development board provides an easy-to-use platform for rapid prototyping and development

Cost-effectiveThe board offers a cost-effective solution for developing IoT and robotics projects

Flexibility

The board's expansion options and peripherals provide flexibility for customizing projects

Efficient power management

The low power consumption of the microcontroller makes it suitable for battery-powered devices

Target Audience

The STM8S103F3P6 Development Board is suitable for

Hobbyists

Enthusiasts and makers looking to develop IoT and robotics projects

Students

Students and educators looking to learn about microcontrollers and IoT development

Professionals

Engineers and developers working on IoT and robotics projects, as well as industrial control systems and consumer electronics.

By providing a comprehensive overview of the STM8S103F3P6 Development Board, this documentation aims to help users understand the component's functionality, key features, and applications, enabling them to develop innovative IoT projects and prototypes.

Pin Configuration

  • STM8S103F3P6 Development Board Pinout Explanation
  • The STM8S103F3P6 development board is a microcontroller-based board featuring the STM8S103F3P6 IC, which is a 8-bit microcontroller from STMicroelectronics. This documentation provides a detailed explanation of each pin on the board, including their functions and how to connect them.
  • Pin Structure:
  • The STM8S103F3P6 development board has a 20-pin DIP (Dual In-Line Package) structure, with 10 pins on each side. The pins are labeled from 1 to 20, starting from the top-left corner.
  • Pin Descriptions:
  • Here's a point-by-point explanation of each pin:
  • 1. VCC (Pin 1): Power supply pin. Connect to a 3.3V or 5V power source, depending on the application requirements.
  • 2. PA0 (Pin 2): Input/Output pin. Can be used as a digital I/O pin or as an ADC (Analog-to-Digital Converter) input.
  • 3. PA1 (Pin 3): Input/Output pin. Can be used as a digital I/O pin or as an ADC input.
  • 4. PA2 (Pin 4): Input/Output pin. Can be used as a digital I/O pin or as an ADC input.
  • 5. PA3 (Pin 5): Input/Output pin. Can be used as a digital I/O pin or as an ADC input.
  • 6. PA4 (Pin 6): Input/Output pin. Can be used as a digital I/O pin or as an ADC input.
  • 7. PA5 (Pin 7): Input/Output pin. Can be used as a digital I/O pin or as an ADC input.
  • 8. PA6 (Pin 8): Input/Output pin. Can be used as a digital I/O pin or as an ADC input.
  • 9. PA7 (Pin 9): Input/Output pin. Can be used as a digital I/O pin or as an ADC input.
  • 10. GND (Pin 10): Ground pin. Connect to the ground of the power supply or other components.
  • 11. PB0 (Pin 11): Input/Output pin. Can be used as a digital I/O pin or as an external interrupt pin.
  • 12. PB1 (Pin 12): Input/Output pin. Can be used as a digital I/O pin or as an external interrupt pin.
  • 13. PB2 (Pin 13): Input/Output pin. Can be used as a digital I/O pin or as an external interrupt pin.
  • 14. PB3 (Pin 14): Input/Output pin. Can be used as a digital I/O pin or as an external interrupt pin.
  • 15. PB4 (Pin 15): Input/Output pin. Can be used as a digital I/O pin or as an external interrupt pin.
  • 16. PB5 (Pin 16): Input/Output pin. Can be used as a digital I/O pin or as an external interrupt pin.
  • 17. RST (Pin 17): Reset pin. Active-low reset pin. Connect to a pull-up resistor and a reset button if required.
  • 18. GND (Pin 18): Ground pin. Connect to the ground of the power supply or other components.
  • 19. SWIM (Pin 19): Single Wire Interface Module pin. Used for programming and debugging the microcontroller.
  • 20. VCC (Pin 20): Power supply pin. Connect to a 3.3V or 5V power source, depending on the application requirements.
  • Pin Connection Guidelines:
  • When connecting components to the STM8S103F3P6 development board, follow these guidelines:
  • Use a breadboard or a PCB to connect components to the board.
  • Use jumper wires to connect pins to other components, ensuring correct polarity.
  • Connect VCC pins to a power source, and GND pins to the ground of the power supply or other components.
  • Use pull-up or pull-down resistors when required, depending on the component's specifications.
  • Ensure that the total current drawn from the board does not exceed the recommended maximum current rating.
  • By following these guidelines and understanding the pin structure, you can effectively design and develop projects using the STM8S103F3P6 development board.

Code Examples

STM8S103F3P6 Development Board Documentation
Overview
The STM8S103F3P6 Development Board is a microcontroller-based development board featuring the STM8S103F3P6 MCU from STMicroelectronics. This board is designed for prototyping and development of IoT projects, robots, and other embedded systems. The board offers a range of peripherals, including GPIO, UART, SPI, I2C, ADC, and more.
Technical Specifications
MCU: STM8S103F3P6 (8-bit, 16 MHz, 8 KB Flash, 1 KB RAM)
 Operating Voltage: 3.3V or 5V
 GPIO: 15 digital I/O pins, 2 analog input pins
 Communication Interfaces: UART, SPI, I2C, ADC
 Peripherals: 1 x 16-bit Timer, 1 x 8-bit Timer, 1 x Watchdog Timer
 Development Tools: IAR Embedded Workbench, Keil Vision, or STVD-IDE
Code Examples
### Example 1: Blinking LED using GPIO
In this example, we'll use the GPIO pins to blink an LED connected to pin PB5.
Hardware Requirements
1 x LED
 1 x 220 resistor
 1 x Breadboard
 Jumper wires
Software Requirements
IAR Embedded Workbench (or alternative development tool)
Code
```c
#include <stdint.h>
#include <stdbool.h>
#include "stm8s.h"
#define LED_PIN 5 // Pin PB5
int main() {
  // Initialize GPIO Pin PB5 as output
  GPIO_Init(GPIOB, (GPIO_InitTypeDef){.GPIO_Pin = LED_PIN, .GPIO_Mode = GPIO_Mode_Out});
while (true) {
    // Set LED pin high (turn on LED)
    GPIO_WriteBit(GPIOB, LED_PIN, Bit_SET);
    delay_ms(500); // 500ms delay
// Set LED pin low (turn off LED)
    GPIO_WriteBit(GPIOB, LED_PIN, Bit_RESET);
    delay_ms(500); // 500ms delay
  }
}
void delay_ms(uint16_t ms) {
  // Simple delay function using Timer 2
  TIM2_Init((TIM_TimeBaseInitTypeDef){.TIM_Prescaler = 0x00, .TIM_CounterMode = TIM_CounterMode_Downcounter});
  TIM2_SetCounter(0x0000);
  while (TIM2_GetCounter() < ms);
  TIM2_Cmd(TIM2, DISABLE);
}
```
Explanation
In this example, we initialize GPIO Pin PB5 as an output and use a simple delay function to blink the LED. The `TIM2_Init()` function sets up Timer 2 in downcounter mode, and the `TIM2_SetCounter()` function sets the counter value to 0. The `while` loop waits until the counter reaches the desired delay value, and then the LED is toggled.
### Example 2: UART Communication using STM8S103F3P6
In this example, we'll use the UART interface to send a string to a serial terminal.
Hardware Requirements
1 x USB-to-UART adapter (e.g., FT232R)
 1 x Serial terminal software (e.g., Tera Term, Putty)
Software Requirements
IAR Embedded Workbench (or alternative development tool)
Code
```c
#include <stdint.h>
#include <stdbool.h>
#include "stm8s.h"
#include "uart.h"
#define UART_BAUDRATE 9600
int main() {
  // Initialize UART
  UART_Init((UART_InitTypeDef){.UART_BaudRate = UART_BaudRate9600, .UART_WordLength = UART_WordLength_8b, .UART_StopBits = UART_StopBits_1, .UART_Parity = UART_Parity_None, .UART_Mode = UART_Mode_Tx});
while (true) {
    // Send a string to the serial terminal
    UART_SendData((uint8_t )"Hello, World!
", 14);
    delay_ms(1000); // 1s delay
  }
}
void delay_ms(uint16_t ms) {
  // Simple delay function using Timer 2
  TIM2_Init((TIM_TimeBaseInitTypeDef){.TIM_Prescaler = 0x00, .TIM_CounterMode = TIM_CounterMode_Downcounter});
  TIM2_SetCounter(0x0000);
  while (TIM2_GetCounter() < ms);
  TIM2_Cmd(TIM2, DISABLE);
}
```
Explanation
In this example, we initialize the UART interface with a baud rate of 9600 and send a string to the serial terminal using the `UART_SendData()` function. The `delay_ms()` function is used to introduce a 1-second delay between each transmission.
These examples demonstrate basic usage of the STM8S103F3P6 Development Board's GPIO and UART interfaces. You can extend these examples to develop more complex projects, such as IoT devices, robots, or other embedded systems.