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




我要赚赏金打赏帖 |
|
|---|---|
| 【S32K3学习整理】使用 LPUART 的loopback 模式实现核间通讯被打赏¥28元 | |
| arduinounoq原生zephyr环境搭建被打赏¥31元 | |
| 树莓派3+Klipper,MPU6050共振补偿被打赏¥41元 | |
| GroveCreatorKit套件+摇杆测评被打赏¥18元 | |
| 设备功耗web监控界面(ESP32C5)被打赏¥28元 | |
| OrangePiZero2W系统被打赏¥33元 | |
| Linux环境下以模拟方式快速实现出入管理功能测试被打赏¥24元 | |
| 树莓派3+Klipper,老3D打印机满血升级被打赏¥33元 | |
| OK1126B-S开发板下串口屏及其应用被打赏¥21元 | |
| 低功耗超声波液位测距仪(ESP32S3)被打赏¥27元 | |