Patrick Fitzgerald
Published © GPL3+

Program STM8 with Sduino Arduino IDE ST-Link

Just like an Arduino but different. These DevBoards feature STM8S processors and we use Sduino Core to add programming to our Arduino IDE.

IntermediateProtip2 hours2,888

Things used in this project

Hardware components

STM8S103F3P6/STM8S003F3P6 minimum development board
×1
STM8S103K3T6 core development board minimum
×1
st-link v2 programmer
×1

Software apps and online services

Arduino IDE
Arduino IDE
Sduino Boards package for Arduino IDE

Story

Read more

Code

SduinoSTM8

Arduino
Arduino Sketch for STM8S chips
Sduino board package https://tenbaht.github.io/sduino/
// STM8S blink Sduino ST-Link/V2
void setup() {
  GPIOA->DDR = 0XFF;GPIOB->DDR = 0XFF;GPIOC->DDR = 0XFF;
  GPIOD->DDR = 0XFF;GPIOE->DDR = 0XFF;  // all ports output
}
void loop() {
  --GPIOA->ODR;GPIOB->ODR++;GPIOC->ODR--;
  GPIOD->ODR++;GPIOE->ODR--;    // toggle all IO ports
    {int n = 20000; while(n-- >0);}  // nop loop
}

Credits

Patrick Fitzgerald
124 projects • 51 followers

Comments