View previous topic :: View next topic |
Author |
Message |
kender
Joined: 09 Aug 2004 Posts: 768 Location: Silicon Valley
|
setup_timer_2() for PWM |
Posted: Thu Jun 02, 2005 1:32 pm |
|
|
Colleagues,
My clock is 4MHz. I want to get the highest frequency out of my CCP pin. Will I get 4MHz if I do this:
Code: | setup_timer_2(T2_DIV_BY_1, 0x00, 0); |
?
Thanks,
Nick |
|
|
Neutone
Joined: 08 Sep 2003 Posts: 839 Location: Houston
|
|
Posted: Thu Jun 02, 2005 2:34 pm |
|
|
The best speed you will get is 1Mhz
setup_timer_2(T2_DIV_BY_1,0,1);
it wil count 0,0,0,0 and may give a 50% duty cycle if the PWM is set to 2 |
|
|
|