HPWM on second half


Closed Thread
Results 1 to 23 of 23

Hybrid View

  1. #1
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default hum

    Rmteo..
    you mentionned earlier

    "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."

    I understand what a half bridge is, but I am bit confused about configuring the pic in half bridge mode.. what do you mean by that?

    So far I added an inverter at my HPWM output, I would still like to get two ports, I ordered chips which includes the eccp mode.

    K

  2. #2
    Join Date
    May 2007
    Posts
    604


    Did you find this post helpful? Yes | No

    Default

    From the PIC16F690 datasheet:

    REGISTER 11-1: CCP1CON: ENHANCED CCP1 CONTROL REGISTER
    bit 7-6 P1M<1:0>: PWM Output Configuration bits
    If CCP1M<3:2> = 00, 01, 10:
    xx = P1A assigned as Capture/Compare input; P1B, P1C, P1D assigned as port pins
    If CCP1M<3:2> = 11:
    00 = Single output; P1A modulated; P1B, P1C, P1D assigned as port pins
    01 = Full-Bridge output forward; P1D modulated; P1A active; P1B, P1C inactive
    10 = Half-Bridge output; P1A, P1B modulated with dead-band control; P1C, P1D assigned as port pins
    11 = Full-Bridge output reverse; P1B modulated; P1C active; P1A, P1D inactive

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


    Did you find this post helpful? Yes | No

    Default

    Here's an example for the 12F615.
    Code:
    @ DEVICE PIC12F615, MCLR_OFF, IOSCFS_4MHZ, INTRC_OSC_NOCLKOUT, WDT_OFF, BOD_OFF, PROTECT_OFF
        
    DEFINE OSC 4
    duty VAR WORD
    
    ANSEL   = 0	            ' 12F615 Set all pins to digital
    CMCON0 = 0
    OPTION_REG = 0          ' Disable internal pullups
    WPU = 0                 ' 12F615 Individual pull-ups disabled
    VRCON   = 0             ' Internal Vref disabled
    
        TRISIO = %00111010  ' GPIO.0 = P1B, GPIO.2=P1A outputs
        PR2 = 82            ' Set PWM for approximately 12kHz
        CCP1CON = %10001100 ' PWM mode; P1A active-high; P1B active-high
        T2CON = %00000100   ' %00000110 = TMR2 ON 1:16 prescale
        PWM1CON = %10000001 ' min dead-band time
        
        Duty = 166          ' Roughly 50% duty cycle
        CCP1CON.4 = duty.0
        CCP1CON.5 = duty.1
        CCPR1L = DUTY >> 2
                                    
    MAIN:
        GOTO  MAIN
        
        End
    This has a 1uS dead-band with roughly 12kHz PWM, and each output is the compliment of
    the other.
    Attached Images Attached Images  
    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, 13:41
  2. 18F4620 HPWM Half Bridge Mod problem
    By showtime in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 2nd November 2007, 12: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, 11:18
  4. sound command & music
    By trying in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 26th May 2006, 14:14
  5. 3 HPWM channels
    By docwisdom in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 4th April 2006, 02: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