The TMR0 registers in MC56F8006

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

The TMR0 registers in MC56F8006

566件の閲覧回数
khalil001
Contributor II

172324_172324.JPG1.JPG

172340_172340.JPG捕获.JPG

 

I have written the program

but the registers in debug mode reveal 0

like follow pictrue:

172341_172341.JPGOO.JPG

 

So, I think I don't start the TMR0.

and how I start the TMR0?

ラベル(1)
タグ(1)
0 件の賞賛
4 返答(返信)

416件の閲覧回数
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

I think you should enable the gated clock of TA0  and TA1 modules before you write any registers of TA0 or TA1.

SIM_PCE|=0x03; //enable both TA0 and TA1 clock.

Hope it can help you

BR

XiangJun Rong

0 件の賞賛

416件の閲覧回数
khalil001
Contributor II

Thank you very very much!!!

the TMR has already started.

but I have another problem.

The program can't go into the interrupt function.

My program as follow:

1111.JPG

The  intialization of TMR1 as follow:

22222.JPG

The interrupt function as follow:

33333.JPG

44444.JPG

I am sorry for that you can take your time to solve my problem.

Could you help me solve it?

Thank you very much!!!

0 件の賞賛

416件の閲覧回数
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

Pls check the I0/I1 bits in SR register,I0/I1 should be cleared,  check the priority bits of TWR0 located at chapter 12 Interrupt Controller (INTC), check the interrupt enable bit in TMR0_nSCTRL.

Hope it can help you

BR

XiangJun Rong

0 件の賞賛

416件の閲覧回数
khalil001
Contributor II

ok,thank you very very much

0 件の賞賛