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.

F28335,20MHz外部晶振,波特率设的9600,可实际翻倍了

Other Parts Discussed in Thread: C2000WARE, CONTROLSUITE

在main()中调用了UARTa_Init(9600);

void UARTa_Init(Uint32 baud)
{
unsigned char scihbaud=0;
unsigned char scilbaud=0;
Uint16 scibaud=0;

scibaud=25000000/(8*baud)-1;//37500000/(8*baud)-1;
scihbaud=scibaud>>8;
scilbaud=scibaud&0xff;


EALLOW;
SysCtrlRegs.PCLKCR0.bit.SCIAENCLK = 1; // SCI-A
EDIS;

InitSciaGpio();

//Initalize the SCI FIFO
SciaRegs.SCIFFTX.all=0xE040;
SciaRegs.SCIFFRX.all=0x204f;
SciaRegs.SCIFFCT.all=0x0;

// Note: Clocks were turned on to the SCIA peripheral
// in the InitSysCtrl() function
SciaRegs.SCICCR.all =0x0007; // 1 stop bit, No loopback
// No parity,8 char bits,
// async mode, idle-line protocol
SciaRegs.SCICTL1.all =0x0003; // enable TX, RX, internal SCICLK,
// Disable RX ERR, SLEEP, TXWAKE
SciaRegs.SCICTL2.all =0x0003;
SciaRegs.SCICTL2.bit.TXINTENA =1;
SciaRegs.SCICTL2.bit.RXBKINTENA =1;
SciaRegs.SCIHBAUD =scihbaud;
SciaRegs.SCILBAUD =scilbaud;
// SciaRegs.SCICCR.bit.LOOPBKENA =1; // Enable loop back
SciaRegs.SCICTL1.all =0x0023; // Relinquish SCI from Reset

}

在连接串口助手时,9600波特率都是乱码。

设串口助手的波特率为19200,收发的数据都正确

波特率被翻倍了,联想到51单片机的PCON……

请问 28335是在哪个寄存器设的?谢谢!