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.

TMS570LC4357: SCI3 to SCI4 communication

Part Number: TMS570LC4357
Other Parts Discussed in Thread: HALCOGEN

Hello,

I have been trying to perform a simple SCI communication with SCI3 transmitting information to SCI4. I have the wire from SCI3TX (N2) to SCI4RX(A13) and the code is as simple as:

sciInit();

_enable_IRQ_interrupt_();
sciEnableNotification(sciREG3,SCI_TX_INT);
sciEnableNotification(sciREG4,SCI_RX_INT);

sciSend(sciREG3, 5, &tx[0]);

sciReceive(sciREG4, 5, &rx[0]);
printf("After receiving %d\n", rx[0]);

 

However, the rx array is empty after the sciReceive. The sciNotification function is also never called, I have tried to put the sciReceiver statement in there. 

 

In Halcogen, I have enabled the SCI3/SCI4 drivers, also the corresponding pins, SCI3TX pin is set to output with the DIR checkbox and the interruptions are enabled. I attach the whole project.

 

What am I missing here?

6813.SCI4_3.rar

  • Hello,

    1. If you like to use interrupt mode, please enable the SCI3/SCI4 interrupt in VIM module (channel 64 an channel 116)

    2. You can try polling mode, before receiving data, check the FLG to make sure that the RXRDY bit is set. 

  • Hello QJ,

    Thank you for your answer. After enabling SCI3/SCI4 interrupts now the program calls the sciNotification function. However, I still receive no information. I have within the sciNotification:

    sciReceive(sciREG4, 5, &rx[0]);

    instead of in the main function.

  • Hello,

    Good. 

    You should receive the first byte at least. Before sciSend(), you need to call sciReceive() first to define the rx_length. Otherwise, the INT ISR reads 1st byte only.

    Add a breakpoint at  if (g_sciTransfer_t[1U].rx_length > 0U) in scixHighLevelInterrupt(), and check the SCIRD register using CCS register window.

  • Hello,

    In the breakpoint I see in the IRD register the first byte of the array that I want to transmit.

    I have modified the code so that I have within sciNotification sciSend and sciReceive. (I have call these two instructions in the main code as well, sciReceive firs, as suggested). In this way I am receiving the data in the right array (after the second call to sciNotification) however I am in a loop of recursive calls to sciNotification.

  • Good to know you received the correct data in interrupt mode.

    The sciNotification() is only called when received data is shifted from shift register to data buffer. If no data is received, sciNotification(0 should not be called again.