View previous topic :: View next topic |
Author |
Message |
horizontech
Joined: 09 Nov 2003 Posts: 13
|
Best way to count PWM pulse |
Posted: Sun May 03, 2009 5:10 pm |
|
|
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
|
|
Posted: Sun May 03, 2009 11:56 pm |
|
|
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 |
Posted: Mon May 04, 2009 8:11 am |
|
|
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
|
|
Posted: Tue May 05, 2009 2:51 pm |
|
|
You didn't post the frequency of the PWM pulses. |
|
|
bungee-
Joined: 27 Jun 2007 Posts: 206
|
|
Posted: Tue May 05, 2009 4:33 pm |
|
|
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
|
|
Posted: Tue May 05, 2009 4:38 pm |
|
|
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
|
|
Posted: Tue May 05, 2009 5:14 pm |
|
|
We agree on that
there could not be less information from horizontech about topic. |
|
|
|