Page 1 of 1

Pin Selection for Internal CAN

Posted: Fri Jul 15, 2016 11:36 am
by eSYS.co
Hello Flowcode 7 friends,
I have a problem with the set of input and output pins for the internal CAN.

There are at "Connections"> TX pin and RX pin.
I can open here "Edit properties" and set checkbox "writeable".

When i dobble click "$ PORTA," the grafical Pin editor opened.
The preselected pin is always "RA0" (for TX and RX).

No change is possible!

How does it work?
How can I assign the correct pins?

Thanks for your help!

PS: Controller is "dsPIC33EP64MC503"

Re: Pin Selection for Internal CAN

Posted: Fri Jul 15, 2016 3:29 pm
by Steve
Are you using the "CAN (Internal, MCP2515)" component in the "Comms" menu? This seems to be working ok for me.

The "CAN" in the "Peripheral CAL" section of the "Tools" menu does seem to have a problem, but I think you should be using the one in the "Comms" menu.

Re: Pin Selection for Internal CAN

Posted: Fri Jul 15, 2016 5:13 pm
by eSYS.co
Yes that is correct. I use the can from the "comms" menue.
Handle = Can1
Type = can (internal, mcp2515)

But i don't can change the connection pins.
There Show always
TX Pin $PortA.
RX Pin $PortA.

Best regards,

Andreas

Re: Pin Selection for Internal CAN

Posted: Fri Jul 15, 2016 5:28 pm
by EtsDriver
eSYS.co wrote:Hello Flowcode 7 friends,
I have a problem with the set of input and output pins for the internal CAN.

There are at "Connections"> TX pin and RX pin.
I can open here "Edit properties" and set checkbox "writeable".

When i dobble click "$ PORTA," the grafical Pin editor opened.
The preselected pin is always "RA0" (for TX and RX).

No change is possible!

How does it work?
How can I assign the correct pins?

Thanks for your help!

PS: Controller is "dsPIC33EP64MC503"
Oh i see:
CAN_pins..JPG
(173.4 KiB) Downloaded 2349 times
The ds33EP64MC503 has RP pins, RemappablePeripherals? Peripheral Pin Select (PPS)?
Matrix team take a look to 175-177 pages of this devices datasheet:
http://ww1.microchip.com/downloads/en/D ... 00657H.pdf

**
OFFtopic: This micro seems to be a great little controller, might implement it to something if FlowcodeV7 gets these Remappable pins to work fine with all those supported communications? :)

Re: Pin Selection for Internal CAN

Posted: Thu Jul 21, 2016 9:22 am
by Benj
Hello,

Thanks for letting us know of the problem. I have tracked it down to a missing definition in the chip definition file which has now been fixed.

To apply the fix simply extract the files from the archive into your "Flowcode 7/FCD/PIC16" folder and then restart Flowcode.
PIC16.zip
(108.88 KiB) Downloaded 382 times
Let me know how you get on.

Re: Pin Selection for Internal CAN

Posted: Sun Jul 24, 2016 10:11 pm
by eSYS.co
Thank you for the zip file.

Now i can set the Input and Output Pins for the CAN_Driver. :D

Whren i compile the Code i become the following error message:

Is there an additional problem ?

  • C:\Program Files (x86)\Flowcode 7\CAL\/PIC16BIT\PIC16BIT_CAL_CAN.c: In function 'FC_CAL_Internal_CAN_Init_1':
    C:\Program Files (x86)\Flowcode 7\CAL\/PIC16BIT\PIC16BIT_CAL_CAN.c:200:4: error: 'RPINR26BITS' has no member named 'C1RX'

    Error returned from [xc16-gcc.exe]
    Completed compilation, return = 1

    C:\Program Files (x86)\Flowcode 7\compilers\pic16\batchfiles\pic16_C30_comp.bat reported error code 1
Thanks for help.

Re: Pin Selection for Internal CAN

Posted: Wed Jul 27, 2016 12:24 pm
by Benj
Hello,

Thanks for letting us know. The "C1RX" should be "C1RXR".

I have fixed the problem in the chip definition file. You simply have to download the file and copy it to the "Flowcode 7/FCD/PIC16" folder before starting Flowcode and the changes will be loaded.
33EP64MC503.fcdx
(29.49 KiB) Downloaded 338 times
|Let us know how you get on.

Re: Pin Selection for Internal CAN

Posted: Wed Jul 27, 2016 1:07 pm
by Benj
I may have also found another bug to do with the fact that the device does not have DMA memory for the CAN buffers.

If you get a linker compile error saying there is not enough memory then this should hopefully solve the issue.

Simply place the attached file into your "Flowcode 7/CAL/PIC16BIT" folder and then the compilation should succeed.
PIC16BIT_CAL_CAN.c
(68.28 KiB) Downloaded 411 times

Re: Pin Selection for Internal CAN

Posted: Fri Aug 12, 2016 7:16 pm
by EtsDriver
Hey!

The dsPIC33FJ256GP710 and 710A version of this chip seems to have similar issues with internal CAN pin selections? Even after applying the "fixing" pic16.zip files? Might be more internal selections problems like SPI side but didnt have time to check everything out now.

http://www.microchip.com/wwwproducts/en ... J256GP710A

Re: Pin Selection for Internal CAN

Posted: Tue Aug 16, 2016 12:31 pm
by Benj
Many thanks for letting us know, seems we missed these devices on the last pass through as well as a few others.

The attached definition files have now been updated with the correct CAN pin definitions.
PIC16_CAN.zip
(258.12 KiB) Downloaded 380 times

Re: Pin Selection for Internal CAN

Posted: Sat Dec 31, 2016 2:17 pm
by Lord Grezington
Hello Ben

I have the same problem using FC6 attempting to re-map the pins when trying to use the internal ECAN on the 33EP32MC504. Please can you send me an updated file so that the mapping works as required?

Thanks

Re: Pin Selection for Internal CAN

Posted: Tue Jan 03, 2017 11:53 am
by Benj
Hello,

The v7 updated FCD files and CAL C file should be compatible with v6. Make a backup of your files first just in case there are any problems.

Let us know if not and we will investigate.