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

EX_PATG.c

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



Joined: 26 Jun 2011
Posts: 5

View user's profile Send private message

EX_PATG.c
PostPosted: Mon Nov 21, 2011 9:33 am     Reply with quote

Sorry if I continue to disturb but I just have a question: ex_patg.c example, in the CCS,
Code:


//NOTE:  periods MUST be multiples of 400
//Periods are in microseconds
#define  PERIOD_0 400
#define  PERIOD_1 800
#define  PERIOD_2 1600
#define  PERIOD_3 2000
#define  PERIOD_4 20000
#define  PERIOD_5 64000
#define  PERIOD_6 2000000

what is it?I mean what is meant by PERIOD?
ezflyr



Joined: 25 Oct 2010
Posts: 1019
Location: Tewksbury, MA

View user's profile Send private message

PostPosted: Mon Nov 21, 2011 11:34 am     Reply with quote

Hi,

Generally, in the context of electronics, "period" is used to express the total time for one cycle of a particular waveform. The EX_PATG.c program generate square waves. A square wave is comprised of some "on time" and some "off time". The total of the two is the period. Frequency of the wave form is the reciprocal of the period (ie. f = 1/period).

John
malu79



Joined: 26 Jun 2011
Posts: 5

View user's profile Send private message

PostPosted: Mon Nov 21, 2011 12:20 pm     Reply with quote

if I wanted to get a frequency of 1 Hz, what time should I consider?
Ttelmah



Joined: 11 Mar 2010
Posts: 19477

View user's profile Send private message

PostPosted: Mon Nov 21, 2011 3:34 pm     Reply with quote

Since the comment says 'periods are in microseconds'. 1000000. One million microseconds=1 second.

Best Wishes
malu79



Joined: 26 Jun 2011
Posts: 5

View user's profile Send private message

PostPosted: Wed Nov 23, 2011 1:45 am     Reply with quote

If I can not use the period 1000000 to obtain the frequency of 1 Hz, the problem is that I can not set a correct value for the timer, the frequency increasing also because it accumulates a delay that I can not delete.
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