Created Tue, 30 Aug 2016 13:20:02 +0000 by eldoori
Tue, 30 Aug 2016 13:20:02 +0000
I am trying to use the chipKIT MAX32/chipKIT Network Shield combo for the CAN bus, however the CANdemo.pde does not compile for some reason. I get a lot of "has no member named" and "not declared in this scope" errors. What I did whas to download the libraries from the network shield resource centre (https://reference.digilentinc.com/chipkit_shield_network/chipkit_shield_network) and paste them in the mpide sketchbook. I also tried to compile it using the Arduino IDE, however the plib.h library is not embedded in the IDE.
These are all the errors I get:
C:\Users\eldoo\Documents\mpide\libraries\chipKITCAN\chipKITCAN.cpp: In function 'void Can1InterruptHandler()': C:\Users\eldoo\Documents\mpide\libraries\chipKITCAN\chipKITCAN.cpp:95:14: error: 'volatile struct __IFS1bits_t' has no member named 'CAN1IF' C:\Users\eldoo\Documents\mpide\libraries\chipKITCAN\chipKITCAN.cpp: At global scope: C:\Users\eldoo\Documents\mpide\libraries\chipKITCAN\chipKITCAN.cpp:115:58: error: Vector number must be an integer between 0 and 255 C:\Users\eldoo\Documents\mpide\libraries\chipKITCAN\chipKITCAN.cpp: In function 'void Can2InterruptHandler()': C:\Users\eldoo\Documents\mpide\libraries\chipKITCAN\chipKITCAN.cpp:121:14: error: 'volatile struct __IFS1bits_t' has no member named 'CAN2IF' C:\Users\eldoo\Documents\mpide\libraries\chipKITCAN\chipKITCAN.cpp: In member function 'void CAN::attachInterrupt(void (*)())': C:\Users\eldoo\Documents\mpide\libraries\chipKITCAN\chipKITCAN.cpp:191:30: error: 'INT_CAN_1_VECTOR' was not declared in this scope C:\Users\eldoo\Documents\mpide\libraries\chipKITCAN\chipKITCAN.cpp:193:19: error: 'INT_CAN1' was not declared in this scope C:\Users\eldoo\Documents\mpide\libraries\chipKITCAN\chipKITCAN.cpp:202:30: error: 'INT_CAN_2_VECTOR' was not declared in this scope C:\Users\eldoo\Documents\mpide\libraries\chipKITCAN\chipKITCAN.cpp:204:19: error: 'INT_CAN2' was not declared in this scope C:\Users\eldoo\Documents\mpide\libraries\chipKITCAN\chipKITCAN.cpp: In member function 'void CAN::detachInterrupt()': C:\Users\eldoo\Documents\mpide\libraries\chipKITCAN\chipKITCAN.cpp:232:19: error: 'INT_CAN1' was not declared in this scope C:\Users\eldoo\Documents\mpide\libraries\chipKITCAN\chipKITCAN.cpp:241:19: error: 'INT_CAN2' was not declared in this scope
Thank you in advance!
Tue, 30 Aug 2016 14:34:24 +0000
Make sure you have the right board selected in the IDE. That looks like it should compile fine, though I haven't actually tested it yet (too busy rebuilding a mail server right now).
Wed, 31 Aug 2016 14:18:22 +0000
Thanks again majenko, I do have a different problem now. When I set up a CAN connection to my laptop I can send and reveive from the laptop's side but I can only send from the chipKIT side, the receive doesn't work.
I have a problem much simular to this post: http://www.chipkit.net/forum/viewtopic.php?f=18&t=3122
I have tried his approach, however it didn't work. Do you have any idea what I can do.
Mon, 30 Nov 2020 10:44:38 +0000
Can I please know how was the code made run successfully? Thanks!!