Davidwallis 0 Posted December 15, 2016 Share Posted December 15, 2016 Does anyone have a can bus example for energia that works with the tm4c123g? Thanks David Quote Link to post Share on other sites
Rei Vilo 695 Posted December 15, 2016 Share Posted December 15, 2016 See chapter 6 of the http://www.ti.com/lit/ug/spmu298d/spmu298d.pdf'>TivaWareTM Peripheral Driver Library USER spirilis 1 Quote Link to post Share on other sites
Davidwallis 0 Posted December 30, 2016 Author Share Posted December 30, 2016 Hi, I got the example working to some extent, but ended up using code composer - so mods feel free to move this if needed. Few questions on the RX example.. How do I add interrupt vectors? Initally I have got it triggering on can messages by enabling: CANIntRegister(CAN0_BASE, CANIntHandler); // if using dynamic vectors I have set the msgID as: sCANMessage.ui32MsgID = 0x600; and have tried all sorts of masks.. from 0 to 0xffff etc - Just not sure how to set this? sCANMessage.ui32MsgIDMask = 0xfff; In this scenario I am running at 1Mbps and have configured the baud rate accordingly - the bus is very busy currently.. but using another product and tool I can see the message being sent as: CAN id 600 Length 8 DATA 00 00 00 00 34 61 00 However I see no data from the example.. what simple thing am I doing wrong?? Quote Link to post Share on other sites
energia 485 Posted January 2, 2017 Share Posted January 2, 2017 Attached are 2 Sketches that might help you. dph_CANExamplePolled.ino dph_CANExampleWithInterrupts.ino Fmilburn and Davidwallis 2 Quote Link to post Share on other sites
Davidwallis 0 Posted January 3, 2017 Author Share Posted January 3, 2017 Thanks, I eventually got the code working with a peer review from a friend, who couldn't see anything wrong, he built it on his machine and then sent the bin which I flashed and it all worked ok.. Downgrading tivaware on my machine and rebuilding it - it then worked.. Need to have another play with this tonight.. Next problem was I was loosing messages - Don't know if I need to use more slots and fifo to cope with the volume of messages (@ 1Mbps) ? Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.