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.

[参考译文] TM4C123GH6PM:定时器模块未上电。

Guru**** 2604225 points


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

https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/749659/tm4c123gh6pm-timer-module-is-not-getting-powered-up

器件型号:TM4C123GH6PM
#define GPTMCFG_TIMER0 (*(volatile unsigned long *) 0x40030000))//GPTMConfiguration
#define GPTMCTL_TIMER0 (*(volatile unsigned long *) 0x4003000c)//:GPTMControl
#define GPTMTAMR_TIMER0 (*(volatile unsigned long *) 0x40030004)//GPTMTTimerA 模式 
#define RCGC_TIMER (*((volatile unsigned long *) 0x400FE604))//16/32-Bit General-PurposeTimerRunModeClockGatingControl (RCGCTIMER) #define GPTMTAILR_TIMER0 (*((volatile unsigned long *) 0x40030028))//:GPTMTTimerAIntervalLoad #define GPTMRIS_TIMER0 (*(volatile unsigned long *) 0x4003001c)//:GPTMRawInterruptStatus #define GPTMICR_TIMER0 (*(volatile unsigned long *) 0x40030024))//:GPTMInterruptClear void SystemInit (void){} void TimerModule_power() { RCGC_TIMER |= 0x01;//将时钟发送到 timer0 } void timer0_init () { GPTMCTL_TIMER0 |=(0<GPTMC00008)|=(0<TMC0000_Timer8);针对 Timer0<TMCTMCFG<TMCT0008) GPTMTAMR_TIMER0 |=(0x2<0);//为周期模式启用 GPTMTAMR_TIMER0 |=(1<4);//为递增计数 GPTMTAILR_TIMER0 = 0x0000f42400;// 16MHz 的1秒延迟}void timer_delay () {<TMCR0|<TMR0|/TIMER0|/TMR0|<TMR0|<TMR0|1 ) //等待计数器与间隔加载寄存 器 GPTMICR_TIMER0 |=(1<0); } int main() { TimerModule_pow(); timer0_init(); while (1) { GPIODATA_Porte ^= 0x55; timer_delay (); }// 编译没有在没有任何错误或警告的情况下运行,但没有在任何仿真中进行。 在命令窗口“*** error 65: access violation at 0x400FE604 : no res'read' permission”(***错误65:访问冲突位于0x400FE604:无“重新读取”权限)中。 问题是什么?

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

    请使用 TivaWare 库并查看示例:C:\ti\TivaWare_C_Series-2.1.4.178\examples\peripheral\timer_period_16bit.c