2602 views|0 replies

67

Posts

2

Resources
The OP
 

11. [Learning LPC1768 library functions] Systick experiment [Copy link]

The system tick timer is an important part of the Cortex-M3 . The system tick timer is designed to provide 10 millisecond interval interrupts for the operating system or other system management software . Because the system tick timer is part of the Cortex-M3 , it is easy to port software by providing a standard timer that can be used in Cortex-M3 core devices .

/************************************************************************        
** 函数名:void SysTick_Init(uint8_t time)
** 函数功能: systick初始化
** 输入参数: time 定时时间(ms)
** 输出参数: 无                
** 返回值:无        
************************************************************************/ 
void SysTick_Init(uint8_t time){
                

        SysTick_Config(SystemCoreClock/1000*time); //系统时钟/1000  

}

/************************************************************************        
** 函数名:void delay_us(uint32_t MS)
** 函数功能: 毫秒延时函数
** 输入参数: 毫秒 
** 输出参数: 无                
** 返回值:无        
************************************************************************/ 
void Delay_ms(uint32_t MS){
        
                
unsigned long systickcnt;
  systickcnt = SysTickCnt;
  while ((SysTickCnt - systickcnt) < MS);
        
}

void SysTick_Handler(void)
{

        
  SysTickCnt++;
        SysTick->CTRL &= ~(1<<16);

}

【11】LPC1768_SYSTICK实验.rar (251.73 KB, downloads: 9)



This content is originally created by EEWORLD forum user cxmdz . If you want to reprint or use it for commercial purposes, you must obtain the author’s consent and indicate the source

This post is from NXP MCU
 

Guess Your Favourite
Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list