Microcontroller execution time

Discussion in 'Microcontrollers and Programming' started by electronicsLearner77, Jul 15, 2017.

  1. electronicsLearner77

    electronicsLearner77

    Joined:
    Jul 2, 2015
    Messages:
    40
    Likes Received:
    0
    I have a timer and if i configure it for 1ms the execution time of main function from the beginning to end will be less compared to the same timer configured for 500 micro seconds. Is it correct? Or there will not be any difference. The controller is a pic. Please suggest.
     
    electronicsLearner77, Jul 15, 2017
    #1
    1. Advertisements

  2. electronicsLearner77

    Minder

    Joined:
    Apr 24, 2015
    Messages:
    1,950
    Likes Received:
    403
    Location:
    Canadian Midwest
    Depends what source you are using to run the timer, if the system clock then it will depend on the freq of the clock (Fosc/4) and the pre-scale the timer is set for.
    You can pre load the timer with any value and then check the over flow after changing timer value.
    M.
     
    Last edited: Jul 15, 2017
    Minder, Jul 15, 2017
    #2
    1. Advertisements

  3. electronicsLearner77

    electronicsLearner77

    Joined:
    Jul 2, 2015
    Messages:
    40
    Likes Received:
    0
    I think i have not explained my question properly. My question was if i increase the frequency of timer interrupt (for that matter any interrupt) then it will load the sytem more and hence other functions will take more time to finish. Similarly if i decrease the timer interrupt frequency then less time for other functions to finish. Am i correct?
     
    electronicsLearner77, Jul 15, 2017
    #3
  4. electronicsLearner77

    Minder

    Joined:
    Apr 24, 2015
    Messages:
    1,950
    Likes Received:
    403
    Location:
    Canadian Midwest
    If the timer period is reduced and you are using a Interrupt location routine, Then obviously the more often the interrupt is called it will increase the time taken for non-interupt routines to perform their task etc.
    In some cases, instead of using the interrupt locations is to turn off GIE etc and just poll the interrupt bit, which will still be set regardless.
    M.
     
    Minder, Jul 15, 2017
    #4
    electronicsLearner77 likes this.
    1. Advertisements

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Similar Threads
  1. J. David

    BS2 microcontroller startup time

    J. David, Dec 1, 2005, in forum: Electronic Design
    Replies:
    0
    Views:
    463
    J. David
    Dec 1, 2005
  2. ssylee

    PIC code self-start execution

    ssylee, Sep 22, 2007, in forum: Electronic Design
    Replies:
    15
    Views:
    867
    ssylee
    Oct 10, 2007
  3. Brad

    Dehumidifier Option, Set Time On & Time Off

    Brad, Oct 12, 2007, in forum: General Electronics
    Replies:
    1
    Views:
    1,162
    Joe R
    Oct 19, 2007
  4. Brad
    Replies:
    0
    Views:
    1,149
  5. Mark Sableman

    Motion for Writ of Execution

    Mark Sableman, Nov 3, 2007, in forum: Security Alarms
    Replies:
    2
    Views:
    1,784
    Jim Rojas
    Nov 3, 2007
  6. shaheen
    Replies:
    1
    Views:
    1,676
    rob_croxford
    Oct 26, 2010
  7. paddy

    required delay before function execution!!

    paddy, Dec 4, 2012, in forum: Microcontrollers and Programming
    Replies:
    11
    Views:
    1,085
    paddy
    Dec 11, 2012
  8. indeedisuper

    Code execution in ISR too slow.

    indeedisuper, Oct 7, 2015, in forum: Microcontrollers and Programming
    Replies:
    12
    Views:
    418
    Colin Mitchell
    Oct 24, 2015
Loading...