打印

【stm32f0实验】stm32f的滴答

[复制链接]
1544|0
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
gaochy1126|  楼主 | 2012-7-24 12:34 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
SYSTick.rar (145.02 KB)
#include "stm32f0xx_conf.h"

GPIO_InitTypeDef        GPIO_InitStructure;
void Init_Gpio()初始化GPIO口 点亮led
{

  RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOC, ENABLE);
  GPIO_InitStructure.GPIO_Pin = GPIO_Pin_8;
  GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
  GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
  GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
  GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
  GPIO_Init(GPIOC, &GPIO_InitStructure);

}
int main()
{
SystemInit();
Init_Gpio();
GPIO_WriteBit(GPIOC,GPIO_Pin_8,1);
if (SysTick_Config(SystemCoreClock / 4))配置滴答 每一秒闪烁2次!!!!
  {
    while (1);
  }
while(1);函数在滴答中断执行

}
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

1030

主题

11276

帖子

25

粉丝