Connect with us

SCI works fine in loopback mode but in normal mode it doesn't

Discussion in 'Microcontrollers, Programming and IoT' started by Sailesh, Apr 14, 2016.

Scroll to continue with content
  1. Sailesh

    Sailesh

    5
    0
    Apr 14, 2016
    We implemented a SCI for TMS320F28835 TI microcontroller.
    In loopback mode SCI working properly but when in normal mode it doesn't trigger receive
    interrupt and even oscilloscope also not showing any signal on SCITx pin.

    Micro controller supports 3 SCI for testing purpose we made connected SCI-B TX to
    SCI-C Rx( Implemented device driver in which SCI-B will be sending some data and
    SCI-C suppose to receive).

    SCI-B TxINT is getting trigger when we sends but SCI-C RxINT doesnot triggering.
    Even TXGpio also not showing of signal in oscilloscope.
    SCI code is attached with post

    Need help please reply if you have any idea about problem.
     

    Attached Files:

  2. Amar Dhore

    Amar Dhore

    129
    12
    Dec 2, 2015
    1. In your code, Where are you enabling RX and TX.
    2. what is your Baud Rate?

    May be instead of trying interrupt mode, you should try first with polling, then go from there to interrupt mode.

    This might be a helpful document: http://www.ti.com/lit/ug/sprufz5a/sprufz5a.pdf
     
    Sailesh likes this.
  3. Sailesh

    Sailesh

    5
    0
    Apr 14, 2016
    Thanks Amar.

    I used same pdf for implementing and its not working polling also I tried which is not working.
    Baud rate 100K . BRR as 30

    Do we have some range of Baud rate for SCI ?
     
  4. Amar Dhore

    Amar Dhore

    129
    12
    Dec 2, 2015
  5. Sailesh

    Sailesh

    5
    0
    Apr 14, 2016
    I am trying with 115200 baud rate and BRR is 26. CPU freq 100MHZ.

    Sorry in hurry and tension I have written wrong
     
  6. Sailesh

    Sailesh

    5
    0
    Apr 14, 2016
    I changed baud rate to 9600 and BRR is 0x144. CPU freq 100MHZ.

    I tried with SCI adapter which connect with system's hyper terminal.
    Ones I tried with RX INT and once polling but nothing is working.

    I don't know whats going wrong ?
     

    Attached Files:

  7. Amar Dhore

    Amar Dhore

    129
    12
    Dec 2, 2015
    in here:
    void SciA_Transmit(int data)
    {
    while (SciaRegs.SCIFFTX.bit.TXFFST != 0) {} //Why are you doing this??

    // Check if TXRDY is high
    SciaRegs.SCITXBUF=data;
    //wait for TXRDY to go low

    }



    Few more things:
    1. Enable TXENA
    2. Write to SCITXBUF, then the transmitter is no longer empty, and check if TXRDY goes low.
    3. If TXRDY goes low, then transmission w2as successful, you can transmit the next byte.
    4. I am not sure if yo have to set TXWAKE before you Transmit. Check the specs.
     
  8. Sailesh

    Sailesh

    5
    0
    Apr 14, 2016
    Thanking you for great support.

    Problem was EALLOW was needed for GPIOs

    like below:

    void Gpio_SciA_init(void)
    {
    EALLOW;
    GpioCtrlRegs.GPBPUD.bit.GPIO35 = 0; // Enable pull-up for GPIO22 (SCITXDA)
    GpioCtrlRegs.GPAPUD.bit.GPIO28 = 0; // Enable pull-up for GPIO23 (SCIRXDA)

    GpioCtrlRegs.GPAQSEL2.bit.GPIO28 = 3; // Asynch input GPIO23 (SCIRXDA)

    GpioCtrlRegs.GPBMUX1.bit.GPIO35 = 1; // Configure GPIO29 for SCITXDA operation
    GpioCtrlRegs.GPAMUX2.bit.GPIO28 = 1; // Configure GPIO28 for SCIRXDA operation
    EDIS;
    }
     
  9. Amar Dhore

    Amar Dhore

    129
    12
    Dec 2, 2015
    Great....Glad its working now..
     
    Sailesh likes this.
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-