Instant Interrupts - Revisited


Closed Thread
Results 1 to 40 of 773

Hybrid View

  1. #1
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    .Damn.. way to slow this time

    my solution was..
    Code:
    asm
    RXBnIF=RXB1IF
    TXBnIF=TXB2IF
    FIFOWMIF=RXB0IF
    INT_LIST    MACRO
        INT_Handler TMR1_INT, _ToggleLED1, PBP, yes
        endm
        INT_CREATE
       endasm
    From p18f8680.inc file...
    Code:
    ;----- PIR3 Bits -----------------------------------------------------
    RXB0IF           EQU  H'0000'
    RXB1IF           EQU  H'0001'
    TXB0IF           EQU  H'0002'
    TXB1IF           EQU  H'0003'
    TXB2IF           EQU  H'0004'
    ERRIF            EQU  H'0005'
    WAKIF            EQU  H'0006'
    IRXIF            EQU  H'0007'
    
    FIFOWMIF         EQU  H'0000'
    RXBnIF           EQU  H'0001'
    TXBnIF           EQU  H'0004'
    On another hand... seems odd...
    Last edited by mister_e; - 30th May 2008 at 23:33.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

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


    Did you find this post helpful? Yes | No

    Default

    Good one Steve. That would have worked too.

    Since they're actually the same bit's, but with different Names depending on the mode, that might be an easy way for me to fix it. Maybe.
    <br>
    DT

  3. #3
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    But yeah... we know how Microchip work... hard to tell if it will always work... on all PIC

    Worth a try!
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  4. #4
    Join Date
    Oct 2003
    Location
    Australia
    Posts
    257


    Did you find this post helpful? Yes | No

    Question

    Steve,

    Do you know if the there is any difference in accuracy between using a xtal osc and the internal RC osc esp. in relation to timer interrupts?

    Squib

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


    Did you find this post helpful? Yes | No

    Default

    Must be Steve's day off.

    Hi Squib,

    Well it depends on the internal oscillator type, and how you're using the interrupts.

    The typical general purpose crystal will have a tolerance of +/- 50 PPM (Parts per million) Although there are other crystals with tighter tolerances, some down to less than 1 PPM. But they come at a higher cost.

    If you're using one of the older 4mhz internal oscillators, depending on temperature and proper calibration numbers, they can vary up to +/-10% (100,000 PPM). A HUGE difference.

    The newer 8mhz oscillators will vary a modest +/- 2.5% over the temperature range, but that's still 25,000 PPM.

    If the interrupts are being used for "Long Term" timing like a clock, a difference of 1 PPM translates to an error of +/- 31.5 seconds per year. At 50 PPM it's 26.3 minutes/yr

    But with the 8mhz INT_OSC, you're looking at a whopping 9.1 Days/Yr.. And with the old 4mhz osc you're off by +/-36.5 days. Yikes!

    Of course these are "Worst case" numbers with maximum temperature extremes, actual results may vary.

    hth,
    DT

  6. #6
    Join Date
    Sep 2007
    Location
    USA, CA
    Posts
    271


    Did you find this post helpful? Yes | No

    Default

    For reference, I recently tried to see what kind of baud I could get out of my pic serial port, using the internal 8MHz osc. I used an FTDI232R on the PC side, which accepts +/- 3% on the baud rate. The lower baud rates locked in fine, but at 125Kbaud, I had to slow the PIC baud rate down to 118k to 124k. (I did not try any fractions to get more precise failure speeds.) Apparently at the temperature of that particular pic at that particular time, the oscillator was running about 3% fast. That's 30,000 parts per million... way off, I would say.

  7. #7
    Join Date
    Oct 2003
    Location
    Australia
    Posts
    257


    Did you find this post helpful? Yes | No

    Default

    Thanks DT for the info, those are some pretty scarey numbers you pulled up!

    The reason I asked was I have a three minute timer using DT_14 interrupts and I also used Steves Pic timer calc but I'm consistantly getting the timer out by about -10 secs using the int_osc at 8MHz.

    I'll try an ext_xtal and see if I get the same error, but comparing my error to the numbers you pulled up, mines probabaly due to a coding error. :-)

    If I find a difference I'll let you know.

    Cheers

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