1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

maximum time delay using timer interrupt of timer 1 of 8051

Discussion in '8051/8951' started by Bob Parihar, Mar 2, 2015.

  1. Bob Parihar

    Bob Parihar Member

    Joined:
    Oct 8, 2014
    Messages:
    87
    Likes:
    0
    i came to know that 8051 get interrupted whenever the timer overflows.. ie TF flag is set
    so if i use MODE 1 timer one... the maximum delay after which MCU get interrupted comes out to be 71 ms approx(65535*1.085 micro sec)

    so what if i need an interrupt delay more than 71 ms say i want an interrupt after 1sec? how it will possible?
     
  2. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,164
    Likes:
    910
    Location:
    Rochdale UK
    ONLINE
    I normally set a variable to increment when the timer reaches a certain value..

    setup the timer for 50mS and when the timer overflows increment the variable..

    pre-load the timer so it fires at 50mS... In the interrupt preload the timer again and increment the milli second var.. when it reaches 20 then you will have reached 1 second...


    What crystal are you using.. can I assume a 12Mhz???
     

Share This Page