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.

Sending data from PPC to MSP430



Hello,

I'm sending data from PPC405 CPU to MSP430 via I2C.

The data is a structure that contains few 32bits fields (unsigned long)

The PPC405 is big endian. The MSP430 is little endian.

But for some reason, when I'm sending the data I do not have to run "htonl" (byte swap) on the data received in the MSP430.

When I'm sending data from PPC405 to x86, I have to run "htonl" in the x86. 

Can you explain this ?

Thanks,

Zvika 

  • Zvi Vered said:
    Can you explain this ?

    No. Except for the fact that I2C itself doesn't care for endianess. It always transfers bytes. Whether 4 bytes form a DWORD and which is the MSB and which the LSB is a don't care for I2C.
    So how do you receive the bytes on the MSP might shed some light on your question. Without knowing your code, nobody but you can tell.

**Attention** This is a public forum