Olimex Support Forum

Microcontrollers => PIC => Topic started by: vicoET on September 06, 2019, 02:42:06 PM

Title: canbus on PIC32-EMZ64
Post by: vicoET on September 06, 2019, 02:42:06 PM
hello,
i'm quite newbie on this. Can you please share some example or code or library for CANBUS in PIC32-EMZ64 board? In harmony 3 i don't see any reference to CAN
thank you in advance
Title: Re: canbus on PIC32-EMZ64
Post by: LubOlimex on September 10, 2019, 08:33:09 AM
Not sure about harmony 3 but in harmony 2 these were located in \\apps\examples\peripheral\can\echo_send - maybe the directory structure is the same. Maybe test with harmony 2.

We lack a CAN example since we struggled to get it working ourselves back in the day and haven't recently checked what is the state of the software provided by Microchip. There are many forum threads in the official Microchip forums on the subject, search for "canbus pic32mz".
Title: Re: canbus on PIC32-EMZ64
Post by: vicoET on September 11, 2019, 08:16:36 PM
hello i see the example "echo_send" and tried to make it compile with EMZ64 configuration. But it seems it gets stuck after a few.
There are many threads on it on Microchip forums but information are often confused.
Too bad that Olimex didn't provide any example or application on CAN.

Any further help would be appreciated.

thank you
Title: Re: canbus on PIC32-EMZ64
Post by: KeesZagers on September 13, 2019, 01:14:18 PM
Two earlier discussions have been started by me in the past:

https://www.olimex.com/forum/index.php?topic=5144.0

and

https://www.olimex.com/forum/index.php?topic=5505.0

In fact I got some CAN initialisation up and running. As the CAN module in the MZ controllers is the same as in the MX controllers, communication should not be a big issue further on. For me however this module did not make any sense because it had no real further I/O available. So I still use the Duinomite and PIC32-T795 modules. My advise to you: forget Harmony and try to read and write directly into the CAN registers.