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

    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.

  2. #2
    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 20:28.
    Steve

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

  3. #3
    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

  4. #4
    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.

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


    Did you find this post helpful? Yes | No

    Default

    Ok, I disabled that code to disable/enable the USBSERVICE interrupt before the gosubs and now the interrupt is getting executed a LOT of times.

    I can't say at what interval, but the counter is scrolling on the LCD pretty fast. The hundreds are going by just a bit faster than every second, but I still lose connection.

    Darrel, how can I adjust the speed of the interrupt?

    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!

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


    Did you find this post helpful? Yes | No

    Default

    I'm going to solder a wire to 1 pin, blink that pin in the interrupt and connect my scope on the wire.

    I don't know much about scopes, but I might be able to figure out the frequency.

    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!

  7. #7
    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, 22:43
  2. DT instant interrupts with mister_e keypad
    By Tomexx in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 26th November 2008, 21:02
  3. DT's Instant Interrupts trouble
    By Tomexx in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 24th November 2008, 21:48
  4. Keypad and DT's Instant Interrupts
    By Homerclese in forum General
    Replies: 11
    Last Post: - 27th April 2007, 07:32
  5. Replies: 1
    Last Post: - 1st November 2006, 04: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