Multiple pins for ECCP

Discussion in 'Embedded Systems and Microcontrollers' started by Damasta, May 20, 2008.

  1. Damasta

    Thread Starter New Member

    May 20, 2008
    1
    0
    Hi All,

    Im new at using the Pic's, i have this 16F685
    http://ww1.microchip.com/downloads/en/DeviceDoc/41262E.pdf

    and i understand that it has four channels for ECCP, but i am interested in using three of them for HPWM.. but i am having a hard time understanding how to set up the registers..

    I also know that

    "Hpwm PORTC.2, duty, frequency " gave me an error becuase the PORTC.2 part is incorrect.. the channels on the datasheet are P1A, P1B, P1C, and P1D.. i understand that a number in place of Portc.2 will not give the error.. but would one correspond to A. and 4 to D?

    I also found these defines in sample code
    "
    DEFINE CCP1_REG PORTC 'Hpwm 1 pin port
    DEFINE CCP1_BIT 2 'Hpwm 1 pin bit
    DEFINE CCP2_REG PORTC 'Hpwm 2 pin port
    DEFINE CCP2_BIT 1 'Hpwm 2 pin bit

    "

    However my pic only has CCP1, which confuses me..

    can anyone give me any adive or a link where these defines are explained?

    Thanks..

    .Victor
     
Loading...