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 support@ccsinfo.com

Quick PIC question RE Hz

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



Joined: 04 Aug 2006
Posts: 98

View user's profile Send private message

Quick PIC question RE Hz
PostPosted: Wed Sep 13, 2006 4:56 pm     Reply with quote

Hi

If I use a 20MHz crystal, the PIC runs at 5MHz or 5,000,000 Hz.... Also, most instructions run for one cycle, with some running for 2 or 3 cycles.

Then, say I have a loop that simply toggles an output pin on/off, and say, one iteration of the loop is approximately 10 cycles, would the output pulse of the pin equal 5MHz/10 = 500kHz?

thanks
Douglas Kennedy



Joined: 07 Sep 2003
Posts: 755
Location: Florida

View user's profile Send private message AIM Address

PostPosted: Wed Sep 13, 2006 5:56 pm     Reply with quote

Yes goto statements take up two cycles everything else one cycle so if 10 cycles is your total in your loop the pin will go high and low 5 mhz/10 or 500 khz.
theteaman



Joined: 04 Aug 2006
Posts: 98

View user's profile Send private message

PostPosted: Wed Sep 13, 2006 5:59 pm     Reply with quote

great, thanks!
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