Producing PWM with 15msec period
Posted: Thu Nov 07, 2013 1:17 pm
Hi
I use a P16F1939 with Fosc=4MHz (internal module). I do like to configure three CCP outputs of it (it offers up to 5) to produce 3 PWM (or pulse streams) with period=15msec and duty cycle=33% (or ON=5msec and OFF=10msec). Using the PWM component provided by FlowCode i can obtain a max period=4msec and given the Fosc of micro (Tosc=Fosc/4 and then PrescalerMAX = 1:16) it is logical. Ihave checked it with scope on actual hardware, simulator shows wrong things unless i am missing something.
Have you any idea (or program instruction?) of how i can increase the period of PWM to 15msec under the given Fosc of micro? And to set the PWM duty cycle at 33% (i.e. 5msec). I need this to realize a power saving circuit for common type relays instead to use latching relays.
It should be noted that i can't minimize the micro Fosc of 4MHz to e.g. 1MHz - which can provide PWM with period of up to 16msec - because i want to be compatible with the RC5 receiver component macro.
Thanks for any help
I use a P16F1939 with Fosc=4MHz (internal module). I do like to configure three CCP outputs of it (it offers up to 5) to produce 3 PWM (or pulse streams) with period=15msec and duty cycle=33% (or ON=5msec and OFF=10msec). Using the PWM component provided by FlowCode i can obtain a max period=4msec and given the Fosc of micro (Tosc=Fosc/4 and then PrescalerMAX = 1:16) it is logical. Ihave checked it with scope on actual hardware, simulator shows wrong things unless i am missing something.
Have you any idea (or program instruction?) of how i can increase the period of PWM to 15msec under the given Fosc of micro? And to set the PWM duty cycle at 33% (i.e. 5msec). I need this to realize a power saving circuit for common type relays instead to use latching relays.
It should be noted that i can't minimize the micro Fosc of 4MHz to e.g. 1MHz - which can provide PWM with period of up to 16msec - because i want to be compatible with the RC5 receiver component macro.
Thanks for any help