Search code examples
stm32avrusartcubemxstm32cubemx

how to do USART communication please tell me everything which should be taken care to do usart communication



I am Using Atollic and cubemx on ubuntu.



Solution

  • Your question deserves a tutorial by its own, but in short you need to

    1. Define the pins for both RX and TX
    2. Define your protocol options [ baud rate, parity, crc..]
    3. Calculate the prescaleers (USARTDIV) according to you src clock and baudrate
    4. define whether or not you need interrupts for reception or transmission

    Please take a look to the book Mastering STM32 by Carmine Noviello. Also read the section of STM32 user manual Page 785 chapter 27