{"id":4319,"date":"2019-05-29T20:00:47","date_gmt":"2019-05-29T18:00:47","guid":{"rendered":"https:\/\/msalamon.pl\/?p=4319"},"modified":"2025-12-27T19:31:33","modified_gmt":"2025-12-27T18:31:33","slug":"no-more-gpio-multiplexing-max7219-in-action-part-3","status":"publish","type":"post","link":"https:\/\/msalamon.pl\/en\/no-more-gpio-multiplexing-max7219-in-action-part-3\/","title":{"rendered":"No More GPIO Multiplexing! MAX7219 in Action, Part 3"},"content":{"rendered":"\n<p>It\u2019s time to use <a href=\"https:\/\/sklep.msalamon.pl\/kategoria-produktu\/wyswietlacze\/led\/\">MAX7219<\/a> in a slightly different way than it was probably originally designed for. We will create graphic LED displays controlled by a higher-level graphics library. This will work exactly the same way as, for example, OLEDs. See how simple it is \ud83d\ude42<\/p>\n\n\n\n<!--more-->\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><a href=\"https:\/\/sklep.msalamon.pl\/?s=matrycowy&amp;post_type=product&amp;utm_source=blog&amp;utm_medium=banner&amp;utm_campaign=max7219&amp;utm_content=matrix\" target=\"_blank\" rel=\"noopener noreferrer\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"341\" src=\"http:\/\/msalamon.pl\/wp-content\/uploads\/2018\/09\/MAX7219_matrix_baner-1024x341.jpg\" alt=\"\" class=\"wp-image-959\" srcset=\"https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/09\/MAX7219_matrix_baner-1024x341.jpg 1024w, https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/09\/MAX7219_matrix_baner-300x100.jpg 300w, https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/09\/MAX7219_matrix_baner-768x256.jpg 768w, https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/09\/MAX7219_matrix_baner-24x8.jpg 24w, https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/09\/MAX7219_matrix_baner-36x12.jpg 36w, https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/09\/MAX7219_matrix_baner-160x53.jpg 160w, https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/09\/MAX7219_matrix_baner.jpg 1200w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n<\/div>\n\n\n<p>Complete post series:<\/p>\n\n\n\n<p><a href=\"http:\/\/msalamon.pl\/nigdy-wiecej-multipleksowania-na-gpio-max7219-w-akcji-cz-1\/\">No more multiplexing on GPIO! MAX7219 in action part 1<\/a><\/p>\n\n\n\n<p><a href=\"http:\/\/msalamon.pl\/nigdy-wiecej-multipleksowania-na-gpio-max7219-w-akcji-cz-2\/\">No more multiplexing on GPIO! MAX7219 in action part 2<\/a><\/p>\n\n\n\n<p><a href=\"http:\/\/msalamon.pl\/nigdy-wiecej-multipleksowania-na-gpio-max7219-w-akcji-cz-3\/\">No more multiplexing on GPIO! MAX7219 in action part 3<\/a><\/p>\n\n\n\n<h1 class=\"wp-block-heading\">MAX7219 \u2013 matrix multiplexing<\/h1>\n\n\n\n<p>The fact that these chips are intended for 7-segment displays doesn\u2019t mean they can\u2019t be used differently. The digit decoder can be disabled, and then the data can be written freely. Since one digit means 8 LEDs and the chip controls eight digits, the math is simple \u2013 we can drive 64 LEDs in any way. Of course, our friends from China have made sure you don\u2019t have to struggle with wiring these diodes. There are 8\u00d78 pixel matrices with common cathode available, which are multiplexed in the same way as ordinary 7-segment displays. The LEDs are just arranged differently.<\/p>\n\n\n\n<p>You can buy single, double, or quad modules. All are chained, which makes the whole connection easier. Each subsequent module is also connected in cascade, so data transmission looks the same as for digits, with the difference that now we have a graphic display.<\/p>\n\n\n\n<p>Since these are individual pixels, why not use these matrices just like, for example, an <a href=\"http:\/\/msalamon.pl\/wyswietlacze-oled-ssd1306-i2c-czy-spi\/\">OLED I wrote about some time ago<\/a>. The idea is to use the GFX_BW library, which is used to draw simple graphics and bitmaps very easily.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How is the matrix wired?<\/h2>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><a href=\"https:\/\/sklep.msalamon.pl\/kategoria-produktu\/dev-boardy\/stm32-nucleo\/?utm_source=blog&amp;utm_medium=banner&amp;utm_campaign=max7219&amp;utm_content=nucleo\"><img loading=\"lazy\" decoding=\"async\" width=\"1200\" height=\"400\" src=\"http:\/\/msalamon.pl\/wp-content\/uploads\/2020\/07\/Nucleo-64-baner.jpg\" alt=\"\" class=\"wp-image-1593\" srcset=\"https:\/\/msalamon.pl\/wp-content\/uploads\/2020\/07\/Nucleo-64-baner.jpg 1200w, https:\/\/msalamon.pl\/wp-content\/uploads\/2020\/07\/Nucleo-64-baner-300x100.jpg 300w, https:\/\/msalamon.pl\/wp-content\/uploads\/2020\/07\/Nucleo-64-baner-1024x341.jpg 1024w, https:\/\/msalamon.pl\/wp-content\/uploads\/2020\/07\/Nucleo-64-baner-768x256.jpg 768w\" sizes=\"auto, (max-width: 1200px) 100vw, 1200px\" \/><\/a><\/figure>\n<\/div>\n\n\n<p><\/p>\n\n\n\n<p>As you remember, with the OLED we worked on a RAM buffer that mirrored what was to be on the display. For <a href=\"https:\/\/sklep.msalamon.pl\/kategoria-produktu\/wyswietlacze\/led\/\">MAX7219<\/a> matrices I did the same. GFX_BW needs only a function that sets a single pixel to operate. Pixel (0,0) is located in the top-left corner of the display. As a reminder \u2013 X increases to the right, and Y downward.<\/p>\n\n\n\n<p>So how does the <a href=\"https:\/\/sklep.msalamon.pl\/kategoria-produktu\/wyswietlacze\/led\/?utm_source=blog&amp;utm_medium=article&amp;utm_campaign=max7219&amp;utm_content=Text\">MAX7219<\/a> accept data when used with matrices? I think the drawing explains it best.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><a href=\"http:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/MAX7219-Matrix-Type-0-1.png\"><img loading=\"lazy\" decoding=\"async\" width=\"300\" height=\"300\" src=\"http:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/MAX7219-Matrix-Type-0-1-300x300.png\" alt=\"\" class=\"wp-image-882\" srcset=\"https:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/MAX7219-Matrix-Type-0-1-300x300.png 300w, https:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/MAX7219-Matrix-Type-0-1-150x150.png 150w, https:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/MAX7219-Matrix-Type-0-1-24x24.png 24w, https:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/MAX7219-Matrix-Type-0-1-36x36.png 36w, https:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/MAX7219-Matrix-Type-0-1-80x80.png 80w, https:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/MAX7219-Matrix-Type-0-1.png 700w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/figure>\n<\/div>\n\n\n<p><\/p>\n\n\n\n<p>R[0\u00f77], i.e. rows \u2013 are the subsequent digits that are written into the <a href=\"https:\/\/sklep.msalamon.pl\/kategoria-produktu\/wyswietlacze\/led\/?utm_source=blog&amp;utm_medium=article&amp;utm_campaign=max7219&amp;utm_content=Text\">MAX7219<\/a>. C[0\u00f77], on the other hand, are the corresponding bits contained in each digit (the transmitted byte). To sum up. To set pixel (0,0) you must set the seventh bit of digit zero in the MAX7219. To set, for example, pixel (4,2) you must light BIT3 of the second digit.<\/p>\n\n\n\n<p>Now it\u2019s enough to properly assign this data to the buffer that will be pushed to the <a href=\"https:\/\/sklep.msalamon.pl\/kategoria-produktu\/wyswietlacze\/led\/?utm_source=blog&amp;utm_medium=article&amp;utm_campaign=max7219&amp;utm_content=Text\">MAX7219<\/a> chips. During tests I discovered that there are two types of modules on the market \ud83d\ude41 They differ in almost nothing. Well, <strong>almost<\/strong>. There is one small detail \u2013 the connections between the IC and the LED matrix are different. They are exactly as in the drawing below.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><a href=\"http:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/MAX7219-Matrix-Type-1-1.png\"><img loading=\"lazy\" decoding=\"async\" width=\"300\" height=\"300\" src=\"http:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/MAX7219-Matrix-Type-1-1-300x300.png\" alt=\"\" class=\"wp-image-883\" srcset=\"https:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/MAX7219-Matrix-Type-1-1-300x300.png 300w, https:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/MAX7219-Matrix-Type-1-1-150x150.png 150w, https:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/MAX7219-Matrix-Type-1-1-24x24.png 24w, https:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/MAX7219-Matrix-Type-1-1-36x36.png 36w, https:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/MAX7219-Matrix-Type-1-1-80x80.png 80w, https:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/MAX7219-Matrix-Type-1-1.png 700w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/figure>\n<\/div>\n\n\n<p><\/p>\n\n\n\n<p>The difference lies in a mirror connection of digits and their bits. A bit like swapping little-endian to big-endian or vice versa. This makes the buffer fill based on the first connection incorrect for the second one and, as a result, text and images are displayed incorrectly, as I reported <a href=\"https:\/\/www.facebook.com\/337301850459416\/videos\/419752148779219\/?__xts__[0]=68.ARCLPRHMQb6KXjh7gewmrn5U0De9NXJdcbrcfzxwEzgo9gZHH7O7g5uLljs15Ixp8oKbBuNkfviXEXcA2ili0q5oCOSZAjMLaIMzIecai5QF7P3egz4L6WOQUqimsQ_UnF1lWEj2FUf6KCAPzdVixROv0-9DzPbKTPIMrQq7mE-Sj55nRErBmmNpRrDvaIGKOjzy6cxhldjun3Xe5rQ4hMydXWgz1B9ZufZk7dyoHyJViyZZcCiR_qo6wqUMxc6kdQkZMV0px3Wbk5DhFqkpaa4enHBzVXqML1t_EEQJKtfPg01u365IR4e4I7OZLQzao16YFbsU4ihrKXD5xyPgM6WGTMTbL1jF&amp;__tn__=-R\" target=\"_blank\" rel=\"noopener\">on my fanpage<\/a>.<\/p>\n\n\n\n<p>Fortunately, I handled this at the level of the pixel-setting function, so the higher layers are completely unaffected.<\/p>\n\n\n\n<p>Ultimately, the pixel drawing function looks like this:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"c\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">MAX7219_STATUS MAX7219_SetPixel(int x, int y, MAX7219_Color Color)\n{\n\tif ((x &amp;lt; 0) || (x &amp;gt;= MAX7219_X_PIXELS) || (y &amp;lt; 0) || (y &amp;gt;= MAX7219_Y_PIXELS))\n\t\treturn MAX7219_OUT_OF_RANGE;\n\tswitch(Color)\n\t{\n\t\t#if(MAX7219_MODULE_TYPE == 0)\n\t\tcase MAX7219_WHITE: Max7219PixelsBuffer[(x\/8) + (y*MAX7219_COLUMNS)] |= (0x80 &amp;gt;&amp;gt; (x&amp;amp;7)); break;\n\t\tcase MAX7219_BLACK: Max7219PixelsBuffer[(x\/8) + (y*MAX7219_COLUMNS)] &amp;amp;= ~(0x80 &amp;gt;&amp;gt; (x&amp;amp;7)); break;\n\t\tcase MAX7219_INVERSE: Max7219PixelsBuffer[(x\/8) + (y*MAX7219_COLUMNS)] ^= (0x80 &amp;gt;&amp;gt; (x&amp;amp;7)); break;\n\t\t\n\t\t#elif(MAX7219_MODULE_TYPE == 1)\n\t\tcase MAX7219_WHITE: Max7219PixelsBuffer[(x\/8) + ((MAX7219_PIXELS_PER_DEVICE_ROW-1) - ((y%8)) + ((y\/8)*MAX7219_PIXELS_PER_DEVICE_ROW))*MAX7219_COLUMNS] |= (1 &amp;lt;&amp;lt; (x&amp;amp;7)); break;\n\t\tcase MAX7219_BLACK: Max7219PixelsBuffer[(x\/8) + ((MAX7219_PIXELS_PER_DEVICE_ROW-1) - ((y%8)) + ((y\/8)*MAX7219_PIXELS_PER_DEVICE_ROW))*MAX7219_COLUMNS] &amp;amp;= ~(1 &amp;lt;&amp;lt; (x&amp;amp;7)); break;\n\t\tcase MAX7219_INVERSE: Max7219PixelsBuffer[(x\/8) + ((MAX7219_PIXELS_PER_DEVICE_ROW-1) - ((y%8)) + ((y\/8)*MAX7219_PIXELS_PER_DEVICE_ROW))*MAX7219_COLUMNS] ^= (1 &amp;lt;&amp;lt; (x&amp;amp;7)); break;\n\t\t\n\t\t#endif\n\t\t\n\t\tdefault: return MAX7219_ERROR;\n\t}\n\treturn MAX7219_OK;\n}<\/pre>\n\n\n\n<p>You choose which kind of module you will be dealing with via the <strong><em>MAX7219_MODULE_TYPE<\/em><\/strong> constant. Type set to <strong>0<\/strong> is the first one I showed \u2013 more human-friendly. If you have the second module, set this constant to <strong>1<\/strong>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Library settings<\/h3>\n\n\n\n<p>Besides the matrix type mentioned above, you need to set a few more constants.<\/p>\n\n\n\n<p>First, the number of devices, i.e. how many <a href=\"https:\/\/sklep.msalamon.pl\/kategoria-produktu\/wyswietlacze\/led\/?utm_source=blog&amp;utm_medium=article&amp;utm_campaign=max7219&amp;utm_content=Text\">MAX7219<\/a> chips you have in the setup. For a chain of 7-segment displays this was one value. Here I made two:&nbsp;<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Number of rows \u2013 <em><strong>MAX7219_ROWS<\/strong><\/em><\/li>\n\n\n\n<li>Number of columns \u2013 <em><strong>MAX7219_COLUMNS<\/strong><\/em><\/li>\n<\/ul>\n\n\n\n<p>You can connect matrices not only one after another, but also one below another. There is one condition that must be met for the library to work correctly. You <strong>MUST<\/strong> connect the <strong>DOUT<\/strong> of the last chip in a row to the <strong>first<\/strong> chip in the next row.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><a href=\"http:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/MAX7219-Matrix-Chain.png\"><img loading=\"lazy\" decoding=\"async\" width=\"300\" height=\"300\" src=\"http:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/MAX7219-Matrix-Chain-300x300.png\" alt=\"\" class=\"wp-image-876\" srcset=\"https:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/MAX7219-Matrix-Chain-300x300.png 300w, https:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/MAX7219-Matrix-Chain-150x150.png 150w, https:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/MAX7219-Matrix-Chain-24x24.png 24w, https:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/MAX7219-Matrix-Chain-36x36.png 36w, https:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/MAX7219-Matrix-Chain-80x80.png 80w, https:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/MAX7219-Matrix-Chain.png 700w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/figure>\n<\/div>\n\n\n<p><\/p>\n\n\n\n<p>Based on the drawing you can also see how to set the number of devices. We have 3 rows and 2 columns. So in the header file it will look like this.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"c\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/\n\/\/ Configuration\n\/\/\n#define MAX7219_ROWS 3\n#define MAX7219_COLUMNS 2<\/pre>\n\n\n\n<p>The last setting is the decision whether you use hardware control of the CS pin. I also described this <a href=\"http:\/\/msalamon.pl\/wyswietlacze-oled-ssd1306-i2c-czy-spi\/\">in the OLED post<\/a>.&nbsp;<\/p>\n\n\n\n<p>Alright, but what about the resolution and, therefore, the buffer size. I decided these settings would calculate themselves based on the number of chips in the system. Knowing that each device has 8\u00d78 pixels, and how many devices there are in each direction, it\u2019s easy to calculate the resolution of the entire display. Everything is handled by convenient macros<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"c\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/\n\/\/ Resolution\n\/\/\n#define MAX7219_PIXELS_PER_DEVICE_ROW 8\n#define MAX7219_PIXELS_PER_DEVICE_COLUMN 8\n#define MAX7219_X_PIXELS (MAX7219_PIXELS_PER_DEVICE_ROW*MAX7219_COLUMNS)\n#define MAX7219_Y_PIXELS (MAX7219_PIXELS_PER_DEVICE_COLUMN*MAX7219_ROWS)\n#define MAX7219_DEVICES (MAX7219_ROWS * MAX7219_COLUMNS)<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Library functions<\/h3>\n\n\n\n<p>Besides the standard initialization, you have 3 functions at your disposal that you will use intensively.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"c\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">MAX7219_STATUS MAX7219_SetPixel(int x, int y, MAX7219_Color Color);\nMAX7219_STATUS MAX7219_Clear(MAX7219_Color Color);\nMAX7219_STATUS MAX7219_Display(void);<\/pre>\n\n\n\n<p>MAX7219_SetPixel for setting a pixel, which you pass to the higher-level GFX_BW library.<\/p>\n\n\n\n<p>MAX7219_Clear for clearing the RAM buffer to a specified color.<\/p>\n\n\n\n<p>MAX7219_Display for transferring the RAM buffer to the display.<\/p>\n\n\n\n<p>We don\u2019t need anything else. GFX_BW handles the rest.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Display operation<\/h2>\n\n\n\n<p>I took two modules with 4 <a href=\"https:\/\/sklep.msalamon.pl\/kategoria-produktu\/wyswietlacze\/led\/?utm_source=blog&amp;utm_medium=article&amp;utm_campaign=max7219&amp;utm_content=Text\">MAX7219<\/a> chips each onto my desk. Connected one after another, they build a display with a resolution of 64 x 8 pixels. There are as many as 8 devices to configure, and each \u201cdigit\u201d in the <a href=\"https:\/\/sklep.msalamon.pl\/kategoria-produktu\/wyswietlacze\/led\/?utm_source=blog&amp;utm_medium=article&amp;utm_campaign=max7219&amp;utm_content=Text\">MAX7219<\/a> chips is always set, even if no pixel changes. Therefore, refreshing the entire display will take a little while. Let\u2019s see how long.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><a href=\"http:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/max7219_matrix_1_25MHz.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"144\" src=\"http:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/max7219_matrix_1_25MHz-1024x144.jpg\" alt=\"\" class=\"wp-image-877\" srcset=\"https:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/max7219_matrix_1_25MHz-1024x144.jpg 1024w, https:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/max7219_matrix_1_25MHz-300x42.jpg 300w, https:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/max7219_matrix_1_25MHz-768x108.jpg 768w, https:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/max7219_matrix_1_25MHz-1536x216.jpg 1536w, https:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/max7219_matrix_1_25MHz-24x3.jpg 24w, https:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/max7219_matrix_1_25MHz-36x5.jpg 36w, https:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/max7219_matrix_1_25MHz-160x23.jpg 160w, https:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/max7219_matrix_1_25MHz.jpg 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n<\/div>\n\n\n<p>SCK 1.25 MHz<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><a href=\"http:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/max7219_matrix_2_5MHz.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"139\" src=\"http:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/max7219_matrix_2_5MHz-1024x139.jpg\" alt=\"\" class=\"wp-image-878\" srcset=\"https:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/max7219_matrix_2_5MHz-1024x139.jpg 1024w, https:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/max7219_matrix_2_5MHz-300x41.jpg 300w, https:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/max7219_matrix_2_5MHz-768x104.jpg 768w, https:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/max7219_matrix_2_5MHz-1536x208.jpg 1536w, https:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/max7219_matrix_2_5MHz-24x3.jpg 24w, https:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/max7219_matrix_2_5MHz-36x5.jpg 36w, https:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/max7219_matrix_2_5MHz-160x22.jpg 160w, https:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/max7219_matrix_2_5MHz.jpg 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n<\/div>\n\n\n<p>SCK 2.5 MHz<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><a href=\"http:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/max7219_matrix_5MHz.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"139\" src=\"http:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/max7219_matrix_5MHz-1024x139.jpg\" alt=\"\" class=\"wp-image-879\" srcset=\"https:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/max7219_matrix_5MHz-1024x139.jpg 1024w, https:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/max7219_matrix_5MHz-300x41.jpg 300w, https:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/max7219_matrix_5MHz-768x104.jpg 768w, https:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/max7219_matrix_5MHz-1536x208.jpg 1536w, https:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/max7219_matrix_5MHz-24x3.jpg 24w, https:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/max7219_matrix_5MHz-36x5.jpg 36w, https:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/max7219_matrix_5MHz-160x22.jpg 160w, https:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/max7219_matrix_5MHz.jpg 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n<\/div>\n\n\n<p>SCK 5 MHz<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><a href=\"http:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/max7219_matrix_10MHz.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"139\" src=\"http:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/max7219_matrix_10MHz-1024x139.jpg\" alt=\"\" class=\"wp-image-880\" srcset=\"https:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/max7219_matrix_10MHz-1024x139.jpg 1024w, https:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/max7219_matrix_10MHz-300x41.jpg 300w, https:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/max7219_matrix_10MHz-768x104.jpg 768w, https:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/max7219_matrix_10MHz-1536x208.jpg 1536w, https:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/max7219_matrix_10MHz-24x3.jpg 24w, https:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/max7219_matrix_10MHz-36x5.jpg 36w, https:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/max7219_matrix_10MHz-160x22.jpg 160w, https:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/max7219_matrix_10MHz.jpg 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n<\/div>\n\n\n<p>SCK 10 MHz<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Clock 1.25 MHz \u2013 8.45 ms<\/li>\n\n\n\n<li>Clock 2.5 MHz \u2013 4.38 ms<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Clock 5 MHz \u2013 2.34 ms<\/li>\n\n\n\n<li>Clock 10 MHz \u2013 1.32 ms<\/li>\n<\/ul>\n\n\n\n<p>The differences between the results are as expected. Alright, but this probably doesn\u2019t tell you much. I\u2019ll now set as many devices as needed to get a resolution of 128 x 64, as in the case of OLEDs. That will be 16 x 8 devices, i.e. a total of 128 MAX7219 chips. I don\u2019t have that many, but the SDIN pin will still carry the signal for them \ud83d\ude42<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><a href=\"http:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/max7219_matrix_12864px_10MHz.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"139\" src=\"http:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/max7219_matrix_12864px_10MHz-1024x139.jpg\" alt=\"\" class=\"wp-image-881\" srcset=\"https:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/max7219_matrix_12864px_10MHz-1024x139.jpg 1024w, https:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/max7219_matrix_12864px_10MHz-300x41.jpg 300w, https:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/max7219_matrix_12864px_10MHz-768x104.jpg 768w, https:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/max7219_matrix_12864px_10MHz-1536x208.jpg 1536w, https:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/max7219_matrix_12864px_10MHz-24x3.jpg 24w, https:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/max7219_matrix_12864px_10MHz-36x5.jpg 36w, https:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/max7219_matrix_12864px_10MHz-160x22.jpg 160w, https:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/max7219_matrix_12864px_10MHz.jpg 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n<\/div>\n\n\n<p><\/p>\n\n\n\n<p>So what?! As much as 291 ms! Disaster&#8230; What do I need a display for if I can refresh it only 3 times per second&#8230; Can this be sped up? What if I wanted to build a matrix several times larger?!<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Speed up!<\/h3>\n\n\n\n<p>Such slow operation is unacceptable. The problem is that we perform only one assignment to one chip at a time, while No-ops are sent to the others. In this way, when sending information to 128 chips, we set only 8 pixels out of 8192. As you can easily calculate, you need to send information about eight pixels to all 128 MAXs 1024 times.&nbsp;<\/p>\n\n\n\n<p>How can this be sped up? You can eliminate those unfortunate No-ops. Instead of sending zeros to almost all chips, always send useful information to each of them. You can send data for digit zero to each one in a single go. Then for the first digits, second digits, etc. In this way we will transfer data for 128 devices <strong>only 8 times<\/strong>!<\/p>\n\n\n\n<p>To do this, the <em>MAX7219_Display<\/em> function needs to be modified so that it does not send data to individual chips, but packs into its buffer the data for each MAX and then pushes it via SPI.<\/p>\n\n\n\n<p>Of course, I managed to modify the code in this way. For the test eight chips, sending the entire frame takes several times less time.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><a href=\"http:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/max7219_matrix_1_25MHz_optimized.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"139\" src=\"http:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/max7219_matrix_1_25MHz_optimized-1024x139.jpg\" alt=\"\" class=\"wp-image-885\" srcset=\"https:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/max7219_matrix_1_25MHz_optimized-1024x139.jpg 1024w, https:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/max7219_matrix_1_25MHz_optimized-300x41.jpg 300w, https:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/max7219_matrix_1_25MHz_optimized-768x104.jpg 768w, https:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/max7219_matrix_1_25MHz_optimized-1536x208.jpg 1536w, https:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/max7219_matrix_1_25MHz_optimized-24x3.jpg 24w, https:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/max7219_matrix_1_25MHz_optimized-36x5.jpg 36w, https:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/max7219_matrix_1_25MHz_optimized-160x22.jpg 160w, https:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/max7219_matrix_1_25MHz_optimized.jpg 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n<\/div>\n\n\n<p>SCK 1.25 MHz<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><a href=\"http:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/max7219_matrix_2_5MHz_optimized.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"139\" src=\"http:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/max7219_matrix_2_5MHz_optimized-1024x139.jpg\" alt=\"\" class=\"wp-image-886\" srcset=\"https:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/max7219_matrix_2_5MHz_optimized-1024x139.jpg 1024w, https:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/max7219_matrix_2_5MHz_optimized-300x41.jpg 300w, https:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/max7219_matrix_2_5MHz_optimized-768x104.jpg 768w, https:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/max7219_matrix_2_5MHz_optimized-1536x208.jpg 1536w, https:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/max7219_matrix_2_5MHz_optimized-24x3.jpg 24w, https:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/max7219_matrix_2_5MHz_optimized-36x5.jpg 36w, https:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/max7219_matrix_2_5MHz_optimized-160x22.jpg 160w, https:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/max7219_matrix_2_5MHz_optimized.jpg 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n<\/div>\n\n\n<p>SCK 2.5 MHz<br><\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><a href=\"http:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/max7219_matrix_5MHz_optimized.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"139\" src=\"http:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/max7219_matrix_5MHz_optimized-1024x139.jpg\" alt=\"\" class=\"wp-image-887\" srcset=\"https:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/max7219_matrix_5MHz_optimized-1024x139.jpg 1024w, https:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/max7219_matrix_5MHz_optimized-300x41.jpg 300w, https:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/max7219_matrix_5MHz_optimized-768x104.jpg 768w, https:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/max7219_matrix_5MHz_optimized-1536x208.jpg 1536w, https:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/max7219_matrix_5MHz_optimized-24x3.jpg 24w, https:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/max7219_matrix_5MHz_optimized-36x5.jpg 36w, https:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/max7219_matrix_5MHz_optimized-160x22.jpg 160w, https:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/max7219_matrix_5MHz_optimized.jpg 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n<\/div>\n\n\n<p>SCK 5 MHz<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><a href=\"http:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/max7219_matrix_10MHz_optimized.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"139\" src=\"http:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/max7219_matrix_10MHz_optimized-1024x139.jpg\" alt=\"\" class=\"wp-image-888\" srcset=\"https:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/max7219_matrix_10MHz_optimized-1024x139.jpg 1024w, https:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/max7219_matrix_10MHz_optimized-300x41.jpg 300w, https:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/max7219_matrix_10MHz_optimized-768x104.jpg 768w, https:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/max7219_matrix_10MHz_optimized-1536x208.jpg 1536w, https:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/max7219_matrix_10MHz_optimized-24x3.jpg 24w, https:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/max7219_matrix_10MHz_optimized-36x5.jpg 36w, https:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/max7219_matrix_10MHz_optimized-160x22.jpg 160w, https:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/max7219_matrix_10MHz_optimized.jpg 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n<\/div>\n\n\n<p>SCK 10 MHz<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Clock 1.25 MHz \u2013 1.06 ms<\/li>\n\n\n\n<li>Clock 2.5 MHz \u2013 0.55 ms<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Clock 5 MHz \u2013 0.29 ms<\/li>\n\n\n\n<li>Clock 10 MHz \u2013 0.175 ms<\/li>\n<\/ul>\n\n\n\n<p>A beautiful reduction in refresh time. I\u2019ll just take a look at how it looks for 128\u00d764 resolution and 10 MHz on the clock:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><a href=\"http:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/max7219_matrix_12864px_10MHz_optimized.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"139\" src=\"http:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/max7219_matrix_12864px_10MHz_optimized-1024x139.jpg\" alt=\"\" class=\"wp-image-889\" srcset=\"https:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/max7219_matrix_12864px_10MHz_optimized-1024x139.jpg 1024w, https:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/max7219_matrix_12864px_10MHz_optimized-300x41.jpg 300w, https:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/max7219_matrix_12864px_10MHz_optimized-768x104.jpg 768w, https:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/max7219_matrix_12864px_10MHz_optimized-1536x208.jpg 1536w, https:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/max7219_matrix_12864px_10MHz_optimized-24x3.jpg 24w, https:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/max7219_matrix_12864px_10MHz_optimized-36x5.jpg 36w, https:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/max7219_matrix_12864px_10MHz_optimized-160x22.jpg 160w, https:\/\/msalamon.pl\/wp-content\/uploads\/2019\/04\/max7219_matrix_12864px_10MHz_optimized.jpg 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n<\/div>\n\n\n<p><\/p>\n\n\n\n<p>BOOM! <strong>Only 2.34 ms<\/strong>. That\u2019s over a hundredfold gain!<\/p>\n\n\n\n<p>I\u2019ll compile all the data I\u2019ve collected so you have a convenient comparison.<\/p>\n\n\n\n<figure class=\"wp-block-table tablepress tablepress-id-12\"><table class=\"has-fixed-layout\"><thead><tr><td><\/td><th>8 IC (64 x 8 px)<\/th><th>8 IC (64 x 8 px) optimized<\/th><th>128 IC (128 x 64 px)<\/th><th>128 IC (128 x 64 px) optimized<\/th><\/tr><\/thead><tbody><tr><td>1.25 MHz<\/td><td>8.45 ms<\/td><td>1.06 ms<\/td><td>2.13 s<\/td><td>16.70 ms<\/td><\/tr><tr><td>2.5 MHz<\/td><td>4.38 ms<\/td><td>0.55 ms<\/td><td>1.08 s<\/td><td>8.50 ms<\/td><\/tr><tr><td>5 MHz<\/td><td>2.34 ms<\/td><td>0.30 ms<\/td><td>554 ms<\/td><td>4.39 ms<\/td><\/tr><tr><td>10 MHz<\/td><td>1.32 ms<\/td><td>0.175 ms<\/td><td>291 ms<\/td><td>2.34 ms<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>And this is how it looks in action.<\/p>\n\n\n\n<p><iframe width=\"560\" height=\"315\" loading=\"lazy\" src=\"https:\/\/www.youtube.com\/embed\/szLEwkcqmo4\" frameborder=\"0\" allow=\"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Summary<\/h2>\n\n\n\n<p>Of course, this code can be further improved if needed, for example with DMA. As for me, I would end this series of posts about <a href=\"https:\/\/sklep.msalamon.pl\/kategoria-produktu\/wyswietlacze\/led\/?utm_source=blog&amp;utm_medium=article&amp;utm_campaign=max7219&amp;utm_content=Text\">MAX7219<\/a> here. Honestly, I didn\u2019t think it would turn into as many as three posts. These chips seemed trivial to me, but as I delved into them I had a lot of fun improving the code. I hope that while reading you had at least half as much fun as I did, huehue \ud83d\ude42<\/p>\n\n\n\n<p><a href=\"https:\/\/sklep.msalamon.pl\/kategoria-produktu\/wyswietlacze\/led\/?utm_source=blog&amp;utm_medium=article&amp;utm_campaign=max7219&amp;utm_content=Text\">MAX7219<\/a> is a great integrated circuit. If you can put it into your project, I recommend it as a replacement for classic GPIO multiplexing. There\u2019s no point struggling with code optimization. Let me know in the comments what you think about these chips.<\/p>\n\n\n\n<p>The full project along with the library can be found, as usual, on my GitHub: <a href=\"https:\/\/github.com\/lamik\/MAX7219_matrix_STM32_HAL\" target=\"_blank\" rel=\"noopener\">link<\/a><\/p>\n\n\n\n<p><span>If you noticed any error, disagree with something, would like to add something important, or simply think you\u2019d like to discuss this topic, write a comment. Remember that the discussion should be polite and in accordance with the rules of the Polish language.<\/span><\/p>\n\n\n<div class=\"kk-star-ratings kksr-auto kksr-align-left kksr-valign-bottom\"\n    data-payload='{&quot;align&quot;:&quot;left&quot;,&quot;id&quot;:&quot;4319&quot;,&quot;slug&quot;:&quot;default&quot;,&quot;valign&quot;:&quot;bottom&quot;,&quot;ignore&quot;:&quot;&quot;,&quot;reference&quot;:&quot;auto&quot;,&quot;class&quot;:&quot;&quot;,&quot;count&quot;:&quot;0&quot;,&quot;legendonly&quot;:&quot;&quot;,&quot;readonly&quot;:&quot;&quot;,&quot;score&quot;:&quot;0&quot;,&quot;starsonly&quot;:&quot;&quot;,&quot;best&quot;:&quot;5&quot;,&quot;gap&quot;:&quot;0&quot;,&quot;greet&quot;:&quot;&quot;,&quot;legend&quot;:&quot;0\\\/5 - (0 votes)&quot;,&quot;size&quot;:&quot;24&quot;,&quot;title&quot;:&quot;No More GPIO Multiplexing! MAX7219 in Action, Part 3&quot;,&quot;width&quot;:&quot;0&quot;,&quot;_legend&quot;:&quot;{score}\\\/{best} - ({count} {votes})&quot;,&quot;font_factor&quot;:&quot;1.25&quot;}'>\n            \n<div class=\"kksr-stars\">\n    \n<div class=\"kksr-stars-inactive\">\n            <div class=\"kksr-star\" data-star=\"1\" style=\"padding-right: 0px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"2\" style=\"padding-right: 0px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"3\" style=\"padding-right: 0px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"4\" style=\"padding-right: 0px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"5\" style=\"padding-right: 0px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n    <\/div>\n    \n<div class=\"kksr-stars-active\" style=\"width: 0px;\">\n            <div class=\"kksr-star\" style=\"padding-right: 0px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 0px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 0px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 0px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 0px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n    <\/div>\n<\/div>\n                \n\n<div class=\"kksr-legend\" style=\"font-size: 19.2px;\">\n            <span class=\"kksr-muted\"><\/span>\n    <\/div>\n    <\/div>\n","protected":false},"excerpt":{"rendered":"<p>It\u2019s time to use MAX7219 in a slightly different way than it was probably originally designed for. We will create graphic LED displays controlled by a higher-level graphics library. This will work exactly the same way as, for example, OLEDs. See how simple it is \ud83d\ude42<\/p>\n","protected":false},"author":1,"featured_media":3174,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","_links_to":"","_links_to_target":""},"categories":[160],"tags":[175,176,174,177],"class_list":["post-4319","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-stm32","tag-electronics","tag-programming","tag-stm32","tag-stm32cubemx"],"_links":{"self":[{"href":"https:\/\/msalamon.pl\/en\/wp-json\/wp\/v2\/posts\/4319","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/msalamon.pl\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/msalamon.pl\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/msalamon.pl\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/msalamon.pl\/en\/wp-json\/wp\/v2\/comments?post=4319"}],"version-history":[{"count":3,"href":"https:\/\/msalamon.pl\/en\/wp-json\/wp\/v2\/posts\/4319\/revisions"}],"predecessor-version":[{"id":4422,"href":"https:\/\/msalamon.pl\/en\/wp-json\/wp\/v2\/posts\/4319\/revisions\/4422"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/msalamon.pl\/en\/wp-json\/wp\/v2\/media\/3174"}],"wp:attachment":[{"href":"https:\/\/msalamon.pl\/en\/wp-json\/wp\/v2\/media?parent=4319"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/msalamon.pl\/en\/wp-json\/wp\/v2\/categories?post=4319"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/msalamon.pl\/en\/wp-json\/wp\/v2\/tags?post=4319"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}