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.

LAUNCHXL-F28069M: TX Data Incorrect

Part Number: LAUNCHXL-F28069M

Tool/software:

First of all I'm just running the Example_2806xSci_Echoback example simplified and changed the jp6 and jp7 header to transmit uart to the gpio28 and gpio29 pins. 

My code is simple and is just getting the character from the buffer and printing it to the tx pin for verification.  I plan to use these values of the joystick from the RX pin to spin a motor at a certain speed.  But I need to verify that I'm getting the correct data

This is just the for loop of the echoback example.  Everything else is as it originally was.  I was thinking that maybe I had to parse each bit coming from the buffer and make it into an actual string. That is what the bottom commented code is. But then after stepping through breakpoints, I see that it seems like the whole number is coming through into the buffer as you can see in some of the pictures. Sometimes also the full number does not come through.  Like it is one part of it.  Like the ascii 50 which translates to the number 2  

 for(;;)
    {
        ReceivedChar = SciaRegs.SCIRXBUF.all;


        scia_xmit(ReceivedChar);

//        ReceivedChar = SciaRegs.SCIRXBUF.all;
//
//        int i = 0;
//        char str[25] = "";
//        str[i] = ReceivedChar;
//        ReceivedChar = SciaRegs.SCIRXBUF.all;
//        i++;
//
//        while(ReceivedChar != 0) {
//            ReceivedChar = SciaRegs.SCIRXBUF.all;
//            str[i] = ReceivedChar;
//            i++;
//        }
//
//        scia_msg(str);

        LoopCount++;
    }

Also when putting the ReceivedChar in the expressions window and putting on continuous refresh, the numbers just go from 48 to 57 which I am pretty sure are just the asii decimal version of the strings.  This does not make any sense though as when I put the logic analyzer directly on the rx pin it shows the 30000 or 0 or 60000 asii strings depending on where I move the joystick.  So, I am obviously missing something in translations writing it to TX output or how the SCIRXBUFF gets the information

 Setup of the boards

I have an ItsyBitsy NRF52840 that I connected to the LaunchXL-F28069M GPIO28 RX pin.  When I connect my logic analyzer to the rx pin

I see

which is perfect.  That's what I see in my putty terminals.  (Left is the Central board with the joystick connected and the right on is receiving the data and is writing it to the launchpad)

Unfortunately, when I connect the logic analyzer to the TX pin on the launchpad

and try to write to it and view it on the logic analyzer there is some garbage.  If you look close, you can see the 32200 ish number. This is the number range when the joystick is in the middle position. It is proceeded by a bunch of 2's in some cases and different kinds of numbers.  Not sure why.  Maybe cause I am not initializing a variable and there is some garbage coming in.

  • Hello,

    In the "for" loop, you should be sure to still wait to confirm there is valid data in the RX FIFO before reading it. The example does this with a simple "while" loop to wait until the RX FIFO Status = 1 to confirm there is 1 level of data in the RX FIFO. Only then does it move on the read the RXFIFO into the "ReceivedChar" variable:

        for(;;)
        {
            msg = "\r\nEnter a character: \0";
            scia_msg(msg);
    
            //
            // Wait for inc character
            //
            while(SciaRegs.SCIFFRX.bit.RXFFST !=1)
            {
                //
                // wait for XRDY =1 for empty state
                //
            }
    
            //
            // Get character
            //
            ReceivedChar = SciaRegs.SCIRXBUF.all;
    
            //
            // Echo character back
            //
            msg = "  You sent: \0";
            scia_msg(msg);
            scia_xmit(ReceivedChar);
    
            LoopCount++;
        }

    Please add this while loop in and let me know if the behavior changes. It would also be good to confirm that the unmodified version of the example is able to work fine for you too.

    Best Regards,

    Allison

  • Thank you Allison!!  Worked like a charm!!!!!