{"id":2208,"date":"2022-05-06T10:12:28","date_gmt":"2022-05-06T10:12:28","guid":{"rendered":"https:\/\/picockpit.com\/raspberry-pi\/?p=2208"},"modified":"2023-09-18T13:52:24","modified_gmt":"2023-09-18T13:52:24","slug":"spi-the-serial-peripheral-interface","status":"publish","type":"post","link":"https:\/\/picockpit.com\/raspberry-pi\/pt\/spi-the-serial-peripheral-interface\/","title":{"rendered":"SPI - O Interface Perif\u00e9rico Serial"},"content":{"rendered":"<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/05\/everything-about-spi-title-image-1024x576.png\" alt=\"Tudo sobre a imagem do t\u00edtulo SPI\" class=\"wp-image-5345\" srcset=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/05\/everything-about-spi-title-image-1024x576.png 1024w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/05\/everything-about-spi-title-image-300x169.png 300w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/05\/everything-about-spi-title-image-768x432.png 768w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/05\/everything-about-spi-title-image-18x10.png 18w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/05\/everything-about-spi-title-image.png 1200w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>SPI significa Interface Perif\u00e9rico Serial. Com o SPI \u00e9 poss\u00edvel trocar dados de forma flamejante e r\u00e1pida entre dois dispositivos. E s\u00f3 s\u00e3o necess\u00e1rios quatro fios.<\/p>\n\n\n\n\n\n<h2 class=\"wp-block-heading\">Caracter\u00edsticas do SPI<\/h2>\n\n\n\n<p>A interface perif\u00e9rica de s\u00e9rie \u00e9 uma interface de comunica\u00e7\u00e3o s\u00edncrona para dist\u00e2ncias curtas. S\u00edncrona significa que os dados s\u00e3o enviados em forma de blocos ou frames e os dois dispositivos s\u00e3o sincronizados utilizando um rel\u00f3gio. \u00c9 uma interface de s\u00e9rie, pelo que os dispositivos enviam um bit de cada vez (ao contr\u00e1rio da comunica\u00e7\u00e3o paralela). Um dos dispositivos \u00e9 o \"Mestre\" e dita o ciclo do rel\u00f3gio. O outro dispositivo \u00e9 o \"Slave\". Normalmente a comunica\u00e7\u00e3o est\u00e1 em modo full duplex. Assim, ambos os dispositivos podem enviar dados, mesmo ao mesmo tempo.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/05\/SPI-Characteristics-1024x275.jpg\" alt=\"Caracter\u00edsticas do SPI\" class=\"wp-image-2211\" style=\"width:676px;height:181px\" width=\"676\" height=\"181\" srcset=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/05\/SPI-Characteristics-1024x275.jpg 1024w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/05\/SPI-Characteristics-300x81.jpg 300w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/05\/SPI-Characteristics-768x207.jpg 768w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/05\/SPI-Characteristics-1536x413.jpg 1536w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/05\/SPI-Characteristics-2048x551.jpg 2048w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/05\/SPI-Characteristics-18x5.jpg 18w\" sizes=\"auto, (max-width: 676px) 100vw, 676px\" \/><figcaption class=\"wp-element-caption\">Caracter\u00edsticas do SPI<\/figcaption><\/figure>\n<\/div>\n\n\n<h2 class=\"wp-block-heading\">Cablagem<\/h2>\n\n\n\n<p>S\u00f3 s\u00e3o necess\u00e1rios quatro fios para a liga\u00e7\u00e3o, por isso \u00e9 muito f\u00e1cil de instalar.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/05\/SPI-Wiring-1024x497.jpg\" alt=\"Cablagem SPI\" class=\"wp-image-2217\" style=\"width:665px;height:322px\" width=\"665\" height=\"322\" srcset=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/05\/SPI-Wiring-1024x497.jpg 1024w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/05\/SPI-Wiring-300x146.jpg 300w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/05\/SPI-Wiring-768x372.jpg 768w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/05\/SPI-Wiring-1536x745.jpg 1536w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/05\/SPI-Wiring-2048x993.jpg 2048w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/05\/SPI-Wiring-18x9.jpg 18w\" sizes=\"auto, (max-width: 665px) 100vw, 665px\" \/><figcaption class=\"wp-element-caption\">Cablagem SPI<\/figcaption><\/figure>\n<\/div>\n\n\n<p>Existem quatro pinos que necessita para uma liga\u00e7\u00e3o SPI: o Rel\u00f3gio em S\u00e9rie (SCL ou SCLK), a Entrada Escravo de Sa\u00edda Principal (MOSI), a Entrada Escravo de Sa\u00edda Principal (MISO) e o Pino Selec\u00e7\u00e3o de Chip ou Selec\u00e7\u00e3o de Escravo (CS ou SS).<\/p>\n\n\n\n<p>Ligar os pinos correspondentes nos dispositivos Master e Slave.<\/p>\n\n\n\n<p>Um dispositivo Master pode ligar-se a m\u00faltiplos dispositivos Slave, desde que tenha suficientes pinos de selec\u00e7\u00e3o de chip. O Master controla qual o dispositivo Slave que recebe os dados, definindo o pino de selec\u00e7\u00e3o do chip correspondente para BAIXO ou ALTO.<\/p>\n\n\n\n<p>O Raspberry Pi 4 tem 7 autocarros SPI . Se quiser saber como aceder aos autocarros SPI de 1 a 6, deixe um coment\u00e1rio abaixo.<\/p>\n\n\n\n<p>Vamos dar uma olhada no <a href=\"https:\/\/www.raspberrypi.com\/documentation\/computers\/raspberry-pi.html#spi-overview\">SPI bus 0<\/a>.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\" id=\"raspberry-pi-pinout\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/05\/Pinout-1024x584.jpg\" alt=\"Pi Pinout de framboesa\" class=\"wp-image-2218\" style=\"width:659px;height:376px\" width=\"659\" height=\"376\" srcset=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/05\/Pinout-1024x584.jpg 1024w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/05\/Pinout-300x171.jpg 300w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/05\/Pinout-768x438.jpg 768w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/05\/Pinout-1536x876.jpg 1536w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/05\/Pinout-2048x1167.jpg 2048w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/05\/Pinout-18x10.jpg 18w\" sizes=\"auto, (max-width: 659px) 100vw, 659px\" \/><figcaption class=\"wp-element-caption\">Pi Pinout de framboesa<\/figcaption><\/figure>\n<\/div>\n\n\n<p>Como pode ver no <a href=\"#raspberry-pi-pinout\">gr\u00e1fico pinout<\/a> acima do pino 23 \u00e9 o pino SCLK no Raspberry Pi. MISO \u00e9 o pino 21 e MOSI \u00e9 o pino 19.  O autocarro 0 tem dois pinos CS que s\u00e3o os pinos 24 e 26.<\/p>\n\n\n\n<p>Se quiser usar o autocarro 0, certifique-se de o activar primeiro.<\/p>\n\n\n\n<figure class=\"wp-block-video\"><video height=\"1080\" style=\"aspect-ratio: 1920 \/ 1080;\" width=\"1920\" controls src=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/05\/Enable-SPI.mp4\"><\/video><\/figure>\n\n\n\n<p>Executar o comando<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code data-no-translation=\"\">sudo raspi-config<\/code><\/pre>\n\n\n\n<p>Depois seleccione <strong>3 Op\u00e7\u00f5es de Interface<\/strong> e clique <strong>I4 SPI<\/strong>. Finalmente imprensa <strong>Sim<\/strong> e <strong>Ok<\/strong> para permitir o SPI.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Modos SPI<\/h2>\n\n\n\n<p>Existem quatro modos diferentes de transmiss\u00e3o de dados que deve estar ciente. Diferem na polaridade do rel\u00f3gio e na fase do rel\u00f3gio.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"310\" src=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/05\/SPI-Modes-1024x310.jpg\" alt=\"Modos SPI\" class=\"wp-image-2216\" srcset=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/05\/SPI-Modes-1024x310.jpg 1024w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/05\/SPI-Modes-300x91.jpg 300w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/05\/SPI-Modes-768x233.jpg 768w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/05\/SPI-Modes-1536x465.jpg 1536w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/05\/SPI-Modes-2048x620.jpg 2048w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/05\/SPI-Modes-18x5.jpg 18w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">Modos SPI<\/figcaption><\/figure>\n\n\n\n<p>Ambos podem ser 0 ou 1. Relativamente \u00e0 polaridade do rel\u00f3gio, um 0 significa um LOW idle state e um 1 significa um HIGH idle state. Uma fase de 0 significa que os dados s\u00e3o enviados na borda descendente, enquanto que um 1 significa que os dados s\u00e3o enviados na borda ascendente. Antes de poderem enviar os dados, o Mestre e o Escravo t\u00eam de concordar com um dos quatro modos.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Vantagens<\/h2>\n\n\n\n<p>As maiores vantagens s\u00e3o a alta velocidade, a facilidade de instala\u00e7\u00e3o de hardware e software e a baixa necessidade de energia.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/05\/SPI-Advantages-1024x557.jpg\" alt=\"Vantagens\" class=\"wp-image-2215\" style=\"width:369px;height:200px\" width=\"369\" height=\"200\" srcset=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/05\/SPI-Advantages-1024x557.jpg 1024w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/05\/SPI-Advantages-300x163.jpg 300w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/05\/SPI-Advantages-768x418.jpg 768w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/05\/SPI-Advantages-18x10.jpg 18w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/05\/SPI-Advantages.jpg 1104w\" sizes=\"auto, (max-width: 369px) 100vw, 369px\" \/><figcaption class=\"wp-element-caption\">Vantagens<\/figcaption><\/figure>\n<\/div>\n\n\n<h2 class=\"wp-block-heading\">Desvantagens<\/h2>\n\n\n\n<p>A interface perif\u00e9rica de s\u00e9rie n\u00e3o \u00e9 realmente extens\u00edvel no alcance e n\u00famero de dispositivos, uma vez que o Master neads um pino de selec\u00e7\u00e3o de chip para cada dispositivo. Tamb\u00e9m n\u00e3o h\u00e1 reconhecimento de Slave de hardware, pelo que o Master n\u00e3o sabe se os dados s\u00e3o recebidos por algu\u00e9m.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/05\/SPI-Disadvantages-1024x558.jpg\" alt=\"Desvantagens\" class=\"wp-image-2214\" style=\"width:366px;height:199px\" width=\"366\" height=\"199\" srcset=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/05\/SPI-Disadvantages-1024x558.jpg 1024w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/05\/SPI-Disadvantages-300x163.jpg 300w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/05\/SPI-Disadvantages-768x418.jpg 768w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/05\/SPI-Disadvantages-18x10.jpg 18w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/05\/SPI-Disadvantages.jpg 1103w\" sizes=\"auto, (max-width: 366px) 100vw, 366px\" \/><figcaption class=\"wp-element-caption\">Desvantagens<\/figcaption><\/figure>\n<\/div>\n\n\n<h2 class=\"wp-block-heading\">Casos de utiliza\u00e7\u00e3o<\/h2>\n\n\n\n<p>A maioria dos dispositivos SPI s\u00e3o dispositivos incorporados ou <a href=\"https:\/\/buyzero.de\/products\/1-3-spi-colour-lcd-240x240-breakout?_pos=1&amp;_sid=2104ef18d&amp;_ss=r\">LCD-Displays<\/a>. Em geral, \u00e9 utilizado em \u00e1reas onde s\u00e3o necess\u00e1rios poucos dispositivos e uma r\u00e1pida transmiss\u00e3o de dados.<\/p>\n\n\n\n<p>Permite que o Raspberry Pi fa\u00e7a interface com todos os tipos de <a href=\"https:\/\/buyzero.de\/search?type=product&amp;options%5Bprefix%5D=last&amp;options%5Bunavailable_products%5D=last&amp;q=SPI\">sensores e dispositivos<\/a>. Quase todos os dispositivos compat\u00edveis Raspberry Pi utilizam o SPI ou a interface I2C.<\/p>\n\n\n\n<p>Os cart\u00f5es SD utilizam tamb\u00e9m a interface SPI, pelo que mesmo o leitor de cart\u00f5es SD no Raspberry Pi tem alguns pinos internos MISO e MOSI.<\/p>\n<div class=\"shariff shariff-align-center shariff-widget-align-left shariff-buttonstretch\"><ul class=\"shariff-buttons theme-white orientation-horizontal buttonsize-medium\"><li class=\"shariff-button twitter shariff-nocustomcolor\" style=\"background-color:#595959\"><a href=\"https:\/\/twitter.com\/share?url=https%3A%2F%2Fpicockpit.com%2Fraspberry-pi%2Fpt%2Fspi-the-serial-peripheral-interface%2F&text=SPI%20%E2%80%93%20The%20Serial%20Peripheral%20Interface\" title=\"Compartilhar no X\" aria-label=\"Compartilhar no X\" role=\"button\" rel=\"noopener nofollow\" class=\"shariff-link\" style=\"; background-color:#000; color:#000\" target=\"_blank\"><span class=\"shariff-icon\" style=\"fill:#000\"><svg width=\"32px\" height=\"20px\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewbox=\"0 0 24 24\"><path fill=\"#000\" d=\"M14.258 10.152L23.176 0h-2.113l-7.747 8.813L7.133 0H0l9.352 13.328L0 23.973h2.113l8.176-9.309 6.531 9.309h7.133zm-2.895 3.293l-.949-1.328L2.875 1.56h3.246l6.086 8.523.945 1.328 7.91 11.078h-3.246zm0 0\"\/><\/svg><\/span><span class=\"shariff-text\" style=\"color:#000\">partilhar<\/span>&nbsp;<\/a><\/li><li class=\"shariff-button facebook shariff-nocustomcolor\" style=\"background-color:#4273c8\"><a href=\"https:\/\/www.facebook.com\/sharer\/sharer.php?u=https%3A%2F%2Fpicockpit.com%2Fraspberry-pi%2Fpt%2Fspi-the-serial-peripheral-interface%2F\" title=\"Partilhar no Facebook\" aria-label=\"Partilhar no Facebook\" role=\"button\" rel=\"nofollow\" class=\"shariff-link\" style=\"; background-color:#3b5998; color:#3b5998\" target=\"_blank\"><span class=\"shariff-icon\" style=\"fill:#3b5998\"><svg width=\"32px\" height=\"20px\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewbox=\"0 0 18 32\"><path fill=\"#3b5998\" d=\"M17.1 0.2v4.7h-2.8q-1.5 0-2.1 0.6t-0.5 1.9v3.4h5.2l-0.7 5.3h-4.5v13.6h-5.5v-13.6h-4.5v-5.3h4.5v-3.9q0-3.3 1.9-5.2t5-1.8q2.6 0 4.1 0.2z\"\/><\/svg><\/span><span class=\"shariff-text\" style=\"color:#3b5998\">partilhar<\/span>&nbsp;<\/a><\/li><li class=\"shariff-button telegram shariff-nocustomcolor\" style=\"background-color:#4084A6\"><a href=\"https:\/\/telegram.me\/share\/url?url=https%3A%2F%2Fpicockpit.com%2Fraspberry-pi%2Fpt%2Fspi-the-serial-peripheral-interface%2F&text=SPI%20%E2%80%93%20The%20Serial%20Peripheral%20Interface\" title=\"Compartilhar no Telegram\" aria-label=\"Compartilhar no Telegram\" role=\"button\" rel=\"noopener nofollow\" class=\"shariff-link\" style=\"; background-color:#0088cc; color:#0088cc\" target=\"_blank\"><span class=\"shariff-icon\" style=\"fill:#0088cc\"><svg width=\"32px\" height=\"20px\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewbox=\"0 0 32 32\"><path fill=\"#0088cc\" d=\"M30.8 6.5l-4.5 21.4c-.3 1.5-1.2 1.9-2.5 1.2L16.9 24l-3.3 3.2c-.4.4-.7.7-1.4.7l.5-7L25.5 9.2c.6-.5-.1-.8-.9-.3l-15.8 10L2 16.7c-1.5-.5-1.5-1.5.3-2.2L28.9 4.3c1.3-.5 2.3.3 1.9 2.2z\"\/><\/svg><\/span><span class=\"shariff-text\" style=\"color:#0088cc\">partilhar<\/span>&nbsp;<\/a><\/li><li class=\"shariff-button reddit shariff-nocustomcolor\" style=\"background-color:#ff5700\"><a href=\"https:\/\/www.reddit.com\/submit?url=https%3A%2F%2Fpicockpit.com%2Fraspberry-pi%2Fpt%2Fspi-the-serial-peripheral-interface%2F\" title=\"Compartilhar no Reddit\" aria-label=\"Compartilhar no Reddit\" role=\"button\" rel=\"noopener nofollow\" class=\"shariff-link\" style=\"; background-color:#ff4500; color:#ff4500\" target=\"_blank\"><span class=\"shariff-icon\" style=\"fill:#ff4500\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewbox=\"0 0 512 512\"><path fill=\"#ff4500\" d=\"M440.3 203.5c-15 0-28.2 6.2-37.9 15.9-35.7-24.7-83.8-40.6-137.1-42.3L293 52.3l88.2 19.8c0 21.6 17.6 39.2 39.2 39.2 22 0 39.7-18.1 39.7-39.7s-17.6-39.7-39.7-39.7c-15.4 0-28.7 9.3-35.3 22l-97.4-21.6c-4.9-1.3-9.7 2.2-11 7.1L246.3 177c-52.9 2.2-100.5 18.1-136.3 42.8-9.7-10.1-23.4-16.3-38.4-16.3-55.6 0-73.8 74.6-22.9 100.1-1.8 7.9-2.6 16.3-2.6 24.7 0 83.8 94.4 151.7 210.3 151.7 116.4 0 210.8-67.9 210.8-151.7 0-8.4-.9-17.2-3.1-25.1 49.9-25.6 31.5-99.7-23.8-99.7zM129.4 308.9c0-22 17.6-39.7 39.7-39.7 21.6 0 39.2 17.6 39.2 39.7 0 21.6-17.6 39.2-39.2 39.2-22 .1-39.7-17.6-39.7-39.2zm214.3 93.5c-36.4 36.4-139.1 36.4-175.5 0-4-3.5-4-9.7 0-13.7 3.5-3.5 9.7-3.5 13.2 0 27.8 28.5 120 29 149 0 3.5-3.5 9.7-3.5 13.2 0 4.1 4 4.1 10.2.1 13.7zm-.8-54.2c-21.6 0-39.2-17.6-39.2-39.2 0-22 17.6-39.7 39.2-39.7 22 0 39.7 17.6 39.7 39.7-.1 21.5-17.7 39.2-39.7 39.2z\"\/><\/svg><\/span><span class=\"shariff-text\" style=\"color:#ff4500\">partilhar<\/span>&nbsp;<\/a><\/li><\/ul><\/div>","protected":false},"excerpt":{"rendered":"<p>SPI significa Interface Perif\u00e9rico Serial. Com o SPI \u00e9 poss\u00edvel trocar dados de forma flamejante e r\u00e1pida entre dois dispositivos. E s\u00f3 s\u00e3o necess\u00e1rios quatro fios. Caracter\u00edsticas do SPI A interface perif\u00e9rica de s\u00e9rie \u00e9 uma interface de comunica\u00e7\u00e3o s\u00edncrona para curtas dist\u00e2ncias. S\u00edncrona significa que os dados s\u00e3o enviados em forma de blocos ou frames e os dois dispositivos s\u00e3o...<\/p>","protected":false},"author":3,"featured_media":5345,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[196],"tags":[199,200,202,201,204,189,203,188,198,197],"class_list":["post-2208","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-interfaces","tag-4-wire-interface","tag-4-wire-spi","tag-hardware","tag-interface","tag-knowledge","tag-pi","tag-rasbperry-pi","tag-raspberry","tag-serial-peripheral-interface","tag-spi"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>SPI - The Serial Peripheral Interface | PiCockpit<\/title>\n<meta name=\"description\" content=\"SPI means Serial Peripheral Interface. With SPI you can exchange data blazingly fast between two devices. And you only need four wires.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/picockpit.com\/raspberry-pi\/pt\/spi-the-serial-peripheral-interface\/\" \/>\n<meta property=\"og:locale\" content=\"pt_PT\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"SPI - The Serial Peripheral Interface | PiCockpit\" \/>\n<meta property=\"og:description\" content=\"SPI means Serial Peripheral Interface. With SPI you can exchange data blazingly fast between two devices. And you only need four wires.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/picockpit.com\/raspberry-pi\/pt\/spi-the-serial-peripheral-interface\/\" \/>\n<meta property=\"og:site_name\" content=\"PiCockpit\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/pi3gshop\" \/>\n<meta property=\"article:published_time\" content=\"2022-05-06T10:12:28+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-09-18T13:52:24+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/05\/everything-about-spi-title-image.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"675\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Nathan Busler\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@pi3g\" \/>\n<meta name=\"twitter:site\" content=\"@pi3g\" \/>\n<meta name=\"twitter:label1\" content=\"Escrito por\" \/>\n\t<meta name=\"twitter:data1\" content=\"Nathan Busler\" \/>\n\t<meta name=\"twitter:label2\" content=\"Tempo estimado de leitura\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutos\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/pl\\\/spi-interfejs-serial-peripheral-interface\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/pl\\\/spi-interfejs-serial-peripheral-interface\\\/\"},\"author\":{\"name\":\"Nathan Busler\",\"@id\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/#\\\/schema\\\/person\\\/e38fef75134e5e54175b2615a8c3eb47\"},\"headline\":\"SPI &#8211; The Serial Peripheral Interface\",\"datePublished\":\"2022-05-06T10:12:28+00:00\",\"dateModified\":\"2023-09-18T13:52:24+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/pl\\\/spi-interfejs-serial-peripheral-interface\\\/\"},\"wordCount\":564,\"commentCount\":5,\"publisher\":{\"@id\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/pl\\\/spi-interfejs-serial-peripheral-interface\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/wp-content\\\/uploads\\\/2022\\\/05\\\/everything-about-spi-title-image.png\",\"keywords\":[\"4-Wire-Interface\",\"4-Wire-SPI\",\"Hardware\",\"Interface\",\"Knowledge\",\"Pi\",\"Rasbperry Pi\",\"Raspberry\",\"Serial Peripheral Interface\",\"SPI\"],\"articleSection\":[\"Interfaces\"],\"inLanguage\":\"pt-PT\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/pl\\\/spi-interfejs-serial-peripheral-interface\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/pl\\\/spi-interfejs-serial-peripheral-interface\\\/\",\"url\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/pl\\\/spi-interfejs-serial-peripheral-interface\\\/\",\"name\":\"SPI - The Serial Peripheral Interface | PiCockpit\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/pl\\\/spi-interfejs-serial-peripheral-interface\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/pl\\\/spi-interfejs-serial-peripheral-interface\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/wp-content\\\/uploads\\\/2022\\\/05\\\/everything-about-spi-title-image.png\",\"datePublished\":\"2022-05-06T10:12:28+00:00\",\"dateModified\":\"2023-09-18T13:52:24+00:00\",\"description\":\"SPI means Serial Peripheral Interface. With SPI you can exchange data blazingly fast between two devices. And you only need four wires.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/pl\\\/spi-interfejs-serial-peripheral-interface\\\/#breadcrumb\"},\"inLanguage\":\"pt-PT\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/pl\\\/spi-interfejs-serial-peripheral-interface\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"pt-PT\",\"@id\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/pl\\\/spi-interfejs-serial-peripheral-interface\\\/#primaryimage\",\"url\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/wp-content\\\/uploads\\\/2022\\\/05\\\/everything-about-spi-title-image.png\",\"contentUrl\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/wp-content\\\/uploads\\\/2022\\\/05\\\/everything-about-spi-title-image.png\",\"width\":1200,\"height\":675,\"caption\":\"Everything about SPI Title Image\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/pl\\\/spi-interfejs-serial-peripheral-interface\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Interfaces\",\"item\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/category\\\/interfaces\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"SPI &#8211; The Serial Peripheral Interface\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/#website\",\"url\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/\",\"name\":\"PiCockpit\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"pt-PT\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/#organization\",\"name\":\"PiCockpit.com\",\"url\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"pt-PT\",\"@id\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/wp-content\\\/uploads\\\/2023\\\/07\\\/Screenshot-from-2023-07-24-15-01-24.png\",\"contentUrl\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/wp-content\\\/uploads\\\/2023\\\/07\\\/Screenshot-from-2023-07-24-15-01-24.png\",\"width\":1165,\"height\":283,\"caption\":\"PiCockpit.com\"},\"image\":{\"@id\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/pi3gshop\",\"https:\\\/\\\/x.com\\\/pi3g\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/#\\\/schema\\\/person\\\/e38fef75134e5e54175b2615a8c3eb47\",\"name\":\"Nathan Busler\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"pt-PT\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/93fef66631dac0f47ce2c90f774cd4e4fe44028ea5266602e20fbf246f7d14f9?s=96&d=blank&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/93fef66631dac0f47ce2c90f774cd4e4fe44028ea5266602e20fbf246f7d14f9?s=96&d=blank&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/93fef66631dac0f47ce2c90f774cd4e4fe44028ea5266602e20fbf246f7d14f9?s=96&d=blank&r=g\",\"caption\":\"Nathan Busler\"},\"sameAs\":[\"https:\\\/\\\/buyzero.de\"],\"url\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/pt\\\/author\\\/nathan\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"SPI - A Interface Perif\u00e9rica Serial | PiCockpit","description":"SPI significa Interface Perif\u00e9rico Serial. Com o SPI \u00e9 poss\u00edvel trocar dados de forma flamejante e r\u00e1pida entre dois dispositivos. E s\u00f3 s\u00e3o necess\u00e1rios quatro fios.","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:\/\/picockpit.com\/raspberry-pi\/pt\/spi-the-serial-peripheral-interface\/","og_locale":"pt_PT","og_type":"article","og_title":"SPI - The Serial Peripheral Interface | PiCockpit","og_description":"SPI means Serial Peripheral Interface. With SPI you can exchange data blazingly fast between two devices. And you only need four wires.","og_url":"https:\/\/picockpit.com\/raspberry-pi\/pt\/spi-the-serial-peripheral-interface\/","og_site_name":"PiCockpit","article_publisher":"https:\/\/www.facebook.com\/pi3gshop","article_published_time":"2022-05-06T10:12:28+00:00","article_modified_time":"2023-09-18T13:52:24+00:00","og_image":[{"width":1200,"height":675,"url":"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/05\/everything-about-spi-title-image.png","type":"image\/png"}],"author":"Nathan Busler","twitter_card":"summary_large_image","twitter_creator":"@pi3g","twitter_site":"@pi3g","twitter_misc":{"Escrito por":"Nathan Busler","Tempo estimado de leitura":"4 minutos"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/picockpit.com\/raspberry-pi\/pl\/spi-interfejs-serial-peripheral-interface\/#article","isPartOf":{"@id":"https:\/\/picockpit.com\/raspberry-pi\/pl\/spi-interfejs-serial-peripheral-interface\/"},"author":{"name":"Nathan Busler","@id":"https:\/\/picockpit.com\/raspberry-pi\/#\/schema\/person\/e38fef75134e5e54175b2615a8c3eb47"},"headline":"SPI &#8211; The Serial Peripheral Interface","datePublished":"2022-05-06T10:12:28+00:00","dateModified":"2023-09-18T13:52:24+00:00","mainEntityOfPage":{"@id":"https:\/\/picockpit.com\/raspberry-pi\/pl\/spi-interfejs-serial-peripheral-interface\/"},"wordCount":564,"commentCount":5,"publisher":{"@id":"https:\/\/picockpit.com\/raspberry-pi\/#organization"},"image":{"@id":"https:\/\/picockpit.com\/raspberry-pi\/pl\/spi-interfejs-serial-peripheral-interface\/#primaryimage"},"thumbnailUrl":"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/05\/everything-about-spi-title-image.png","keywords":["4-Wire-Interface","4-Wire-SPI","Hardware","Interface","Knowledge","Pi","Rasbperry Pi","Raspberry","Serial Peripheral Interface","SPI"],"articleSection":["Interfaces"],"inLanguage":"pt-PT","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/picockpit.com\/raspberry-pi\/pl\/spi-interfejs-serial-peripheral-interface\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/picockpit.com\/raspberry-pi\/pl\/spi-interfejs-serial-peripheral-interface\/","url":"https:\/\/picockpit.com\/raspberry-pi\/pl\/spi-interfejs-serial-peripheral-interface\/","name":"SPI - A Interface Perif\u00e9rica Serial | PiCockpit","isPartOf":{"@id":"https:\/\/picockpit.com\/raspberry-pi\/#website"},"primaryImageOfPage":{"@id":"https:\/\/picockpit.com\/raspberry-pi\/pl\/spi-interfejs-serial-peripheral-interface\/#primaryimage"},"image":{"@id":"https:\/\/picockpit.com\/raspberry-pi\/pl\/spi-interfejs-serial-peripheral-interface\/#primaryimage"},"thumbnailUrl":"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/05\/everything-about-spi-title-image.png","datePublished":"2022-05-06T10:12:28+00:00","dateModified":"2023-09-18T13:52:24+00:00","description":"SPI significa Interface Perif\u00e9rico Serial. Com o SPI \u00e9 poss\u00edvel trocar dados de forma flamejante e r\u00e1pida entre dois dispositivos. E s\u00f3 s\u00e3o necess\u00e1rios quatro fios.","breadcrumb":{"@id":"https:\/\/picockpit.com\/raspberry-pi\/pl\/spi-interfejs-serial-peripheral-interface\/#breadcrumb"},"inLanguage":"pt-PT","potentialAction":[{"@type":"ReadAction","target":["https:\/\/picockpit.com\/raspberry-pi\/pl\/spi-interfejs-serial-peripheral-interface\/"]}]},{"@type":"ImageObject","inLanguage":"pt-PT","@id":"https:\/\/picockpit.com\/raspberry-pi\/pl\/spi-interfejs-serial-peripheral-interface\/#primaryimage","url":"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/05\/everything-about-spi-title-image.png","contentUrl":"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/05\/everything-about-spi-title-image.png","width":1200,"height":675,"caption":"Everything about SPI Title Image"},{"@type":"BreadcrumbList","@id":"https:\/\/picockpit.com\/raspberry-pi\/pl\/spi-interfejs-serial-peripheral-interface\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/picockpit.com\/raspberry-pi\/"},{"@type":"ListItem","position":2,"name":"Interfaces","item":"https:\/\/picockpit.com\/raspberry-pi\/category\/interfaces\/"},{"@type":"ListItem","position":3,"name":"SPI &#8211; The Serial Peripheral Interface"}]},{"@type":"WebSite","@id":"https:\/\/picockpit.com\/raspberry-pi\/#website","url":"https:\/\/picockpit.com\/raspberry-pi\/","name":"PiCockpit","description":"","publisher":{"@id":"https:\/\/picockpit.com\/raspberry-pi\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/picockpit.com\/raspberry-pi\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"pt-PT"},{"@type":"Organization","@id":"https:\/\/picockpit.com\/raspberry-pi\/#organization","name":"PiCockpit.com","url":"https:\/\/picockpit.com\/raspberry-pi\/","logo":{"@type":"ImageObject","inLanguage":"pt-PT","@id":"https:\/\/picockpit.com\/raspberry-pi\/#\/schema\/logo\/image\/","url":"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2023\/07\/Screenshot-from-2023-07-24-15-01-24.png","contentUrl":"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2023\/07\/Screenshot-from-2023-07-24-15-01-24.png","width":1165,"height":283,"caption":"PiCockpit.com"},"image":{"@id":"https:\/\/picockpit.com\/raspberry-pi\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/pi3gshop","https:\/\/x.com\/pi3g"]},{"@type":"Person","@id":"https:\/\/picockpit.com\/raspberry-pi\/#\/schema\/person\/e38fef75134e5e54175b2615a8c3eb47","name":"Nathan Busler","image":{"@type":"ImageObject","inLanguage":"pt-PT","@id":"https:\/\/secure.gravatar.com\/avatar\/93fef66631dac0f47ce2c90f774cd4e4fe44028ea5266602e20fbf246f7d14f9?s=96&d=blank&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/93fef66631dac0f47ce2c90f774cd4e4fe44028ea5266602e20fbf246f7d14f9?s=96&d=blank&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/93fef66631dac0f47ce2c90f774cd4e4fe44028ea5266602e20fbf246f7d14f9?s=96&d=blank&r=g","caption":"Nathan Busler"},"sameAs":["https:\/\/buyzero.de"],"url":"https:\/\/picockpit.com\/raspberry-pi\/pt\/author\/nathan\/"}]}},"_links":{"self":[{"href":"https:\/\/picockpit.com\/raspberry-pi\/pt\/wp-json\/wp\/v2\/posts\/2208","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/picockpit.com\/raspberry-pi\/pt\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/picockpit.com\/raspberry-pi\/pt\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/picockpit.com\/raspberry-pi\/pt\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/picockpit.com\/raspberry-pi\/pt\/wp-json\/wp\/v2\/comments?post=2208"}],"version-history":[{"count":13,"href":"https:\/\/picockpit.com\/raspberry-pi\/pt\/wp-json\/wp\/v2\/posts\/2208\/revisions"}],"predecessor-version":[{"id":5347,"href":"https:\/\/picockpit.com\/raspberry-pi\/pt\/wp-json\/wp\/v2\/posts\/2208\/revisions\/5347"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/picockpit.com\/raspberry-pi\/pt\/wp-json\/wp\/v2\/media\/5345"}],"wp:attachment":[{"href":"https:\/\/picockpit.com\/raspberry-pi\/pt\/wp-json\/wp\/v2\/media?parent=2208"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/picockpit.com\/raspberry-pi\/pt\/wp-json\/wp\/v2\/categories?post=2208"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/picockpit.com\/raspberry-pi\/pt\/wp-json\/wp\/v2\/tags?post=2208"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}