Skip to content

Instantly share code, notes, and snippets.

@varghes
Created February 12, 2020 18:10
Show Gist options
  • Save varghes/211847fa710d474cc65569a6ed5c41e9 to your computer and use it in GitHub Desktop.
Save varghes/211847fa710d474cc65569a6ed5c41e9 to your computer and use it in GitHub Desktop.
stm8s103f3p6 blink Test
#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();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment