{"id":461,"date":"2014-06-04T09:39:32","date_gmt":"2014-06-04T09:39:32","guid":{"rendered":"https:\/\/ibex.tech\/embedded\/?p=461"},"modified":"2022-02-18T15:37:49","modified_gmt":"2022-02-18T15:37:49","slug":"io-2","status":"publish","type":"post","link":"https:\/\/ibex.tech\/embedded\/microchip\/dspic\/xc16-dspic\/io-2","title":{"rendered":"IO"},"content":{"rendered":"<h4>\nInputs<br \/>\n<\/h4>\n<pre>\r\n<code>\r\n#define\tINPUT_1\t\t\t\t\t\t\tPORTBbits.RB11\r\n#define\tINPUT_2\t\t\t\t\t\t\t_RB11\r\n<\/code><\/pre>\n<h4>\nOutputs<br \/>\n<\/h4>\n<pre>\r\n<code>\r\n#define OUTPUT_1(state)\t\t\t\t\tLATBbits.LATB10 = state\r\n#define OUTPUT_2(state)\t\t\t\t\t_LATB10 = state\r\n#define OUTPUT_3(state)\t\t\t\t\t(state ? (_LATB10 = 1) : (_LATB10 = 0))\r\n<\/code><\/pre>\n<h4>\nPeripheral Pin Select<br \/>\n<\/h4>\n<p>\ndsPIC33EP256MU806 example:\n<\/p>\n<pre>\r\n<code>\r\n\t\/\/----- SETUP PERIPHERAL PIN SELECT -----\r\n\tRPINR14bits.QEA1R = 66;\t\t\/\/QEI1 Phase A on RP66\r\n\tRPINR14bits.QEB1R = 67;\t\t\/\/QEI1 Phase B on RP67\r\n\tRPINR16bits.QEA2R = 68;\t\t\/\/QEI2 Phase A on RP68\r\n\tRPINR16bits.QEB2R = 69;\t\t\/\/QEI2 Phase B on RP69\r\n<\/code><\/pre>\n<p>\n&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Inputs #define INPUT_1 PORTBbits.RB11 #define INPUT_2 _RB11 Outputs #define OUTPUT_1(state) LATBbits.LATB10 = state #define OUTPUT_2(state) _LATB10 = state #define OUTPUT_3(state) (state ? (_LATB10 = 1) : (_LATB10 = 0)) Peripheral Pin Select dsPIC33EP256MU806 example: \/\/&#8212;&#8211; SETUP PERIPHERAL PIN SELECT &#8212;&#8211; RPINR14bits.QEA1R = 66; \/\/QEI1 Phase A on RP66 RPINR14bits.QEB1R = 67; \/\/QEI1 Phase B on [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[51],"tags":[],"class_list":["post-461","post","type-post","status-publish","format-standard","hentry","category-xc16-dspic"],"_links":{"self":[{"href":"https:\/\/ibex.tech\/embedded\/wp-json\/wp\/v2\/posts\/461","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=461"}],"version-history":[{"count":2,"href":"https:\/\/ibex.tech\/embedded\/wp-json\/wp\/v2\/posts\/461\/revisions"}],"predecessor-version":[{"id":474,"href":"https:\/\/ibex.tech\/embedded\/wp-json\/wp\/v2\/posts\/461\/revisions\/474"}],"wp:attachment":[{"href":"https:\/\/ibex.tech\/embedded\/wp-json\/wp\/v2\/media?parent=461"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibex.tech\/embedded\/wp-json\/wp\/v2\/categories?post=461"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibex.tech\/embedded\/wp-json\/wp\/v2\/tags?post=461"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}