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



