CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Constant pulse with pic18f1220

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
andresteff



Joined: 21 Mar 2020
Posts: 44

View user's profile Send private message

Constant pulse with pic18f1220
PostPosted: Wed Jul 19, 2023 8:17 am     Reply with quote

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: 1934
Location: Norman, OK

View user's profile Send private message

PostPosted: Wed Jul 19, 2023 10:15 am     Reply with quote

Using Search I found one good place to start:
http://www.ccsinfo.com/forum/viewtopic.php?t=60024&highlight=pulse+width
It has a couple of good references also.
_________________
Google and Forum Search are some of your best tools!!!!
Ttelmah



Joined: 11 Mar 2010
Posts: 19539

View user's profile Send private message

PostPosted: Thu Jul 20, 2023 12:34 am     Reply with quote

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.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group