1

I have got the number 317 saved in 2 bytes (00000001 00111101) and it should be transfered via SPI (serial) to a slave device.

The device expect the two bytes B11 and B12, but in a certain order:

"The highest bits of the data words are send first and the lowest bits are send last, that is, byte B11 is the highest byte and byte B12 is the lowest byte."

My question is, what do they exactly mean? Am I supposed to flip the bytes itselves (10000000 10111100) or to flip bytes AND bits (10111100 10000000)?

Lexinas
  • 27
  • 2

1 Answers1

0

Flip the bytes. Or switch , rather:

00000001 00111101

->

00111101 00000001

This is known as endianness (which should help you find related questions)

doctorlove
  • 18,872
  • 2
  • 46
  • 62