I am having some issues when I am trying to switch the pins on the GPIO pins being used for CAN on the DSP. When the program boots up it we default for Can A to be pins 18/19. But when I give it the command to switch pins for Ecan it does not work. I want to know if I am missing something in the process of switching the GPIO pins. Any help would be greatly appreciated. Let me know If you need to see more of the code but below is the section I use to select the GPIO pins.
CanAValue can be 0 or 1.
void InitECanaGpio(Uint16 CanAValue){ EALLOW;switch (CanAValue){ case 0: //default setting /* Enable internal pull-up for the selected CAN pins */ // Pull-ups can be enabled or disabled by the user. // This will enable the pullups for the specified pins. // Comment out other unwanted lines. GpioCtrlRegs.GPAPUD.bit.GPIO18 = 0; // Enable pull-up for GPIO18 (CANRXA) GpioCtrlRegs.GPAPUD.bit.GPIO19 = 0; // Enable pull-up for GPIO19 (CANTXA) /* Set qualification for selected CAN pins to asynch only */ // Inputs are synchronized to SYSCLKOUT by default. // This will select asynch (no qualification) for the selected pins. GpioCtrlRegs.GPAQSEL2.bit.GPIO18 = 3; // Asynch qual for GPIO18 (CANRXA) /* Configure eCAN-A pins using GPIO regs*/ // This specifies which of the possible GPIO pins will be eCAN functional pins. GpioCtrlRegs.GPAMUX2.bit.GPIO18 = 3; // Configure GPIO18 for CANRXA operation GpioCtrlRegs.GPAMUX2.bit.GPIO19 = 3; // Configure GPIO19 for CANTXA operation GpioCtrlRegs.GPADIR.bit.GPIO19 = 1; //Configure CANTXA as output break; case 1: /* Enable internal pull-up for the selected CAN pins */ // Pull-ups can be enabled or disabled by the user. // This will enable the pullups for the specified pins. // Comment out other unwanted lines. GpioCtrlRegs.GPAPUD.bit.GPIO30 = 0; // Enable pull-up for GPIO30 (CANRXA) GpioCtrlRegs.GPAPUD.bit.GPIO31 = 0; // Enable pull-up for GPIO31 (CANTXA) /* Set qualification for selected CAN pins to asynch only */ // Inputs are synchronized to SYSCLKOUT by default. // This will select asynch (no qualification) for the selected pins. GpioCtrlRegs.GPAQSEL2.bit.GPIO30 = 3; // Asynch qual for GPIO30 (CANRXA) /* Configure eCAN-A pins using GPIO regs*/ // This specifies which of the possible GPIO pins will be eCAN functional pins. GpioCtrlRegs.GPAMUX2.bit.GPIO30 = 1; // Configure GPIO30 for CANRXA operation GpioCtrlRegs.GPAMUX2.bit.GPIO31 = 1; // Configure GPIO31 for CANTXA operation GpioCtrlRegs.GPADIR.bit.GPIO31 = 1; //Configure CANTXA as output break;} EDIS;}
David,
My guess would be that after you have setup the eCAN to work with one set of pins, you do not turn off those pins before switching to the other set. I would recommend before changing the gpio mux to point to the eCAN, change the pins back to normal GPIOs.
Let me know if that fixes it.
Regards,
Trey
Trey German
C2000 Applications
How should I go about doing that?
Replace this:
case 0: //default setting /* Enable internal pull-up for the selected CAN pins */ // Pull-ups can be enabled or disabled by the user. // This will enable the pullups for the specified pins. // Comment out other unwanted lines. GpioCtrlRegs.GPAPUD.bit.GPIO18 = 0; // Enable pull-up for GPIO18 (CANRXA) GpioCtrlRegs.GPAPUD.bit.GPIO19 = 0; // Enable pull-up for GPIO19 (CANTXA) /* Set qualification for selected CAN pins to asynch only */ // Inputs are synchronized to SYSCLKOUT by default. // This will select asynch (no qualification) for the selected pins. GpioCtrlRegs.GPAQSEL2.bit.GPIO18 = 3; // Asynch qual for GPIO18 (CANRXA) /* Configure eCAN-A pins using GPIO regs*/ // This specifies which of the possible GPIO pins will be eCAN functional pins. GpioCtrlRegs.GPAMUX2.bit.GPIO18 = 3; // Configure GPIO18 for CANRXA operation GpioCtrlRegs.GPAMUX2.bit.GPIO19 = 3; // Configure GPIO19 for CANTXA operation GpioCtrlRegs.GPADIR.bit.GPIO19 = 1; //Configure CANTXA as output break; case 1: /* Enable internal pull-up for the selected CAN pins */ // Pull-ups can be enabled or disabled by the user. // This will enable the pullups for the specified pins. // Comment out other unwanted lines. GpioCtrlRegs.GPAPUD.bit.GPIO30 = 0; // Enable pull-up for GPIO30 (CANRXA) GpioCtrlRegs.GPAPUD.bit.GPIO31 = 0; // Enable pull-up for GPIO31 (CANTXA) /* Set qualification for selected CAN pins to asynch only */ // Inputs are synchronized to SYSCLKOUT by default. // This will select asynch (no qualification) for the selected pins. GpioCtrlRegs.GPAQSEL2.bit.GPIO30 = 3; // Asynch qual for GPIO30 (CANRXA) /* Configure eCAN-A pins using GPIO regs*/ // This specifies which of the possible GPIO pins will be eCAN functional pins. GpioCtrlRegs.GPAMUX2.bit.GPIO30 = 1; // Configure GPIO30 for CANRXA operation GpioCtrlRegs.GPAMUX2.bit.GPIO31 = 1; // Configure GPIO31 for CANTXA operation GpioCtrlRegs.GPADIR.bit.GPIO31 = 1; //Configure CANTXA as output break;With this:
case 0: //default setting /* Enable internal pull-up for the selected CAN pins */ // Pull-ups can be enabled or disabled by the user. // This will enable the pullups for the specified pins. // Comment out other unwanted lines. GpioCtrlRegs.GPAPUD.bit.GPIO18 = 0; // Enable pull-up for GPIO18 (CANRXA) GpioCtrlRegs.GPAPUD.bit.GPIO19 = 0; // Enable pull-up for GPIO19 (CANTXA) /* Set qualification for selected CAN pins to asynch only */ // Inputs are synchronized to SYSCLKOUT by default. // This will select asynch (no qualification) for the selected pins. GpioCtrlRegs.GPAQSEL2.bit.GPIO18 = 3; // Asynch qual for GPIO18 (CANRXA) /* Configure eCAN-A pins using GPIO regs*/ // This specifies which of the possible GPIO pins will be eCAN functional pins. // Turn off other CAN pins
GpioCtrlRegs.GPAMUX2.bit.GPIO30 = 0; // Configure GPIO30 for GPIO operation GpioCtrlRegs.GPAMUX2.bit.GPIO31 = 0; // Configure GPIO31 for GPIOoperation
GpioCtrlRegs.GPAMUX2.bit.GPIO18 = 3; // Configure GPIO18 for CANRXA operation GpioCtrlRegs.GPAMUX2.bit.GPIO19 = 3; // Configure GPIO19 for CANTXA operation //GpioCtrlRegs.GPADIR.bit.GPIO19 = 1; //Configure CANTXA as output // Setting the direction of pins under peripheral control is un-neccessary break; case 1: /* Enable internal pull-up for the selected CAN pins */ // Pull-ups can be enabled or disabled by the user. // This will enable the pullups for the specified pins. // Comment out other unwanted lines. GpioCtrlRegs.GPAPUD.bit.GPIO30 = 0; // Enable pull-up for GPIO30 (CANRXA) GpioCtrlRegs.GPAPUD.bit.GPIO31 = 0; // Enable pull-up for GPIO31 (CANTXA) /* Set qualification for selected CAN pins to asynch only */ // Inputs are synchronized to SYSCLKOUT by default. // This will select asynch (no qualification) for the selected pins. GpioCtrlRegs.GPAQSEL2.bit.GPIO30 = 3; // Asynch qual for GPIO30 (CANRXA) /* Configure eCAN-A pins using GPIO regs*/ // This specifies which of the possible GPIO pins will be eCAN functional pins. // Turn off other CAN pins
GpioCtrlRegs.GPAMUX2.bit.GPIO18 = 0; // Configure GPIO18 for GPIO operation GpioCtrlRegs.GPAMUX2.bit.GPIO19 = 0; // Configure GPIO19 for GPIO operation
GpioCtrlRegs.GPAMUX2.bit.GPIO30 = 1; // Configure GPIO30 for CANRXA operation GpioCtrlRegs.GPAMUX2.bit.GPIO31 = 1; // Configure GPIO31 for CANTXA operation //GpioCtrlRegs.GPADIR.bit.GPIO31 = 1; //Configure CANTXA as output break;Regards,Trey
I think both of you forgot that the GPxMUX - registers are EALLOW - protected.
I thought Eallow allowed you access and edis closed the access.
That is correct. If you called EALLOW before this code without calling EDIS, you should be ok. In practice though, you should always call EALLOW right before you are accessing a protected register and call EDIS right afterward. This is to protect your system in the case the processor "goes into the weeds" so to speak. Imagine if your device was driving some power electronics connected to 3 phase mains and the GPIOs controlling the gate drive got messed up....
The GPIO ports are still not switching correctly.
I have another function for can B which will be show below which is pretty much identical to Can A but with different GPIO. When Can B is switched from 16/17 to 08/10. The pin on GPIO 8 drops low but the data is still comming out 16.
This is what happens on GPIO 08
This is what happens on GPIO 16(correct but wrong pin)
void InitECanbGpio(Uint16 CanBValue){ EALLOW;switch (CanBValue){ case 0: //default GpioCtrlRegs.GPAPUD.bit.GPIO16 = 0; // Enable pull-up for GPIO16 (CANTXB) GpioCtrlRegs.GPAPUD.bit.GPIO17 = 0; // Enable pull-up for GPIO17 (CANRXB) // Set qualification for selected CAN pins to asynch only // Inputs are synchronized to SYSCLKOUT by default. // This will select asynch (no qualification) for the selected pins. // Comment out other unwanted lines. GpioCtrlRegs.GPAQSEL2.bit.GPIO17 = 3; // Asynch qual for GPIO17 (CANRXB) // Turn off other CAN pins GpioCtrlRegs.GPAMUX1.bit.GPIO8 = 0; // Configure GPIO08 for CANTXB operation GpioCtrlRegs.GPAMUX1.bit.GPIO10 = 0; // Configure GPIO10 for CANRXB operation GpioCtrlRegs.GPAMUX1.bit.GPIO12 = 0; // Configure GPIO12 for CANTXB operation GpioCtrlRegs.GPAMUX1.bit.GPIO13 = 0; // Configure GPIO13 for CANRXB operation GpioCtrlRegs.GPAMUX2.bit.GPIO20 = 0; // Configure GPIO20 for CANTXB operation GpioCtrlRegs.GPAMUX2.bit.GPIO21 = 0; // Configure GPIO21 for CANRXB operation // Configure eCAN-B pins using GPIO regs*/ // This specifies which of the possible GPIO pins will be eCAN functional pins. GpioCtrlRegs.GPAMUX2.bit.GPIO16 = 2; // Configure GPIO16 for CANTXB operation GpioCtrlRegs.GPAMUX2.bit.GPIO17 = 2; // Configure GPIO17 for CANRXB operation //GpioCtrlRegs.GPADIR.bit.GPIO16 = 1; //Configure CANTXB as output break; case 1: GpioCtrlRegs.GPAPUD.bit.GPIO8 = 0; // Enable pull-up for GPIO08 (CANTXB) GpioCtrlRegs.GPAPUD.bit.GPIO10 = 0; // Enable pull-up for GPIO10 (CANRXB) // Set qualification for selected CAN pins to asynch only // Inputs are synchronized to SYSCLKOUT by default. // This will select asynch (no qualification) for the selected pins. // Comment out other unwanted lines. GpioCtrlRegs.GPAQSEL1.bit.GPIO10 = 3; // Asynch qual for GPIO10 (CANRXB) // Turn off other CAN pins GpioCtrlRegs.GPAMUX2.bit.GPIO16 = 0; // Configure GPIO16 for CANTXB operation GpioCtrlRegs.GPAMUX2.bit.GPIO17 = 0; // Configure GPIO17 for CANRXB operation GpioCtrlRegs.GPAMUX1.bit.GPIO12 = 0; // Configure GPIO12 for CANTXB operation GpioCtrlRegs.GPAMUX1.bit.GPIO13 = 0; // Configure GPIO13 for CANRXB operation GpioCtrlRegs.GPAMUX2.bit.GPIO20 = 0; // Configure GPIO20 for CANTXB operation GpioCtrlRegs.GPAMUX2.bit.GPIO21 = 0; // Configure GPIO21 for CANRXB operation // Configure eCAN-B pins using GPIO regs*/ // This specifies which of the possible GPIO pins will be eCAN functional pins. GpioCtrlRegs.GPAMUX1.bit.GPIO8 = 2; // Configure GPIO08 for CANTXB operation GpioCtrlRegs.GPAMUX1.bit.GPIO10 = 2; // Configure GPIO10 for CANRXB operation //GpioCtrlRegs.GPADIR.bit.GPIO8 = 1; //Configure CANTXB as output break; case 2: GpioCtrlRegs.GPAPUD.bit.GPIO12 = 0; // Enable pull-up for GPIO12 (CANTXB) GpioCtrlRegs.GPAPUD.bit.GPIO13 = 0; // Enable pull-up for GPIO13 (CANRXB) // Set qualification for selected CAN pins to asynch only // Inputs are synchronized to SYSCLKOUT by default. // This will select asynch (no qualification) for the selected pins. // Comment out other unwanted lines. GpioCtrlRegs.GPAQSEL1.bit.GPIO13 = 3; // Asynch qual for GPIO13 (CANRXB) // Turn off other CAN pins GpioCtrlRegs.GPAMUX2.bit.GPIO16 = 0; // Configure GPIO16 for CANTXB operation GpioCtrlRegs.GPAMUX2.bit.GPIO17 = 0; // Configure GPIO17 for CANRXB operation GpioCtrlRegs.GPAMUX1.bit.GPIO8 = 0; // Configure GPIO08 for CANTXB operation GpioCtrlRegs.GPAMUX1.bit.GPIO10 = 0; // Configure GPIO10 for CANRXB operation GpioCtrlRegs.GPAMUX2.bit.GPIO20 = 0; // Configure GPIO20 for CANTXB operation GpioCtrlRegs.GPAMUX2.bit.GPIO21 = 0; // Configure GPIO21 for CANRXB operation // Configure eCAN-B pins using GPIO regs // This specifies which of the possible GPIO pins will be eCAN functional pins. GpioCtrlRegs.GPAMUX1.bit.GPIO12 = 2; // Configure GPIO12 for CANTXB operation GpioCtrlRegs.GPAMUX1.bit.GPIO13 = 2; // Configure GPIO13 for CANRXB operation //GpioCtrlRegs.GPADIR.bit.GPIO12 = 1; //Configure CANTXB as output break; case 3: GpioCtrlRegs.GPAPUD.bit.GPIO20 = 0; // Enable pull-up for GPIO20 (CANTXB) GpioCtrlRegs.GPAPUD.bit.GPIO21 = 0; // Enable pull-up for GPIO21 (CANRXB) // Set qualification for selected CAN pins to asynch only // Inputs are synchronized to SYSCLKOUT by default. // This will select asynch (no qualification) for the selected pins. // Comment out other unwanted lines. GpioCtrlRegs.GPAQSEL2.bit.GPIO21 = 3; // Asynch qual for GPIO21 (CANRXB) // Turn off other CAN pins GpioCtrlRegs.GPAMUX2.bit.GPIO16 = 0; // Configure GPIO16 for CANTXB operation GpioCtrlRegs.GPAMUX2.bit.GPIO17 = 0; // Configure GPIO17 for CANRXB operation GpioCtrlRegs.GPAMUX1.bit.GPIO8 = 0; // Configure GPIO08 for CANTXB operation GpioCtrlRegs.GPAMUX1.bit.GPIO10 = 0; // Configure GPIO10 for CANRXB operatio GpioCtrlRegs.GPAMUX1.bit.GPIO12 = 0; // Configure GPIO12 for CANTXB operation GpioCtrlRegs.GPAMUX1.bit.GPIO13 = 0; // Configure GPIO13 for CANRXB operationn // Configure eCAN-B pins using GPIO regs*/ // This specifies which of the possible GPIO pins will be eCAN functional pins. GpioCtrlRegs.GPAMUX2.bit.GPIO20 = 2; // Configure GPIO20 for CANTXB operation GpioCtrlRegs.GPAMUX2.bit.GPIO21 = 2; // Configure GPIO21 for CANRXB operation //GpioCtrlRegs.GPADIR.bit.GPIO20 = 1; //Configure CANTXB as output break; } EDIS;}
The above code looks good, but I have to wonder how the CAN peripheral is interpretting this GPIO switch. When we switch the GPIO mux, we have no idea what state the internal nets are that connect to the CAN controller. I think we should also take the CAN controller off the bus before we change the GPIOs associated with the CAN peripheral. Try setting the CCR bit before you change the GPIO mux configuration, and then clear the bit after you have the GPIO mux how you want it.
Let me know how this works for you.
The CCR is set then unset in the CAnshadow function. Could the error we occuring in the function nused to transmit the command :
[TX] - TMS CANB-SEND;ID=00h;Data=012345h<CR><LF>
else if(strcmp(mode,"-SEND")==0){ InitECanbGpio(CanB_Value); ptr = strtok (0,";"); ptr += 3; for(i=0;i<4;i++) ph[i] = *ptr++; c = sscanf(ph,"%x",&ID); //write address ptr = strtok (0,";"); ptr += 5; i = 0; ph[2] = 0; while(c != 0){ ph[0] = *ptr++; ph[1] = *ptr++; c = sscanf(ph,"%x",&Data[i]); //write address ++i; } data_length = i-1; //set message ID ECanbMboxes.MBOX0.MSGID.all = 0; ECanbMboxes.MBOX0.MSGID.bit.STDMSGID = ID; //configure Mailbox0 as transmit ECanbShadow.CANMD.all = ECanbRegs.CANMD.all; ECanbShadow.CANMD.bit.MD0 = 0; ECanbRegs.CANMD.all = ECanbShadow.CANMD.all; // Enable Mailbox0 ECanbShadow.CANME.all = ECanbRegs.CANME.all; ECanbShadow.CANME.bit.ME0 = 1; ECanbRegs.CANME.all = ECanbShadow.CANME.all; if(data_length<=8){ ECanbMboxes.MBOX0.MSGCTRL.bit.DLC = data_length; } else{ SciaTx(String_err); SciaTx(": Too many Bytes"); return; } ECanbMboxes.MBOX0.MDH.all = 0; ECanbMboxes.MBOX0.MDL.all = 0; switch (data_length){ case 8: ECanbMboxes.MBOX0.MDH.byte.BYTE7 = Data[7]; case 7: ECanbMboxes.MBOX0.MDH.byte.BYTE6 = Data[6]; case 6: ECanbMboxes.MBOX0.MDH.byte.BYTE5 = Data[5]; case 5: ECanbMboxes.MBOX0.MDH.byte.BYTE4 = Data[4]; case 4: ECanbMboxes.MBOX0.MDL.byte.BYTE3 = Data[3]; case 3: ECanbMboxes.MBOX0.MDL.byte.BYTE2 = Data[2]; case 2: ECanbMboxes.MBOX0.MDL.byte.BYTE1 = Data[1]; case 1: ECanbMboxes.MBOX0.MDL.byte.BYTE0 = Data[0]; } ECanbShadow.CANTRS.all = 0; ECanbShadow.CANTRS.bit.TRS0 = 1; // Set TRS for mailbox 0 ECanbRegs.CANTRS.all = ECanbShadow.CANTRS.all; Msg_Flags.bit.Timeout = 0; CpuTimer0Regs.TCR.bit.TSS = 0; //start Timer0 to catch runaway while loop do{ ECanbShadow.CANTA.all = ECanbRegs.CANTA.all; if(Msg_Flags.bit.Timeout == 1){ SciaTx(String_err); SciaTx(": Timeout"); return; } } while(ECanbShadow.CANTA.bit.TA0 == 0 ); // Wait for TA5 bit to be set.. CpuTimer0Regs.TCR.bit.TSS = 0; //stop Timer0 since while successful CpuTimer0Regs.TCR.bit.TRB = 1; //reload Timer0 ECanbShadow.CANTA.all = 0; ECanbShadow.CANTA.bit.TA0 = 1; // Clear TA5 ECanbRegs.CANTA.all = ECanbShadow.CANTA.all; //set ID in response message String_CAN_ID[7]=command[17]; String_CAN_ID[8]=command[18]; //send ID Response SciaTx(String_CAN_ID); SciaTx(String_crlf); SciaTxByte(data_length); }
You should only need to set the CCR bit when you are changing the bit rate or when you want to go bus off. I don't see in the above code that you posted where CCR is set. Give my suggestion a shot and let me know if it works.
This didn't work either. I really am stuck. Even though the line appears to swtich, nothing comes out on the new line. it only comes out on the old line we are trying to switch from
That is really wierd. We must be missing something.
Can you check that the writes to the MUX registers are actually writing? Once you set the bits to 0 you shouldn't see anything come out of the old pin.
you can see right here i close all the mux ports first. And the when the line is activated the line drops low.
switch (CanBValue){ case 0: // Turn off other CAN pins GpioCtrlRegs.GPAMUX1.bit.GPIO8 = 0; // Configure GPIO08 for CANTXB operation GpioCtrlRegs.GPAMUX1.bit.GPIO10 = 0; // Configure GPIO10 for CANRXB operation GpioCtrlRegs.GPAMUX1.bit.GPIO12 = 0; // Configure GPIO12 for CANTXB operation GpioCtrlRegs.GPAMUX1.bit.GPIO13 = 0; // Configure GPIO13 for CANRXB operation GpioCtrlRegs.GPAMUX2.bit.GPIO20 = 0; // Configure GPIO20 for CANTXB operation GpioCtrlRegs.GPAMUX2.bit.GPIO21 = 0; // Configure GPIO21 for CANRXB operation //default GpioCtrlRegs.GPAPUD.bit.GPIO16 = 0; // Enable pull-up for GPIO16 (CANTXB) GpioCtrlRegs.GPAPUD.bit.GPIO17 = 0; // Enable pull-up for GPIO17 (CANRXB) // Set qualification for selected CAN pins to asynch only // Inputs are synchronized to SYSCLKOUT by default. // This will select asynch (no qualification) for the selected pins. // Comment out other unwanted lines. GpioCtrlRegs.GPAQSEL2.bit.GPIO17 = 3; // Asynch qual for GPIO17 (CANRXB) // Configure eCAN-B pins using GPIO regs*/ // This specifies which of the possible GPIO pins will be eCAN functional pins. GpioCtrlRegs.GPAMUX2.bit.GPIO16 = 2; // Configure GPIO16 for CANTXB operation GpioCtrlRegs.GPAMUX2.bit.GPIO17 = 2; // Configure GPIO17 for CANRXB operation //GpioCtrlRegs.GPADIR.bit.GPIO16 = 1; //Configure CANTXB as output break; case 1: // Turn off other CAN pins GpioCtrlRegs.GPAMUX2.bit.GPIO16 = 0; // Configure GPIO16 for CANTXB operation GpioCtrlRegs.GPAMUX2.bit.GPIO17 = 0; // Configure GPIO17 for CANRXB operation GpioCtrlRegs.GPAMUX1.bit.GPIO12 = 0; // Configure GPIO12 for CANTXB operation GpioCtrlRegs.GPAMUX1.bit.GPIO13 = 0; // Configure GPIO13 for CANRXB operation GpioCtrlRegs.GPAMUX2.bit.GPIO20 = 0; // Configure GPIO20 for CANTXB operation GpioCtrlRegs.GPAMUX2.bit.GPIO21 = 0; // Configure GPIO21 for CANRXB operation GpioCtrlRegs.GPAPUD.bit.GPIO8 = 0; // Enable pull-up for GPIO08 (CANTXB) GpioCtrlRegs.GPAPUD.bit.GPIO10 = 0; // Enable pull-up for GPIO10 (CANRXB) // Set qualification for selected CAN pins to asynch only // Inputs are synchronized to SYSCLKOUT by default. // This will select asynch (no qualification) for the selected pins. // Comment out other unwanted lines. GpioCtrlRegs.GPAQSEL1.bit.GPIO10 = 3; // Asynch qual for GPIO10 (CANRXB) // Configure eCAN-B pins using GPIO regs*/ // This specifies which of the possible GPIO pins will be eCAN functional pins. GpioCtrlRegs.GPAMUX1.bit.GPIO8 = 2; // Configure GPIO08 for CANTXB operation GpioCtrlRegs.GPAMUX1.bit.GPIO10 = 2; // Configure GPIO10 for CANRXB operation //GpioCtrlRegs.GPADIR.bit.GPIO8 = 1; //Configure CANTXB as output break;
I know in your code you close them, but there could be something else at play here. Please check in the memory or registers window that the bits are being set as programmed in your code. There is no reason the old pins should still spit out data after they have been turned off.
After using the watch window I could see the bits switching but the program still doesn't work. What is the next thing to check.