Instant Interrupts - Revisited


Closed Thread
Results 1 to 40 of 773

Hybrid View

  1. #1
    Join Date
    Dec 2005
    Posts
    23


    Did you find this post helpful? Yes | No

    Post

    Hello all

    Today I play with " Instant Interrupts" thank's Darrel

    For to begin I use blinky program
    I want to augment the speed of blink light by loading a value
    in TMR1H and TMR1L but the speed does not change

    Rq:
    I want not to change the value of the prescaler


    code:

    '********************
    TMR1H = %11111111
    TMR1L = %11111110
    '********************

    1CON = %110001 ; Prescaler = 8, TMR1ON

    what is wrong please?

  2. #2
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by debutpic View Post
    I want to augment the speed of blink light by loading a value
    in TMR1H and TMR1L but the speed does not change

    code:

    '********************
    TMR1H = %11111111
    TMR1L = %11111110
    '********************
    Loading that value %1111111111111110 = $FFFE = 65534
    Means the timer will overflow after only 2 ticks.
    A smaller number would help.

    Also, it has to be loaded after every interrupt, not just at the beginning of the program.
    <br>
    DT

  3. #3
    Join Date
    Dec 2005
    Posts
    23


    Did you find this post helpful? Yes | No

    Default

    thank's Darrel

    Remark:

    In my next code if I load TMR1H with a high value code work fine

    Main:

    TMR1H = %11111111
    pause 1

    ----------------------------

    but if I reduce the value in TMR1H code don't work
    display is OFF

    Main:

    TMR1H = %10111111
    pause 1

    -------------------------------
    if I want use this value "TMR1H = %10111111"
    I must write "pause 20" and not "pause 1"

    an idea ???????

  4. #4
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    No, I have no idea what you are doing.
    If you're using a timer, why do you need pauses?

    What frequency are you trying to run the timer at?
    What frequency is your primary oscillator?
    What PIC are you using?
    <br>
    DT

  5. #5
    Join Date
    Dec 2005
    Posts
    23


    Did you find this post helpful? Yes | No

    Default

    I use one 16F877 MCU to 20 Mhz

    TMR1 produce an interrupt every 0,4 µSec
    for to drive four 7 segment displays (prescaler:1)

    My board developpement is EasyPic4

    If I write not a Pause after TMR1H %11111111
    then the displays don't work

  6. #6
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by debutpic View Post
    I use one 16F877 MCU to 20 Mhz
    TMR1 produce an interrupt every 0,4 µSec
    At 4Mhz, each instruction takes 1 uSec to execute.
    At 20Mhz, each instruciton takes .2 uSec to execute.
    When you take in to account the fact that each jump/return to/from the interrupt handler takes at minimum 4 instructions cycles (2 for the jump into the int handler, 2 for the RETFIE after the handler), which happens to be .8uSec, you have less than ZERO time to do anything.
    Even at 40Mhz, you're still at ZERO time left over.
    At 48Mhz, you might get one instruction in here and there...
    And even at 64Mhz, you probably won't get more than one or two instructions done between interrupts.

  7. #7
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,133


    Did you find this post helpful? Yes | No

    Default

    I think it is better to post the details of your project so that you could get a decent help. And the .4usec to drive a LED display, to me seems too little time.

    Ioannis

Similar Threads

  1. Clock using Instant Interrupts
    By PICpocket in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 16th February 2009, 21:43
  2. DT instant interrupts with mister_e keypad
    By Tomexx in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 26th November 2008, 20:02
  3. DT's Instant Interrupts trouble
    By Tomexx in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 24th November 2008, 20:48
  4. Keypad and DT's Instant Interrupts
    By Homerclese in forum General
    Replies: 11
    Last Post: - 27th April 2007, 06:32
  5. Replies: 1
    Last Post: - 1st November 2006, 03:11

Members who have read this thread : 6

You do not have permission to view the list of names.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts