Get started in easy steps with stm8s103f3p6 low cost development board
Buy the STM8 board here (0.7$ Including shipment to your country) : Link
Step 1:
Download STVD-STM8
http://www.st.com/en/development-tools/stvd-stm8.html
(it does not have a compiler so we need to use any other compiler , I have used cosmic)
Download the cosmic compiler , get the license file .
http://cosmicsoftware.com/download_stm8_free.php
Step 2:
Install Cosmic Compiler & STVD
Step 3:
Start a New project

Select the workspace

Select The Tool Chain

Select the controller

Step 4 :
Add headerfile for the controller “STM8S103F.h”, all header files are here
C:\Program Files (x86)\STMicroelectronics\st_toolset\include

Step 5:
copy the code & build .. When asked point out the cosmic license . If asked Computer name , right click on “My computer ” or “This PC” -> Properties ,where you can see the name .
#include <STM8S103F3P.h>
void myDelay(void);
void myDelay()
{
int i,j;
for(i=0;i<1000;i++)
{
for(j=0;j<100;)
{
j++;
}
}
}
main()
{
PB_DDR |=0x20;// PB.5 as Output
PB_CR1 |=0x20;// PB.5 as Push Pull Type Output
while(1)
{
PB_ODR |=1<<5;// PB.5 = 1
myDelay();
PB_ODR &=~(1<<5);// PB.5 = 0
myDelay();
}
}
Step 6:
Connect the ST-Link with board , ( SWIM & GND Pins )

Step 7 :
Program Debug ..
On Menu “Debug Instrument ” Select ” Swim ST-Link” ,
Click Debug -> “Start Debugging ” & to continue press ” F5″

Now you can see the LED blinking ..
Schematics
