??? 04/20/06 18:58 Read: times |
#114632 - Measuring 1s using timer 2 AT89S8252 |
Hi,
I'm using timer 2 of an AT89S8252 (12Mhz) to calculate a time of 1 second but I'm a bit confused. I want to load a value of 50000 decimal into timer 2 so I have to load in t2 lower order byte: "50" and in the higher order byte "C3". and reload the value in timer 2 for 20 times (20 x 50ms = 1 s)Is this correct? In another program om this website: http://www.8052.com/codelib/freq.asm the author uses this code: MOV CRCL, # Low (-49999) ;0xAF; // 50 ms Reload 3CAF = -50000 MOV CRCH, # High(-49999) ;0x3C; MOV TL2, # Low (-49999) ;V0.2 new ReloadValue -49999 MOV TH2, # High(-49999) but isn't 3CAF hexadecimal the same value as 15535 decimal value? Or is it just me who has a confusing day:p Greetz, Aephyon |
Topic | Author | Date |
Measuring 1s using timer 2 AT89S8252 | 01/01/70 00:00 | |
the timer count UP | 01/01/70 00:00 | |
WOOPS![]() | 01/01/70 00:00 |