Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stm32f10x.h"
- void SysTick_Handler(void)
- {
- GPIOB->ODR ^= 0x0100;
- }
- int main(void){
- int i;
- RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB,ENABLE);
- /*
- GPIO_InitTypeDef tmp;
- GPIOB->ODR ^= 0x0100;
- GPIOB->ODR ^= 0x1000;
- tmp.GPIO_Mode=GPIO_Mode_Out_PP;
- tmp.GPIO_Speed=GPIO_Speed_2MHz;
- 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;
- GPIO_Init(GPIOB,&tmp);
- */
- RCC->APB2ENR= 0x0008;
- GPIOB->CRH=0X33333333;
- SysTick_Config(8000000/11);
- GPIOB->ODR=0x0100;
- while(1){
- /*
- for(i=1000000; i>0; i--);
- GPIO_WriteBit(GPIOB,GPIO_Pin_10,1);
- GPIOB->ODR=0x00000100;
- for(i=1000000; i>0; i--);
- GPIO_WriteBit(GPIOB,GPIO_Pin_10,0);
- GPIOB->ODR=0x00000000;
- for(i=1000000 ; i>0; i--);
- */
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement