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

help to set PCD Timer 1 as external counter

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



Joined: 13 Jun 2012
Posts: 4

View user's profile Send private message

help to set PCD Timer 1 as external counter
PostPosted: Wed Sep 12, 2012 9:34 am     Reply with quote

Hi,

I have a problem to set dspic 30f4013 timer1 or 2 to capture a square wave of 30KHz on every rising or falling edge. I cannot get a clear guidance in the CCS manual for PCD compiler. My set up code is:
Code:

//TIMER1 16 bits as counter /UP- ext input  T1CKI RC14
SETUP_TIMER1(TMR_EXTERNAL, TMR_DIV_BY_1, 0xFFFF); 
enable_interrupts(int_timer1);
enable_interrupts(intr_global);

How do I include interrupt on every rising or falling edge as in PIC18F and PIC16F?

Much appreciation for your help.
bkamen



Joined: 07 Jan 2004
Posts: 1615
Location: Central Illinois, USA

View user's profile Send private message

PostPosted: Thu Sep 13, 2012 11:05 pm     Reply with quote

Look at the Compare/Capture/PWM module in the PIC18's if you're trying to get time information on a signal. (as a start)

Then look up Timer1 (if that 30Khz is supposed to be a clock of sorts)

Then look up INT0 (in I/O Ports) if you're using the signal to pace some sort of other event.

Your post is kind of vague to give you a more exact "go read this" answer.


-Ben
_________________
Dazed and confused? I don't think so. Just "plain lost" will do. :D
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