CANComms, Endianess and Bit Offsets

Support forum for users of the M1 Build

CANComms, Endianess and Bit Offsets

Postby David Ferguson on Tue Feb 09, 2021 9:47 am

Can someone please explain why the "bitoff" parameter passed to the various CANComms.Get<type>() functions does not represent the offset from the start of the buffer when the "bigendian" flag used on the RXOpenStandard() call is false.

I was surprised to find it inverted.

I think of Endianess relating to the byte order of multi-byte quantities, not the bit offset of a buffer. We still call byte offset 0 regardless of endianess, why wouldn't we refer to bit offset 0 as the same?

I wish the M1 Development manual explained this topic in the CANComms library discussion (or even the help in M1 Build for the functions).
David Ferguson
Veracity Racing Data
David Ferguson
Pro User
 
Posts: 1362
Joined: Fri Nov 07, 2008 2:45 am
Location: Paso Robles, California

Re: CANComms, Endianess and Bit Offsets

Postby adrian on Fri Feb 12, 2021 4:38 pm

We don't really have a proper document on how this works but I have a draft explanation that I use which I have attached.

Let me know if you have any other questions and I'll put it on the list to get added to the help or the Dev Manual.
Attachments
M1 Build CAN Bit Numbering Intel Motorola.pdf
(317.98 KiB) Downloaded 586 times
adrian
MoTeC
 
Posts: 719
Joined: Mon Apr 13, 2015 5:16 pm

Re: CANComms, Endianess and Bit Offsets

Postby David Ferguson on Sat Feb 13, 2021 3:13 am

Thank You!

That is exactly the info I need, and your examples are excellent. I need to add some bitfield stuff to the work I'm doing, and would have certainly been even more confused without this info.
David Ferguson
Veracity Racing Data
David Ferguson
Pro User
 
Posts: 1362
Joined: Fri Nov 07, 2008 2:45 am
Location: Paso Robles, California


Return to M1 Build

Who is online

Users browsing this forum: No registered users and 20 guests