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

Best way to count PWM pulse

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



Joined: 09 Nov 2003
Posts: 13

View user's profile Send private message Send e-mail

Best way to count PWM pulse
PostPosted: Sun May 03, 2009 5:10 pm     Reply with quote

HI

I need to count 4096 pulse PWM from PIC.

I am looking for the best way to use same PIC to generate PWM and count 4096 pulses from the same PIC ?

Can I use setup_timer as counter to input PWM pin ?

Thanks for your help

Alain Tanguay
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sun May 03, 2009 11:56 pm     Reply with quote

Why do you want to count the pulses ? Do you want to stop sending
the pulses after 4096 have been sent ?

What is the frequency of the PWM signal ?
Horizontech1
Guest







Pwm conting
PostPosted: Mon May 04, 2009 8:11 am     Reply with quote

hi !

I need to control Led driver TLC5940 , And after 4096 PWM pulse on this IC , i need to toogle the blank Pin on the TLC5940


Thanks


Alain Tanguay
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue May 05, 2009 2:51 pm     Reply with quote

You didn't post the frequency of the PWM pulses.
bungee-



Joined: 27 Jun 2007
Posts: 206

View user's profile Send private message

PostPosted: Tue May 05, 2009 4:33 pm     Reply with quote

First of all TLC5940 does not require PWM signal, but clock signal and on every 4096 cycle there has to be SYNC signal. And this clock can be up to 30MHz.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue May 05, 2009 4:38 pm     Reply with quote

I know that. But I assume that he wants to use the CCP, either in
PWM or Compare mode, to generate the GSCLK pulses. But how
it's done, or whether it can be done at all, depends upon the desired
frequency of the pulses.
bungee-



Joined: 27 Jun 2007
Posts: 206

View user's profile Send private message

PostPosted: Tue May 05, 2009 5:14 pm     Reply with quote

We agree on that Wink

there could not be less information from horizontech about topic. Razz
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