- This topic has 1 reply, 2 voices, and was last updated 13 years, 4 months ago by .
Viewing 2 posts - 1 through 2 (of 2 total)
Viewing 2 posts - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.
|
Microcontroller › 8051 › nrf24le1 timers
Hi!
i am having trouble with the timer2 of nrf24le1… i simply never get an interrupt… this is how i config and start the timer 2:
T2CON = 0x00; //Clear Timer
T2CON = 0x10; //Timer2 Clocked with CkCPU/12- Autoreload on overflow
CRCL = (unsigned char) RELOAD_VAL_2;
CRCH = (unsigned char) (RELOAD_VAL_2>>;
TL2 = (unsigned char) RELOAD_VAL_2;
TH2 = (unsigned char) (RELOAD_VAL_2>>;
ET2=1;
T2CON |= 0x01; //Starts Timer2
IEN0 |= (0x01 << 5);
EA1 = 1;
has anybody an idea what i am doing wrong?
my program is very simple.. it contains just one timer2 which i config and start and then i increment a variable in the interrupt function.. that is all..
thanks !
Norma
These are the common logical mistakes:
1. Interrupts have not been enebaled.
2. Registers have not been configured correctly.
3. Interrupts have not been enabled at the right place in the code.
4. ISR in not correctly written.
Try if you doing any of the fowwloing mistakes.