Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

how to calculate time(seconds) with 8051 timers????

Status
Not open for further replies.

info_req

Member level 5
Joined
Jun 20, 2007
Messages
81
Helped
6
Reputation
12
Reaction score
4
Trophy points
1,288
Location
Pakistan
Activity points
1,764
8051 2 second timer

dear all,
i want to calculate time using 8051 timers, clock is 12MHz. i.e how to program timer for 1000000???

can i use timer0 and timer1, so that they count more than 16 bit????
thanks
 

timers in 8051

Dear Friend

you can use any timers
but the maximum count you can get is only 65535+1
because the timer is a 16 bit timer
you can use other methods to get your required counts
but if you need exat timimg you should take care

ml
 

    info_req

    Points: 2
    Helpful Answer Positive Rating
mcs51 use timer

use timer in a loop
 

    info_req

    Points: 2
    Helpful Answer Positive Rating
how to calculate 8051 timer

as mentioned, use two timers in loops. which means make a 65535 counts for the counter in the internal loop update the count for the timer in the external loop by 1. and so you'll achieve number of counts larger than 65535 (16 bits)..
 

how to calculate time in seconds

asoom said:
as mentioned, use two timers in loops. which means make a 65535 counts for the counter in the internal loop update the count for the timer in the external loop by 1. and so you'll achieve number of counts larger than 65535 (16 bits)..
there is no need for 2 TIMERs to do that... how exactly are you going to increment a TIMER with ... a TIMER INT? you just need a timer and some variable to do the counting of interrupts.

0x41 0x56 0x45!!
 

calculating time in 8051 interrupts

Hi!
in every timer0 interrupt, set the TH0 and TL0 to accurate frecuency and use a counter variable.

This variable is the auxiliar to use longer times than 16 bits
 

calculate timer count

Hi!
You can do this very accurately by using just one timer.
See the complete keil project that is attached. Study the code carefully.
Ask if still not clear about the code.
Regards.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top