Tool/software:
Hi,
I am setting up the code with same parameters as the SCI example3 but with Hardware Abstraction Layer. I am using polling to read/send the data.
void sci_write(const uint16_t * const array, uint16_t length)
{
int i=0;
for(i = 0; i < length; i++)
{
while(!SciaRegs.SCICTL2.bit.TXRDY);
SciaRegs.SCITXBUF.bit.TXDT = array[i];
}
}
void sci_read(uint16_t * array, uint16_t length){
int i=0;
for(i = 0; i < length; i++)
{
while(!SciaRegs.SCIRXST.bit.RXRDY);
array[i] = SciaRegs.SCIRXBUF.bit.SAR;
}
}
Here's the readout result shown in the terminal. I was able to get proper readout for the first few characters (Fig 1). Then the Baudrate register and SCICTL2 registers were forced to change (Fig 2)
Fig 1 Terminal Readout
Fig 2 Register automatically changed (left: before right: after)
(C2000 ware SCI example 3 worked perfectly, which means the hardware, baudrate, port etc were set properly)