Programmatically generate a (false) interrupt?


Closed Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2008
    Location
    Los Angeles, CA
    Posts
    156

    Default Programmatically generate a (false) interrupt?

    I've been around long enough to know a dumb question when I see it, and I'm pretty sure this is one.... but here goes.

    I've got a some hardware connected to a PIC board that can generate an interrupt (DT_INT0) if different hardware alarm conditions exist. When the board is first powered up, however, no alarm conditions are reported until the first (real) interrupt happens, because nothing has actually generated an interrupt since power up. So... I need to programmatically generate an INT0 on power-up to report any alarm conditions that already exist.

    How do you do that? I tried a GOSUB to the INT0 handler, and it didn't error, but also didn't work.

  2. #2
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,521


    Did you find this post helpful? Yes | No

    Default

    Hi,
    What "type" of interrupt are you using? ON INTERRUPT, DT-INTS or "true" ASM interrupts?

    By the sound of it you're using DT-INTS in which case my guess is that you can't GOSUB to the handler because the handler doesn't end with a corresponding RETURN (the @ INT_RETURN is not the same thing as a "normal" RETURN) which makes the PIC go off to la-la land.

    Have you tried, after enabling the interrupts, to simply write to the corresponding interrupt flag bit? I've never tried it my self but I can't se why that wouldn't trip the interrupt. For INT0, simply try INTCON.1 = 1

    /Henrik.

  3. #3
    Join Date
    Dec 2008
    Location
    Los Angeles, CA
    Posts
    156


    Did you find this post helpful? Yes | No

    Talking

    That works perfectly! Thank you.

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts