{"id":4359,"date":"2020-12-17T07:07:09","date_gmt":"2020-12-17T07:07:09","guid":{"rendered":"http:\/\/fastbitlab.com\/?p=4359"},"modified":"2023-09-07T14:28:39","modified_gmt":"2023-09-07T08:58:39","slug":"stm32-i2c-lecture-33-exercise-reading-data-from-the-i2c-slave","status":"publish","type":"post","link":"https:\/\/fastbitlab.com\/blog\/stm32-i2c-lecture-33-exercise-reading-data-from-the-i2c-slave\/","title":{"rendered":"STM32 I2C Lecture 33 &#8211; Exercise: Reading data from the I2C slave"},"content":{"rendered":"<div class=\"boldgrid-section\" style=\"background-image: linear-gradient(to left, #eeeeee, #eeeeee);\" data-bg-color-1=\"#EEEEEE\" data-bg-color-2=\"#EEEEEE\" data-bg-direction=\"to left\">\n<div class=\"container\">\n<div class=\"row\" style=\"padding-top: 50px; padding-bottom: 50px; background-image: linear-gradient(to left, #eeeeee, #eeeeee);\" data-bg-color-1=\"#EEEEEE\" data-bg-color-2=\"#EEEEEE\" data-bg-direction=\"to left\">\n<div class=\"col-md-1 col-sm-12 col-xs-12 col-lg-1\">\n<p>&nbsp;<\/p>\n<\/div>\n<div class=\"col-md-10 col-sm-12 col-xs-12 col-lg-10\">\n<h1 class=\"\" style=\"text-align: center; border-width: 0px; font-size: 34px; line-height: 50px;\"><span style=\"color: #000080;\">Exercise: Reading data from the I2C slave<\/span><\/h1>\n<div class=\"row bg-editor-hr-wrap\">\n<div class=\"col-lg-12 col-md-12 col-xs-12 col-sm-12\">\n<div>\n<div class=\"bg-hr bg-hr-10\" style=\"border-style: solid; border-width: 0px 0px 3px; color: rgba(11, 34, 151, 0.9);\"><\/div>\n<p>&nbsp;<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">Let\u2019s do the I2C master and slave communication exercise in order to understand the master receiving data from the slave. <\/span><\/p>\n<p class=\"\" style=\"font-size: 23px; border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; line-height: 35px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"text-decoration: underline; color: #000080;\"><b>Exercise:<\/b><\/span><\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">When a button on the master is pressed, the master should read and display data from Arduino slave connected. First, the master has to get the length of the data from the slave to read subsequent data from the slave.<\/span><\/p>\n<ol class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\">\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400; color: #000000;\">Use I2C SCL=100KHz (Standard mode).<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400; color: #000000;\">Use internal pull resistors for SDA and SCL lines.<\/span><\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<p class=\"\" style=\"font-size: 23px; border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; line-height: 35px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"color: #000080;\"><b>Things you need for exercise:<\/b><\/span><\/p>\n<ol class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\">\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400; color: #000000;\">Arduino board, which acts as a slave device.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400; color: #000000;\">ST board, which acts as a master device.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400; color: #000000;\">Some jumper wires to connect I2C pins.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400; color: #000000;\">Breadboard<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"color: #000000;\"><span style=\"font-weight: 400;\">2 Pull up resistors of value 407K<\/span><span style=\"font-weight: 400;\">\u03a9 (only if your pin doesn\u2019t support internal pull-up resistors)<\/span><\/span><\/li>\n<\/ol>\n<p class=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">1. Circuit connection for this exercise is as shown in Figure 1.<\/span><\/p>\n<figure id=\"attachment_4361\" aria-describedby=\"caption-attachment-4361\" style=\"width: 741px\" class=\"wp-caption aligncenter\"><img fetchpriority=\"high\" decoding=\"async\" class=\" wp-image-4361\" src=\"http:\/\/fastbitlab.com\/wp-content\/uploads\/2020\/12\/Figure-1-20.png\" alt=\"\" width=\"741\" height=\"279\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2020\/12\/Figure-1-20.png 1167w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2020\/12\/Figure-1-20-300x113.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2020\/12\/Figure-1-20-768x289.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2020\/12\/Figure-1-20-1024x385.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2020\/12\/Figure-1-20-600x226.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2020\/12\/Figure-1-20-120x45.png 120w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2020\/12\/Figure-1-20-500x188.png 500w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2020\/12\/Figure-1-20-200x75.png 200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2020\/12\/Figure-1-20-400x150.png 400w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2020\/12\/Figure-1-20-800x301.png 800w\" sizes=\"(max-width: 741px) 100vw, 741px\" \/><figcaption id=\"caption-attachment-4361\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 1. Circuit connection for I2C master and I2C slave communication.<\/span><\/figcaption><\/figure>\n<p class=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">Connect the ST board to the Arduino board through I2C pins and data will be read from the slave to the master. Then the master has to print the received data over the semi hosting.<\/span><\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">Figure 2 shows the connection of the Arduino board with the ST board SPI pins. Don\u2019t use the PB9 here; instead, use PB7 because we have faced some issues with the PB9 in our previous exercise.<\/span><\/p>\n<p class=\"\">&nbsp;<\/p>\n<figure id=\"attachment_4362\" aria-describedby=\"caption-attachment-4362\" style=\"width: 715px\" class=\"wp-caption aligncenter\"><img decoding=\"async\" class=\" wp-image-4362\" src=\"http:\/\/fastbitlab.com\/wp-content\/uploads\/2020\/12\/Figure-2-18.png\" alt=\"\" width=\"715\" height=\"376\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2020\/12\/Figure-2-18.png 1637w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2020\/12\/Figure-2-18-300x158.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2020\/12\/Figure-2-18-768x403.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2020\/12\/Figure-2-18-1024x538.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2020\/12\/Figure-2-18-600x315.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2020\/12\/Figure-2-18-120x63.png 120w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2020\/12\/Figure-2-18-500x263.png 500w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2020\/12\/Figure-2-18-200x105.png 200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2020\/12\/Figure-2-18-400x210.png 400w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2020\/12\/Figure-2-18-800x420.png 800w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2020\/12\/Figure-2-18-1200x630.png 1200w\" sizes=\"(max-width: 715px) 100vw, 715px\" \/><figcaption id=\"caption-attachment-4362\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 2. Connection of Arduino board with the ST board SPI pins.<\/span><\/figcaption><\/figure>\n<p class=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">The user button is used to initiate the I2C transactions and also you can use USB logic analyzer if you want.<\/span><\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; line-height: 30px; font-size: 17px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"color: #000000;\"><span style=\"font-weight: 400;\">2.&nbsp;<\/span><span style=\"font-weight: 400;\">Power your Arduino board and download the I2C slave sketch to Arduino, and the sketch name is 002I2CSlaveTxString.ino. In order to perform this exercise, the slave device or Arduino board should be ready with the sketch.<\/span><\/span><\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">3. The procedure to read the data from the Arduino Slave is shown in Figure 3.<\/span><\/p>\n<div class=\"mceTemp\"><\/div>\n<figure id=\"attachment_4363\" aria-describedby=\"caption-attachment-4363\" style=\"width: 725px\" class=\"wp-caption aligncenter\"><img decoding=\"async\" class=\"wp-image-4363\" src=\"http:\/\/fastbitlab.com\/wp-content\/uploads\/2020\/12\/Figure-3-18.png\" alt=\"Reading data from the I2C slave\" width=\"725\" height=\"275\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2020\/12\/Figure-3-18.png 1491w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2020\/12\/Figure-3-18-300x114.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2020\/12\/Figure-3-18-768x291.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2020\/12\/Figure-3-18-1024x388.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2020\/12\/Figure-3-18-600x227.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2020\/12\/Figure-3-18-120x45.png 120w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2020\/12\/Figure-3-18-500x189.png 500w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2020\/12\/Figure-3-18-200x76.png 200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2020\/12\/Figure-3-18-400x152.png 400w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2020\/12\/Figure-3-18-800x303.png 800w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2020\/12\/Figure-3-18-1200x455.png 1200w\" sizes=\"(max-width: 725px) 100vw, 725px\" \/><figcaption id=\"caption-attachment-4363\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 3. Procedure to read the data from the Arduino Slave.<\/span><\/figcaption><\/figure>\n<p class=\"\">&nbsp;<\/p>\n<ul class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\">\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400; color: #000000;\"><span style=\"font-weight: 400;\">The<\/span> Arduino I2C sketch is written in such a fashion that you should send commands to get the response.&nbsp;<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400; color: #000000;\">First, the master should send command code 0x51 to read the length of the data from the slave because the master should have some idea about the length. The master should send the command 0x51 to the slave to fetch one byte of length information.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400; color: #000000;\">After that master should send the command code 0x52 to read the complete data from the slave.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400; color: #000000;\">The master has to display that data using semi hosting.<\/span><\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">Now let\u2019s see how to execute these procedures. Let\u2019s understand I2C transactions to read the 1-byte length information from the slave.<\/span><\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"color: #000000;\"><span style=\"color: #ff0000;\"><strong>1. Master should send a command to slave<\/strong><\/span><span style=\"font-weight: 400;\"><span style=\"color: #ff0000;\"><strong>&nbsp;(Figure 4):<\/strong> <\/span>Here, the master performs data write. That is master sending command code 0x51, which is the write operation to the slave, and the R\/W position will be zero.<\/span><\/span><\/p>\n<figure id=\"attachment_4364\" aria-describedby=\"caption-attachment-4364\" style=\"width: 694px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-4364\" src=\"http:\/\/fastbitlab.com\/wp-content\/uploads\/2020\/12\/Figure-4-14.png\" alt=\"Reading data from the I2C slave\" width=\"694\" height=\"223\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2020\/12\/Figure-4-14.png 1705w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2020\/12\/Figure-4-14-300x96.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2020\/12\/Figure-4-14-768x246.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2020\/12\/Figure-4-14-1024x329.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2020\/12\/Figure-4-14-600x192.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2020\/12\/Figure-4-14-120x38.png 120w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2020\/12\/Figure-4-14-500x160.png 500w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2020\/12\/Figure-4-14-200x64.png 200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2020\/12\/Figure-4-14-400x128.png 400w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2020\/12\/Figure-4-14-800x257.png 800w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2020\/12\/Figure-4-14-1200x385.png 1200w\" sizes=\"(max-width: 694px) 100vw, 694px\" \/><figcaption id=\"caption-attachment-4364\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 4. Master sending the command to the slave.<\/span><\/figcaption><\/figure>\n<p>&nbsp;<\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"color: #000000;\"><span style=\"color: #ff0000;\"><b>2. Master reads the response from the slave<\/b><\/span><span style=\"font-weight: 400;\"><span style=\"color: #ff0000;\">&nbsp;<\/span>(Figure 5): The master reads the length information from the slave as a response. For this I2C transaction, the master makes R\/W bit as 1 since it reads 1 byte of data from the slave.<\/span><\/span><\/p>\n<figure id=\"attachment_4365\" aria-describedby=\"caption-attachment-4365\" style=\"width: 711px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-4365\" src=\"http:\/\/fastbitlab.com\/wp-content\/uploads\/2020\/12\/Figure-5-10.png\" alt=\"Reading data from the I2C slave\" width=\"711\" height=\"221\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2020\/12\/Figure-5-10.png 1749w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2020\/12\/Figure-5-10-300x93.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2020\/12\/Figure-5-10-768x239.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2020\/12\/Figure-5-10-1024x319.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2020\/12\/Figure-5-10-600x187.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2020\/12\/Figure-5-10-120x37.png 120w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2020\/12\/Figure-5-10-500x156.png 500w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2020\/12\/Figure-5-10-200x62.png 200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2020\/12\/Figure-5-10-400x125.png 400w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2020\/12\/Figure-5-10-800x249.png 800w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2020\/12\/Figure-5-10-1200x374.png 1200w\" sizes=\"(max-width: 711px) 100vw, 711px\" \/><figcaption id=\"caption-attachment-4365\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 5. Master reading response from the slave.<\/span><\/figcaption><\/figure>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">Here we are going to use two I2C transactions. The first transaction is data write that is master sending the command and the second transaction is data read that is master reading one byte of data from the slave, which is nothing but length information.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 18px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: bold; color: #ff0000;\">3. I2C transactions to read \u201clength\u201d bytes of data from the slave:<\/span><\/p>\n<ul class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\">\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400; color: #000000;\">The master has to send the command 0x52 to the slave, indicating that the slave should send the data to the master (Figure 4).<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400; color: #000000;\">The next I2C transaction is a data read (Figure 6). The master is reading the response from the slave. In Figure 6, N is the length, which is fetched in the earlier transaction. In the data read, the master receives all the bytes from the slave.<\/span><\/li>\n<\/ul>\n<figure id=\"attachment_4366\" aria-describedby=\"caption-attachment-4366\" style=\"width: 690px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-4366\" src=\"http:\/\/fastbitlab.com\/wp-content\/uploads\/2020\/12\/Figure-6-10.png\" alt=\"Reading data from the I2C slave\" width=\"690\" height=\"219\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2020\/12\/Figure-6-10.png 1715w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2020\/12\/Figure-6-10-300x95.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2020\/12\/Figure-6-10-768x244.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2020\/12\/Figure-6-10-1024x325.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2020\/12\/Figure-6-10-600x191.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2020\/12\/Figure-6-10-120x38.png 120w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2020\/12\/Figure-6-10-500x159.png 500w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2020\/12\/Figure-6-10-200x64.png 200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2020\/12\/Figure-6-10-400x127.png 400w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2020\/12\/Figure-6-10-800x254.png 800w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2020\/12\/Figure-6-10-1200x381.png 1200w\" sizes=\"(max-width: 690px) 100vw, 690px\" \/><figcaption id=\"caption-attachment-4366\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 6. Transaction diagram for data read.<\/span><\/figcaption><\/figure>\n<p class=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"color: #000000;\">In the following article, let&#8217;s write the <\/span><span style=\"color: #0000ff;\"><a style=\"color: #0000ff; text-decoration: underline;\" href=\"http:\/\/fastbitlab.com\/exercise-coding-part-1-2\/\" target=\"_blank\" rel=\"noopener\">code<\/a>.<\/span><\/p>\n<p class=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 20px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"color: #000080;\"><b>FastBit Embedded Brain Academy Courses,<\/b><\/span><\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"color: #000000;\">Click here:<\/span>&nbsp;<span style=\"color: #0000ff;\"><a style=\"color: #0000ff; text-decoration: underline;\" href=\"http:\/\/fastbitlab.com\/course1\" target=\"_blank\" rel=\"noopener\">http:\/\/fastbitlab.com\/course1<\/a><\/span><\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; Exercise: Reading data from the I2C slave &nbsp; Let\u2019s do the I2C master and slave communication exercise in order to understand the master receiving data from the slave. Exercise: When a button on the master is pressed, the master should read and display data from Arduino slave connected. First, the master has to get [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":4361,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ocean_post_layout":"","ocean_both_sidebars_style":"","ocean_both_sidebars_content_width":0,"ocean_both_sidebars_sidebars_width":0,"ocean_sidebar":"0","ocean_second_sidebar":"0","ocean_disable_margins":"enable","ocean_add_body_class":"","ocean_shortcode_before_top_bar":"","ocean_shortcode_after_top_bar":"","ocean_shortcode_before_header":"","ocean_shortcode_after_header":"","ocean_has_shortcode":"","ocean_shortcode_after_title":"","ocean_shortcode_before_footer_widgets":"","ocean_shortcode_after_footer_widgets":"","ocean_shortcode_before_footer_bottom":"","ocean_shortcode_after_footer_bottom":"","ocean_display_top_bar":"default","ocean_display_header":"default","ocean_header_style":"","ocean_center_header_left_menu":"0","ocean_custom_header_template":"0","ocean_custom_logo":0,"ocean_custom_retina_logo":0,"ocean_custom_logo_max_width":0,"ocean_custom_logo_tablet_max_width":0,"ocean_custom_logo_mobile_max_width":0,"ocean_custom_logo_max_height":0,"ocean_custom_logo_tablet_max_height":0,"ocean_custom_logo_mobile_max_height":0,"ocean_header_custom_menu":"0","ocean_menu_typo_font_family":"0","ocean_menu_typo_font_subset":"","ocean_menu_typo_font_size":0,"ocean_menu_typo_font_size_tablet":0,"ocean_menu_typo_font_size_mobile":0,"ocean_menu_typo_font_size_unit":"px","ocean_menu_typo_font_weight":"","ocean_menu_typo_font_weight_tablet":"","ocean_menu_typo_font_weight_mobile":"","ocean_menu_typo_transform":"","ocean_menu_typo_transform_tablet":"","ocean_menu_typo_transform_mobile":"","ocean_menu_typo_line_height":0,"ocean_menu_typo_line_height_tablet":0,"ocean_menu_typo_line_height_mobile":0,"ocean_menu_typo_line_height_unit":"","ocean_menu_typo_spacing":0,"ocean_menu_typo_spacing_tablet":0,"ocean_menu_typo_spacing_mobile":0,"ocean_menu_typo_spacing_unit":"","ocean_menu_link_color":"","ocean_menu_link_color_hover":"","ocean_menu_link_color_active":"","ocean_menu_link_background":"","ocean_menu_link_hover_background":"","ocean_menu_link_active_background":"","ocean_menu_social_links_bg":"","ocean_menu_social_hover_links_bg":"","ocean_menu_social_links_color":"","ocean_menu_social_hover_links_color":"","ocean_disable_title":"default","ocean_disable_heading":"default","ocean_post_title":"","ocean_post_subheading":"","ocean_post_title_style":"","ocean_post_title_background_color":"","ocean_post_title_background":0,"ocean_post_title_bg_image_position":"","ocean_post_title_bg_image_attachment":"","ocean_post_title_bg_image_repeat":"","ocean_post_title_bg_image_size":"","ocean_post_title_height":0,"ocean_post_title_bg_overlay":0.5,"ocean_post_title_bg_overlay_color":"","ocean_disable_breadcrumbs":"default","ocean_breadcrumbs_color":"","ocean_breadcrumbs_separator_color":"","ocean_breadcrumbs_links_color":"","ocean_breadcrumbs_links_hover_color":"","ocean_display_footer_widgets":"default","ocean_display_footer_bottom":"default","ocean_custom_footer_template":"0","ocean_post_oembed":"","ocean_post_self_hosted_media":"","ocean_post_video_embed":"","ocean_link_format":"","ocean_link_format_target":"self","ocean_quote_format":"","ocean_quote_format_link":"post","ocean_gallery_link_images":"off","ocean_gallery_id":[],"footnotes":""},"categories":[8],"tags":[23],"class_list":["post-4359","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog","tag-stm32-i2c-lectures","entry","has-media"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>STM32 I2C Lecture 33 - Exercise: Reading data from the I2C slave<\/title>\n<meta name=\"description\" content=\"Exercise: Reading data from the I2C slave. Learn how to establish I2C communication between an Arduino slave and an ST board master. Follow\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/fastbitlab.com\/blog\/stm32-i2c-lecture-33-exercise-reading-data-from-the-i2c-slave\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"STM32 I2C Lecture 33 - Exercise: Reading data from the I2C slave\" \/>\n<meta property=\"og:description\" content=\"Exercise: Reading data from the I2C slave. Learn how to establish I2C communication between an Arduino slave and an ST board master. Follow\" \/>\n<meta property=\"og:url\" content=\"https:\/\/fastbitlab.com\/blog\/stm32-i2c-lecture-33-exercise-reading-data-from-the-i2c-slave\/\" \/>\n<meta property=\"og:site_name\" content=\"FastBit EBA\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/fastbiteba\/\" \/>\n<meta property=\"article:published_time\" content=\"2020-12-17T07:07:09+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-09-07T08:58:39+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2020\/12\/Figure-1-20.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1167\" \/>\n\t<meta property=\"og:image:height\" content=\"439\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"FastBitLab\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@fastbiteba\" \/>\n<meta name=\"twitter:site\" content=\"@fastbiteba\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"FastBitLab\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/stm32-i2c-lecture-33-exercise-reading-data-from-the-i2c-slave\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/stm32-i2c-lecture-33-exercise-reading-data-from-the-i2c-slave\\\/\"},\"author\":{\"name\":\"FastBitLab\",\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/#\\\/schema\\\/person\\\/e32b38e733a0d76ffa7e6bc998652e5d\"},\"headline\":\"STM32 I2C Lecture 33 &#8211; Exercise: Reading data from the I2C slave\",\"datePublished\":\"2020-12-17T07:07:09+00:00\",\"dateModified\":\"2023-09-07T08:58:39+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/stm32-i2c-lecture-33-exercise-reading-data-from-the-i2c-slave\\\/\"},\"wordCount\":757,\"commentCount\":3,\"publisher\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/stm32-i2c-lecture-33-exercise-reading-data-from-the-i2c-slave\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/12\\\/Figure-1-20.png\",\"keywords\":[\"STM32 I2C Lectures\"],\"articleSection\":[\"Blog\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/stm32-i2c-lecture-33-exercise-reading-data-from-the-i2c-slave\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/stm32-i2c-lecture-33-exercise-reading-data-from-the-i2c-slave\\\/\",\"url\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/stm32-i2c-lecture-33-exercise-reading-data-from-the-i2c-slave\\\/\",\"name\":\"STM32 I2C Lecture 33 - Exercise: Reading data from the I2C slave\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/stm32-i2c-lecture-33-exercise-reading-data-from-the-i2c-slave\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/stm32-i2c-lecture-33-exercise-reading-data-from-the-i2c-slave\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/12\\\/Figure-1-20.png\",\"datePublished\":\"2020-12-17T07:07:09+00:00\",\"dateModified\":\"2023-09-07T08:58:39+00:00\",\"description\":\"Exercise: Reading data from the I2C slave. Learn how to establish I2C communication between an Arduino slave and an ST board master. Follow\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/stm32-i2c-lecture-33-exercise-reading-data-from-the-i2c-slave\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/stm32-i2c-lecture-33-exercise-reading-data-from-the-i2c-slave\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/stm32-i2c-lecture-33-exercise-reading-data-from-the-i2c-slave\\\/#primaryimage\",\"url\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/12\\\/Figure-1-20.png\",\"contentUrl\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/12\\\/Figure-1-20.png\",\"width\":1167,\"height\":439,\"caption\":\"Figure 1. Circuit connection for I2C master and I2C slave communication.\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/stm32-i2c-lecture-33-exercise-reading-data-from-the-i2c-slave\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"STM32 I2C Lecture 33 &#8211; Exercise: Reading data from the I2C slave\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/\",\"name\":\"FastBit EBA\",\"description\":\"Your Online Academy of Embedded Systems\",\"publisher\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/#organization\",\"name\":\"FastBit EBA\",\"url\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/04\\\/logo-EzNrEnyr.png\",\"contentUrl\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/04\\\/logo-EzNrEnyr.png\",\"width\":640,\"height\":640,\"caption\":\"FastBit EBA\"},\"image\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/fastbiteba\\\/\",\"https:\\\/\\\/x.com\\\/fastbiteba\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/fastbit-embedded-brain-academy-b3167b124\\\/\",\"https:\\\/\\\/www.youtube.com\\\/channel\\\/UCa1REBV9hyrzGp2mjJCagBg\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/#\\\/schema\\\/person\\\/e32b38e733a0d76ffa7e6bc998652e5d\",\"name\":\"FastBitLab\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/9230d0f9bdef28b63a01e7ca274ee7b2e8ed9abe932ee564af8809caaf52a0c8?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/9230d0f9bdef28b63a01e7ca274ee7b2e8ed9abe932ee564af8809caaf52a0c8?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/9230d0f9bdef28b63a01e7ca274ee7b2e8ed9abe932ee564af8809caaf52a0c8?s=96&d=mm&r=g\",\"caption\":\"FastBitLab\"},\"description\":\"The FastBit Embedded Brain Academy uses the power of internet to bring the online courses related to the field of embedded system programming, Real time operating system, Embedded Linux systems, etc at your finger tip with very low cost. Backed with strong experience of industry, we have produced lots of courses with the customer enrolment over 3000+ across 100+ countries.\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"STM32 I2C Lecture 33 - Exercise: Reading data from the I2C slave","description":"Exercise: Reading data from the I2C slave. Learn how to establish I2C communication between an Arduino slave and an ST board master. Follow","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/fastbitlab.com\/blog\/stm32-i2c-lecture-33-exercise-reading-data-from-the-i2c-slave\/","og_locale":"en_US","og_type":"article","og_title":"STM32 I2C Lecture 33 - Exercise: Reading data from the I2C slave","og_description":"Exercise: Reading data from the I2C slave. Learn how to establish I2C communication between an Arduino slave and an ST board master. Follow","og_url":"https:\/\/fastbitlab.com\/blog\/stm32-i2c-lecture-33-exercise-reading-data-from-the-i2c-slave\/","og_site_name":"FastBit EBA","article_publisher":"https:\/\/www.facebook.com\/fastbiteba\/","article_published_time":"2020-12-17T07:07:09+00:00","article_modified_time":"2023-09-07T08:58:39+00:00","og_image":[{"width":1167,"height":439,"url":"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2020\/12\/Figure-1-20.png","type":"image\/png"}],"author":"FastBitLab","twitter_card":"summary_large_image","twitter_creator":"@fastbiteba","twitter_site":"@fastbiteba","twitter_misc":{"Written by":"FastBitLab","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/fastbitlab.com\/blog\/stm32-i2c-lecture-33-exercise-reading-data-from-the-i2c-slave\/#article","isPartOf":{"@id":"https:\/\/fastbitlab.com\/blog\/stm32-i2c-lecture-33-exercise-reading-data-from-the-i2c-slave\/"},"author":{"name":"FastBitLab","@id":"https:\/\/fastbitlab.com\/blog\/#\/schema\/person\/e32b38e733a0d76ffa7e6bc998652e5d"},"headline":"STM32 I2C Lecture 33 &#8211; Exercise: Reading data from the I2C slave","datePublished":"2020-12-17T07:07:09+00:00","dateModified":"2023-09-07T08:58:39+00:00","mainEntityOfPage":{"@id":"https:\/\/fastbitlab.com\/blog\/stm32-i2c-lecture-33-exercise-reading-data-from-the-i2c-slave\/"},"wordCount":757,"commentCount":3,"publisher":{"@id":"https:\/\/fastbitlab.com\/blog\/#organization"},"image":{"@id":"https:\/\/fastbitlab.com\/blog\/stm32-i2c-lecture-33-exercise-reading-data-from-the-i2c-slave\/#primaryimage"},"thumbnailUrl":"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2020\/12\/Figure-1-20.png","keywords":["STM32 I2C Lectures"],"articleSection":["Blog"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/fastbitlab.com\/blog\/stm32-i2c-lecture-33-exercise-reading-data-from-the-i2c-slave\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/fastbitlab.com\/blog\/stm32-i2c-lecture-33-exercise-reading-data-from-the-i2c-slave\/","url":"https:\/\/fastbitlab.com\/blog\/stm32-i2c-lecture-33-exercise-reading-data-from-the-i2c-slave\/","name":"STM32 I2C Lecture 33 - Exercise: Reading data from the I2C slave","isPartOf":{"@id":"https:\/\/fastbitlab.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/fastbitlab.com\/blog\/stm32-i2c-lecture-33-exercise-reading-data-from-the-i2c-slave\/#primaryimage"},"image":{"@id":"https:\/\/fastbitlab.com\/blog\/stm32-i2c-lecture-33-exercise-reading-data-from-the-i2c-slave\/#primaryimage"},"thumbnailUrl":"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2020\/12\/Figure-1-20.png","datePublished":"2020-12-17T07:07:09+00:00","dateModified":"2023-09-07T08:58:39+00:00","description":"Exercise: Reading data from the I2C slave. Learn how to establish I2C communication between an Arduino slave and an ST board master. Follow","breadcrumb":{"@id":"https:\/\/fastbitlab.com\/blog\/stm32-i2c-lecture-33-exercise-reading-data-from-the-i2c-slave\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/fastbitlab.com\/blog\/stm32-i2c-lecture-33-exercise-reading-data-from-the-i2c-slave\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/fastbitlab.com\/blog\/stm32-i2c-lecture-33-exercise-reading-data-from-the-i2c-slave\/#primaryimage","url":"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2020\/12\/Figure-1-20.png","contentUrl":"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2020\/12\/Figure-1-20.png","width":1167,"height":439,"caption":"Figure 1. Circuit connection for I2C master and I2C slave communication."},{"@type":"BreadcrumbList","@id":"https:\/\/fastbitlab.com\/blog\/stm32-i2c-lecture-33-exercise-reading-data-from-the-i2c-slave\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/fastbitlab.com\/blog\/"},{"@type":"ListItem","position":2,"name":"STM32 I2C Lecture 33 &#8211; Exercise: Reading data from the I2C slave"}]},{"@type":"WebSite","@id":"https:\/\/fastbitlab.com\/blog\/#website","url":"https:\/\/fastbitlab.com\/blog\/","name":"FastBit EBA","description":"Your Online Academy of Embedded Systems","publisher":{"@id":"https:\/\/fastbitlab.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/fastbitlab.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/fastbitlab.com\/blog\/#organization","name":"FastBit EBA","url":"https:\/\/fastbitlab.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/fastbitlab.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2026\/04\/logo-EzNrEnyr.png","contentUrl":"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2026\/04\/logo-EzNrEnyr.png","width":640,"height":640,"caption":"FastBit EBA"},"image":{"@id":"https:\/\/fastbitlab.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/fastbiteba\/","https:\/\/x.com\/fastbiteba","https:\/\/www.linkedin.com\/in\/fastbit-embedded-brain-academy-b3167b124\/","https:\/\/www.youtube.com\/channel\/UCa1REBV9hyrzGp2mjJCagBg"]},{"@type":"Person","@id":"https:\/\/fastbitlab.com\/blog\/#\/schema\/person\/e32b38e733a0d76ffa7e6bc998652e5d","name":"FastBitLab","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/9230d0f9bdef28b63a01e7ca274ee7b2e8ed9abe932ee564af8809caaf52a0c8?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/9230d0f9bdef28b63a01e7ca274ee7b2e8ed9abe932ee564af8809caaf52a0c8?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/9230d0f9bdef28b63a01e7ca274ee7b2e8ed9abe932ee564af8809caaf52a0c8?s=96&d=mm&r=g","caption":"FastBitLab"},"description":"The FastBit Embedded Brain Academy uses the power of internet to bring the online courses related to the field of embedded system programming, Real time operating system, Embedded Linux systems, etc at your finger tip with very low cost. Backed with strong experience of industry, we have produced lots of courses with the customer enrolment over 3000+ across 100+ countries."}]}},"_links":{"self":[{"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/posts\/4359","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/comments?post=4359"}],"version-history":[{"count":5,"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/posts\/4359\/revisions"}],"predecessor-version":[{"id":11385,"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/posts\/4359\/revisions\/11385"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/media\/4361"}],"wp:attachment":[{"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/media?parent=4359"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/categories?post=4359"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/tags?post=4359"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}