Page 2 of 2

Re: dsPIC33EP512GM710 CAN bus stopped working

Posted: Mon Oct 14, 2019 4:14 pm
by lexicon
A few more experiments with variable definitions resulted in more variations on the output:

5x int = 08 00 FC 1F FC 1F 08 00
6x = 00 00 FC 1F 00 00 FC 1F
7x = FC 1F FC 1F FC 1F FC 1F

And then with 8 int's defined... it worked correctly.
ETA: It seems like the pattern probably repeats then as 9 is the same as 1.

Re: dsPIC33EP512GM710 CAN bus stopped working

Posted: Tue Oct 15, 2019 7:58 am
by LeighM
Hi Martin,
Thanks for the investigations.
Looks then like it might be worth trying the (original) version of PIC16BIT_CAL_CAN.c that has the aligned attribute setting with that latest compiler
Thanks
Leigh

Re: dsPIC33EP512GM710 CAN bus stopped working

Posted: Tue Oct 15, 2019 2:20 pm
by lexicon
Due to a period of stupidity on my part, I was wrong to say that the device no longer resets with certain PIC16BIT_CAL_CAN.c files - it does, just the same :oops:
Anyway, I have tried all 8 versions that I have, but I still get the same results - the ones that do not cause a reset have the corrupted output dependent on the variable definitions.

Martin.

Re: dsPIC33EP512GM710 CAN bus stopped working

Posted: Thu Oct 24, 2019 1:48 pm
by lexicon
Having continued to struggle, but needing a solution, I decided to have a go at driving the CAN bus in MPLABX using the device configurator (MCC).
I was able to fairly easily create code to transmit CAN messages.

I have since been able to 'merge' the Flowcode .c code with the MCC generated files and build a working hex file in MPLAB.

This is a bit of a 'hack & bodge' workaround, and may not be viable for a complex project, but it's a start.