{"id":102,"date":"2012-05-24T08:47:58","date_gmt":"2012-05-24T08:47:58","guid":{"rendered":"http:\/\/www.electronic-products-development.com\/?p=102"},"modified":"2022-02-18T15:37:50","modified_gmt":"2022-02-18T15:37:50","slug":"spi-dspic","status":"publish","type":"post","link":"https:\/\/ibex.tech\/embedded\/microchip\/dspic\/c30-compiler-dspic\/spi-dspic","title":{"rendered":"SPI"},"content":{"rendered":"<pre>\r\n<code>\r\n\/\/----- SETUP SPI 1 -----\r\n\/\/Used for: Flash memory IC\r\nw_temp = SPI1BUF;\r\nSPI1STAT = 0;\r\nSPI1CON1 = 0x0320; \/\/SPI in master mode\r\n\/\/Data is valid on the rising edge of the clock (Transmit occurs on transition from active to idle clock state)\r\n\/\/Clock low in idle bus state\r\nSPI1CON1bits.PPRE1 = 1; \/\/Prescallers 4:1 1:1 = 10MHz (max possible from this device)\r\nSPI1CON1bits.PPRE0 = 0;\r\nSPI1CON1bits.SPRE2 = 1;\r\nSPI1CON1bits.SPRE1 = 1;\r\nSPI1CON1bits.SPRE0 = 1;\r\nSPI1CON2 = 0;\r\nSPI1STATbits.SPIEN = 1; \/\/Enable the port\r\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\/\/&#8212;&#8211; SETUP SPI 1 &#8212;&#8211; \/\/Used for: Flash memory IC w_temp = SPI1BUF; SPI1STAT = 0; SPI1CON1 = 0x0320; \/\/SPI in master mode \/\/Data is valid on the rising edge of the clock (Transmit occurs on transition from active to idle clock state) \/\/Clock low in idle bus state SPI1CON1bits.PPRE1 = 1; \/\/Prescallers 4:1 1:1 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[50],"tags":[],"class_list":["post-102","post","type-post","status-publish","format-standard","hentry","category-c30-compiler-dspic"],"_links":{"self":[{"href":"https:\/\/ibex.tech\/embedded\/wp-json\/wp\/v2\/posts\/102","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ibex.tech\/embedded\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ibex.tech\/embedded\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ibex.tech\/embedded\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ibex.tech\/embedded\/wp-json\/wp\/v2\/comments?post=102"}],"version-history":[{"count":3,"href":"https:\/\/ibex.tech\/embedded\/wp-json\/wp\/v2\/posts\/102\/revisions"}],"predecessor-version":[{"id":458,"href":"https:\/\/ibex.tech\/embedded\/wp-json\/wp\/v2\/posts\/102\/revisions\/458"}],"wp:attachment":[{"href":"https:\/\/ibex.tech\/embedded\/wp-json\/wp\/v2\/media?parent=102"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibex.tech\/embedded\/wp-json\/wp\/v2\/categories?post=102"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibex.tech\/embedded\/wp-json\/wp\/v2\/tags?post=102"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}