{"id":2513,"date":"2024-05-10T05:13:41","date_gmt":"2024-05-10T05:13:41","guid":{"rendered":"https:\/\/blog.embeddedexpert.io\/?p=2513"},"modified":"2024-05-10T05:13:45","modified_gmt":"2024-05-10T05:13:45","slug":"working-with-stm32-and-displays-max7219-led-matrix","status":"publish","type":"post","link":"https:\/\/blog.embeddedexpert.io\/?p=2513","title":{"rendered":"Working with STM32 and displays: MAX7219 LED Matrix"},"content":{"rendered":"\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"684\" src=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/05\/mkf_6358-1024x684-1.webp\" alt=\"\" class=\"wp-image-2514\" srcset=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/05\/mkf_6358-1024x684-1.webp 1024w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/05\/mkf_6358-1024x684-1-300x200.webp 300w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/05\/mkf_6358-1024x684-1-768x513.webp 768w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/05\/mkf_6358-1024x684-1-750x501.webp 750w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/05\/mkf_6358-1024x684-1-400x267.webp 400w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/05\/mkf_6358-1024x684-1-250x167.webp 250w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>In this guide, we shall interface the MAX7219 LED Matrix with STM32 and display characters, numbers and custom shapes.<\/p>\n\n\n\n<p>In this guide, we shall cover the following:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>MAX7219.<\/li><li>Connection with STM32<\/li><li>SPI configuration.<\/li><li>Sending data.<\/li><li>MAX7219 Initialization.<\/li><li>Functions to display character, number and custom shape.<\/li><li>Results.<\/li><\/ul>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">1.1  MAX7219:<\/h2>\n\n\n\n<p>Unlike the 74HC595 shift register, we don\u2019t need to control each digit of 7-segment display individually by adding delay. We just send data 7-segments and seven-segment control data. It has a built-in BCD to 7-segment decoder. Most importantly, it has on-chip 8\u00d78 RAM which we can use to store display codes of digits that we want to display.<\/p>\n\n\n\n<p>One of the major advantages of this display driver is that we can update individual bits without updating the entire display that isn\u2019t possible with 74HC595 shift register. Hence, we can save microcontroller execution time and energy.<\/p>\n\n\n\n<p>Moreover, it has a built-in brightness control circuit and by using a scan limit register we can configure the number of digits display we want to use.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">1.2 Pinout Diagram:<\/h2>\n\n\n\n<p>As you can depict from this pinout diagram that it is a 24 pin IC. Eight pins provide data to segments that A-G pins. DIG0 to DIG7 pins are used to connect with common pins of 8 common-cathode type seven-segment displays. The pin configuration is the same for both MAX7219 and MAX7212.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"921\" src=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2022\/02\/Screen-Shot-2022-02-18-at-5.24.46-PM-1024x921.png\" alt=\"\" class=\"wp-image-775\" srcset=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2022\/02\/Screen-Shot-2022-02-18-at-5.24.46-PM-1024x921.png 1024w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2022\/02\/Screen-Shot-2022-02-18-at-5.24.46-PM-300x270.png 300w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2022\/02\/Screen-Shot-2022-02-18-at-5.24.46-PM-768x691.png 768w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2022\/02\/Screen-Shot-2022-02-18-at-5.24.46-PM-1536x1382.png 1536w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2022\/02\/Screen-Shot-2022-02-18-at-5.24.46-PM-1150x1034.png 1150w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2022\/02\/Screen-Shot-2022-02-18-at-5.24.46-PM-750x675.png 750w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2022\/02\/Screen-Shot-2022-02-18-at-5.24.46-PM-400x360.png 400w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2022\/02\/Screen-Shot-2022-02-18-at-5.24.46-PM-250x225.png 250w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2022\/02\/Screen-Shot-2022-02-18-at-5.24.46-PM.png 2048w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>This table shows the function of each pin. Out of 14 pins, 16 pins are used to connect 8-digit LED displays.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/microcontrollerslab.com\/wp-content\/uploads\/2020\/04\/MAX7219-pin-details.jpg?ezimgfmt=rs:767x404\/rscb1\/ngcb1\/notWebP\" alt=\"MAX7219 pin details\" class=\"wp-image-16871\" \/><\/figure>\n\n\n\n<p>According to the above table, MAX7219\/MAX7212 receives and transmits data through SPI communication. Pin1 (DIN) is a serial data input pin. We connect DIN of MAX7219 with a DOUT pin of PIC16F877A microcontroller SPI pin. Serial data transfer to an internal 16-bit register on every positive edge clock on pin13(Clk). We provide clock signals from Pic microcontroller SPI communication clock pin (SCK).<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">1.3 MAX7219\/MAX7212 Registers:<\/h2>\n\n\n\n<p>This block diagram shows the configuration registers of MAX7219 LED driver IC. It has drivers for segements and digits.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/microcontrollerslab.com\/wp-content\/uploads\/2020\/04\/MAX7219-MAX7212-configuration-Registers.jpg?ezimgfmt=rs:754x484\/rscb1\/ngcb1\/notWebP\" alt=\"MAX7219 MAX7221configuration Registers\" class=\"wp-image-16875\" \/><\/figure>\n\n\n\n<p>Following are the main registers that used to configure and control display.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">1.4 Registers Map:<\/h2>\n\n\n\n<p>The following table shows the registers within the IC.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"889\" height=\"1024\" src=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2022\/02\/Screen-Shot-2022-02-18-at-5.27.06-PM-889x1024.png\" alt=\"\" class=\"wp-image-776\" srcset=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2022\/02\/Screen-Shot-2022-02-18-at-5.27.06-PM-889x1024.png 889w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2022\/02\/Screen-Shot-2022-02-18-at-5.27.06-PM-261x300.png 261w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2022\/02\/Screen-Shot-2022-02-18-at-5.27.06-PM-768x884.png 768w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2022\/02\/Screen-Shot-2022-02-18-at-5.27.06-PM-1334x1536.png 1334w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2022\/02\/Screen-Shot-2022-02-18-at-5.27.06-PM-1150x1324.png 1150w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2022\/02\/Screen-Shot-2022-02-18-at-5.27.06-PM-750x863.png 750w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2022\/02\/Screen-Shot-2022-02-18-at-5.27.06-PM-400x461.png 400w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2022\/02\/Screen-Shot-2022-02-18-at-5.27.06-PM-250x288.png 250w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2022\/02\/Screen-Shot-2022-02-18-at-5.27.06-PM.png 1600w\" sizes=\"(max-width: 889px) 100vw, 889px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">1.5 Serial Data Format:<\/h2>\n\n\n\n<p>The data shall be sent in serial format with most significant bit (MSB) first to be transmit:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"117\" src=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2022\/02\/Screen-Shot-2022-02-18-at-5.28.54-PM-1024x117.png\" alt=\"\" class=\"wp-image-777\" srcset=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2022\/02\/Screen-Shot-2022-02-18-at-5.28.54-PM-1024x117.png 1024w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2022\/02\/Screen-Shot-2022-02-18-at-5.28.54-PM-300x34.png 300w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2022\/02\/Screen-Shot-2022-02-18-at-5.28.54-PM-768x88.png 768w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2022\/02\/Screen-Shot-2022-02-18-at-5.28.54-PM-1536x176.png 1536w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2022\/02\/Screen-Shot-2022-02-18-at-5.28.54-PM-2048x234.png 2048w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2022\/02\/Screen-Shot-2022-02-18-at-5.28.54-PM-1150x131.png 1150w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2022\/02\/Screen-Shot-2022-02-18-at-5.28.54-PM-750x86.png 750w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2022\/02\/Screen-Shot-2022-02-18-at-5.28.54-PM-400x46.png 400w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2022\/02\/Screen-Shot-2022-02-18-at-5.28.54-PM-250x29.png 250w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">2. Connection with STM32:<\/h2>\n\n\n\n<p><\/p>\n\n\n\n<p>The connection as following:<\/p>\n\n\n\n<figure class=\"wp-block-table is-style-stripes\"><table><tbody><tr><td>MAX7219<\/td><td>STM32F411 Nucleo<\/td><\/tr><tr><td>Vcc<\/td><td>5V<\/td><\/tr><tr><td>GND<\/td><td>GND<\/td><\/tr><tr><td>Din<\/td><td>MOSI (PA7)<\/td><\/tr><tr><td>SCK<\/td><td>SCK (PA5)<\/td><\/tr><tr><td>CS<\/td><td>PA0<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"656\" src=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/05\/Screenshot-2024-05-10-at-7.39.17\u202fAM-1024x656.png\" alt=\"\" class=\"wp-image-2515\" srcset=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/05\/Screenshot-2024-05-10-at-7.39.17\u202fAM-1024x656.png 1024w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/05\/Screenshot-2024-05-10-at-7.39.17\u202fAM-300x192.png 300w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/05\/Screenshot-2024-05-10-at-7.39.17\u202fAM-768x492.png 768w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/05\/Screenshot-2024-05-10-at-7.39.17\u202fAM-1536x985.png 1536w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/05\/Screenshot-2024-05-10-at-7.39.17\u202fAM-2048x1313.png 2048w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/05\/Screenshot-2024-05-10-at-7.39.17\u202fAM-1150x737.png 1150w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/05\/Screenshot-2024-05-10-at-7.39.17\u202fAM-750x481.png 750w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/05\/Screenshot-2024-05-10-at-7.39.17\u202fAM-400x256.png 400w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/05\/Screenshot-2024-05-10-at-7.39.17\u202fAM-250x160.png 250w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">3. SPI Configuration:<\/h2>\n\n\n\n<p>Since the module uses SPI to communicate with the MCU, we shall configure SPI1 of the STM32F4 to work as half-duplex master mode.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>Before we start, please refer to this guide for how to <a href=\"https:\/\/blog.embeddedexpert.io\/?p=1255\" data-type=\"URL\" data-id=\"https:\/\/blog.embeddedexpert.io\/?p=1255\" target=\"_blank\" rel=\"noreferrer noopener\">setup a new project in STM32CubeIDE<\/a>.<\/p>\n\n\n\n<p>We start off by creating new source and header file with name of MAX7219.c and MAX7219.h respectively.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>Within the header file, use header guard 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;}\">#ifndef MAX7219_H_\n#define MAX7219_H_\n\n\n#endif \/* MAX7219_H_ *\/<\/pre><\/div>\n\n\n\n<p>Within the header file, include stdint.h 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;stdint.h&quot;<\/pre><\/div>\n\n\n\n<p>Include the following 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;}\">void MAX7219_SPI_Init(void);\n\nvoid MAX7219_Init(void);\n\nvoid MAX7219_Char_Display(char ch);\n\nvoid MAX7219_Num_Display(uint8_t Num);\n\nvoid MAX7219_Custom_Shap(uint8_t shape[]);<\/pre><\/div>\n\n\n\n<p>Thats all for the header file.<\/p>\n\n\n\n<p>For the source file, include the MAX7219 header file 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;max7219.h&quot;<\/pre><\/div>\n\n\n\n<p>Include STM32F4 main header file:<\/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;stm32f4xx.h&quot;<\/pre><\/div>\n\n\n\n<p>Include ctypes (needed later):<\/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 &lt;ctype.h&gt;<\/pre><\/div>\n\n\n\n<p>Declare the following two dimensional array to hold the map for numbers and characters:<\/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;}\">static uint8_t Num_Char[38][8]={\n{0x3C,0x42,0x42,0x42,0x42,0x42,0x42,0x3C},\/\/0\n{0x10,0x30,0x50,0x10,0x10,0x10,0x10,0x7c},\/\/1\n{0x7E,0x2,0x2,0x7E,0x40,0x40,0x40,0x7E},\/\/2\n{0x3E,0x2,0x2,0x3E,0x2,0x2,0x3E,0x0},\/\/3\n{0x8,0x18,0x28,0x48,0xFE,0x8,0x8,0x8},\/\/4\n{0x3C,0x20,0x20,0x3C,0x4,0x4,0x3C,0x0},\/\/5\n{0x3C,0x20,0x20,0x3C,0x24,0x24,0x3C,0x0},\/\/6\n{0x3E,0x22,0x4,0x8,0x8,0x8,0x8,0x8},\/\/7\n{0x0,0x3E,0x22,0x22,0x3E,0x22,0x22,0x3E},\/\/8\n{0x3E,0x22,0x22,0x3E,0x2,0x2,0x2,0x3E},\/\/9\n{0x18,0x24,0x42,0x42,0x7E,0x42,0x42,0x42},\/\/A\n{0x3C,0x22,0x22,0x3c,0x22,0x22,0x3C,0x0},\/\/B\n{0x3C,0x40,0x40,0x40,0x40,0x40,0x40,0x3C},\/\/C\n{0x7C,0x22,0x22,0x22,0x22,0x22,0x22,0x7C},\/\/D\n{0x7C,0x40,0x40,0x7C,0x40,0x40,0x40,0x7C},\/\/E\n{0x7C,0x40,0x40,0x7C,0x40,0x40,0x40,0x40},\/\/F\n{0x3C,0x40,0x40,0x40,0x4c,0x44,0x44,0x3C},\/\/G\n{0x44,0x44,0x44,0x7C,0x44,0x44,0x44,0x44},\/\/H\n{0x7C,0x10,0x10,0x10,0x10,0x10,0x10,0x7C},\/\/I\n{0x3C,0x8,0x8,0x8,0x8,0x8,0x48,0x30},\/\/J\n{0x0,0x24,0x28,0x30,0x20,0x30,0x28,0x24},\/\/K\n{0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x7C},\/\/L\n{0x81,0xC3,0xA5,0x99,0x81,0x81,0x81,0x81},\/\/M\n{0x0,0x42,0x62,0x52,0x4A,0x46,0x42,0x0},\/\/N\n{0x3C,0x42,0x42,0x42,0x42,0x42,0x42,0x3C},\/\/O\n{0x3C,0x22,0x22,0x22,0x3C,0x20,0x20,0x20},\/\/P\n{0x1C,0x22,0x22,0x22,0x22,0x26,0x22,0x1D},\/\/Q\n{0x3C,0x22,0x22,0x22,0x3C,0x24,0x22,0x21},\/\/R\n{0x0,0x1E,0x20,0x20,0x3E,0x2,0x2,0x3C},\/\/S\n{0x0,0x3E,0x8,0x8,0x8,0x8,0x8,0x8},\/\/T\n{0x42,0x42,0x42,0x42,0x42,0x42,0x22,0x1C},\/\/U\n{0x42,0x42,0x42,0x42,0x42,0x42,0x24,0x18},\/\/V\n{0x0,0x49,0x49,0x49,0x49,0x2A,0x1C,0x0},\/\/W\n{0x0,0x41,0x22,0x14,0x8,0x14,0x22,0x41},\/\/X\n{0x41,0x22,0x14,0x8,0x8,0x8,0x8,0x8},\/\/Y\n{0x0,0x7F,0x2,0x4,0x8,0x10,0x20,0x7F},\/\/Z\n};<\/pre><\/div>\n\n\n\n<p><\/p>\n\n\n\n<p>For the SPI configuration:<\/p>\n\n\n\n<p>Declare the following 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;}\">void MAX7219_SPI_Init(void)<\/pre><\/div>\n\n\n\n<p>Within the function.<\/p>\n\n\n\n<p>Enable clock access to GPIOA:<\/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;}\">\t\/*Enable clock access to GPIOA*\/\n\tRCC-&gt;AHB1ENR|=RCC_AHB1ENR_GPIOAEN;<\/pre><\/div>\n\n\n\n<p>Set PA5 and PA7 to alternate function and SPI alternate for SPI:<\/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;}\">\t\/*Set PA5 and PA7 to alternate mode*\/\n\tGPIOA-&gt;MODER|=GPIO_MODER_MODE5_1|GPIO_MODER_MODE7_1;\n\tGPIOA-&gt;MODER&amp;=~(GPIO_MODER_MODE5_0|GPIO_MODER_MODE7_0);\n\n\t\/*Set PA5 and PA7 alternate function*\/\n\t#define AF05\t0x05\n\tGPIOA-&gt;AFR[0]|=(AF05&lt;&lt;GPIO_AFRL_AFSEL5_Pos)|(AF05&lt;&lt;GPIO_AFRL_AFSEL7_Pos);<\/pre><\/div>\n\n\n\n<p>Set PA0 as output to act as CS line:<\/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;}\">\t\/*Set PA0 as out for CS line*\/\n\tGPIOA-&gt;MODER|=GPIO_MODER_MODE0_0;\n\tGPIOA-&gt;MODER&amp;=~GPIO_MODER_MODE0_1;\n\n\t\/*Set PA0 to high*\/\n\tGPIOA-&gt;BSRR=GPIO_BSRR_BS0;<\/pre><\/div>\n\n\n\n<p><\/p>\n\n\n\n<p>For the SPI configuration:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Set to half-duplex.<\/li><li>Enable output for half-duplex mode.<\/li><li>Set the data frame formate to 16-bit.<\/li><li>Software slave management.<\/li><li>Set to master mode.<\/li><li>Enable SPI peripheral.<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"257\" src=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/05\/Screenshot-2024-05-10-at-7.54.58\u202fAM-1024x257.png\" alt=\"\" class=\"wp-image-2517\" srcset=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/05\/Screenshot-2024-05-10-at-7.54.58\u202fAM-1024x257.png 1024w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/05\/Screenshot-2024-05-10-at-7.54.58\u202fAM-300x75.png 300w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/05\/Screenshot-2024-05-10-at-7.54.58\u202fAM-768x193.png 768w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/05\/Screenshot-2024-05-10-at-7.54.58\u202fAM-1536x386.png 1536w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/05\/Screenshot-2024-05-10-at-7.54.58\u202fAM-2048x515.png 2048w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/05\/Screenshot-2024-05-10-at-7.54.58\u202fAM-1150x289.png 1150w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/05\/Screenshot-2024-05-10-at-7.54.58\u202fAM-750x188.png 750w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/05\/Screenshot-2024-05-10-at-7.54.58\u202fAM-400x100.png 400w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/05\/Screenshot-2024-05-10-at-7.54.58\u202fAM-250x63.png 250w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\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;}\">\t\/*Enable clock access to SPI1*\/\n\n\tRCC-&gt;APB2ENR|=RCC_APB2ENR_SPI1EN;\n\n\t\/*Enable half-duplex mode*\/\n\tSPI1-&gt;CR1|=SPI_CR1_BIDIMODE;\n\n\t\/*Enable output for half-duplex (act as master)*\/\n\tSPI1-&gt;CR1|=SPI_CR1_BIDIOE;\n\n\t\/*Set data format to 16-bit*\/\n\n\tSPI1-&gt;CR1|=SPI_CR1_DFF;\n\n\t\/*Enable software slave management*\/\n\n\tSPI1-&gt;CR1|=SPI_CR1_SSI|SPI_CR1_SSM;\n\n\t\/*Set to master mode*\/\n\tSPI1-&gt;CR1|=SPI_CR1_MSTR;\n\n\t\/*Enable SPI Peripheral*\/\n\n\tSPI1-&gt;CR1|=SPI_CR1_SPE;<\/pre><\/div>\n\n\n\n<p>Note: Make sure that the baud rate is not more than 8MHz. (By default STM32F4 running at 16MHz and baud rate of SPI is 8MHz by default)<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">4. Sending Data:<\/h2>\n\n\n\n<p><\/p>\n\n\n\n<p>In order to send the data, we need to declare a function to transmit data over SPI bus 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;}\">static void SPI_Transmit(uint16_t data)\n{\n\tSPI1-&gt;DR = data;\n\t\/*Wait until TXE is set*\/\n\twhile(!(SPI1-&gt;SR &amp; (SPI_SR_TXE))){}\n\n\t\/*Wait for BUSY flag to reset*\/\n\twhile((SPI1-&gt;SR &amp; (SPI_SR_BSY))){}\n\n\t\/*Clear OVR flag*\/\n\t(void)SPI1-&gt;DR;\n\t(void)SPI1-&gt;SR;\n}<\/pre><\/div>\n\n\n\n<p>The function shall take uint16_t variable and returns nothing.<\/p>\n\n\n\n<p>First, put the data into the DR register of the SPI.<\/p>\n\n\n\n<p>Wait until the Transmit buffer is empty.<\/p>\n\n\n\n<p>Wait until the bus is free.<\/p>\n\n\n\n<p>Clear over run flag by reading the DR register and SR register.<\/p>\n\n\n\n<p>For sending the data MAX719 chip, we shall use the following 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;}\">static void MAX7219_Write(uint8_t address, uint8_t data)\n{\n\t\/*set the address and data as single variable*\/\n\tuint16_t temp_data;\n\ttemp_data=(address&lt;&lt;8)|data;\n\n\t\/*Set CS to low*\/\n\tGPIOA-&gt;BSRR=GPIO_BSRR_BR0;\n\n\t\/*Transmit the data*\/\n\tSPI_Transmit(temp_data);\n\n\t\/*Set CS to high*\/\n\tGPIOA-&gt;BSRR=GPIO_BSRR_BS0;\n\n}<\/pre><\/div>\n\n\n\n<p>Since the chip requires address followed by the data, hence the function shall take two parameters:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Address.<\/li><li>Data.<\/li><\/ul>\n\n\n\n<p>Then we shall store both the address and data into single uint16_t variable with the upper 8-bit for the address and lower 8-bit for the data.<\/p>\n\n\n\n<p>Set PA0 (CS) to low.<\/p>\n\n\n\n<p>Send the data over SPI bus.<\/p>\n\n\n\n<p>Set PA0 (CS) to high.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">5. MAX7219 Initialization:<\/h2>\n\n\n\n<p><\/p>\n\n\n\n<p>In order to Initialize the MAX7219, we need the following steps:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>No decode for the incoming data.<\/li><li>Set the brightness.<\/li><li>Scan limit to 8 digit (8-lines).<\/li><li>Power up the mode.<\/li><li>No test.<\/li><\/ul>\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 MAX7219_Init(void)\n{\n\tMAX7219_Write(0x09, 0x00);       \/\/  no decoding\n\tMAX7219_Write(0x0a, 0x03);       \/\/  brightness intensity\n\tMAX7219_Write(0x0b, 0x07);       \/\/  scan limit = 8 LEDs\n\tMAX7219_Write(0x0c, 0x01);       \/\/  power down =0\uff0cnormal mode = 1\n\tMAX7219_Write(0x0f, 0x00);       \/\/  no test display\n}<\/pre><\/div>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">6. <span style=\"font-size: revert;font-weight: revert\">Functions to display character, number and custom shape<\/span>:<\/h2>\n\n\n\n<p><\/p>\n\n\n\n<p>To display a character:<\/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 MAX7219_Char_Display(char ch)\n{\n\tch=toupper(ch);\n\tfor(int i=1;i&lt;9;i++)\n\t{\n\t\tMAX7219_Write (i,Num_Char[(ch - 55)][i-1]);\n\t}\n}<\/pre><\/div>\n\n\n\n<p>First, convert the character from small case to upper case.<\/p>\n\n\n\n<p>Send the character data to the MAX7219 from the lookup matrix.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>For displaying the numbers:<\/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 MAX7219_Num_Display(uint8_t Num)\n{\n\tif(Num&gt;9)return;\n\n\tfor(int i=1;i&lt;9;i++)\n\t{\n\t\tMAX7219_Write (i,Num_Char[(Num)][i-1]);\n\t}\n}<\/pre><\/div>\n\n\n\n<p><\/p>\n\n\n\n<p>For displaying custom shapes:<\/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 MAX7219_Custom_Shap(uint8_t shape[])\n{\n\tfor(int i=1;i&lt;9;i++)\n\t{\n\t\tMAX7219_Write (i,shape[i-1]);\n\t}\n}<\/pre><\/div>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">7. Results:<\/h2>\n\n\n\n<p>In main.c:<\/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;delay.h&quot;\n#include &quot;max7219.h&quot;\n\n\nuint8_t he[8]= {0B00000000, 0B01100110, 0B11111111, 0B11111111, 0B11111111, 0B00111100, 0B00011000, 0B00000000};\n\n\nint main(void)\n{\n\n\tdelay_init(16000000);\n\tMAX7219_SPI_Init();\n\tMAX7219_Init();\n    MAX7219_Char_Display('E');\n\t\n\n\twhile(1)\n\t{\n\n\t}\n\n}\n<\/pre><\/div>\n\n\n\n<p><\/p>\n\n\n\n<p>When you run the code, you should get this:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/05\/IMG_3674.heic\" alt=\"\" class=\"wp-image-2519\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>Happy coding \ud83d\ude09<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this guide, we shall interface the MAX7219 LED Matrix with STM32 and display characters, numbers and custom shapes. In this guide, we shall cover the following: MAX7219. Connection with STM32 SPI configuration. Sending data. MAX7219 Initialization. Functions to display character, number and custom shape. Results. 1.1 MAX7219: Unlike the 74HC595 shift register, we don\u2019t [&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-2513","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\/2513"}],"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=2513"}],"version-history":[{"count":3,"href":"https:\/\/blog.embeddedexpert.io\/index.php?rest_route=\/wp\/v2\/posts\/2513\/revisions"}],"predecessor-version":[{"id":2520,"href":"https:\/\/blog.embeddedexpert.io\/index.php?rest_route=\/wp\/v2\/posts\/2513\/revisions\/2520"}],"wp:attachment":[{"href":"https:\/\/blog.embeddedexpert.io\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2513"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.embeddedexpert.io\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2513"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.embeddedexpert.io\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2513"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}