golfdubcrazy
hi im trying to setting up a steering angle sensor on canbus. setup is OSEK and Little (intel)

bits 0-15 is the angle data and bit 16 is 1 or 0 depending on steering left/right or +/- 

Is there a way to get bit 16 to set the signed value ?

Thanks
Quote 0 0
littleozfella
Hi,
    When you are setting up the packets you select if you want signed or unsigned...
    CAN.png 
Quote 0 0
golfdubcrazy
Hi thanks for the reply yes i have tried changing the data types. the problem is bits 0-15 are a unsigned value and read correct when set to unsigned. 

i.e 0-500' but doesn't specify if it is positive or negative value. as the +/- value is from bit 16.

i have tried changing the setting so bits 0-16 in one stream but the negative reads correct i.e 0-500 but the positive reads 1600 and counts down to 300.

im hoping that makes sense.


Thanks Again.
Quote 0 0
littleozfella

did you try Big-Endian? That would give 16 the priority wouldn't it??  I am no CAN guru so am as interested as you to know the solution..  so first would be to understand + or - then the rest of the bits...

 

Quote 0 0