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.

SCI DATA ACQUSITION PROBLEM (F2806X)



I searched all of the community but couldn't find any answer.

I have a F2806x MCU.
I have a serial peripheral unit that sends data wtih command. It sends data
that compose of bytes. For example; If I send command 0xCE it should
response with echo of my command and the data as follows:

Command: 0xCE

Response:

Byte1: 0xCE (the echo of the command)

Byte 2-5: temperature

Byte 6-9: pressure

Byte 10-13: moisture

Byte 14-17: Timer

Byte 18-19: Checksum

Here, for example, I need the pressure data that consist of 4 byte(32bit).
How can I extract this data from sci. When I write an sci communication
code I only receives 1Byte(8bit) data in sci buffer.(I see in watch window).

My code is compose of known sci code examples.

(I use SCI channel B. And I tested the code examples in the control suite, they works well.)

  • Hello,

    I suggest you to use some protocol communication for this.

    Maybe you can use Modbus RTU (RS485)?

    In this case, you can know which buffer contains what data so you can parse them in your code.

    You can see the example of Modbus RTU from here https://github.com/brnluiz/2833xFreeModbus

    And you need to modify your hardware a little.

    Sorry that I cannot share you my Modbus HW or SW because they are company proprietary.

    Another suggestion is to make a buffer that will be filled by all data that you (will) need.

    For example, one buffer[19] for 19 bytes data, and you should read all 19 bytes data to fill the buffer (even if you don't need it).

    You will only parse the data that you need for example buffer[6] until buffer[9] to get the pressure data.

    Good luck!

    Best regards,

    Maria