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.

TMS320F28335: SCI串口问题,接收数据错误

Part Number: TMS320F28335

使用f28335的SCIA通过USB-TTL向电脑的串口助手发送数据,结果能够正常接收到数据,但是每个发送的数据都与电脑接收到的数据不一致

波特率为9600,采用fifo查询方式,配置代码如下:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
void InitSciA(Uint32 baud)
{
Uint16 scibaud = 0;
unsigned char scihbaud=0;
unsigned char scilbaud=0;
scibaud=37500000/(8*baud)-1;
scihbaud=scibaud>>8;
scilbaud=scibaud&0xff;
// Initialize SCI-A:
//tbd...
/* Enable internal pull-up for the selected pins */
// Pull-ups can be enabled or disabled disabled by the user.
// This will enable the pullups for the specified pins.
EALLOW;
GpioCtrlRegs.GPAPUD.bit.GPIO28 = 0; // Enable pull-up for GPIO28 (SCIRXDA)
GpioCtrlRegs.GPAPUD.bit.GPIO29 = 0; // Enable pull-up for GPIO29 (SCITXDA)
/* Set qualification for selected pins to asynch only */
// Inputs are synchronized to SYSCLKOUT by default.
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

然后在100ms的定时中断里面发送数据

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
interrupt void TINT0_ISR(void) // CPU-Timer 0
{
// char *msg;
// Insert ISR Code here
// To receive more interrupts from this PIE group, acknowledge this interrupt
// PieCtrlRegs.PIEACK.all = PIEACK_GROUP1;
// Next two lines for debug only to halt the processor here
// Remove after inserting ISR Code
// asm (" ESTOP0");
// for(;;);
if(CpuTimer0.InterruptCount == 0){
CpuTimer0.InterruptCount++;
LED1 = 1;
}
else{
CpuTimer0.InterruptCount--;
LED1 = 0;
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

发送的明明是0x41,接收到的却是0x5F,换了其他串口助手软件也是这样

通过仿真器调试,寄存器里的数据都正确

请教各位大佬,到底是什么原因呢?