I am trying to develop a product based on the DRV8312-C2-KIT which receives speed control commands via the CAN bus.
I am using the PM_Sensorless project, unchanged apart from the CAN code additions, in RAM.
I have added code from the various CAN examples, but am not seeing any activity (oscilloscope) on the isolated CAN outputs of the card when my code runs.
I can still control the motor from the watch window.
(Interestingly, if I close the IDE, remove the USB cable from the kit, power the kit down then up and reconnect the USB cable, I get 2-3 seconds of activity on the isolated CAN connections - is that a red-herring?)
Can anyone provide guidance to why I am not getting CAN transmissions?
Thanks
steve robinson
Below are the changes I have made to the project.
PM_Sensorless-DevInit_F2803x.c
// GPIO-30 - PIN FUNCTION = CANRX
GpioCtrlRegs.GPAMUX2.bit.GPIO30 = 1; // 0=GPIO, 1=CANRX-A, 2=Resv, 3=Resv
GpioCtrlRegs.GPADIR.bit.GPIO30 = 0; // 1=OUTput, 0=INput
GpioDataRegs.GPACLEAR.bit.GPIO30 = 1; // uncomment if --> Set Low initially
// GpioDataRegs.GPASET.bit.GPIO30 = 1; // uncomment if --> Set High initially
//--------------------------------------------------------------------------------------
// GPIO-31 - PIN FUNCTION = LED2 on controlCARD (CANTX)
GpioCtrlRegs.GPAMUX2.bit.GPIO31 = 1; // 0=GPIO, 1=CANTX-A, 2=Resv, 3=Resv
GpioCtrlRegs.GPADIR.bit.GPIO31 = 1; // 1=OUTput, 0=INput
GpioDataRegs.GPACLEAR.bit.GPIO31 = 1; // uncomment if --> Set Low initially
// GpioDataRegs.GPASET.bit.GPIO31 = 1; // uncomment if --> Set High initially
//--------------------------------------------------------------------------------------
SysCtrlRegs.PCLKCR0.bit.ECANAENCLK=1; // eCAN-A
PM_Sensorless.c
after..... DeviceInit(); // Device Life support & GPIO
//STEVES CAN STUFF - RIGHT PLACE????
InitECanaGpio(); //from the DSP2803x_Ecan.c example
InitECana(); //as from the DSP2803x_Ecan.c example BUT with the message id setup added from the Example_2803xECanBack2Back.c example
//send some can
ECanaRegs.CANTRS.all = 0x0000FFFF; // Set TRS for all transmit mailboxes
while(ECanaRegs.CANTA.all != 0x0000FFFF ) {} // Wait for all TAn bits to be set..
ECanaRegs.CANTA.all = 0x0000FFFF; // Clear all TAn
... and before the infinite while loop so that it would transmit only once