你的浏览器版本过低,可能导致网站不能正常访问!
为了你能正常使用网站功能,请使用这些浏览器。

查看: 3437|回复: 1

[STM32F429] 【STM32F429开发日志】1.MDK510工程建立和SYStick实现精确延时

[复制链接]

43

主题

292

回帖

0

蝴蝶豆

金牌会员

最后登录
2020-11-28
发表于 2014-5-26 20:28:53 | 显示全部楼层 |阅读模式
 
收到429的开发板有一天时间了,这算是第一篇开发日志吧(昨天发的一篇不知道怎么没显示出来),希望对小伙伴们有用,以后我还会陆续推出其他的代码。
请看英文说明:
@par Example Description:

This example is used as a template project that can be used as reference to build
any new firmware application for STM32F429xx devices using the STM32F4xx Standard
Peripherals Library.
 
@par Hardware and Software environment


  - This example runs on STMF429xx Devices.
  - This example has been tested with STMicroelectronics STM32F429I-DISCO board 
    and can be easily tailored to any other supported device and development board.



硬件平台:stm32f429_discovery 
编译器:MDK 510
日期:2014.5.25


1.该例程在官方的驱动下完善,修改stm32f429i_discovery.c 文件较多,简化了LED和Key的驱动;
2.使用的外部8Mhz晶振,主频为180Mhz。
3.实现功能:利用systick定时器使2个LED间隔500ms轮流闪烁。


主要代码:
#include "SysTick.h"


__IO uint32_t TimingDelay;


/******************************************************************************************
*函数名称:void SysTick_Init(void)
*
*入口参数:无
*
*出口参数:无
*
*功能说明:SysTick初始化  如果初始化失败,会停入WHILE死循环
*******************************************************************************************/
void SysTick_Init(void)
{
    if (SysTick_Config(SystemCoreClock / 1000))  //SysTick end of count event each 1ms 
    { 
        while (1); //初始化失败
    }
}


/******************************************************************************************
*函数名称:void Delay(__IO uint32_t nTime)
*
*入口参数:无
*
*出口参数:无
*
*功能说明:供外部调用的延时函数
*******************************************************************************************/
void Delay(__IO uint32_t nTime)

    TimingDelay = nTime;
    
    while(TimingDelay != 0);
}


/******************************************************************************************
*函数名称:void TimingDelay_Decrement(void)
*
*入口参数:无
*
*出口参数:无
*
*功能说明:SysTick中断调用函数
*******************************************************************************************/
void TimingDelay_Decrement(void)
{
    if (TimingDelay != 0x00)
    { 
        TimingDelay--;
    }
}


/**
  * @brief  This function handles SysTick Handler.
  * @param  None
  * @retval None
  */


void SysTick_Handler(void)
{
  TimingDelay_Decrement();
}


 
工程下载: 1.SysTick精确延时.zip (1.58 MB, 下载次数: 149)
<
回复

使用道具 举报

0

主题

1

回帖

0

蝴蝶豆

新手上路

最后登录
2015-3-4
发表于 2015-3-4 21:52:50 | 显示全部楼层
写的非常好。
回复 支持 反对

使用道具 举报

关于
我们是谁
投资者关系
意法半导体可持续发展举措
创新与技术
意法半导体官网
联系我们
联系ST分支机构
寻找销售人员和分销渠道
社区
媒体中心
活动与培训
隐私策略
隐私策略
Cookies管理
行使您的权利
官方最新发布
STM32N6 AI生态系统
STM32MCU,MPU高性能GUI
ST ACEPACK电源模块
意法半导体生物传感器
STM32Cube扩展软件包
关注我们
st-img 微信公众号
st-img 手机版