Quantcast
Channel: Forums - Recent Threads
Viewing all articles
Browse latest Browse all 262198

CCS/LAUNCHXL-F28379D: SCI Reading Issues

$
0
0

Part Number: LAUNCHXL-F28379D

Tool/software: Code Composer Studio

Good afternoon,

It took a lot of work but I was finally able to communicate between my PC with a serial adaptor and the dev board. I am now trying to take in the data that is being sent through TR on the PC to the RX on the board. I have it set up to work with interrupts and it is firing. I am having some weird behavior in that the code will either read in a digit number or a char* but not both. I am going to need to be able to read in both because strings and numbers will be used to configure the device. 

Example code is below that shows how I am trying to sort the incoming data. This is in the RX ISR

 receivedChar = SCI_readCharBlockingFIFO(SCIB_BASE);

    if (receivedChar != NULL)

    {
        // TODO make it check for char or int and convert accordingly and store it

        // if its is a digit

        if (isdigit(receivedChar) || receivedChar == ".")

        {
            digitArray[count] = receivedChar - '0';
        }

        // if its is a character

        else if (isalpha(receivedChar) || receivedChar == '-')
        {
            charArray[count] = receivedChar;
        }

Like I said if I put just characters it reads fine or digits but not if the file is sending both. It is also very difficult to debug because I am running the transmission code from python using pyserial and receiving it with ccs on the dev board. I also tried adding a delay between each send of data thinking it needed it. 


Viewing all articles
Browse latest Browse all 262198

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>