Exact match. Not showing close matches.
'[PIC]dsPIC PWM Duty Cycle'
I'm trying to get the PWM module on my dsPIC30F4011 working so that I can
drive a hobby servo (which takes a 1-2ms pulse), but am confused on how to
calculate the duty cycle.
Fosc = 10x10^6 (10MHz)
Fcy = 2.5x10^6 (2.5MHz)
Tcy = 4x10^-7 (400ns)
Fpwm = 55.555 (1/18ms)
PTPER = 44999
I assume I'm supposed to use the "Duty cycle for Free Running Mode" equation
15-4 in 70062E.pdf:
But I don't know how to use this equation, since I don't know what PDCx or
Any help would be appreciated, thanks!
Did my message with the same name as this one get "out"?
I ask because I just searched the piclist.com website with the exact title
of the message and I didn't see it as a result.
Just looking for some confirmation that it did get posted.
Yes, at 11:07 AM
Nathan House wrote:
> Did my message with the same name as this one get "out"?
> I ask because I just searched the piclist.com website with the exact title
> of the message and I didn't see it as a result.
> Just looking for some confirmation that it did get posted.
> Yes, at 11:07 AM
Or at 6:07am here.
ie time zone may affect your shown time.
I'm really confused by this. The family reference
I'm assuming that "DT" stands for dead time; and since I'm not using the
dead time generator, the equation becomes:
Is duty cycle in percent? To calculate the value for the "PDCx" register
(which controls the pin's duty cycle) for say, 100%, do I put the 100% where
the "Duty cycle for Free Running Mode" text is? Thus making the equation:
Inserting my PTPER value, and solving for PDCx?:
That can't be right!
I'm so confused...
Does anyone know how to calculate duty cycle for a dsPIC30F?
Nathan House wrote:
> Does anyone know how to calculate duty cycle for a dsPIC30F?
Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products
(978) 742-9014. Gold level PIC consultants since 2000.
VICENTE COLOMAR PRATS
Basicaly is the same as lower-rage micros:
* First you have to set the Period. That is the same as establishing the
frequency. To do that, you have to set post-scaler and pre-scaler, then
PTPER register. With those numbers your micro will count, and depending on
the micro frequency you will have a determined pwm frequency.
* To set duty cycle you have to write PDCx register (depending in wich of 3
generators you use). This value depends on previous PTPER, so, if you use
PDC1=PTPER you will have 100% PWM, if you use PDC1=PTPER/2 you will have 50%
PWM and so on...
That's very esquematic, you have some more registers wich need configuration
before to start pwm. Read chapter 15 on the 30F4011 datasheet.
Good look, I'm also starting with same micro.
OK. Someone could have pointed out that my problems came from a stupid,
simple little math error ;-)
I think it's working now.
More... (looser matching)
- Last day of these posts
- In 2009
, 2010 only
- New search...