We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
I've been reading http://www.keil.com/appnotes/files/apnt_105.pdf in order to learn how to best handle 8051 timer interrupts in Keil C. For calculating the starting value, it says:
#define TIMER0_COUNT 0xDC11 /* 10000h - ((11,059,200 Hz / (12 * FREQ)) - 17) */
I understand everything except the final -17. Where did this come from? Is it the number of cycles needed to initialize the timer or something like that?
Hey! The guy Ashley actually answered a post and correctly too. The 12 in the expression is for a 12 clock cycle and the 17 is the estimated number of 12 clock cycles (instructions)to service the timer. It's an attempt to tune the timer count more accurately. As the guy points out, there are other ways to tune your timer counts.
Bradford