# How to disable ECAN on PIC18F45K80 ?

Status
Not open for further replies.

#### chrischris

##### Member
Hi, I am trying UART communication on PIC18F45K80 but the pins are multiplexed with CAN bus, I need to disable CAN but, there is no straightforward ENABLE/DISABLE bit. PIC32s have very easy enable/disable option. Any ideas on how to do that with this PIC ?

I have tried this on Proteus but doesn't work !

CIOCONbits.CANCAP = 0;
CANSTATbits.OPMODE = 0b001;

EDIT:
Also there is CANMX bit which can either be set to PORTB or PORTC, but there is no option to not to use it at all !

Thanks,
Chris

Last edited:

#### NorthGuy

##### Well-Known Member
C:
CANCONbits.REQOP = 4; // should be that way after reset already, also may try "1"
PMD2bits.ECANMD = 1; // removes power from the CAN module (won't release pins though)

#### chrischris

##### Member
Thanks, NorthGuy, though this worked for me

CANCONbits.ABAT =1;

CANCONbits.REQOP = 0b001;

Status
Not open for further replies.