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.

What's the mean of "byte writes"?

Dear TI,

I am studying datasheet of CRC. I want to confirm the mean of "byte write" which is described in datasheet.

If now we have a 32 bit register, Abc, that is divided to four parts, O(1 bit), E(8 bits), F(4 bits), Reserve(19 bits).

Abc = 0xFFFFFFFF;

Abc->O = 1;

Abc->E = 0xFF;

Abc->F = 0xF;

The above write instructions, which are meet to "byte writes"?

Thanks a lot.

  • Hi Yang,

    It sounds like you are working with the concept of bit fields in the C language, if you have a 1-bit field like 'O' and a 4-bit field like 'F'.

    This is find, but the hardware on the device supports only writing 1 byte at time. So let's say that 'O' is 1 bit but for some reason it got packed into the same byte of RAM as 'F', then if you write code that changes the value of 'O' the compiler has to convert this to code that reads both O&F together, changes O while leaving F alone, and then writes both 'new O' and F together back to the storage location.

    This is because the memory is not designed to write anything narrower than 8 bits at a time.

    You could design a memory that supports bit-writes (down to individual bits) but that is an unusual capability for a microcontroller to have, and the cortex R does not have this capability (to directly change just 1 bit in RAM).

    Some of our peripherals have this capability though, look at the GIO port registers, you will see DSET, DCLR aliases to DOUT. These registers let you change a bit by writing a '1' to the bit , but leave the bit alone if you write a '0'. But we don't have this capability on normal RAM.