PIC32MZ tutorial -- Core Timer
2024-10-19 21:35:06
Core Timer is a very popular feature of PIC32 since it is a piece of the MIPS M4K core itself and is common to all MIPS processors. Most RTOS's timer are based on core timer. This timer has a fixed prescaler 1:2, and it is a 32-bit timer, no need to combine with two 16-bit timer like we do with other timers (Timer2 and Timer3 or Timer4 and Timer5). At this moment I only use core timer to implement time delay. To accomplish it, I write two functions: ReadCoreTimer() and CoreT_DelayMs().
unsigned int __attribute__((nomips16)) ReadCoreTimer(void)
{
unsigned int timer; // get the count reg
asm volatile("mfc0 %0, $9" : "=r"(timer)); return timer;
} void CoreT_DelayMs(unsigned int delayMs)
{
unsigned int delayStart; delayStart = ReadCoreTimer(); while ((ReadCoreTimer() - delayStart) < (delayMs * CORE_TIMER_MILLISECONDS));
}
最新文章
- windows下PHP与Apache的安装配置
- Emoji表情符号录入MySQL数据库报错的解决方案(MySQL utf8与utf8mb4区别)
- 使用注解实现IOC
- EF Code First教程-02 约定配置
- Leetcode--Add two number
- js面向对象(构造函数与继承)
- ExecutorService.execute(Runnable x) 判断是否完成,得到返回值
- CSS 之 @media
- 关于API,前后端分离
- js设置元素class方法小结及classList相关
- AngularJS学习之旅—AngularJS 事件(十四)
- 20165221 《网络对抗技术》EXP2:后门原理与实践
- OpenStack搭建Q版在控制节点上的环境准备(step2)
- 上传input中file文件到云端,并返回链接
- mac 安装 RabbitMQ
- Python day15装饰器基本理论,以及结合全局变量模拟session
- bootstrap导航条等样例持续更新》。。
- doc2vec使用笔记
- 转:苹果Xcode帮助文档阅读指南
- EOS Dapp开发(1)-基于Docker的开发环境搭建
热门文章
- 扩展 ASP.NET MVC 模型扩展 &ndash; ASP.NET MVC 4 系列
- case使用例子
- Head First设计模式之装饰者模式(Decorator Pattern)
- [2014.01.27]wfGifAnimator 动画GIF组件 3.0
- linux eclipse c++
- Java 和C/C++的“语法”上的差异!
- Can&#39;t connect to MySQL server on localhost (0)
- ruby生成随机成绩
- springmvc--json--返回json的日期格式问题
- NVMe over Fabrics又让RDMA技术火了一把