Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
09/23/02 10:40
Read: times


 
#29540 - timer 2 operation
Hi people,

I'm working with 89c668 and here is an issue I don't understand....

I'd like to use the timer 2 as a 16 bits autoreload timer to use it with my runtime executive sequencer.

I've initialized the timer like this :
/* Timer 2 Initialization */
T2CON = 0x80;
RCAP2L=0;
RCAP2H=0;
TL2=RCAP2L;
TH2=RCAP2H;
ET2=1;
TR2=1;

The TLH and TH2 are defined as
sfr TL2 = 0xCC;
sfr TH2 = 0xCD;

I've also defined a 16 bits register with Keil syntax :
sfr16 T2 = 0xCC;


Now, I would like to use the T2 register in the application, but below are the problems I've encountered

1. T2 is always = 0x0001; whereas TH2 and TL2 are incrementing

2. Impossible to compute T2 - u16variable
An error occurs on the '-' operand

Is someone has an idea on why I've this problems or is there any other way to use the timer 2 as 16 bits instead using TL2 and TH2 ?

Thanks

Stephane

List of 7 messages in thread
TopicAuthorDate
timer 2 operation            01/01/70 00:00      
RE: timer 2 operation            01/01/70 00:00      
RE: timer 2 operation            01/01/70 00:00      
RE: timer 2 operation            01/01/70 00:00      
RE: timer 2 operation            01/01/70 00:00      
RE: timer 2 operation            01/01/70 00:00      
RE: timer 2 operation            01/01/70 00:00      

Back to Subject List