点击: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;}
}
}




我要赚赏金打赏帖 |
|
|---|---|
| 基于ArduinoUNO开发板的AT24C02读写测试被打赏¥16元 | |
| TCS3472S传感器及其色彩检测被打赏¥19元 | |
| 【S32DS】S32K3 RTD7.0.1 HSE 组件配置报错问题解决被打赏¥27元 | |
| 【S32K3XX】MCME 启动 CORE1被打赏¥23元 | |
| AG32VH407下温度大气压传感器及其检测被打赏¥20元 | |
| AG32VH407下光照强度传感器BH1750及其检测被打赏¥22元 | |
| AT32VH407下使用温湿度传感器DHT22进行检测被打赏¥20元 | |
| DIY一个婴儿澡盆温度计被打赏¥34元 | |
| 【FreeRtos】FreeRtos+MPU region 配置规则被打赏¥23元 | |
| 【分享开发笔记,赚取电动螺丝刀】三分钟快速上手驱动墨水屏(ArduinoIDE)被打赏¥28元 | |