Advertisement
Guest User

akiso

a guest
Apr 26th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. #include "stm32f10x.h"
  2. void SysTick_Handler(void)
  3. {
  4. GPIOB->ODR ^= 0x0100;
  5. }
  6.  
  7. int main(void){
  8. int i;
  9. RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB,ENABLE);
  10.  
  11. /*
  12. GPIO_InitTypeDef tmp;
  13. GPIOB->ODR ^= 0x0100;
  14. GPIOB->ODR ^= 0x1000;
  15. tmp.GPIO_Mode=GPIO_Mode_Out_PP;
  16. tmp.GPIO_Speed=GPIO_Speed_2MHz;
  17. tmp.GPIO_Pin=GPIO_Pin_8|GPIO_Pin_9|GPIO_Pin_10|GPIO_Pin_11|GPIO_Pin_12|GPIO_Pin_13|GPIO_Pin_14|GPIO_Pin_15;
  18. GPIO_Init(GPIOB,&tmp);
  19. */
  20. RCC->APB2ENR= 0x0008;
  21. GPIOB->CRH=0X33333333;
  22. SysTick_Config(8000000/11);
  23. GPIOB->ODR=0x0100;
  24.  
  25. while(1){
  26.  
  27.  
  28. /*
  29. for(i=1000000; i>0; i--);
  30. GPIO_WriteBit(GPIOB,GPIO_Pin_10,1);
  31. GPIOB->ODR=0x00000100;
  32. for(i=1000000; i>0; i--);
  33. GPIO_WriteBit(GPIOB,GPIO_Pin_10,0);
  34. GPIOB->ODR=0x00000000;
  35. for(i=1000000 ; i>0; i--);
  36. */
  37.  
  38. }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement