How the UART T/RX send 8 byte data ?

Jeff_wu
Jeff_wu Altair Community Member
edited July 2022 in Community Q&A

Hi Team,

I tying to drive the stepper motor driver IC ( TMC2208) by using UART, according to spec rules I have to send out 8 byte and 16 bites (start & stop bite per byte) a total of 80 bites . But I have no idea how to set UART config in Embed, could anyone help me ? Thank you !

image

image

Answers

  • Girish Karamadi_21849
    Girish Karamadi_21849 New Altair Community Member
    edited July 2022

    Hi Robbert,

    You can use serial read/write and serial config blocks to send the data with required configuration. These blocks are present under each targets under Embedded Menu.

    Looking at the sequence of the data you mentioned you can use the "case" block to send it sequentially.

    For instance for TI target- F28069M I have attached the Embed diagram which send the data serially with the baudrate of 9600. You can replicate the same for your target.

    image

    On the other hand if you are using arduino libraries for motor driver IC then you can use extern blocks to reuse the code from the Arduino.

    Examples on how to use arduino code in Embed can be found under Examples>>Embedded>>Arduino>>External library import.

     

    Regards,

    Girish