Hey guys...
I've got a problem with my uart after pushing the system reset button in CCS. The bootmode configuration of my eval board is in default mode, so the HUA-Demo starts after power up and I can observe some messages from the HUA-Demo in the terminal. Then I'm loading my own code to one of the cores, setting the UART clk divider registers to configure the BAUD rate and sending some debug messages. So far, everything is fine! The messages appear in the terminal!
But now I'm pressing the system reset button of CCS, loading the same code to the device, and the debug messages are no longer appearing in the terminal!
What am I doing wrong? Did I forget some initializations?
I've written the UART code by myself, but this works fine with other ti-devices. I also called the GEL-Script Global_Default_Setup, but this didn't fix my problem.
Regards,
Pille.
Here is my UART init code:
void initRS232(int baudRate, int FIFOmode, int HWhandshake, unsigned char stopBit, unsigned char wordLen, unsigned char parity) {
int divisorValue;
// calculate divisor register value (TL16C550 datasheet page 32)
divisorValue = UART_FREQ_HZ / (baudRate * 16);
// Access Divisor Latch Register
LCR |= 0x80;
FREQ_DIV_LSB = (unsigned char) (divisorValue & 0x00FF); // DIV= freq/baudrate/16
FREQ_DIV_MSB = (unsigned char) ((divisorValue & 0xFF00) >> 8);
LCR &= ~0x80;
// Divisor Latch Register
// set Line Control Register (only stop Bit, Word Length and Parity matters)
LCR = (unsigned char) (stopBit | wordLen | parity);
// set RTS
MCR = 0x02;
// enable
FCR = 0x01;
//init RingBuffer
rxStart = 0;
rxEnd = 0;
cmdEOF = 0;
return;
}