PIC18F4550 PORTC help

Thread Starter

Nayorth

Joined Mar 31, 2009
2
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?



Code

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

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

Thread Starter

Nayorth

Joined Mar 31, 2009
2
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?
 
Top