点击:Debug ---Run---Go
得到下面的图片,图片是静止,当然也看不到闪烁的,但是这是经过我一步步的操作,是没啥疑问的!!图片图下:::::::::::::::::::::

定时器操作的程序如下:(自己测试用的)
main.c文件:
#include "mb95200.h"
unsigned int Systemtime;
/******************************************************************************
NAME: InitCompTimer();
FUNCTION: initial timer for the interval timer (Free run) function
******************************************************************************/
void InitCompTimer (void)
{
T01DR = 0x01; // set count value (high 8 bit)
T00DR = 0xFF; // set count value (low 8 bit)
TMCR0 = 0x10; // 16-bit, no filtering
T00CR0 = 0x82; // interval timer in free run mode
// enable IF flag interrupt
T00CR1 = 0xA1; // enable interrupt, enable output
// start timer
}
/******************************************************************************
name: CompTimer ();
function: enter ISR while the counter value matches the pre-set value
******************************************************************************/
__interrupt void CompTimer (void)
{
T00CR1_IE = 0; // disable interrupt
T00CR1_IF = 0; // clear flag
//... // interrupt service routine
Systemtime++;
T00CR1_IE = 1; // enable interrupt
}
/******************************************************************************
name: main ();
function: main loop
******************************************************************************/
void main (void)
{
InitCompTimer();
InitIrqLevels();
__EI();
DDR6_P63 = 1;
while (1)
{
if(Systemtime<=10)
{
PDR6_P63=0;
}
if(Systemtime>=20)
{
PDR6_P63=1;
}
if(Systemtime>=30) {Systemtime=0;}
}
}
有奖活动 | |
---|---|
【EEPW电子工程师创研计划】技术变现通道已开启~ | |
发原创文章 【每月瓜分千元赏金 凭实力攒钱买好礼~】 | |
【EEPW在线】E起听工程师的声音! | |
“我踩过的那些坑”主题活动——第001期 | |
高校联络员开始招募啦!有惊喜!! | |
【工程师专属福利】每天30秒,积分轻松拿!EEPW宠粉打卡计划启动! | |
送您一块开发板,2025年“我要开发板活动”又开始了! | |
打赏了!打赏了!打赏了! |
打赏帖 | |
---|---|
【我踩过的那些坑】calloc和malloc错误使用导致跑飞问题排查被打赏50分 | |
多组DCTODC电源方案被打赏50分 | |
【我踩过的那些坑】STM32cubeMX软件的使用过程中的“坑”被打赏50分 | |
新手必看!C语言精华知识:表驱动法被打赏50分 | |
【我踩过的那些坑】杜绑线问题被打赏50分 | |
【我踩过的那些坑】STM32的硬件通讯调试过程的“坑”被打赏50分 | |
【我踩过的那些坑】晶振使用的问题被打赏100分 | |
【我踩过的那些坑】电感选型错误导致的处理器连接不上被打赏50分 | |
【我踩过的那些坑】工作那些年踩过的记忆深刻的坑被打赏10分 | |
【我踩过的那些坑】DRC使用位置错误导致的问题被打赏100分 |