PIC18F4550 PORTC help

Discussion in 'Embedded Systems and Microcontrollers' started by Nayorth, Nov 17, 2009.

  1. Nayorth

    Thread Starter New Member

    Mar 31, 2009
    Hello all,
    I have been looking on the forum for a bit and thought I might try asking my question here. I am working on a project for school and am trying to figure out how to implement 2 bits on PORTC on the PIC18F4550. To be specific it's C4 and C5 which are automatically taken by the USB option, but I have to use them as just output pins (to drive a motor controller) I have a bit of code at the bottom that's from the datasheet I just need to know how to implement it if anyone has prior experience with the PIC18?


    " UCON<3> = 0;
    UCFG<3> = 1;

    PS. when I just plug this code in all I get is a syntax error.
  2. thatoneguy

    AAC Fanatic!

    Feb 19, 2009
    What compiler/development environment are you using?

    The code doesn't look like C
  3. Nayorth

    Thread Starter New Member

    Mar 31, 2009
    I know how to set TRISC and such. But when turning ADCON1 does that disable the analog to digital converter at all because I need that to be enabled for a distance sensor to drive said motor controller? also the problem might be that I'm using the prior code which could be assembly and not C so that might solve my problem in the first place. But as an added question does PORTCbits.CEx (x being the bit) work for PIC18 using the PIC18F4550 header?
  4. eddy2031

    New Member

    Nov 18, 2009