Jump to content
  • 0

CAN bus chipkit in Arduino IDE


Alex_Francis

Question

Hello, my name is Alexandre.

I'm doing my master's degree that involves Chipkit use of CANbus with Arduino IDE. MPIDE is not an option for now.

When I build the can example in Arduino IDE the plib.h error occurs: 

"C:\Program Files (x86)\Arduino\hardware\chipkit-core\pic32\libraries\chipKITCAN\chipKITCAN.cpp:46:21: fatal error: plib.h: No such file or directory

 #include    <plib.h>

                     ^

compilation terminated."

How can I remove the plib.h dependecy and write directly to the hardware?

I really need to solve this in order to continue my paper, so any hep is very welcome.

 Thanks.

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

Hi @Alex_Francis,

Based on the documentation with the chipKITCAN library (chipKITCAN->documents) the plib library within this demo implements all of the Interrupt Service Routines, so you would need to re-write the interrupts used. It also seems that based on the readme, the chipKIT CAN library proides one-to-one mapping of the functions in the Microchip Library (plib) which provides a C function call interface to "simplify low-level access to the module without the necessity of interacting directly with the module's registers" (quote taken from the CAN-PLib-Help HTML doc). The chipKITCAN library essentially just provides a C++ wrapper for the CAN Peripheral Library.

So my understanding is that essentially you would need to re-write nearly all of the function calls that adjust and read the CAN registers within the PIC32 chip to remove the plib.h dependency, hence why I recommended in your other thread to use the library for the Pmod CAN as a place to start.

Thanks,
JColvin

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...