This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] MSPM0G1106:计时器插入问题、

Guru**** 1810440 points
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1403748/mspm0g1106-timer-int-problem

器件型号:MSPM0G1106

工具与软件:

hello、在下面的软件中、它会一次进入 main 中的 while 循环、但不会再次进入、计时器会继续计数、但不会再次返回 while 循环。


#include "GPIO_Func.h"
#include "ti_msp_dl_config.h"
#include "LCD_Func.h"
#include "rtc_func.h"
#include "INCLUDE.h" System_Init
#include "stdio.h"

int val=0;
int RTC_REPEAT_TIME;


void timer_0_INST_IRQHandler (void)

开关(DL_TimerG_getPendingInterrupt (TIMER_0_INST)){
案例 DL_TIMER_IIDX_ZERO:
RTC_REPEATE_TIME++;
/*
* Timer'ı duruyoruz, yük değerini tekrar ayarlayıp
* tekrar başlatıyoruz
*/
// DL_TimerG_stopCounter (TIMER_0_INST);

/* Timer'ı 200ms periyodunda tekrar başlatıyoruz */
/*
DL_TimerG_setLoadValue (TIMER_0_INST、TIMER_200_milliseconds_tick);
DL_TimerG_startCounter (TIMER_0_INST);

/* gpinlerini değiştir (led'leri yaksöndür)*

休息;
默认值:
休息;
}
}

int main (void)

SYSCFG_DL_init ();


Interrupt_Init ();
Timer_Init ();


Rw_off;
LCD_Backlight_on;
LCD_Init();
Sample_Loop ();

// DS1307'ye saati ayarla
//writeTimeToDS1307 (15、9、0、4、22、 8、24);// Saat:09:52:00、Gün:5 (***)、Tarih:22 Ağustos 2024
while (1){


if (RTC_REPEAT_TIME>5){
RTC_4.15RTC() Read_Time_;
Char timeStr[16];
snprintf (timeStr、sizeof (timeStr)、"%02d:%02d:%02d"、小时、分钟、 秒);

char dateStr[16];
snprintf (dateStr、sizeof (dateStr)、"%02d/%02d/%02d %s"、日期、月份、 年份、dayStr);

// Zamanı üst satıra satıra yazdır , tarihi alt ortalamalı( ya da ortalamadan)
lcdPrintLines (timeStr、dateStr、1、1);
RTC_REPEATE_TIME=0;
}

//delay_cycles (16000000);

}
}

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尊敬的 Burak:

    当您暂停程序时、您在代码中的位置是什么?

    我建议在计时器 ISR 中放置一个断点、查看您是否达到计时器 ISR、因为您已使计时器保持运行。

    此致、
    Luke

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    我太懒得尝试了、但(在这种情况下、这通常是问题的答案)如果 MCU 设置为在处理中断后进入睡眠状态、那么如果你点击暂停、它会最终在哪里?