3 channel PWM with customize duty cycle


Results 1 to 40 of 57

Threaded View

  1. #34


    Did you find this post helpful? Yes | No

    Default Re: 3 channel PWM with customize duty cycle

    hi,

    i compile the additional example of yours into my codes and it works ok but at the toggle part dint works well.

    attached is the simulation using the real pic simulation named result:
    as you can see i want it to be the pin rc3 should be high and pin rc0 should be low at 1 cycle but result show both of pin is high.
    i try to change the code a bit into: ( for phase 1 only)

    Code:
    ChangeBridgeDrive:
     
    ' When we come here the value i contains the phase counter that just got reset so we
    ' can use that to determine for which phase we should switch the outputs.
     
    Select Case i
        Case 0                          ' It was Phase 1 that rolled over
            High PORTC.3              ' Invert the state of the pin
            Low PORTC.0              ' Invert the state of the pin
     Toggle PORTC.3
     Toggle PORTC.0
    it end like attached file name result2.
    yes im also worried about the shoot thru in the beginning but then i realise time
    between each cycle to launch is about 1.8ms, so it should be enough time before it collide each others.

    please help advice the code.

    photoelectric
    please help advice.
    Attached Images Attached Images   

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts