HPWM on second half


Closed Thread
Results 1 to 23 of 23

Hybrid View

  1. #1
    Join Date
    May 2007
    Posts
    604


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by peterdeco1 View Post
    Hi Lerameur. Good news. As I’m writing this, I’m looking at my scope. Portb.7 is exactly 180 degrees out of phase with HPWM 1, which is portb.2 on a 16F819.

    START:
    HPwm 1,127,100 'OUTPUT 100HZ SQUARE WAVE ON PORTB.2

    SPLITPHASE:
    IF PORTB.2 = 1 THEN LOW PORTB.7 'IF RB2 IS HIGH MAKE RB7 LOW
    IF PORTB.2 = 0 THEN HIGH PORTB.7 'IF RB2 IS LOW MAKE RB7 HIGH
    GOTO SPLITPHASE
    2 issues with this method. First, while the signals may appear to be 180 degrees out-of-phase , this appears to be true only at very low frequencies. Try this at a higher frequency - say 10kHZ up and you will see that the complementary phase will be more than 180 degrees out (due to the processing time of the "splitphase" loop). The higher the frequency, the more pronounced this effect will be.
    Second, while the code is running, the processor cannot be doing anything else.

    A better solution would be to use a PIC with an ECCP (Enhanced Compare Capture) module. Many of the newer PIC's have this feature. Set it up to operate in Half-Bridge mode and you will get a PWM signal on the P1A pin and a complementary signal on P1B. Plus you can control the programmable dead-band delay which is used to prevent shoot-through current in half-bridge devices.

  2. #2


    Did you find this post helpful? Yes | No

    Default

    Great suggestion. Quite honestly, I never asked lerameur what his intended frequency was.

  3. #3
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default

    sounds good enough for me, thank you

    any way to do a search on microchip website for all chips containing ECCP ?


    K

  4. #4
    Join Date
    May 2007
    Posts
    604


    Did you find this post helpful? Yes | No

    Default

    Does not appear that microchip lists the devices that have ECCP. What size PIC's are you interested in?

    The smallest PIC that I am aware of that has at least one ECCP is the 14-pin PIC16F616. As I mentioned earlier, many of the 16F and 18F PIC's have one or more ECCP's.

    BTW, I just tested a PIC18F4620 ECCP PWM at 250kHZ (4uS period) in half-bridge mode. The signals on the scope are EXACTLY 180 degrees out-of-phase with each other. Clock was 32MHz - 8MHz FOsc.

  5. #5
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    The 8-pin 12F615 has ECCP with 2 PWM outputs & deadband.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  6. #6
    Join Date
    May 2007
    Posts
    604


    Did you find this post helpful? Yes | No

    Default

    Thanks, Bruce. I have not used the PIC12 (only use PIC18, PIC24 and dsPIC33) so am not familiar with it.

  7. #7
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    If your compiler supports the 615, it's worth looking at. My 1st go-round with this one was
    a batch of serial motor control ICs for a customer. Very cool little controllers. We use them
    for our 8-pin encoder/decoder ICs now. They're nicely priced even in small qty.

    PIC24 are also nice, but I'm not really fond of the Mchip 16-bit C compiler. dsPIC I've never
    had a need for. I can do pretty much everything we're asked for with a 14-bit core & PBP
    or C.

    What I really like about PBP is the open library. If you're into the heavy end, you may want
    to look at PBP. It's worth the price of the compiler just for the library.

    Back in the old days when I used the 8051 core, I would have paid ten times the cost of
    PBP for a similar 51 core library.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

Similar Threads

  1. Bit Angle Modulation (BAM) in a PIC
    By Bronx68 in forum mel PIC BASIC Pro
    Replies: 150
    Last Post: - 24th February 2015, 14:41
  2. 18F4620 HPWM Half Bridge Mod problem
    By showtime in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 2nd November 2007, 13:55
  3. Using HPWM in half bridge mode on 16f690
    By Chris Barron in forum mel PIC BASIC
    Replies: 0
    Last Post: - 29th December 2006, 12:18
  4. sound command & music
    By trying in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 26th May 2006, 15:14
  5. 3 HPWM channels
    By docwisdom in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 4th April 2006, 03:43

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