Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How long does uC pin need to change state for to allow interrupt to be called?

Status
Not open for further replies.
T

treez

Guest
I am using the PIC24FJ64GA004 with a 32.768KHz external oscillator.

I want to have an interrupt..... the pin will go from high to low for just 3us...then back to high again.....and i am hoping that the pic will "see" this 3us low pulse and go to interrupt routine.

Is this possible?.....if not, then how long would the low pulse have to last to make it possible?


PIC24FJ64GA004 DATASHEET:
**broken link removed**
 

I am using the PIC24FJ64GA004 with a 32.768KHz external oscillator.

I want to have an interrupt..... the pin will go from high to low for just 3us...then back to high again.....and i am hoping that the pic will "see" this 3us low pulse and go to interrupt routine.

Is this possible?.....if not, then how long would the low pulse have to last to make it possible?

The answers to your questions are largely dependent on whether you are referring to an External Interrupt or an Interrupt-On-Change.

The information is provided in TABLE 27-17: CLKO AND I/O TIMING REQUIREMENTS:



An External Interrupt requires a minimum time of 20ns, while an Interrupt-On-Change requires a time of two instruction cycles (2 Tcy).


Why is the device being clocked at such a low rate of 32.768KHz?

Are you aware the PIC24F series support both a primary and secondary oscillator?

BigDog
 
  • Like
Reactions: treez

    T

    Points: 2
    Helpful Answer Positive Rating
I am using the PIC24FJ64GA004 with a 32.768KHz external oscillator.

I want to have an interrupt..... the pin will go from high to low for just 3us...then back to high again.....and i am hoping that the pic will "see" this 3us low pulse and go to interrupt routine.

Is this possible?.....if not, then how long would the low pulse have to last to make it possible?

Is the 32.768kHz the primary oscillator running the PIC or is it the secondary oscillator you are using for the RTCC module?
 
  • Like
Reactions: treez

    T

    Points: 2
    Helpful Answer Positive Rating
Thanks, ..yes i am using the 32.768KHz external oscillator as the main and only oscillator., and also for the RTCC.

To simplifiy things i am just using the one oscillator.....32.768KHz

I choose this low frequency oscillator partly because it is used with the RTCC, and partly because a low frequency oscillator means less power consumption.

The application is an emergency lighting unit.

With a 32.768KHz ocscillator, i take it that 2Tcy = 244us............thats a long time, so i take it that i'll have to use the interrupt in change feature?
 

You can't use the interrupt on change, as minimum timing requirement is 2TCY, which in your case is 244us. 244us is much greater than 3us, so you can't use that. Use external interrupt where the minimum timing requirement is 20ns.

Hope this helps.
Tahmid.
 
  • Like
Reactions: treez

    T

    Points: 2
    Helpful Answer Positive Rating
Thanks, do you know which pins of the PIC24FJ64GA004 can be used for interrupts ("External interrupts")?

One method is by examining the pinout of your particular package, for example the SPDIP:



External Interrupt pins are marked by the INTx nomenclature (INT0, INT1, INT2, ...), while Interrupt-On-Change pins are marked by the CNx nomenclature (CN1, CN2, CN3, ...).

Not all packages offer the same number of interrupt pins, typically the higher pin count packages offer more.

Another method is by examining TABLE 1-2: PIC24FJ64GA004 FAMILY PINOUT DESCRIPTIONS starting on page 13.



Search for the specific nomenclature, INTx or CNx, depending on whether you need an External Interrupt or Interrupt-On-Change under the Function column.

You can then determine whether or not the specific package offers a specific pins by cross referencing under the Pin Number/Package Type Column.

The description column will normally state a more verbose description of the particular category of pin function.

Example, CNx, Interrupt-On-Change, SPDIP Package:



Although, after reading several of your threads, I might recommend using a higher frequency clock combined with the utilization of various sleep and idle modes provided by the device.

Doing so may provide better performance, minimizing device power consumption while providing the opportunity to utilize an External Interrupt versus the Interrupt-On-Change.

Two of External Interrupts, INT1 and INT2, offer the added flexibility of being remappable to one of several available RPn pins, in effect the External Interrupt can be routed to an unused RPn pin.


BigDog
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top