MOD54415 CAN bus works like a charm IF
Posted: Tue May 28, 2013 11:24 pm
Hello fellow Netburner users & developers,
I had to implement a CAN bus communication for out MOD54415 application. Because our CAN0 is used for I2C (we migrated from MOD5272) I had to switch to CAN1.
In the example which came 2.6.0 NNDK the pins 42 & 39 where set to CAN0_TX and CAN0_RX, so I made in my application pin 44 = CAN1_TX and pin 41 = CAN1_RX.
Did CanInit, setup the RX fifo, called SendMessage and CanRxMessage like in the example, but nothing happened. After adding 'result = SendMessage(..)' it turned out that I was getting timeouts on SendMessage.
To cut a long story short, it turned out the canif.cpp was writen completly for CAN0 only. Luckily my boss already invested in a makefile to rebuild netburner.lib inside my project I was able to adapt canif.cpp for both controllers. I'll send Netburner a copy of my canif.cpp, maybe they can make it available on request and/or implement in an updates NNDK for the MOD54415.
Happy CANopen interfacing and with regards,
Hans van Herwijnen
PS if you have any questions, just PM me
I had to implement a CAN bus communication for out MOD54415 application. Because our CAN0 is used for I2C (we migrated from MOD5272) I had to switch to CAN1.
In the example which came 2.6.0 NNDK the pins 42 & 39 where set to CAN0_TX and CAN0_RX, so I made in my application pin 44 = CAN1_TX and pin 41 = CAN1_RX.
Did CanInit, setup the RX fifo, called SendMessage and CanRxMessage like in the example, but nothing happened. After adding 'result = SendMessage(..)' it turned out that I was getting timeouts on SendMessage.
To cut a long story short, it turned out the canif.cpp was writen completly for CAN0 only. Luckily my boss already invested in a makefile to rebuild netburner.lib inside my project I was able to adapt canif.cpp for both controllers. I'll send Netburner a copy of my canif.cpp, maybe they can make it available on request and/or implement in an updates NNDK for the MOD54415.
Happy CANopen interfacing and with regards,
Hans van Herwijnen
PS if you have any questions, just PM me