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.

C2000 integer size

I've been wondering about this for a while now-

Why do the C28x processors have 16-bit chars and 16-bit integers?

  • Hi Grant,

    Check the manaul linked here: e2e.ti.com/.../217638

    Regards,
    Gautam
  • Hi Grant,

    Interesting question and one often discussed both externally and internally, from a perspective of providing 8-bit support.

    C2000 processors started with the F240, a true-Harvard architecture with separate program and data buses. These buses were 16-bits wide and the ALU supported 32-bit math.

    From there we went to the 28x that supports 32-bit bus inputs and 64-bit results (ACC:T concatenated) with a modified Harvard architecture (unified memory programming model, allowing program or data in any memory). Many benefits come from this but some of the more important ones are more resolution and integer headroom for variables in control systems. Also the foundation was laid for floating-point support.

    An interesting document to read is the 28x CPU and Instruction Set Ref Guide (SPRU430), 1st published in 2001. This will give good insight into the architecture. The compiler has matured nicely to take advantage of much of the high performance of this CPU.

    With all that said, now comes to the popular topic about chars and integers being supported as 16-bits, which really points to the request for efficient 8-bit support. Please know that this is on our radar and we understand it would be a nice help especially for communication stacks. Stay tuned!

    Jeff
  • Grant,

    To add to Jeff's comments - by ANSI/ISO C definition, the sizeof operator yields the number of bytes required to store an object. ANSI/ISO further stipulates that when sizeof is applied to char, the result is 1. Since the TMS320C28x char is 16 bits (to make it separately addressable), a byte is also 16 bits.

    This yields results you may not expect; for example, size of (int) = = 1 (not 2). TMS320C28x bytes and words are equivalent (16 bits).


    processors.wiki.ti.com/.../Byte_Accesses_with_the_C28x_CPU
  • Jeff, Lori- Exactly the answers I was looking for.

    Thanks,

    Grant