The TMR0 registers in MC56F8006

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

The TMR0 registers in MC56F8006

543 Views
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?

Labels (1)
Tags (1)
0 Kudos
4 Replies

393 Views
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 Kudos

393 Views
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 Kudos

393 Views
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 Kudos

393 Views
khalil001
Contributor II

ok,thank you very very much

0 Kudos