This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS320F28075: __byte() Intrinsic: Signed 8 Bit Numbers

Part Number: TMS320F28075


Hi,

I need to store and retrieve signed 8 bit numbers into an EEPROM using the C28x Processor. 

I know that the __byte() intrinsic allows us to pack and unpack data into 8 bit chunks.  However, retrieving the negative 8 bit values results in corrupted data.

I'm assuming this is because the __byte() intrinsic doesn't handle sign extension correctly.  I.e. the MSB of the resultant is set to 0. Is the best workaround for this to just subtract 256 from the value if it is greater than 127?  Or is there some casting incantation that would address this behavior?

Thanks,

-Colin