Re: PIC processor interrupt for delayed output



On Apr 22, 3:15 am, Bill Bowden <wrongaddr...@xxxxxxx> wrote:
What is the best approach to generate a delayed output from a trigger
input to a PIC microcontroller? The idea is to have a constant known
time from trigger input to output, so I don't want to poll the logic
level on some pin due to the jitter that would occur. Thought about
using the comparator module to generate an interrupt, but it seems
complicated setting and clearing all the various bits and reference
levels.

Is there an easier way?

You don't say what else you want the PIC to be doing while it's
monitoring the pin.

If you can run it in a tight loop I think you can test 8 input pins
(on one port) for a change in four cycles (16 clocks). If you unravel
the loop you can get that down to an average approaching 3 cycles at
the expense of code size.

You also don't say if you're then going to wait in another loop or
whether you'll set up a timer to trigger an interrupt when the output
needs to change state. Finally you don't say how long the delay needs
to be. Unless you can afford your interrupt routine to trash the W and
status register or you can guarantee that the interrupt will never
trigger when anything other than a known bank is selected then there
is quite a lot of overhead you'll need in the interrupt routine that
will limit your minimum delay.

Tim.
.



Relevant Pages

  • Re: kernel panic with pccard insert on recent 7.0 CURRENT
    ... We know if an interrupt source is edge or level ... It falls back to a level trigger emulation if it can't. ... Run A's handler, it claims the interrupt, so schedule A's ithread if ...
    (freebsd-current)
  • Re: [KVM PATCH v4 2/2] kvm: add support for irqfd via eventfd-notification interface
    ... The non-default mode is to trigger a ... I would really like to keep using eventfd. ... But we'd still need to know when to lower the interrupt. ... IIUC, isn't that usually device/subsystem specific, and out of scope of ...
    (Linux-Kernel)
  • Re: TL16C550CIFN
    ... verify this UART's DMA function,but the /RXRDY goes true when there is ... IIRC most cacheing UARTs will allow you to adjust the trigger point ... Thus once an interrupt occurs the service can ... or more characters in the FIFO and more than three character ...
    (comp.arch.embedded)
  • Re: Lenovo 3000 N100 i8042 problems
    ... hardware that only applies to legacy mode, ... internally we the kernel still deals with 2 interrupt ... Does it take long to trigger the bug? ... This has me typing some unimportant stuff, and then it sticks, ...
    (Linux-Kernel)
  • Re: 2.6.19-rc5: known regressions :SMP kernel can not generate ISA irq
    ... ISA irq's is that they have different trigger types (they also have ... so you simply lost the interrupt). ... So when you "mask" an edge-triggered IRQ, you can't really mask it at all, ... trigger into a level trigger at the same time. ...
    (Linux-Kernel)

Loading