View previous topic :: View next topic |
Author |
Message |
andresteff
Joined: 21 Mar 2020 Posts: 44
|
Constant pulse with pic18f1220 |
Posted: Wed Jul 19, 2023 8:17 am |
|
|
I want to read in a pulse of variable width with a Pic18F1220, and output it to a 50us pulse. Can I do this with capture or compare? |
|
 |
dyeatman
Joined: 06 Sep 2003 Posts: 1948 Location: Norman, OK
|
|
 |
Ttelmah
Joined: 11 Mar 2010 Posts: 19732
|
|
Posted: Thu Jul 20, 2023 12:34 am |
|
|
I think what you want is to simply have a 50uSec pulse triggered by probably
the rising edge of the 'variable' pulse.
Look in the CCP data sheet at 'special event trigger' mode. What you do
is have one CCP set to this mode that resets a timer. Then have a second
CCP to generate a fixed width pulse from this timer.
When the timer resets, the second CCP generates the pulse. |
|
 |
|