??? 01/05/05 09:37 Read: times |
#84359 - Verify the timer interval calculations |
Hi
Please verify that i am doing the right calculation to load a 16 bit timer for 1/20 or .05 second delay. Thanks Shahzad 1/20 seconds calculations for 12Mhz crystal 12Mhz is equal to 12000000 12000000 / 12 = 1000000 is the number of cycles in one second 1000000 * .05 = 50000 is the number of increments of 16 bit timer in 1/20 seconds 65536 - 50000 = 15536 = 3CB0 is the value need to be set in time to count from 3CB0 to FFFF in 1/20 seconds ----------------------------------------------------------------- 1/20 seconds calculations for 11.0592Mhz crystal 11.0592 is equal to 11059200 11059200 / 12 = 921600 is the number of cycles in one second 921600 * .05 = 46080 is the number of increments of 16 bit timer in 1/20 seconds 65536 - 46080 = 19456 = 4C00 is the value need to be set in time to count from 4C00 to FFFF in 1/20 seconds |
Topic | Author | Date |
Verify the timer interval calculations | 01/01/70 00:00 | |
Why? | 01/01/70 00:00 | |
whops | 01/01/70 00:00 | |
Why don't you just measure it? | 01/01/70 00:00 | |
i am doing this | 01/01/70 00:00 | |
How do you reload? | 01/01/70 00:00 | |
only difficult way with timer 0![]() | 01/01/70 00:00 |