program for pic18f4550

Discussion in 'Embedded Systems and Microcontrollers' started by sreeraj17, Mar 28, 2007.

  1. sreeraj17

    Thread Starter New Member

    Feb 8, 2007
    5
    0
    hi,
    we are writing a C code for pic18f4550 for doing adc conversion and pwm. the adc output is stored in a register. we have to copy 2 bits(LSB) from this 8-bit ADRESH register to the pwm register CCP1CON. plz give the c code statement to do this!!

    we wrote the following statements but its not working..

    CCPR1L=ADRESL;
    CCP1CONbits.DC1B1 =ADRESH;
    CCP1CONbits.DC1B0 =ADRESH;

    plz help.......
     
  2. Dave

    Retired Moderator

    Nov 17, 2003
    6,960
    145
    Please read and try again. We are willing to help but you must do the work.

    Dave
     
Loading...