Part Number:EVM430-FR6047
Hi,
Brief: Serial eUSCI_A0 does not transmit any serial data to host PC.
I have started developing with the EVM and tried to configure and use serial UART on eUSCI_A0. On the EVM it should communicate thru the ezFET once the pins on header J2 are populated (shown below):
I have configured eUSCI_A0 register as shown:
void serial_init(void) { EUSCI_A_UART_initParam param = {0}; param.selectClockSource = EUSCI_A_UART_CLOCKSOURCE_SMCLK; //SMCLK=> (DCO)16MHz/DIVS_4 -------- ACLK=LFXTCLK=37.768 Khz param.clockPrescalar = 69; //57600 on 4 MHZ param.firstModReg = 0; param.secondModReg = 4; param.parity = EUSCI_A_UART_NO_PARITY; param.msborLsbFirst = EUSCI_A_UART_LSB_FIRST; param.numberofStopBits = EUSCI_A_UART_ONE_STOP_BIT; param.uartMode = EUSCI_A_UART_MODE; param.overSampling = EUSCI_A_UART_LOW_FREQUENCY_BAUDRATE_GENERATION;
// Sets P2SEL1.x GPIO_setAsPeripheralModuleFunctionInputPin(GPIO_PORT_P2, GPIO_PIN0 + GPIO_PIN1, GPIO_SECONDARY_MODULE_FUNCTION);// P2.0 UCA0TXD and P2.1 UCA0RXD if (STATUS_FAIL == EUSCI_A_UART_init(EUSCI_A0_BASE, ¶m)) { return; } PMM_unlockLPM5(); EUSCI_A_UART_enable(EUSCI_A0_BASE); EUSCI_A_UART_clearInterrupt(EUSCI_A0_BASE, EUSCI_A_UART_RECEIVE_INTERRUPT); EUSCI_A_UART_clearInterrupt(EUSCI_A0_BASE, EUSCI_A_UART_TRANSMIT_INTERRUPT); EUSCI_A_UART_enableInterrupt(EUSCI_A0_BASE, EUSCI_A_UART_TRANSMIT_INTERRUPT); // Enable interrupt // Enable USCI_A0 RX interrupt EUSCI_A_UART_enableInterrupt(EUSCI_A0_BASE, EUSCI_A_UART_RECEIVE_INTERRUPT); // Enable interrupt __enable_interrupt(); }
Here is the clock init routine:
void clock_init(void) { /* * Configure CS module * MCLK = 16 MHz from DCOCLK * SMCLK = 8MHz from DCOCLK * ACLK = LFXTCLK 32.768 KHz */ // Unlock CS registers CSCTL0_H = CSKEY >> 8; // Set DCO to 16MHz CSCTL1 = DCORSEL | DCOFSEL_4; // SELA selects ACLK source // SELS selects SMCLK source // SELM selects MCLK source // For EVM HFXCLK = 8MHz, LFXCLK = 32.768 kHz, // Set ACLK = LFXTCLK, SMCLK = DCO, MCLK = HFXTCLK CSCTL2 = SELA__LFXTCLK | SELS__DCOCLK | SELM__HFXTCLK; // DIVA selects ACLK source divider // DIVS selects SMCLK source divider // DIVM selects MCLK source divider CSCTL3 = (DIVA__1 | DIVS__4 | DIVM__1); CSCTL4 &= (HFXTDRIVE_0); CSCTL4 &= (HFXTBYPASS_0); CSCTL4 |= (HFFREQ_1); CSCTL4 |= (LFXTDRIVE_3); CSCTL4 |= (LFXTBYPASS_0); CSCTL4 &= ~(HFXTOFF); CSCTL4 &= ~(LFXTOFF); // Lock CS register CSCTL0_H = 0; // }
On debug the UCA0 Registers are shown below:
MAIN:
uint8_t RXData = 0, TXData = 0; uint8_t check = 0; int main(void) { uint32_t i = 0; TXData = 0x01;
while(1){ serial_trasmitDataByte(TXData); // TXData = TXData+1; for(i = 0; i < 100000; i++); GPIO_toggleOutputOnPin(GPIO_PORT_P1, GPIO_PIN0); } return (0); }
//****************************************************************************** // //This is the USCI_A0 interrupt vector service routine. // //****************************************************************************** #if defined(__TI_COMPILER_VERSION__) || defined(__IAR_SYSTEMS_ICC__) #pragma vector=USCI_A0_VECTOR __interrupt #elif defined(__GNUC__) __attribute__((interrupt(USCI_A0_VECTOR))) #endif void USCI_A0_ISR(void) { switch(__even_in_range(UCA0IV,USCI_UART_UCTXCPTIFG)) { case USCI_NONE: break; case USCI_UART_UCRXIFG: RXData = EUSCI_A_UART_receiveData(EUSCI_A0_BASE); if(!(RXData == TXData)) // Check value { while(1); } check =1; break; case USCI_UART_UCTXIFG: TXData = TXData+1; break; } }
The interruption is running as expected, but I receive no data on the host PC serial communication. Am I missing something??
Also tried using the MSPWARE example (msp430fr60x7_euscia0_uart_03.c) code with no success. Same happens, registers are configured but no data is received