Shop OBEX P1 Docs P2 Docs Learn Events
How long The SX20/28's interrupt interval could be ? — Parallax Forums

How long The SX20/28's interrupt interval could be ?

Protoss2000Protoss2000 Posts: 2
edited 2006-07-28 16:17 in General Discussion
I'm a newer to SX family.· I have same questions.,hope someone can help me.
If use 75MHz.
I want to know· that , if· I have a·interrupt timing by using the instruction :

mov· w,#-int_period
retiw

what's·the smallest ·int_period ? will it be -1 ?

In another words, whether could the interrupt interval· be ·1(-1)/75MHz=0.013us ?


thanks!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Comments

  • BeanBean Posts: 8,129
    edited 2006-07-27 11:18
    I think 12 (-12) is the lowest value you can use without locking-up the main code.
    And that's for just an empty interrupt routine, any code you put in the interrupt routine will mean the value will have to be greater.
    What do you have in mind that you need such a fast interrupt ? Maybe there is another way to do it.

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Cheap 4-digit LED display with driver IC·www.hc4led.com

    Low power SD Data Logger www.sddatalogger.com

    "The meaning of life, is to give life meaning" Unknown.


    Post Edited (Bean (Hitt Consulting)) : 7/27/2006 12:56:27 PM GMT
  • pjvpjv Posts: 1,903
    edited 2006-07-27 15:39
    Hi All;

    Actually the number is usually 6; 3 to get into the interrupt (although an interrupt during a READ instruction I understand can take an extra cycle, thus 4.... I need to test this), and 3 in the return from interrupt.

    This of course would do nothing useful, just bouncing into and out of interrupt, but anyhow it answers the question.

    Cheers,

    Peter (pjv)
  • Protoss2000Protoss2000 Posts: 2
    edited 2006-07-28 09:06
    thank u ,Bean & pjv .
    I just want implement the demodulation of FSK ,using interrupt to measure the width of one pulse. because of the high freqency of the carrier (484K), so I wanna know the interrupt interval.
  • BeanBean Posts: 8,129
    edited 2006-07-28 11:09
    Protoss2000,

    You should be able to use the RTCC counter instead of using a periodic interrupt.
    Setup the input pin to trigger an interrupt on the rising edge (assuming to want to measure the high time).
    In the interrupt routine clear RTCC then setup the pin to interrupt on the falling edge.
    When the interrupt routine is called this time, simply save RTCC into a variable.

    RTCC counts at the clock frequency.

    At 75MHz you may need some kind of heat sink for the SX chip. I'd recommend trying 50MHz first.

    Keep us aprised, it sounds like an interesting project...

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Cheap 4-digit LED display with driver IC·www.hc4led.com

    Low power SD Data Logger www.sddatalogger.com

    "The meaning of life, is to give life meaning" Unknown.
    ·
  • pjvpjv Posts: 1,903
    edited 2006-07-28 16:17
    Hi Protos2000;

    What you are trying to do maybe not so easily done as measuring the time width of one pulse. At 484 KHz, and assuming things are symmetrical, you have approximately (rough figures here) 1 uSec pulses. That means at 50 MHz you would have 50 counts per cycle, and at 75 MHz 75 counts. So a measurement granularity of 1 in 50 or 1 in 75, not counting any switching overheads.

    The minimum shift you could detect that way, and under good circumstances, is 484,000/75, or 6.5 KHz, and 484,000/50 or 9.5 KHz at 75 and 50 MHZ clocks respectively.

    So, depending on the amount of frequency shift, which in analog systems often is only a very small percentage of the carrier frequency, you may not be ablke to discern the frequency deviation with that method.

    There are other ways though, I'm sure. With some more details such as frequency shift and modulation rate, we may be able to direct you.

    Cheers,

    Peter (pjv)
Sign In or Register to comment.