SPRAD88A march   2023  – april 2023 TMS320C28341 , TMS320C28342 , TMS320C28343 , TMS320C28343-Q1 , TMS320C28344 , TMS320C28345 , TMS320C28346 , TMS320C28346-Q1 , TMS320F28P550SJ , TMS320F28P559SJ-Q1

 

  1.   Abstract
  2.   Trademarks
  3. 1Introduction
  4. 2Byte vs Word Terminology
  5. 3Key Points to Consider
    1. 3.1 8-Bit Data Types are not Supported
    2. 3.2 Memory Size is Expressed in 16 Bits
    3. 3.3 Arrays and Structures: Individual Element Offsets are Different
    4. 3.4 Difference in Standard Data Type Widths
    5. 3.5 Dealing With 8-Bit Communication Protocols
  6. 4References
  7. 5Revision History

Dealing With 8-Bit Communication Protocols

Communication peripherals like the Controller Area Network (CAN), Serial Communications Interface (SCI) and Universal Asynchronous Receiver/Transmitter (UART) in C28x devices support 8-bit data transfers. But note that the data would be stored as 16 bits in the memory. The C28x compiler does not support pragma pack(1).

Example:

GUID-20230206-SS0I-6NQP-5TCH-RMVP49LBGCLF-low.png

In this example, the function takes in uint16_t * as the input data parameter. But it only expects 8 bits of data per uint16_t type. The upper half of the uint16_t is ignored and only the lower 8 bits are transferred.