I have written the program
but the registers in debug mode reveal 0
like follow pictrue:
So, I think I don't start the TMR0.
and how I start the TMR0?
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
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:
The intialization of TMR1 as follow:
The interrupt function as follow:
I am sorry for that you can take your time to solve my problem.
Could you help me solve it?
Thank you very much!!!
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.
ok，thank you very very much
Retrieving data ...