{"id":640,"date":"2021-12-20T04:39:31","date_gmt":"2021-12-20T04:39:31","guid":{"rendered":"https:\/\/blog.embeddedexpert.io\/?p=640"},"modified":"2021-12-30T03:48:22","modified_gmt":"2021-12-30T03:48:22","slug":"working-with-stm32f7-and-uart-part-1-sending-a-single-character","status":"publish","type":"post","link":"https:\/\/blog.embeddedexpert.io\/?p=640","title":{"rendered":"Working with STM32F7 and UART part 1: Sending a single character"},"content":{"rendered":"\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"441\" height=\"259\" src=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2021\/08\/UART-BUS-between-two-devices.jpg\" alt=\"\" class=\"wp-image-330\" srcset=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2021\/08\/UART-BUS-between-two-devices.jpg 441w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2021\/08\/UART-BUS-between-two-devices-300x176.jpg 300w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2021\/08\/UART-BUS-between-two-devices-400x235.jpg 400w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2021\/08\/UART-BUS-between-two-devices-250x147.jpg 250w\" sizes=\"(max-width: 441px) 100vw, 441px\" \/><figcaption>UART<\/figcaption><\/figure><\/div>\n\n\n\n<p>In this guide, we shall discuss how to use the UART module on STM32F7xx specifically, STM32F767ZI Nucleo.<\/p>\n\n\n\n<p>In this guide we will cover the following:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>What is UART<\/li><li>How to configure the UART on STM32F767Zi Nucleo<\/li><li>Code<\/li><li>Demo<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">1. What is UART<\/h2>\n\n\n\n<p>To transfer data, computers adopt two method: serial and parallel. In serial communication data is sent a bit at a time (1 line)while in parallel communication 8 or more lines are often used to transfer data. The UART is a form of serial communication. When distance is short, digital signal can be transferred as it is on a single wire and require no modulation. This is how PC keyboard transfer data between the keyboard and motherboard. For long distances like telephone lines, serial data communication requires a modem to modulate.We will not go into the details of this in this lesson, this shall be left for subsequent lessons.&nbsp;<\/p>\n\n\n\n<p><strong>Synchronous vs. Asynchronous<\/strong><\/p>\n\n\n\n<p>Serial communication operate in two ways : synchronous and asynchronous. In the synchronous mode, a block of data is sent at a time while in the asynchronous mode, a single byte of data is sent at a time. It is possible to write code to provide both the synchronous and asynchronous serial communication functions however this could turn out tedious and over complicated therefore, special chips are manufactured to perform these functions. When these chips are added to a microcontroller, they become known as Serial Communication Interface (SCI). The chip that provides the the asynchronous communication (<strong>UART<\/strong>) is the main theme of this lesson. The chip for synchronous communication is known as the&nbsp;<strong>USART<\/strong>&nbsp;and shall left for another lesson.&nbsp;<\/p>\n\n\n\n<p><strong>Asynchronous Communication Data Framing<\/strong><\/p>\n\n\n\n<p>The data is received in zeros and ones format, in order to make sense of the data, the sender and the receiver must agree on a set of rules i.e. a protocol, on how data is packed, how many bits constitute a character and when data begins and ends.<\/p>\n\n\n\n<p><strong>The Protocol<\/strong><\/p>\n\n\n\n<ol class=\"wp-block-list\"><li><strong>Start and Stop bits<\/strong><\/li><\/ol>\n\n\n\n<p>Asynchronous serial communication is widely used in character transfer. Each character is packed between start and stop bits. This is known as the framing.<\/p>\n\n\n\n<p><strong>start bit<\/strong>&nbsp;: &nbsp;Always&nbsp;<strong>1<\/strong>&nbsp;bit, value is always&nbsp;<strong>0<\/strong><\/p>\n\n\n\n<p><strong>stop bit<\/strong>: &nbsp;<strong>&nbsp;1<\/strong>&nbsp;or&nbsp;<strong>2<\/strong>&nbsp;bits, value is always<strong>&nbsp;1<\/strong><\/p>\n\n\n\n<p>Lets take an example. Lets say we are transferring ASCII character \u2018A\u2019&nbsp;<\/p>\n\n\n\n<p>its binary code is 0100 0001 and 0x41 in hex.Furthermore, it is framed between a start bit and 2 stop bits. This is what its frame will look like.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/bohobiom.com\/wp-content\/uploads\/2020\/01\/1frame-750x234-1.png\" alt=\"\" \/><\/figure>\n\n\n\n<p>&nbsp;2.<strong>&nbsp;Parity bit<\/strong><\/p>\n\n\n\n<p>Some systems require parity bit in order to maintain data integrity.The parity bit of a character byte is included in the data frame after the stop bit(s).<\/p>\n\n\n\n<p>&nbsp;3.<strong>Rate of data transfer : Baud rate\/bps<\/strong><\/p>\n\n\n\n<p>We shall explain this concept with an example. Lets say we are asked to calculate the number of bits used &nbsp;and time taken in transferring 50 pages of text, each with 80\u00d725 characters. Assuming 8 bits per character and 1 stop bit<\/p>\n\n\n\n<p><em>solution<\/em><\/p>\n\n\n\n<p>For each character a total of 10 bits is used ( 1 start bit, 8 bits character, 1 stop bit).<\/p>\n\n\n\n<p>Therefore total number of bits &nbsp;=&nbsp;80 x 25 x10 = 20,000 bits per page<\/p>\n\n\n\n<p>50 pages &nbsp;implies,&nbsp;50\u00d720,000 &nbsp;= &nbsp;1,000,000 bits.<\/p>\n\n\n\n<p>Therefore it will take 1 million bits to transfer &nbsp;this information.<\/p>\n\n\n\n<p>The time it takes to transfer the entire data using<\/p>\n\n\n\n<p><strong>a<\/strong>. 9600 baudrate implies, &nbsp;1,000,000 \/ 9600 = 204 seconds<\/p>\n\n\n\n<p><strong>b<\/strong>. 57,600 baudrate implies&nbsp;1,000,000 \/57,600 = 17 seconds<\/p>\n\n\n\n<p>Baudrate simply means the transfer of bits per second. There are various standardized baudrate we can choose from when we program our serial communication devices. &nbsp;The key thing is, both communication devices must have the same baudrate. We shall see this later on in our example code.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">2. How to Configure UART on STM32F767Z Nucleo-144<\/h2>\n\n\n\n<p><\/p>\n\n\n\n<p>First things first, we need to figure out which USART is connected to the built-in ST-Link V2\/1<\/p>\n\n\n\n<p>We can find this information from the reference manual of Nucleo-144 <\/p>\n\n\n\n<p>According to the section of hardware layout, PD8 and PD9 is connected to ST-link V2\/1 and they are related to USART3 in our case.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"413\" src=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2021\/12\/Screen-Shot-2021-12-20-at-7.16.31-AM-1024x413.png\" alt=\"\" class=\"wp-image-641\" srcset=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2021\/12\/Screen-Shot-2021-12-20-at-7.16.31-AM-1024x413.png 1024w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2021\/12\/Screen-Shot-2021-12-20-at-7.16.31-AM-300x121.png 300w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2021\/12\/Screen-Shot-2021-12-20-at-7.16.31-AM-768x310.png 768w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2021\/12\/Screen-Shot-2021-12-20-at-7.16.31-AM-1536x620.png 1536w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2021\/12\/Screen-Shot-2021-12-20-at-7.16.31-AM-1150x464.png 1150w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2021\/12\/Screen-Shot-2021-12-20-at-7.16.31-AM-750x303.png 750w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2021\/12\/Screen-Shot-2021-12-20-at-7.16.31-AM-400x161.png 400w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2021\/12\/Screen-Shot-2021-12-20-at-7.16.31-AM-250x101.png 250w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2021\/12\/Screen-Shot-2021-12-20-at-7.16.31-AM.png 1646w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Hence we need to enable clock access to USART3<\/p>\n\n\n\n<p>Before we enable clock access to USART3, we need to configure PD8 as alternate function and enable clock access to port D<\/p>\n\n\n\n<p>We can enable clock access as following (how enable locate the clock source and enable clock access can be found <a href=\"https:\/\/blog.embeddedexpert.io\/?p=514\" data-type=\"URL\" data-id=\"https:\/\/blog.embeddedexpert.io\/?p=514\" target=\"_blank\" rel=\"noreferrer noopener\">here<\/a>):<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csrc&quot;,&quot;theme&quot;:&quot;dracula&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;C&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;c&quot;}\">RCC-&gt;AHB1ENR|=RCC_AHB1ENR_GPIODEN;<\/pre><\/div>\n\n\n\n<p>Then we set the PD8 and alternate function (refer to this <a href=\"https:\/\/blog.embeddedexpert.io\/?p=562\" data-type=\"URL\" data-id=\"https:\/\/blog.embeddedexpert.io\/?p=562\" target=\"_blank\" rel=\"noreferrer noopener\">topic<\/a> for how set the alternate function)<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csrc&quot;,&quot;theme&quot;:&quot;dracula&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;C&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;c&quot;}\">GPIOD-&gt;MODER|=GPIO_MODER_MODER8_1;<\/pre><\/div>\n\n\n\n<p>Now we need to figure out which alternate function.<\/p>\n\n\n\n<p>We can refer to the datasheet of the STM32F767, pinout section, we can find a table that represents the alternate function<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"687\" src=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2021\/12\/Screen-Shot-2021-12-20-at-7.26.31-AM-1024x687.png\" alt=\"\" class=\"wp-image-642\" srcset=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2021\/12\/Screen-Shot-2021-12-20-at-7.26.31-AM-1024x687.png 1024w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2021\/12\/Screen-Shot-2021-12-20-at-7.26.31-AM-300x201.png 300w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2021\/12\/Screen-Shot-2021-12-20-at-7.26.31-AM-768x515.png 768w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2021\/12\/Screen-Shot-2021-12-20-at-7.26.31-AM-1536x1030.png 1536w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2021\/12\/Screen-Shot-2021-12-20-at-7.26.31-AM-2048x1373.png 2048w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2021\/12\/Screen-Shot-2021-12-20-at-7.26.31-AM-1150x771.png 1150w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2021\/12\/Screen-Shot-2021-12-20-at-7.26.31-AM-750x503.png 750w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2021\/12\/Screen-Shot-2021-12-20-at-7.26.31-AM-400x268.png 400w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2021\/12\/Screen-Shot-2021-12-20-at-7.26.31-AM-250x168.png 250w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Since USART is AF7, we can use small define statement to hold this <\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csrc&quot;,&quot;theme&quot;:&quot;dracula&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;C&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;c&quot;}\">#define AF07 0x07<\/pre><\/div>\n\n\n\n<p>Since PD8 is part of alternate function register high, we can set it as following:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csrc&quot;,&quot;theme&quot;:&quot;dracula&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;C&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;c&quot;}\">GPIOD-&gt;AFR[1]|=(AF07&lt;&lt;0);<\/pre><\/div>\n\n\n\n<p>The GPIO configuration is completed, we can go ahead and configure the USART<\/p>\n\n\n\n<p>First we enable clock access as following:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csrc&quot;,&quot;theme&quot;:&quot;dracula&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;C&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;c&quot;}\">RCC-&gt;APB1ENR|=RCC_APB1ENR_USART3EN;<\/pre><\/div>\n\n\n\n<p>then we can set the baudrate<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csrc&quot;,&quot;theme&quot;:&quot;dracula&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;C&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;c&quot;}\">USART3-&gt;BRR    = 0x008B; \/\/ baud rate 115200 @16MHz<\/pre><\/div>\n\n\n\n<p>Then we enable only the TX part<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csrc&quot;,&quot;theme&quot;:&quot;dracula&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;C&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;c&quot;}\">USART3-&gt;CR1|=USART_CR1_TE; \/\/enbale TX<\/pre><\/div>\n\n\n\n<p>and finally we can enable the module<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csrc&quot;,&quot;theme&quot;:&quot;dracula&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;C&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;c&quot;}\">USART3-&gt;CR1|=USART_CR1_UE;<\/pre><\/div>\n\n\n\n<p>for writing a single character, we can use small function for that<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csrc&quot;,&quot;theme&quot;:&quot;dracula&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;C&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;c&quot;}\">void uart2_write(unsigned char x)\n{\n\nUSART3-&gt;TDR =(x); \/\/send data to the buffer\nwhile(!((USART3-&gt;ISR)&amp;USART_ISR_TC)){;} \/\/wait untill the transfer completed \n}<\/pre><\/div>\n\n\n\n<p>Hence, the entire code as following:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csrc&quot;,&quot;theme&quot;:&quot;dracula&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;C&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;c&quot;}\">#include &quot;stm32f7xx.h&quot;                  \/\/ Device header\n\n\/\/PD8 for USART3 TX\n\nvoid uart2_write(unsigned char x)\n{\n\nUSART3-&gt;TDR =(x);\nwhile(!((USART3-&gt;ISR)&amp;USART_ISR_TC)){;}\n}\n\nint main(void)\n\t{\n\t\t\n\t\t\/\/Configure GPIOD PD8 as TX pin\n\t\tRCC-&gt;AHB1ENR|=RCC_AHB1ENR_GPIODEN;\n\t\tGPIOD-&gt;MODER|=GPIO_MODER_MODER8_1;\n\t\t#define AF07 0x07\n\t\tGPIOD-&gt;AFR[1]|=(AF07&lt;&lt;0);\n\t\t\n\t\t\/\/Configure the UART\n\t\t\n\t\tRCC-&gt;APB1ENR|=RCC_APB1ENR_USART3EN;\n\t\tUSART3-&gt;BRR    = 0x008B; \/\/ baud rate 115200 @16MHz\n\t\tUSART3-&gt;CR1    = 0; \/\/ Enable Tx and Rx and Enable USART2\n\t\tUSART3-&gt;CR1|=USART_CR1_TE; \/\/enbale TX\t\n\t\tUSART3-&gt;CR1|=USART_CR1_UE;\n\t\t\n\twhile(1)\n\t{\n\t\tuart2_write('a');\n\t\tuart2_write('\\r');\n\t\tuart2_write('\\n');\n\t\tfor(volatile int i=0;i&lt;100000;i++);\n\t\t\n\t}\n\t\n\t\n\t}\n<\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">3. Demo:<\/h2>\n\n\n\n<p>Once the code is compiled and uploaded, open teraterm or your favourite serial terminal and set the baudare to 115200<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"532\" src=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2021\/12\/Screen-Shot-2021-12-20-at-7.38.00-AM-1024x532.png\" alt=\"\" class=\"wp-image-643\" srcset=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2021\/12\/Screen-Shot-2021-12-20-at-7.38.00-AM-1024x532.png 1024w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2021\/12\/Screen-Shot-2021-12-20-at-7.38.00-AM-300x156.png 300w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2021\/12\/Screen-Shot-2021-12-20-at-7.38.00-AM-768x399.png 768w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2021\/12\/Screen-Shot-2021-12-20-at-7.38.00-AM-1150x598.png 1150w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2021\/12\/Screen-Shot-2021-12-20-at-7.38.00-AM-750x390.png 750w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2021\/12\/Screen-Shot-2021-12-20-at-7.38.00-AM-400x208.png 400w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2021\/12\/Screen-Shot-2021-12-20-at-7.38.00-AM-250x130.png 250w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2021\/12\/Screen-Shot-2021-12-20-at-7.38.00-AM.png 1316w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this guide, we shall discuss how to use the UART module on STM32F7xx specifically, STM32F767ZI Nucleo. In this guide we will cover the following: What is UART How to configure the UART on STM32F767Zi Nucleo Code Demo 1. What is UART To transfer data, computers adopt two method: serial and parallel. In serial communication [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,11,12],"tags":[],"class_list":["post-640","post","type-post","status-publish","format-standard","hentry","category-embedded-systems","category-peripheral-drivers","category-stm32"],"_links":{"self":[{"href":"https:\/\/blog.embeddedexpert.io\/index.php?rest_route=\/wp\/v2\/posts\/640"}],"collection":[{"href":"https:\/\/blog.embeddedexpert.io\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.embeddedexpert.io\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.embeddedexpert.io\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.embeddedexpert.io\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=640"}],"version-history":[{"count":3,"href":"https:\/\/blog.embeddedexpert.io\/index.php?rest_route=\/wp\/v2\/posts\/640\/revisions"}],"predecessor-version":[{"id":672,"href":"https:\/\/blog.embeddedexpert.io\/index.php?rest_route=\/wp\/v2\/posts\/640\/revisions\/672"}],"wp:attachment":[{"href":"https:\/\/blog.embeddedexpert.io\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=640"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.embeddedexpert.io\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=640"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.embeddedexpert.io\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=640"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}