help with PWM circuit for PIC16f877A

Discussion in 'Embedded Systems and Microcontrollers' started by switmira, Jan 25, 2010.

  1. switmira

    Thread Starter New Member

    Jan 20, 2010
    1
    0
    hii...i am doing my final year project regarding boost converter..the PWM is produce using pic16f877A..i have to use picbasicpro languange..i need to produce frequency of 45kHz with 50% duty cycle..below is the coding ..really need help...

    TRISC.2 = 0 ' CCP1 (PortC.2 = Output)
    PR2 = 110 ' Set PWM Period for approximately 45KHz
    CCPR1L = 55 ' Set PWM Duty-Cycle to 50%
    CCP1CON = %00001100 ' Select PWM Mode
    T2CON = %00000100 ' Timer2 = ON + 1:1 prescale
     
Loading...