TimerA0

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决
1,740 次查看
AJPinotti
Contributor II

Hello.

 

I wanna run a simple timer to control timeouts, but I don´t wanna use Interrupts. I am trying to configure the register to make the timer run, but it doesn´t.

I am doing as follows:

 

void DL_Timer_Initial_Sb(void)
{
 /* TMRA0_CTRL: CM=001,PCS=1110,SCS=0,ONCE=0,LENGTH=0,DIR=0,Co_INIT=0,OM=0 */
 TMRA0_CTRL=0x3C00;
 /* TMRA0_SCTRL: TCF=0,TCFIE=0,TOF=0,TOFIE=0,IEF=0,IEFIE=0,IPS=0,INPUT=0,Capture_Mode=0,MSTR=0,EEOF=0,VAL=0,FORCE=0,OPS=0,OEN=0 */
 TMRA0_SCTRL=0x0000;
 TMRA_ENBL=0x0001;
}

 

I already tried to use the exact same functions PE gives, but it just doesn´t work. PE code is to big and uses interrupts.

 

What´s is going wrong?

 

Tks a lot.

 

Alexandre

标签 (1)
标记 (1)
0 项奖励
回复
1 解答
849 次查看
AJPinotti
Contributor II

Hi.

 

Found at CPU Bean that there is a TA0 Peripheral Clock that must be set as well. It sets TA0 bit from SIM_PCE1 register, and PE does it at PE_low_level_init().

 

The configuration of the timer was ok, but SIM_PCE1´s TA0 bit was not set. I couldnt even find a word about it in the Quad Timer Section.

 

Till next!

 

Tks.

在原帖中查看解决方案

0 项奖励
回复
1 回复
850 次查看
AJPinotti
Contributor II

Hi.

 

Found at CPU Bean that there is a TA0 Peripheral Clock that must be set as well. It sets TA0 bit from SIM_PCE1 register, and PE does it at PE_low_level_init().

 

The configuration of the timer was ok, but SIM_PCE1´s TA0 bit was not set. I couldnt even find a word about it in the Quad Timer Section.

 

Till next!

 

Tks.

0 项奖励
回复