Instant Interrupts - Revisited


Closed Thread
Results 1 to 40 of 773

Hybrid View

  1. #1
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,172


    Did you find this post helpful? Yes | No

    Default

    Steve, I don't know how to check how often the USBSERVICE interrupt is occurring. The only settings I have are the oscillator and prescaler:

    DEFINE OSC 48
    T1CON = $11 ; Prescaler = 2, TMR1ON

    I am using a 20MHz crystal with these configuration settings:

    CONFIG PLLDIV = 5 ;Divide by 5 (20MHz input)
    CONFIG CPUDIV = OSC1_PLL2 ;[OSC1/OSC2 Src: /1][96MHz PLL Src: /2]
    CONFIG USBDIV = 2 ;Clock source from 96MHz PLL/2
    CONFIG FOSC = HSPLL_HS ;HS oscillator, PLL enabled, HS used by USB

    Robert


    EDIT: Interesting, I added a counter in the interrupt routine and displayed it on the LCD, it only gets executed once. I'm checking now if I disable it and never re-enable it after.
    Last edited by Demon; - 18th August 2006 at 18:58.
    My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.

    Not as dumb as yesterday, but stupider than tomorrow!

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


    Did you find this post helpful? Yes | No

    Default

    your pre-scaller is way too low... so interupt ocure way too fast, USBSERVICE don't have time to finish correctly.
    Steve

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

  3. #3
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,172


    Did you find this post helpful? Yes | No

    Default

    Do you have a suggestion?

    Robert
    My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.

    Not as dumb as yesterday, but stupider than tomorrow!

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


    Did you find this post helpful? Yes | No

    Default

    Uh... my calculation were wrong... (1/12000000)*65536*2='round 10mSec. ARRGGH i don't have my stuff here to compare with mine... Darrel is on-line anyway
    Steve

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

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


    Did you find this post helpful? Yes | No

    Default

    NO.. let's look at that...
    Code:
    T1CON = $11 ; Prescaler = 2, TMR1ON
    i remind that TiCON can be use in 16 bit or 8 bit.. i'm sure you use it in 8 bit mode now... or i missing something obvious about the 16/8 bit.. maybe just in read/write something... mmm something look weird in this line...clock source, mode or else.
    Last edited by mister_e; - 18th August 2006 at 19:28.
    Steve

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

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


    Did you find this post helpful? Yes | No

    Default

    Well yeah, I'm online. But that's not going to help much since I don't have a Clue about using the USB stuff. Just never got around to trying it before.

    I'm still hoping you guys can figure it out. So that when I do get around to trying it, I won't have to work as hard.
    <br>
    DT

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


    Did you find this post helpful? Yes | No

    Default

    if i can finish the house-bench-lab-cleaning stuff soon, i'll have access to my stuff. I have this one working.. but i don't remind wich timer i used and how i used it... the T1CON line seems weird... clock source is still my most possible guess.
    Steve

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

  8. #8
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,172


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mister_e
    Uh... my calculation were wrong... (1/12000000)*65536*2='round 10mSec. ARRGGH i don't have my stuff here to compare with mine... Darrel is on-line anyway
    Steve, I'm trying to figure this out using math (gotta start sometime) and I'd like to know where you got the 12000000 from.

    I read this link you posted in another thread:
    http://ww1.microchip.com/downloads/e...Doc/41214a.pdf

    And I got this formula from Tip #7:
    Tosc x 4 x 65536 x prescaler

    I am using a 48MHz crystal so I get this:
    (1/48000000) x 4 x 65536 x 2 = 0.0109226 (repeating)

    D'uh, ok, I see it now, 48 / 4 = 12, that's where you got your value. So, as you said, that interval rounds up to just over 10ms, that 'should' work.

    I'm sure it has something to do with the interrupt occurring right in the middle of USB processing and interfering with the connection. I don't see what else it can be; the interrupt seems fine, the USB works.

    Robert
    My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.

    Not as dumb as yesterday, but stupider than tomorrow!

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 : 5

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