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 delay can be implemented by timers

Discussion in '8051/8951' started by Greital, Mar 8, 2016.

  1. Greital

    Greital New Member

    Joined:
    Mar 8, 2016
    Messages:
    10
    Likes:
    0
    hi,

    I'm kinda new to 8051 and have a problems with it :(

    Q: assuming 8051 is connected to a 6Mhz crystal, what is the maximum delay that can be implemented by a single timer using mode 1 ?

    what I've tried is the following:
    1. finding the freq = 6/12 Mhz
    2. finding the cycle of time = 1/freq
    3. delay = number of counts X cycle of time ----> here I stuck :banghead: how to find the number of counts ??? :nailbiting:

    I'm not sure if what I'm doing is right or wrong :(

    so please :angelic: help me out with this :(
     
  2. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,305
    Likes:
    914
    Location:
    Rochdale UK
    Using a 12Mhz crystal you will get 1uS per tick cycle....

    The timer can be set to 4 modes..... 16 bit timer... 8 bit timer with pre-scaler.. 8 bit with re-load or just 8 bit timer..

    8 bit with prescaler is pretty much the same as 16 bit but a bit more control..

    a 16 bit timer will run for 65535 ticks or 65535 * 1uS.... That give a total 65.535mS for a complete count.If you use a 6Mhz you can double that to 131mS..

    I have done a bit of an article HERE!!.. It shows interrupts using the timer!!
     
  3. Greital

    Greital New Member

    Joined:
    Mar 8, 2016
    Messages:
    10
    Likes:
    0
    thanks alot :happy: for your help :) , really appreciate it
     

Share This Page