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.

UART character stream

Hi,

A stream of characters are sent from a FPGA to one of the UART ports when the controller is started. No characters are received in the Rx buffer. In the flag register (SCIFLR) the bit  IDLE is set to '1'. Does that mean that I cant receive characters because the SCI hasn't been synchronized? here is my initialization code for the SCI module:

 

void

sci1Init(void)

{

/** @b intalise SCI1 @b */

/** - bring SCI out of reset */

sciREG1->GCR0 = 1U;

/** - Disable all interrupts */

sciREG1->CLRINT = 0xFFFFFFFF;

sciREG1->CLRINTLVL = 0xFFFFFFFF;

/** - global control 1 */

sciREG1->GCR1 = (1 << 25)/* enable transmit */

                                  | (1 << 24)/* enable receive */

                                  | (0 << 10)/* Disable multi buffer mode */

                                  | (1 << 5)/* internal clock (device has no clock pin) */

                                 | ((1-1) << 4)/* number of stop bits */

                                 | (1 << 3)/* even parity, otherwise odd */

                                 | (0 << 2)/* no parity */

                                | (1 << 1);/* asynchronous timing mode */

/** - set baudrate */

sciREG1->BAUD = (3 << 24)/* M */

| (1 << 0);/* Prescaler */

/** - tranmision length */

sciREG1->LENGTH = 7;

/* length */

/** - set SCI pins functional mode */

sciREG1->FUN = (1 << 2)/* tx pin */

                              | (1 << 1)/* rx pin */

                             | (0);/* clk pin */

/** - set SCI pins default output value */

sciREG1->DOUT = (0 << 2)/* tx pin */

                               | (0 << 1)/* rx pin */

                              | (0);/* clk pin */

/** - set SCI pins output direction */

sciREG1->DIR = (0 << 2)/* tx pin */

                             | (0 << 1)/* rx pin */

                           | (0);/* clk pin */

/** - set SCI pins open drain enable */

sciREG1->ODR = (0 << 2)/* tx pin */

                               | (0 << 1)/* rx pin */

                            |(0); * clk pin */

/** - set SCI pins pullup/pulldown enable */

sciREG1->PD = (0 << 2)/* tx pin */

                              |(0 << 1)/* rx pin */

                           |(0);/* clk pin */

/** - set SCI pins pullup/pulldown select */

sciREG1->PSL = (1 << 2)/* tx pin */

                               | (1 << 1)/* rx pin */

                                |       (1);/* clk pin */

/** - set interrupt level */

sciREG1->SETINTLVL = (0 << 26)/* Framing error */

                                           | (0 << 25)/* Overrun error */

                                           | (0 << 24)/* Pariry error */

                                           | (0 << 9)/* Receive */

                                           | (0 << 8)/* Transmit */

                                             | (0 << 1)/* Wakeup */

                                          | (0);/* Break detect */

/** - clear interrupt flags */

sciREG1->FLR = 0xFFFFFBFF;

/** - set interrupt enable */

sciREG1->SETINT = (0 << 26)/* Framing error */

                                   | (0 << 25)/* Overrun error */

                                  | (0 << 24) /* Pariry error */

                               | (0 << 9)/* Receive */

                               | (0 << 8)/* Transmit */

                             | (0 << 1)/* Wakeup */

                             | (0);/* Break detect */

/** - inialise global transfer variables */

g_sciTransfer[0].length = 0;

/** - Finaly start SCI1 */

sciREG1->GCR1 |= (1 << 7);

}

 

Regards,

Jonas

  • Hi Jonas,

    Which target are you using ? If you are using any TI supplied board please specify ?

    1. If the target SCI supports two SCI , check if your are connecting on the right SCI Pins.

    2. If your hw supports , connect SCI1 to SCI2 port and try to transmit from SCI2 to SCI1.

    -Pratip

  • Hi,

     

    I've checked everything there is no hw faults.  Why is the IDLE bit set? Characters are stremed to the Rx pin with 2 Mbit/s, before the TMS570 controller is started and during it executes. I guess that the Rx signal needs to be high 11 bit periods before the SCI can begin to receive characters (as stated in Ref manual page 537 rev C) . Is that correct? In that case thats the fault. Or can I configure the SCI to not have his synch period?

    Best regards

    Jonas

  • Hi Jonas,

    You cannot receive data unless SCI is sync'ed ( 11 bit periods).

    Some suggestions

    Option 1) Can you generate an 11Bit period (High ) in the bus through FPGA so that SCI gets Syn'ed.

    Option 2) You can setup a HANDshake from TMS570 ( Toggle an I/O pin after SCI IDLE bit is cleared ) to signal FPGA to start TX.

    There is no straight forward way which I can think to avoid Sync, I have forwarded your request to design team, I will get back to you as soon as I get some answers.

    Best Regards
    Prathap

     

     

  • Hi Jonas,

    Is your SCI synchronization issue with the FPGA resolved ?

    - Pratip

    ~~~ If a post answers your question, please mark it with the"Verify Answer" button. ~~~

  • Hi Pratip,

     

    Yes, you can close this ticket. Thanks.

    /Jonas