am in 25041 اشتراک گذاری ارسال شده در 8 خرداد، ۱۳۹۰ timer digital To create a realtime timer, realtime microcontroller is not required (RTC). You only need a crystal and a timer prescale settings. for example, if used for 8MHz crystal, then choose the timer prescale of 8. Prescale is a divisor which will be conditional on crystal beats as needed. timer frequency = frequency of crystal / prescale so, timer frequency = 1MHz since T = 1 / F, then T = 1US This means that every single wave oscillation takes 1US. To simplify the calculation, the timer0 registers (TCNT0) shall be 155. TCNT0 then oscillates between 155 to 255. so that any overflow occurs, the timer has counted 100us. when made variable “x” to be in increments of each of the Overflow occurs when x = 10, the timer value is 1ms. and if each x = 10 will raise the value of variable “y”, then “y” is the timer value in ms. (In experiments conducted used ATMega8535 with 8MHz crystal). نقل قول لینک به دیدگاه
ارسال های توصیه شده
به گفتگو بپیوندید
هم اکنون می توانید مطلب خود را ارسال نمایید و بعداً ثبت نام کنید. اگر حساب کاربری دارید، برای ارسال با حساب کاربری خود اکنون وارد شوید .