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.
还有问题想请教你 那如果我用SCI接收到一些数据 这些数据是8bit的 然后与我定义的unsigned char运算 运算的结果再次用SCI进行传输 这样是不是会出现问题
dragon,
在CCS5.3也是一样的,这跟芯片相关,跟CCS无关。关于这个问题,下面有相应的解决方法,你可以参考,如果要进行8bits寻址,需要特殊指令。
Solution:
The smallest addressable memory cell on the F28xx is 16-bits.This is mentioned in the TMS320C28x C/C++ Language Implementation User's Guide (SPRU514) in Section 6.3 called Data Types.
There are compiler instrinsics __byte() and __mov_byte() to access data in increments of 8-bits.
This info from the TMS320C28x Optimizing C/C++ Compiler User's guide (SPRU514) may help (page 82):
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).
To access data in increments of 8 bits, use the __byte() and __mov_byte() intrinsics described in Section 7.4.4.
Reference:
http://e2e.ti.com/support/microcontrollers/c2000/f/171/t/21671.aspx
http://processors.wiki.ti.com/index.php/Byte_Accesses_with_the_C28x_CPU
Eric