• AVR Freaks

Hot!How to shifted phases in PIC18f4431

New Member
  • Total Posts : 4
  • Reward points : 0
  • Joined: 2020/05/03 22:58:02
  • Location: 0
  • Status: offline
2020/05/31 02:26:53 (permalink)

How to shifted phases in PIC18f4431

I am trying to design a driver for a BLDC motor.
I have managed to generate 6 PWM signals with the PIC18F4431.
How I can shifted the phases?
I attach my code and the image of the PWM signals.
void pwm_inicialitze(void)






void main(void)

I want is to try to get such a shifted similar to the one in image 2.

Attached Image(s)


2 Replies Related Threads

    Super Member
    • Total Posts : 5776
    • Reward points : 0
    • Status: offline
    Re: How to shifted phases in PIC18f4431 2020/05/31 06:42:27 (permalink)
    +2 (2)
    PIC18F4431 is a quite old and expensive device...
    If you use more recent devices like dsPIC33EPxxxx family, you'll find lots of application notes and code examples for driving motors and you will also be able to use MCC graphical code generator. 
    dsPIC family has much more sophisticated PWM with more features.
    Super Member
    • Total Posts : 1154
    • Reward points : 0
    • Joined: 2012/11/17 06:27:45
    • Location: Grappaland
    • Status: offline
    Re: How to shifted phases in PIC18f4431 2020/05/31 11:55:00 (permalink)
    +2 (2)
    moving to dsPIC will not improve a thing if you don't know what to do.
    MCC will not help if you don't know what to do with it.
    I don't understand why almost all of your replies are about moving to a newer part and using MCC when it will not solve the issue.
    To the OP, the idea is that you enable/disable the PWM generators in sequence.
    I assume that you are familliar with the six step commutation method?
    Using PWM to regulate the speed means that you still follow the six step commutation, but you enable/disable PWM channels instead of setting pins high and low.
    Jump to:
    © 2020 APG vNext Commercial Version 4.5