Re: [Flashforth-devel] Interrupts - frequency of servicing
Brought to you by:
oh2aun
From: Mikael N. <mik...@fl...> - 2019-12-11 06:48:20
|
Tristan, The best solution is to let the rising edge triggered interrupt switch to falling edge mode, and to start a timer counting clock cycles. Then in the falling edge interrupt routine you can just stop the counter and read out the value from the timer to get the pulse width. Then zero the counter and switch to rising edge mode. Mikael On 2019-12-11 08:26, Tristan Williams wrote: > Hello, > > I would like to measure the width of some pulses using FlashForth on a > PIC18F14K50. My first thought was to do this using the capture mode of > the ECCP unit - setting it to look for a rising edge then switch to > look for a falling edge in an interrupt routine. I have a working > interrupt routine which is seems to be serviced every millisecond > (driven from the 1ms timer1/ticks in my p18-main.cfg?). However, the > pulses I wish to measure are only a few hundred microseconds in length. > > Is there a way to increase the frequency of servicing of my interrupt > routine or another way to approach this? > > Kind regards and thanks, > Tristan > > > _______________________________________________ > Flashforth-devel mailing list > Fla...@li... > https://lists.sourceforge.net/lists/listinfo/flashforth-devel -- -- Mikael |