tag:blogger.com,1999:blog-63389937034076021712024-03-17T09:02:45.241-07:00Tahmid's blogEmbedded Systems and Power ElectronicsTahmidhttp://www.blogger.com/profile/09117804893438710050noreply@blogger.comBlogger73125tag:blogger.com,1999:blog-6338993703407602171.post-54942922036171154452024-01-02T01:40:00.000-08:002024-01-02T11:45:15.140-08:00Quick and dirty PIC16F72 programmer with the Pico<p>Accompanying Github repo: <a href="https://github.com/SyedTahmidMahbub/q-dpico_picprog72">https://github.com/SyedTahmidMahbub/q-dpico_picprog72</a></p><p>Having come to Dhaka over winter break, I was able to scrounge through the 10+ year-old collection of electronics stuff my parents had in storage from when I would experiment with electronics during the initial days of this blog. Among the many parts, I stumbled upon a large number of PIC16F72 MCU's - the defacto 8-bit cheap MCU of choice for many (commercial) projects. However, I couldn't seem to find the corresponding PICKIT2/3 programmer from back then - or one of the clones I had made - within the storage cabinets. At the same time, I had been working on some projects with the Pi Pico (as mentioned in the blog previously: <a href="https://tahmidmc.blogspot.com/2023/08/2023-updates-phd-pi-pico.html">https://tahmidmc.blogspot.com/2023/08/2023-updates-phd-pi-pico.html</a>). This seemed like the perfect use case for the Pico - a very quick and dirty programmer to flash the PIC16F72. With its 2MB onboard flash, a very easy-to-program Micropython interface and the PIC16F72's fairly timing insensitive ICSP protocol (<a href="http://ww1.microchip.com/downloads/en/devicedoc/39588a.pdf">http://ww1.microchip.com/downloads/en/devicedoc/39588a.pdf</a>), I set out to build a programmer to flash some test code onto the PIC16F72. I made use of whatever parts I could scrounge from the parts bin to put the project together.</p><p>As expected, Micropython on the Pi Pico enabled a super-quick development time. To echo what I had previously quoted from the Raspberry Pi foundation:</p><p><span style="-webkit-text-stroke-width: 0.3px; background-color: white; color: #333333; font-family: "Roboto Slab", serif; font-size: 16px;"><i>Computing is just so cheap compared to what it has been historically. That then enables things that are maybe not super efficient, not super tight timing like Micropython but who cares at that point? A lot of people will come in and say things like 'in this benchmark, I found that MicroPython is 100x slower than C' but if your C code is 100x faster than you need, then it doesn't matter. You just write the code you need and you focus on the parts that add value to your project and then you move on to your next project.</i></span></p><p><span style="-webkit-text-stroke-width: 0.3px; background-color: white; color: #333333; font-family: "Roboto Slab", serif; font-size: 16px;">And this is the perfect use case! It's not the highest performance result but it gets the job done and the project development was super quick!</span></p><p><span style="-webkit-text-stroke-width: 0.3px; background-color: white; color: #333333; font-family: "Roboto Slab", serif; font-size: 16px;">The details for the PIC16F72 programming are covered in Microchip's documentation: </span><a href="http://ww1.microchip.com/downloads/en/devicedoc/39588a.pdf">http://ww1.microchip.com/downloads/en/devicedoc/39588a.pdf</a></p><p>A description of Microchip's HEX file format is provided here: <a href="https://microchipdeveloper.com/xwiki/bin/view/software-tools/ipe/sqtp-file-format-specification/intel-hex/">https://microchipdeveloper.com/xwiki/bin/view/software-tools/ipe/sqtp-file-format-specification/intel-hex/</a></p><p>The hardware elements of the project have a few key aspects:</p><p></p><ol style="text-align: left;"><li>A higher voltage power supply is required for programming. This is between 12.75V and 13.25V VPP. To achieve this, a boost converter is used to raise the 5V USB rail to about 13V. I didn't have any inductors on hand except one unmarked part I found, that measured around 1.8mH. The boost converter operates in discontinuous conduction mode with the minimal VPP required current. Because of the 3.3V IO level of the Pico, I used an NPN transistor instead of a logic level MOSFET I had on hand due to the MOSFET's relatively high threshold voltage.</li><li>A VPP level shifter is required to drive the VPP pin up to 13V or hold it low. A PC817 optocoupler is used for this.</li><li>Level shifters are not needed for the PGD and PGC programming lines since the 3.3V from the Pico is high enough (>2V) for the PIC to register, even though the PIC is powered off 5V.</li></ol><div>One useful and interesting aspect of the project is that no separate programming interface is required to transfer the PIC's HEX file from the PC to the Pico. Since the PIC16F72's flash storage is so small compared to the Pico's onboard storage, and using the Micropython setup on the Pico exposes a filesystem, I can just copy the HEX file contents onto a file on the Pico using the Thonny editor. And then hit run in Thonny to program the PIC!</div><div><br /></div><div>The software is effectively the following:</div><div><ol style="text-align: left;"><li>Configure the IOs for their corresponding functions.</li><li>Configure PWM for the boost converter, running at 50kHz.</li><ol><li>Adjust the duty cycle until the output is near 13.2V.</li><li>The output voltage is sensed by an ADC channel.</li></ol><li>Hold this duty cycle for the output voltage - at this point, the feedback loop is stopped.</li><li>Detect the target PIC.</li><li>If detected, issue a bulk erase and then check that the part is blank.</li><li>Upon success, flash the words read from the HEX file.</li></ol></div><div>To modify for another similar (small) PIC, adjust the constants at the beginning of the code:</div><div><ul style="text-align: left;"><li>CODE_START_ADDR</li><li>CODE_END_ADDR</li><li>CONFIG_START_ADDR</li><li>CONFIG_END_ADDR</li><li>DEVID_PIC16F72</li></ul><div>If you use a different inductor for the boost, you can play around with the switching frequency and loop time too.</div></div><div><br /></div><div><br /></div><div>The schematic for the setup is shown below:</div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjdYm_fBMScNt_6co0a93l-oFoxhSs3nIk_mB3uKXGQhuqNJQaFF_1DqOITwYclgngHCe5p0tGQ4BPTe54R6ry8yc6bxU4OguDlLmR0FVu4WYgLPS7ZjV6_rXB60n2grKY6uZAAxAnCQNaZ_OnSFNAxYhVh4EfTeDRdqPJn1u5hPWJTk358W17wjfJUqcxn/s1650/schematic2.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1084" data-original-width="1650" height="420" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjdYm_fBMScNt_6co0a93l-oFoxhSs3nIk_mB3uKXGQhuqNJQaFF_1DqOITwYclgngHCe5p0tGQ4BPTe54R6ry8yc6bxU4OguDlLmR0FVu4WYgLPS7ZjV6_rXB60n2grKY6uZAAxAnCQNaZ_OnSFNAxYhVh4EfTeDRdqPJn1u5hPWJTk358W17wjfJUqcxn/w640-h420/schematic2.png" width="640" /></a></div><br /><div class="separator" style="clear: both; text-align: center;"><br /></div>The code can be found <a href="https://github.com/SyedTahmidMahbub/q-dpico_picprog72/blob/main/prog72.py">here</a> on this github repo: <a href="https://github.com/SyedTahmidMahbub/q-dpico_picprog72">https://github.com/SyedTahmidMahbub/q-dpico_picprog72</a><div><br /></div><div>The repo also has 2 test hex files test.hex and testbig.hex where the latter has a large array in flash to program over a larger amount of the flash storage.<br /><div><br /></div><div>Shown below is an example output from Thonny when I set the target voltage to 13.15V and flashed the testbig.hex file:</div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhHEIl_kVdr0ynCsX3DLiz5_gM9VAeE5ja2tgiHt0N70G8fHJZG8hlinj6qS3vrBYeTbZ6XAru7CeCDXpLD7mjx_TEv6HpS4Ux-w2GyALlfSwfVyz2dpthTxxECL3ftur1FONklAoENwlOJlj2Z2ImM0MAdjDQH1uul_Rca-YwdELPSciBpow1vVEiEHIsw/s1036/output.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="312" data-original-width="1036" height="120" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhHEIl_kVdr0ynCsX3DLiz5_gM9VAeE5ja2tgiHt0N70G8fHJZG8hlinj6qS3vrBYeTbZ6XAru7CeCDXpLD7mjx_TEv6HpS4Ux-w2GyALlfSwfVyz2dpthTxxECL3ftur1FONklAoENwlOJlj2Z2ImM0MAdjDQH1uul_Rca-YwdELPSciBpow1vVEiEHIsw/w400-h120/output.png" width="400" /></a></div>The code and project are by no means optimized for speed or performance. They are, however, optimized for development time! The project could easily be adapted to support other MCUs, and to create an ultra-cheap programmer - something I had previously done with the PIC16F1459 but the Pico enables greater versatility. Due to the onboard stoarage, the Pico could also program a PIC with no interface to a computer for isolated industrial flashing settings.<br /><div><br /></div><div>Finally, a quick photo to truly highlight the quick and dirty build:</div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMuyrgEzEkGt7eYFw3v_EwK5hU0XOBhzc9VA9cWTsWeJ-1rA33P0bY50_6pOfcI6p5i0hVQt61qrBKlVX2SIvJtWxzTXSBp__kFs9q_opCSufPmh-ey4UTXT3iPIrCYiw8PXnxSAW8csed8X1wnKVw_GHXGhxTkA4_OnQQ2DE-nTwVGLWVK2qMJIssRatS/s2572/qdpicopicprog.jpeg" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="2572" data-original-width="2519" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMuyrgEzEkGt7eYFw3v_EwK5hU0XOBhzc9VA9cWTsWeJ-1rA33P0bY50_6pOfcI6p5i0hVQt61qrBKlVX2SIvJtWxzTXSBp__kFs9q_opCSufPmh-ey4UTXT3iPIrCYiw8PXnxSAW8csed8X1wnKVw_GHXGhxTkA4_OnQQ2DE-nTwVGLWVK2qMJIssRatS/w391-h400/qdpicopicprog.jpeg" width="391" /></a></div><br /><div><br /></div><p></p></div>Tahmidhttp://www.blogger.com/profile/09117804893438710050noreply@blogger.com6tag:blogger.com,1999:blog-6338993703407602171.post-47742578027587820632023-12-21T19:50:00.000-08:002024-01-02T09:42:23.062-08:00Sizing IR2110 high-side bootstrap capacitor<p>I have previously discussed the IR2110 gate driver on this blog: <a href="https://tahmidmc.blogspot.com/2013/01/using-high-low-side-driver-ir2110-with.html">https://tahmidmc.blogspot.com/2013/01/using-high-low-side-driver-ir2110-with.html</a></p><p>A crucial part of the high-side gate driver is the sizing of the bootstrap cap. A common sizing strategy is to "use a large cap" and use a larger one for small frequencies. Here, I present a simple method to model the discharge of the cap in a simple LTSpice simulation to inform the capacitor sizing. Shown below is the simulation setup along with the functional block diagram of the IR2110.</p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTZ-tfTVwGidrjLdTcnCCKnM38BTxy88Fquqqylknbycy1zikFO9BjfM9d-JhohBzMKKcTnleZyi6dq__gOrfnIXyecF4arfYJF0B049DnPx1O6SJyCE47K_bzA9rP-d-9PuERkfdnIamzcPkENTdoin00QUd4DdsR1s1RiCFIn3JPLRr_soRdTigNkFKi/s1410/sch.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1362" data-original-width="1410" height="618" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTZ-tfTVwGidrjLdTcnCCKnM38BTxy88Fquqqylknbycy1zikFO9BjfM9d-JhohBzMKKcTnleZyi6dq__gOrfnIXyecF4arfYJF0B049DnPx1O6SJyCE47K_bzA9rP-d-9PuERkfdnIamzcPkENTdoin00QUd4DdsR1s1RiCFIn3JPLRr_soRdTigNkFKi/w640-h618/sch.png" width="640" /></a></div><div class="separator" style="clear: both; text-align: left;">The LTSpice file can be found at: <a href="https://github.com/SyedTahmidMahbub/boostrapcap_ir2110/blob/main/ir2110_capsizing.asc">https://github.com/SyedTahmidMahbub/boostrapcap_ir2110/blob/main/ir2110_capsizing.asc</a></div><div class="separator" style="clear: both; text-align: center;"><br /></div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4LqdgtPRXVVnccTj-LWiCILOLsxIUCN6YcJSPbF8XfLuk8IJGW0wbFTPUf5SazD0UsNbiWPRjYNbWOI9acDCQDRYnHTkLEig_L2-0eHn_-36ArqkCYsh1_Z60Jyl4GMbYipXlnN7stCp116y0mMTF4J-1guoyuKF1LLJ8g2K7EoazqvcQ_aqzo-2jJrec/s1554/ir2110.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="794" data-original-width="1554" height="328" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4LqdgtPRXVVnccTj-LWiCILOLsxIUCN6YcJSPbF8XfLuk8IJGW0wbFTPUf5SazD0UsNbiWPRjYNbWOI9acDCQDRYnHTkLEig_L2-0eHn_-36ArqkCYsh1_Z60Jyl4GMbYipXlnN7stCp116y0mMTF4J-1guoyuKF1LLJ8g2K7EoazqvcQ_aqzo-2jJrec/w640-h328/ir2110.png" width="640" /></a></div><br /><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;">A few key points regarding the setup:</div><div class="separator" style="clear: both; text-align: left;"><ul style="text-align: left;"><li>S1 and S2 represent the high side gate drive FETs in the IR2110 that drive the HO pin.</li><li>S3 and S4 represent the low side gate drive FETs in the IR2110 that drive the LO pin.</li><li>Ibs represents the quiescent VBS current and the offset supply leakage current: Ibs = ILK + IQBS. From datasheet, that evaluates to a max of 50µA + 230µA = 280µA.</li><li>GDH and GDL have their threshold voltages set at +0.5V (refH) and -0.5V (refL) respectively. These, along with yH and yL generate the drive pulses for S1-S4 and correspondingly M1-M2.</li><li>C1 is the bootstrap cap here, specified at 1µF.</li></ul></div>The logic for generating the drive signals for S1-S4 is shown in the diagrams below. Click on the images to expand.<div style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg36dGY0OUPWeYKdEeEHzA2-TaMK0tb9imxqm9sGRW7WwrKjVxt-ysuZAS8YHgfLIl8yuH3ow8U37C1MAdHO4ZCwfMqRKXtRxVZ2dQjXpMhzJi2_7ctn4uwtDVCXtPQYo03Hao9OYxCdUTPJeBbqtdHlasXIkzuQ5yyB2D-ieXTy-ILIpCUixccSiQDSNXP/s1920/signals.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1440" data-original-width="1920" height="150" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg36dGY0OUPWeYKdEeEHzA2-TaMK0tb9imxqm9sGRW7WwrKjVxt-ysuZAS8YHgfLIl8yuH3ow8U37C1MAdHO4ZCwfMqRKXtRxVZ2dQjXpMhzJi2_7ctn4uwtDVCXtPQYo03Hao9OYxCdUTPJeBbqtdHlasXIkzuQ5yyB2D-ieXTy-ILIpCUixccSiQDSNXP/w200-h150/signals.png" width="200" /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEitiAGx0WtI3Jvk4P1fN-_PA9HOiX3lG1K3B_BEVMIQBhvUULy42kiEOK8DGhYiKYcFbFT_35st5B7Cercere6xwfbtxQfwsqF9LkAUxzM9-xtrq64hPldeqklhmU06YV0KF9DuP3eKy8i5RFqj4Nnd-T3X-7diRpq-rKeoNCK9_OVt4-oYWrrQu8-iyP_e/s1920/switches.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1440" data-original-width="1920" height="150" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEitiAGx0WtI3Jvk4P1fN-_PA9HOiX3lG1K3B_BEVMIQBhvUULy42kiEOK8DGhYiKYcFbFT_35st5B7Cercere6xwfbtxQfwsqF9LkAUxzM9-xtrq64hPldeqklhmU06YV0KF9DuP3eKy8i5RFqj4Nnd-T3X-7diRpq-rKeoNCK9_OVt4-oYWrrQu8-iyP_e/w200-h150/switches.png" width="200" /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNfyBIsQf7SMmdeG5qx9aA0uhisK5o8mlhb4tp_geHtQubbed9P4dQ1jJBxLtIcbOJip16SNzEmKElnDQWGHo5uapdytc18j0sDNJvDrbP4_B5ry02vIxfbhmrIMb34H5gIN2T19YblXXdGc4FgK4cWXycbu_hajB8VlL6oQ9utspbg699XN9BXcUWw_JW/s1920/fets.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1440" data-original-width="1920" height="150" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNfyBIsQf7SMmdeG5qx9aA0uhisK5o8mlhb4tp_geHtQubbed9P4dQ1jJBxLtIcbOJip16SNzEmKElnDQWGHo5uapdytc18j0sDNJvDrbP4_B5ry02vIxfbhmrIMb34H5gIN2T19YblXXdGc4FgK4cWXycbu_hajB8VlL6oQ9utspbg699XN9BXcUWw_JW/w200-h150/fets.png" width="200" /></a></div><div style="text-align: right;"><br /></div><div><div class="separator" style="clear: both; text-align: left;">Now, let's go on to the key discussion regarding the cap sizing.</div></div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;">Once the cap is charged, there are a few discharge paths:</div><div class="separator" style="clear: both; text-align: left;"><ul style="text-align: left;"><li>Charge transferred to the gate of the MOSFET being driven</li><li>Current draw due to the gate-source resistor</li><li>Leakage paths - the largest one modeled here is Ibs</li></ul><div>For the charge transfer, consider the gate charge of the MOSFET being driven. This can be gathered from the datasheet of the MOSFET. For the IRFZ44N in this simulation, this is around 40nC-50nC as can be seen from Fig 6 in the IRFZ44N datasheet:</div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWNhyphenhyphenIn85HuWSd5ELbAlfP9uvEIbPc847alVaNLrtExtCPtlDrScifCxHR1i-rJ9rFwqELNi2b7q57_AuUq2Ga-USRJFk9nY3w5EBY_sDWM7ipNVX3l71jKHha3eto4AfUL80gcjjjnN40TMSKgOs5K7pXcPLN5bPkwu0W3AMb8PDpLhy2M0Pu86rwpiRY/s588/qg.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="588" data-original-width="496" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWNhyphenhyphenIn85HuWSd5ELbAlfP9uvEIbPc847alVaNLrtExtCPtlDrScifCxHR1i-rJ9rFwqELNi2b7q57_AuUq2Ga-USRJFk9nY3w5EBY_sDWM7ipNVX3l71jKHha3eto4AfUL80gcjjjnN40TMSKgOs5K7pXcPLN5bPkwu0W3AMb8PDpLhy2M0Pu86rwpiRY/s320/qg.png" width="270" /></a></div>The voltage droop due to charging the MOSFET gate (Qg) can be estimated as:</div><div class="separator" style="clear: both; text-align: left;"><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEguv5QYluxVsSczjq5nIfpv3sc0J0gdr-NSaSGSIv-DT22lH9vBZgWK6tx8Dehy6e7cJRBSwnkopmV47RwMXPfsDs4y6H-N65O7XiZRosh0B5WXE9AqR-SyEwMjd9HP-rsqdZ4ZfuKFmIIh56h1ivT-uLfDoFLHr5hf9ir-OddaxNq7MGWpobqHQHBCHj9S/s224/eq1.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="122" data-original-width="224" height="109" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEguv5QYluxVsSczjq5nIfpv3sc0J0gdr-NSaSGSIv-DT22lH9vBZgWK6tx8Dehy6e7cJRBSwnkopmV47RwMXPfsDs4y6H-N65O7XiZRosh0B5WXE9AqR-SyEwMjd9HP-rsqdZ4ZfuKFmIIh56h1ivT-uLfDoFLHr5hf9ir-OddaxNq7MGWpobqHQHBCHj9S/w200-h109/eq1.png" width="200" /></a></div><div class="separator" style="clear: both; text-align: center;">The voltage droop due to driving current through the gate-source resistor can be estimated as:</div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-kqZ5QbzI0oIBp5sRdpBqW2TmANdfhR1EGtgoPM8Wg2ez3ctEecTeDvjcqkZWgOy45V18aY7QiTlw0qnwmyymeCtEOf2pNR2DY6U8cQN4ovW_X3IHuz0CvqXJNVOxS3Db5cO3SwR5TEnvpL4OO70hjDM8WogYtsYgNvuvT8R8e7ug-5MbaAUbqqQy2gJa/s1228/eq2.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="142" data-original-width="1228" height="74" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-kqZ5QbzI0oIBp5sRdpBqW2TmANdfhR1EGtgoPM8Wg2ez3ctEecTeDvjcqkZWgOy45V18aY7QiTlw0qnwmyymeCtEOf2pNR2DY6U8cQN4ovW_X3IHuz0CvqXJNVOxS3Db5cO3SwR5TEnvpL4OO70hjDM8WogYtsYgNvuvT8R8e7ug-5MbaAUbqqQy2gJa/w640-h74/eq2.png" width="640" /></a></div><div class="separator" style="clear: both; text-align: center;"><br /></div>VD1 is the forward drop for the bootstrap diode D1. Ton is the on-time given by the product of the duty cycle and period.</div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;">Below is the voltage across the boostrap cap from the sim:</div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjULcCqZN8MizKhVV4Xz3drZOrGatRKej7Zc-kjIJMaTE5EG1wEn4K89or8CwfC2dlcCJEgGgeXLYplW-PN9xjr-25IxV9lo78pyllkeTNr2ekV90ekrWY-firtbNZLcf5TLEK70mvWpDtY9NluRYTgSQJAJh8a7TQk6q_VzYu7qgOxNYyWTQrgUpGpYqWA/s1473/vgs_h.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="555" data-original-width="1473" height="242" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjULcCqZN8MizKhVV4Xz3drZOrGatRKej7Zc-kjIJMaTE5EG1wEn4K89or8CwfC2dlcCJEgGgeXLYplW-PN9xjr-25IxV9lo78pyllkeTNr2ekV90ekrWY-firtbNZLcf5TLEK70mvWpDtY9NluRYTgSQJAJh8a7TQk6q_VzYu7qgOxNYyWTQrgUpGpYqWA/w640-h242/vgs_h.png" width="640" /></a></div><br /><div class="separator" style="clear: both; text-align: left;">Observations from this waveform:</div><div class="separator" style="clear: both; text-align: left;"><ul style="text-align: left;"><li>Between 440µs and 500µs, M2 is on, which charges the bootstrap cap C1 through D1. A larger charge resistance (D1 on-state resistance) or a larger bootstrap cap C1 would increase this charging time.</li><li>At 500µs, M1 is turned on. Note that this simulation doesn't model the deadtime, but since we're primarily interested in the boostrap cap's dynamics, that is fine.</li><li>The sharp vertical drop right after 500µs is the charge transfer to M1's gate.</li><li>The continued droop afterwards, to 540µs, is due to Ibs and the gate-source-resistance.</li><li>The voltage drops from 11.403V to 10.921V.</li><li>VGS for M1 tracks this voltage from 500µs to 540µs.</li></ul><div><br /></div><div>Below is a simple script to estimate the total droop with Python:</div><div>Github link: <a href="https://github.com/SyedTahmidMahbub/boostrapcap_ir2110/blob/main/delV_bs.py">https://github.com/SyedTahmidMahbub/boostrapcap_ir2110/blob/main/delV_bs.py</a></div><div><div style="background-color: #1f1f1f; color: #cccccc; font-family: Menlo, Monaco, "Courier New", monospace; font-size: 12px; line-height: 18px; white-space: pre;"><div><span style="color: #c586c0;">import</span> <span style="color: #4ec9b0;">numpy</span> <span style="color: #c586c0;">as</span> <span style="color: #4ec9b0;">np</span></div><br /><div><span style="color: #4fc1ff;">D</span> <span style="color: #d4d4d4;">=</span> <span style="color: #b5cea8;">0.4</span></div><div><span style="color: #9cdcfe;">Tperiod</span> <span style="color: #d4d4d4;">=</span> <span style="color: #b5cea8;">100e-6</span></div><div><span style="color: #9cdcfe;">Ton</span> <span style="color: #d4d4d4;">=</span> <span style="color: #4fc1ff;">D</span> <span style="color: #d4d4d4;">*</span> <span style="color: #9cdcfe;">Tperiod</span></div><div><span style="color: #4fc1ff;">V0</span> <span style="color: #d4d4d4;">=</span> <span style="color: #b5cea8;">11.403</span></div><br /><div><span style="color: #9cdcfe;">Cboostrap</span> <span style="color: #d4d4d4;">=</span> <span style="color: #b5cea8;">1e-6</span></div><div><span style="color: #9cdcfe;">Qg_FET</span> <span style="color: #d4d4d4;">=</span> <span style="color: #b5cea8;">45e-9</span></div><div><span style="color: #9cdcfe;">Rg_on</span> <span style="color: #d4d4d4;">=</span> <span style="color: #b5cea8;">1031</span></div><div><span style="color: #9cdcfe;">Ibs</span> <span style="color: #d4d4d4;">=</span> <span style="color: #b5cea8;">280e-6</span></div><br /><div><span style="color: #9cdcfe;">dV_Qg</span> <span style="color: #d4d4d4;">=</span> <span style="color: #d4d4d4;">-</span><span style="color: #9cdcfe;">Qg_FET</span><span style="color: #d4d4d4;">/</span><span style="color: #9cdcfe;">Cboostrap</span></div><div><span style="color: #9cdcfe;">dV_Rg</span> <span style="color: #d4d4d4;">=</span> <span style="color: #d4d4d4;">-</span><span style="color: #4fc1ff;">V0</span> <span style="color: #d4d4d4;">*</span> (<span style="color: #b5cea8;">1</span> <span style="color: #d4d4d4;">-</span> <span style="color: #4ec9b0;">np</span>.<span style="color: #9cdcfe;">exp</span>(<span style="color: #d4d4d4;">-</span><span style="color: #9cdcfe;">Ton</span><span style="color: #d4d4d4;">/</span><span style="color: #9cdcfe;">Rg_on</span><span style="color: #d4d4d4;">/</span><span style="color: #9cdcfe;">Cboostrap</span>))</div><div><span style="color: #9cdcfe;">dV_Ibs</span> <span style="color: #d4d4d4;">=</span> <span style="color: #d4d4d4;">-</span><span style="color: #9cdcfe;">Ibs</span><span style="color: #d4d4d4;">/</span><span style="color: #9cdcfe;">Cboostrap</span> <span style="color: #d4d4d4;">*</span> <span style="color: #9cdcfe;">Ton</span></div><br /><div><span style="color: #9cdcfe;">V_final</span> <span style="color: #d4d4d4;">=</span> <span style="color: #4fc1ff;">V0</span> <span style="color: #d4d4d4;">+</span> <span style="color: #9cdcfe;">dV_Qg</span> <span style="color: #d4d4d4;">+</span> <span style="color: #9cdcfe;">dV_Rg</span> <span style="color: #d4d4d4;">+</span> <span style="color: #9cdcfe;">dV_Ibs</span></div><div><span style="color: #dcdcaa;">print</span>(<span style="color: #ce9178;">"Droop sources:"</span>)</div><div><span style="color: #dcdcaa;">print</span>(<span style="color: #569cd6;">f</span><span style="color: #ce9178;">" Gate charge: </span><span style="color: #569cd6;">{</span><span style="color: #9cdcfe;">dV_Qg</span> <span style="color: #569cd6;">:.3f}</span><span style="color: #ce9178;"> V"</span>)</div><div><span style="color: #dcdcaa;">print</span>(<span style="color: #569cd6;">f</span><span style="color: #ce9178;">" Gate resistor: </span><span style="color: #569cd6;">{</span><span style="color: #9cdcfe;">dV_Rg</span> <span style="color: #569cd6;">:.3f}</span><span style="color: #ce9178;"> V"</span>)</div><div><span style="color: #dcdcaa;">print</span>(<span style="color: #569cd6;">f</span><span style="color: #ce9178;">" Ibs: </span><span style="color: #569cd6;">{</span><span style="color: #9cdcfe;">dV_Ibs</span> <span style="color: #569cd6;">:.3f}</span><span style="color: #ce9178;"> V"</span>)</div><br /><div><span style="color: #dcdcaa;">print</span>(<span style="color: #569cd6;">f</span><span style="color: #ce9178;">"Droops from </span><span style="color: #569cd6;">{</span><span style="color: #4fc1ff;">V0</span> <span style="color: #569cd6;">:.3f}</span><span style="color: #ce9178;"> V to </span><span style="color: #569cd6;">{</span><span style="color: #9cdcfe;">V_final</span> <span style="color: #569cd6;">:.3f}</span><span style="color: #ce9178;"> V"</span>)</div><br /></div></div><div><br /></div><div>The output of the script is:</div><div><br /></div><div><div>Droop sources:</div><div> Gate charge: -0.045 V</div><div> Gate resistor: -0.434 V</div><div> Ibs: -0.011 V</div><div>Droops from 11.403 V to 10.913 V</div></div><div><br /></div><div>The computed droop matches very well with the simulation!</div><div><br /></div><div><b>Key observations:</b></div><div><ul style="text-align: left;"><li>The droop will get worse with reduced gate-source resistance. Using a larger resistance than 1k will reduce the droop.</li><li>The droop will get worse with a longer on-time. This is why a larger capacitance is needed when operating at lower frequencies such as 50Hz or 60Hz.</li><li>Using a super large cap will increase how long the cap will require being charged at startup. This may be dealt with by precharging the cap (by turning on M2) before M1 has to be turned on.</li><li>A 100% duty cycle can't be used since the bootstrap cap can't be recharged. How high the max possible duty cycle is depends on how long it takes to recharge the cap through the bootstrap diode.</li><li>Gate charge for the MOSFET is a weak function of applied voltage and a very strong function of gate voltage. A larger gate drive voltage will result in a greater droop. Note though that this may not matter if the gate-source resistor dominates the droop.</li><li>A good max allowable droop is given by the 9.7V figure for the IR2110's max VBS undervoltage threshold. Given that there are always additional leakage components, and the cap has an associated tolerance (in many cases >20%), you will want to build in lots of margin.</li></ul><div><br /></div></div><div>Hopefully, this was a useful introduction to sizing the bootstrap capacitance for the IR2110 (or other gate driver). Here is also a good reference to look at: <a href="https://www.infineon.com/dgdl/Infineon-HV_Floating_MOS_Gate_Drivers-ApplicationNotes-v01_00-EN.pdf?fileId=5546d4626c1f3dc3016c47de609d140a&redirId=117674" target="_blank">AN-978</a></div><div><br /></div><div>If you want further clarification on any aspect of this, do let me know in the comments!</div></div>Tahmidhttp://www.blogger.com/profile/09117804893438710050noreply@blogger.com0tag:blogger.com,1999:blog-6338993703407602171.post-58675552360257926102023-11-10T11:53:00.011-08:002024-01-02T09:42:34.979-08:00SmartSinePy, and an example of GUI development with PySide6<p></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEgJo30XcbxxEcQm1m4SiJn44QNNORWu6NqwvfOiyeEXVeQFWaJxI8TAVnuGa3vb8j7WPhS0cYm3bA1JOFzq-0VBfP1M5lhujLNLc8Cr9bGMUCEJrVVGy4dGS7MeM9Xct0YHgjzzrIuRI8YUPTQ0PjCLEdlUePzjJda7qEPPFVFvxs-Z7muXevpzEIWrE4FP" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="1240" data-original-width="1704" height="466" src="https://blogger.googleusercontent.com/img/a/AVvXsEgJo30XcbxxEcQm1m4SiJn44QNNORWu6NqwvfOiyeEXVeQFWaJxI8TAVnuGa3vb8j7WPhS0cYm3bA1JOFzq-0VBfP1M5lhujLNLc8Cr9bGMUCEJrVVGy4dGS7MeM9Xct0YHgjzzrIuRI8YUPTQ0PjCLEdlUePzjJda7qEPPFVFvxs-Z7muXevpzEIWrE4FP=w640-h466" width="640" /></a></div><p style="clear: both; text-align: center;"><span style="font-size: large; text-align: left;"><b>Source code at: </b><a href="https://github.com/SyedTahmidMahbub/SmartSinePy">https://github.com/SyedTahmidMahbub/SmartSinePy</a></span></p><p></p><p>Quite a very long time ago, I had posted a Windows tool called Smart Sine to generate a sine table. See: <a href="https://tahmidmc.blogspot.com/2012/10/smart-sine-software-to-generate-sine.html">https://tahmidmc.blogspot.com/2012/10/smart-sine-software-to-generate-sine.html</a></p><p>This was very useful for pre-generating the sine-table instead of in the main program itself, often useful to save space (and not have to perform trig operations) especially on 8-bit microcontrollers.</p><p>I was recently looking into developing quick GUIs for some test bench automation and was primarily looking for something where I could position and size GUI elements visually (a WYSIWYG editor, basically) and decided to dig into QT Designer and PySide6. I don't mind defining properties and event handlers programmatically (in fact I do prefer it) but what I really don't want to do is have to add every GUI element in code and define its location and size - this is where the QT Designer's visual editing really comes in helpful! Reminds me a lot of the Visual Studio GUI editor back in Visual Basic development days.</p><p>This provided a good opportunity to redo Smart Sine and have an example project for developing the GUI application. A few aspects explored on the GUI side of things:</p><p></p><ul style="text-align: left;"><li>Creating the layout in QT Designer</li><li>Getting inputs from a table</li><li>Working with GUI widget signals (events such as button pressed or slider value changed)</li><li>Updating text in labels and a text browser (textbox)</li><li>Generating a plot with matplotlib and embedded it on the GUI</li></ul><div>This is a great reference for embedding matplotlib: <a href="https://david.roesel.cz/notes/posts/matplotlib-figure-embedded-in-qt/">https://david.roesel.cz/notes/posts/matplotlib-figure-embedded-in-qt/</a></div><div>Particularly about temporarily adding a text box within the widget to specify the layout.</div><div><br /></div><div>For this particular project, I read in the .ui file (that QT Designer generates) straight in the main code without an intermediate conversion.</div><div><br /></div><div>Here is a snapshot from QT Designer:</div><div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEiARUwf1PQy6_88_KqMiInvjYI0asRxUWIAZCiYLxMl-rsI-XDFxKwweErqDJvejFbYaLK7SJYdDFpvLI81HMlAVtrs808A5aMHdayAwAm7zVnn4QKTghodSKmgeEvfrtU2fgYvxhB-UDavuWkt4EQhkoqUnifHzGJVCR5t7LL9gxrUxaYTHqrgxqo5TrKQ" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="1702" data-original-width="2940" height="370" src="https://blogger.googleusercontent.com/img/a/AVvXsEiARUwf1PQy6_88_KqMiInvjYI0asRxUWIAZCiYLxMl-rsI-XDFxKwweErqDJvejFbYaLK7SJYdDFpvLI81HMlAVtrs808A5aMHdayAwAm7zVnn4QKTghodSKmgeEvfrtU2fgYvxhB-UDavuWkt4EQhkoqUnifHzGJVCR5t7LL9gxrUxaYTHqrgxqo5TrKQ=w640-h370" width="640" /></a></div><br />Here are a couple snapshots of the application running:</div><div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEiA7Da_HEfRa808-g5e83Y1kGC-cNnkBBL8vzEF5X4XiSpMCZSO9Hz428RqSuJCVUJMUrXQ2wXrPyXeZ_Y3Pj-IZ50kyn7HP31_ZJfnCa_0k21ZwGY4cZbTNU421IUrcFB036IkXPQywvQ7KwFHT-Ue549X7H0ibnh2AwjDMeQdvPsYf1Fuq0NJh5ioG1UT" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="1240" data-original-width="1704" height="466" src="https://blogger.googleusercontent.com/img/a/AVvXsEiA7Da_HEfRa808-g5e83Y1kGC-cNnkBBL8vzEF5X4XiSpMCZSO9Hz428RqSuJCVUJMUrXQ2wXrPyXeZ_Y3Pj-IZ50kyn7HP31_ZJfnCa_0k21ZwGY4cZbTNU421IUrcFB036IkXPQywvQ7KwFHT-Ue549X7H0ibnh2AwjDMeQdvPsYf1Fuq0NJh5ioG1UT=w640-h466" width="640" /></a></div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEiX6Jzo1yL-QzNR6eo9xmHICTwyCbbt3scVc-kz6e0qW--cD70KRXmjx9GsJe2Gd4i30HVjEfyuoDgXMT39eMJBWOtlQSY5h_YYlFplGjofgw8jL0imn4kQHknM0gf0-aPaZiGVm7qfgHyW-ZaSENZ3W23YR74Y1jzcDO8F9V4SnUswdyEiHxg6d96Uz1uC" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="1240" data-original-width="1704" height="466" src="https://blogger.googleusercontent.com/img/a/AVvXsEiX6Jzo1yL-QzNR6eo9xmHICTwyCbbt3scVc-kz6e0qW--cD70KRXmjx9GsJe2Gd4i30HVjEfyuoDgXMT39eMJBWOtlQSY5h_YYlFplGjofgw8jL0imn4kQHknM0gf0-aPaZiGVm7qfgHyW-ZaSENZ3W23YR74Y1jzcDO8F9V4SnUswdyEiHxg6d96Uz1uC=w640-h466" width="640" /></a></div><div class="separator" style="clear: both; text-align: left;">There are a fair few Python dependencies that you will have to install. A one-line command for installing them is:</div><div class="separator" style="clear: both; text-align: left;">python3 -m pip install pyside6 numpy pyperclip matplotlib</div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;">If there's interest in packaging this up into an executable, let me know!</div><br /></div><div>Source code at: <a href="https://github.com/SyedTahmidMahbub/SmartSinePy">https://github.com/SyedTahmidMahbub/SmartSinePy</a></div><div>The code is commented and should be self-explanatory. But if there are specific questions or anything that is unclear, let me know and I can clear it up!</div><p></p>Tahmidhttp://www.blogger.com/profile/09117804893438710050noreply@blogger.com0tag:blogger.com,1999:blog-6338993703407602171.post-24298014462882364112023-11-03T02:18:00.005-07:002023-11-10T12:35:03.885-08:00Modified Sine Wave Inverter: Harmonic Elimination<p>In inverter designs, we see the concept of a modified (or quasi) sine wave inverter - "better" than a square wave but still very easy to implement by adding a deadtime. By adjusting the duty cycle of the square wave, the output RMS value can be adjusted - and this is often used in inverters for feedback regulation.</p><p>One concept that is tied to how a modified sine wave output is better than a square wave has to do with <b>harmonic elimination</b>.</p><p>To start off with, let's remind ourselves that a square wave is composed of an infinite number of sine waves at odd multiples of the wave's frequency. Here is a great reference for this: <a href="https://mathworld.wolfram.com/FourierSeriesSquareWave.html">Fourier Series--Square Wave -- from Wolfram MathWorld</a></p><p>Now, if we consider the modified sine wave, what happens to the harmonic contents?</p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgc_rOmE5VYWb80rktwPW2Pq79KWMJUqgb_DLQlOeBaYG1vCh-a68odsNyzX_r3iLwPMk7pqHF2MEGk610JybKRoD85-jGmJgqYc9cAoNFxhbYZ1LLMr5ymkgmjvEwNhldVtvmFtPQp2ewgByjSPXAUp_Fzjznl29U-ZARUw3yZs4G5vIrFGSbQ-_ISpgV_/s640/quasinsine.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="480" data-original-width="640" height="480" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgc_rOmE5VYWb80rktwPW2Pq79KWMJUqgb_DLQlOeBaYG1vCh-a68odsNyzX_r3iLwPMk7pqHF2MEGk610JybKRoD85-jGmJgqYc9cAoNFxhbYZ1LLMr5ymkgmjvEwNhldVtvmFtPQp2ewgByjSPXAUp_Fzjznl29U-ZARUw3yZs4G5vIrFGSbQ-_ISpgV_/w640-h480/quasinsine.png" width="640" /></a></div><br /><p>We can solve for the nth harmonic (where n=1, 3, 5, 7, ...) which gives a Fourier coefficient of:</p><p></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEgZBXZNvIpZIF_c_jxOZdU4IbgFhL3H8f2CDoNvpCYsyzBeDdR_75_vBAmUQOCOhBcAiNtg5MpNCjytFJ2QNOa0PzOlywMYLuYEHhUt6KURHxHnfrwnudumhCv6O2yuXN2fh9WXEtJ4TEXNe-rVXnSEJ1svXJJ48G8pYEpOLbBXC0gfh-9kb7CRL2fe-LOq" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="107" data-original-width="205" height="103" src="https://blogger.googleusercontent.com/img/a/AVvXsEgZBXZNvIpZIF_c_jxOZdU4IbgFhL3H8f2CDoNvpCYsyzBeDdR_75_vBAmUQOCOhBcAiNtg5MpNCjytFJ2QNOa0PzOlywMYLuYEHhUt6KURHxHnfrwnudumhCv6O2yuXN2fh9WXEtJ4TEXNe-rVXnSEJ1svXJJ48G8pYEpOLbBXC0gfh-9kb7CRL2fe-LOq=w200-h103" width="200" /></a></div><p style="text-align: left;">Why is this interesting? Can we fix the duty cycle so that we eliminate certain harmonics? Yes! We can make the cos term go to zero by picking nδ = π/2 = 90°. We could then pick <b>δ = 30° and eliminate the 3rd harmonic</b>! Or <b>we could pick δ = 18° and eliminate the 5th harmonic.</b> If we had to pick just one, it would then make sense to eliminate the 3rd harmonic which has a higher Fourier coefficient than the 5th! <b>This will contribute to a better THD (total harmonic distortion).</b></p><p style="text-align: left;">We can of course time shift this waveform and retain the same benefits - this would then correspond to a standard (edge-aligned) PWM. If we are using a full-bridge to generate this waveform, this would correspond to a duty cycle (for each pair of diagonal switches) of (180°-30°-30°)/360° = 33.33%. The off time would, of course, reduce the output RMS voltage compared to a square wave, so you would have to keep that in mind!</p><p style="text-align: left;">What about multiple harmonic eliminations? We can come up with a scheme where we add multiple notches and eliminate multiple harmonics. And, in fact, this is what SPWM achieves by forming these notches in a "sinusoidally optimal" fashion and eliminating several lower order harmonics. I have several articles where I have discussed SPWM (such as <a href="https://tahmidmc.blogspot.com/2011/01/generation-and-implementation-of-sine.html">Generation and Implementation of Sine Wave Table</a>) albeit not in the context of harmonic elimination.</p><p style="text-align: left;"><b>Can we do this in one-stage inverters like with an iron core? No.</b> Unfortunately, in these one-stage inverters, the output voltage regulation is obtained by altering the duty cycle and so you can't have a fixed δ and optimize for a particular harmonic elimination.</p><div><p></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEgghnUXWwzqfhyzwN3-9hPwtVfL-KxzyF7GYPf-wK7aBjYD7pBIs9297g3L22UKH_JYWl0q7cixIUHMZmssZeCcACKgRSpLlfQEdQQWZPY2WzbJlbgr420aJg3LV2_AR0olBh4rp4HcewJ9FhuF__pTDoE5tHZLoXfF725TrTK3iob4DS0OBxeEZ7gSNmAX" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="632" data-original-width="1352" height="188" src="https://blogger.googleusercontent.com/img/a/AVvXsEgghnUXWwzqfhyzwN3-9hPwtVfL-KxzyF7GYPf-wK7aBjYD7pBIs9297g3L22UKH_JYWl0q7cixIUHMZmssZeCcACKgRSpLlfQEdQQWZPY2WzbJlbgr420aJg3LV2_AR0olBh4rp4HcewJ9FhuF__pTDoE5tHZLoXfF725TrTK3iob4DS0OBxeEZ7gSNmAX=w400-h188" width="400" /></a></div><p style="text-align: left;">Can we do this with two-stage inverters such as ones where the input voltage is first stepped up with a ferrite transformer at high frequencies followed by an H-bridge to generate the output? Yes - if we use feedback to control the output of the first stage, we can use this constant δ on the output of the second stage.</p><p></p></div>Tahmidhttp://www.blogger.com/profile/09117804893438710050noreply@blogger.com0tag:blogger.com,1999:blog-6338993703407602171.post-66910713806082334572023-08-13T23:04:00.003-07:002023-08-13T23:14:17.197-07:002023 Updates: PhD; Pi Pico<p>It's 2023 and I'm back to keep the blog going! Lots have changed in my life in the past 6 years since I last posted on the blog.</p><h2 style="text-align: left;">PhD</h2><p>After a six-year stint working as a hardware engineer at Apple, I am excited to now be pursuing my PhD in Electrical Engineering, focused on Power Electronics, at UC Berkeley. I start working with Professor <a href="https://www2.eecs.berkeley.edu/Faculty/Homepages/pilawa.html" target="_blank">Robert Pilawa-Podgurski</a> this week! I anticipate more posts centered around power electronics in the future.</p><p>Why did I want to go back to school in a PhD program? There are 3 key aspects to this:</p><p></p><ol style="text-align: left;"><li>Technical depth. With the recent rapid advances enabled by wide bandgap semiconductors, the recent explosion in adoption of EVs and an expansion in the number of research labs in academia, now is an exciting time for power electronics.</li><li>Positive contributions to climate crisis solutions. Growing up in Bangladesh, I witnessed firsthand the devastating impact of natural disasters that continue to be exacerbated by the climate crisis. Direct impacts of this are witnessed every year half-way across the world in California where I now live. I envision pursuing research opportunities to significantly reduce emissions in the transportation and energy sectors: the largest contributors to the climate crisis and fields that can be directly improved through power electronics.</li><li>Education. This blog has been an early testament to my interest in sharing engineering information and knowledge. I would like to continue to do so, but also engage in a more formal manner through educational institutions, particularly with typically underserved institutions.</li></ol><p></p><h2 style="text-align: left;">Pi Pico</h2><p>In the short term, I am exploring the Raspberry Pi Pico (based on the RP2040 MCU) using MicroPython. Having the resources to support running MicroPython, in a super-cheap part, is an exciting opportunity for me to explore. The idea here is to use Python (very simple software bringup time) to do the software heavy lifting and leveraging on-board hardware for timing-sensitive/hardware applications.</p><p>Here is a great relevant podcast episode: <a href="https://theamphour.com/529-embedded-hardware-with-the-raspberry-pi-team/" target="_blank">The Amp Hour #529 – Embedded Hardware with the Raspberry Pi Team</a>. </p><p>Why Micropython? Listen to 11:30-12:30 in the linked podcast episode where the below qutoes are taken from.</p><p></p><blockquote>Computing is just so cheap compared to what it has been historically. That then enables things that are maybe not super efficient, not super tight timing like Micropython but who cares at that point? A lot of people will come in and say things like 'in this benchmark, I found that MicroPython is 100x slower than C' but if your C code is 100x faster than you need, then it doesn't matter. You just write the code you need and you focus on the parts that add value to your project and then you move on to your next project.</blockquote><p></p>Tahmidhttp://www.blogger.com/profile/09117804893438710050noreply@blogger.com14tag:blogger.com,1999:blog-6338993703407602171.post-81216447487089431102017-06-15T23:45:00.001-07:002017-06-15T23:45:34.129-07:00A digital communication project using OFDM and 32-QAM<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="white-space: pre-wrap;">This past semester (my last one during my undergrad years!), I was enrolled in ECE4670 -- Intro to Digital Communication with Professor Aaron Wagner. The final project required constructing the encoder and decoder (in Matlab) to send data over an existing channel (Cornell’s commcloud server). The project was done in groups of 2 and I had worked with my friend Balazs Szegletes. It was a fun learning experience, and I wanted to share the details of the project here!</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<br /></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="white-space: pre-wrap;">The communication channel is effectively a DAC that outputs the results of the encoder, X, a low-pass filter, and then an ADC that samples this and sends data, Y, to the decoder. The means for sending data to the channel involves writing the data to a wav file, which is then passed as an input parameter to a program called ccplay that is provided for the class. The program handles the DAC and ADC and saves the sampled output as another wav file. The goal is to be able to push data through the channel as quick as possible with few number of bit errors. The figure of merit is computed as:</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="white-space: pre-wrap;">FOM = (min(R, 300000)*(1-N/50000)10)/max(1,400*Po)</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="white-space: pre-wrap;">Where R is the data rate defined as (100,000/(L/44100)) where L is the length of the output of the encoder</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="white-space: pre-wrap;">N is the number of bit errors</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="white-space: pre-wrap;">Po is the average transmitted power</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<br /></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="white-space: pre-wrap;">The channel properties can be modeled by the Toeplitz matrix H, such that:</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="white-space: pre-wrap;">Y = HX + Z, where Z is iid (independent, identically distributed) Gaussian noise. The commcloud server has two such channels, audio0 and audio1.</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<br /></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="white-space: pre-wrap;">This builds on a previous lab, where orthogonal frequency division multiplexing (OFDM) is used with on/off keying to send data over the channel. This scheme achieved a data rate of about 14,000 bits per second with zero errors, resulting in a figure of merit of about 14,000. The high performance design utilizes orthogonal frequency division multiplexing (OFDM) and quadrature amplitude modulation (QAM) to achieve a figure of merit much higher than the previous lab.</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<br /></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="white-space: pre-wrap;">The overall OFDM system block diagram is shown below (taken from Professor Wagner’s course’s <u><a href="http://people.ece.cornell.edu/wagner/ece467-s16/scribe/gbk42.pdf">Scribe notes</a></u>):</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span style="font-family: inherit;"><img src="https://lh3.googleusercontent.com/v-5VPt6DZe0ikzG9mAINAQXvBRt8l1_T-dCs1-6IveqBOW1FJc9m5pMQsLZm5ig19uLkTNj92Cbj56RiS1a-XPNiBv_QMqDAh4pnRcNKbI0s7G58Y6Fq2XE4xrubVjYURMSPILj1" style="border: none; transform: rotate(0rad);" /></span></span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<br /></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="white-space: pre-wrap;">The big gain in performance stems from the use of QAM, which allows encoding multiple bits per sample, in the complex plane. A modulation order (M) of 5 was selected for the design, ie 32-QAM. This was experimentally determined to be the optimal modulation order, which gives the highest data rate (R) before bit errors (N) start outweighing the benefits from a higher data rate.</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<br /></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="white-space: pre-wrap;">The encoder encodes the incoming bit-stream into frequency components and then processes it as described below before sending out its time-domain signal over the channel.</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<br /></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="white-space: pre-wrap;">The encoder accepts the input vector (of length 100,000) and encodes the vector using 32-QAM into 100,000/5 complex samples in a vector x. The encoder then separates x into 8 equal sized data blocks D1...D8 of length L1. The size of L1 is determined by modulation order M: L1=(100,000/(8*5)). Two training blocks, T1 and T2, each a vector consisting all 1’s and of length L1, are inserted to create the following vector, x, of length 10L1.</span><br />
<span style="white-space: pre-wrap;"><br /></span>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjr2bpsK-vCtXSugkjthg1e86jrGIPFitttw4KiWcnxI5hzj2RdY8PO6ail872OLJL2VgON_wGVopkijD_9hcdffv9rB8qjXmqk-usWyuLerM8spDiQnkXmr9R2Wszy4Z7YOH8dcaKpl_0e/s1600/data+blocks.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="30" data-original-width="626" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjr2bpsK-vCtXSugkjthg1e86jrGIPFitttw4KiWcnxI5hzj2RdY8PO6ail872OLJL2VgON_wGVopkijD_9hcdffv9rB8qjXmqk-usWyuLerM8spDiQnkXmr9R2Wszy4Z7YOH8dcaKpl_0e/s1600/data+blocks.png" /></a></div>
<div style="text-align: center;">
<span style="white-space: pre-wrap;"><br /></span></div>
</div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: left;">
<span style="white-space: pre-wrap;">Using a seed of 1, and Matlab’s rand function, a vector, p1, of pseudorandom phase angles (between 0 and 2 pi) is generated. These are used to create a vector p2 of phasors, where:</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="white-space: pre-wrap;">p2(i) = gamma*exp(1jp1(i)) for all i = indices of elements of p1,p2. The constant gamma sets the average power level.</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<br /></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="white-space: pre-wrap;">The elements of this vector are then multiplied element-wise with the elements in vector x. This is to prevent the constructive addition of several frequency components in the time domain which would cause the time-domain signal to clip or saturate. </span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<br /></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="white-space: pre-wrap;">Each block is then prepended by NZpre zero’s. NZpost zero’s are appended to each block. Let this vector be called X. X is then padded with 0 for DC and concatenated with X*. This ensures that the time domain signal is real-valued. The inverse DFT of this is taken to get the real-valued time domain signal. Each block is prepended with a cyclic prefix (length Kc) to make the (Toeplitz) channel transformation effectively look circulant. The encoder then outputs this vector.</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<br /></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="white-space: pre-wrap;">The training blocks are inserted into the data vector so that it may be used at the decoder end for training of channel properties. Each element of a training block (in the frequency domain) has magnitude 1 and a phase theta_t. When this element goes through the channel, it is attenuated and incurs a phase shift and is presented to the decoder with magnitude gamma_c(attenuation of the channel) and phase (theat_t+theta_c) where theta_c is the phase added by the channel. Each frequency component has an associated attenuation and phase addition. Since the training block is the same length as any individual data block, there exists known training information about attenuation and phase for each frequency of interest in the system/encoding at the decoder end. The decoder is then able to use this block’s received data to cancel channel effects for the other blocks. However, it must be noted that the the attenuation and phase addition of the channel are not static and vary with time. Thus it is important not to let the training data be stale. This is the reason two training blocks are used, and also why they are inserted in the order they are, with respect to the data blocks.</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<br /></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="white-space: pre-wrap;">It was observed that placing only one training block at the beginning of the data vector allows determining channel phase reasonably well for only a couple data blocks adjacent to it. Additionally, it was noted that decreasing the number of blocks also made the prediction worse. By placing the two training blocks as they are in the vector allows using a block to cancel channel effects for two adjacent data blocks. The phase variation from the training data to the two data blocks is small enough to allow sufficiently high figure of merit. The phase variation from D1 to D4 is illustrated below:</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span style="font-family: inherit;"><img src="https://lh6.googleusercontent.com/ZSXf2jRddC_hsWmh0KM_CX_hkpmzMPvSf5QXGg725oNxVE2htHtZMSHOwWJfrauvQRcozZ2NgLcimmAXRFX7gXvu3rJSgJKtffN8LZ5EMKk1QsJKB5N6vd0ASxV63COuIn2tSg09" style="border: none; transform: rotate(0rad);" /></span></span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="white-space: pre-wrap;">While the shift is somewhat significant, it is still possible to correctly decode the information. As can be imagined, too far from this and the bit error rate gets terrible.</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<br /></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="white-space: pre-wrap;">At the decoder end, synchronization is performed to determine the start of the signal. This is done by thresholding the average power level over five samples. To recover the samples encoded in the frequency domain, the decoder reverses what the encoder did, firstly ignoring the cyclic prefix, performing a DFT, dropping the flipped conjugate second half of the vector and then dropping the zero-padding. Since gamma_c*exp(1j*theta_c) is known from the training block for each of the frequency levels, the samples in D1 to D4 are divided by gamma_c*exp(1j*theta_c) from T1 to cancel the channel effects. Similarly, D5 to D8 use the channel information from T2. Finally, the pseudo-random phases added at the encoder side are removed by dividing by each of the known phases element-wise. These phases are known since the random number generator had a fixed seed of 1. The individual data blocks are then demodulated (QAM) and concatenated to each other to form the 100,000 long bit vector. For modulating and demodulating using QAM, Matlab’s inbuilt functions qammod and qamdemod are used.</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<br /></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="white-space: pre-wrap;">The following constants were determined to give the highest figure of merit:</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="white-space: pre-wrap;">NZpre = 110</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="white-space: pre-wrap;">NZpost = 1050</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="white-space: pre-wrap;">gamma =7.8 (chosen to meet the power constraint of 1/400)</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="white-space: pre-wrap;">Kc = 170</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<br /></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="white-space: pre-wrap;">Experimentally, the figure of merit scores are about 44,000, and 56,000 for channels audio0 and audio1 respectively. The constants NZpre, NZpost, gamma, modulation order M, number of data blocks, number of training blocks, and placement of training block were all experimented with and the results presented here represent the best combination for the highest figure of merit. With only one training block, the phase drift was high enough to negate the benefits of higher data rate obtained from 32-QAM. However, adding a third training block was seen as a waste since it would minimally reduce the number of bit errors but would hurt the data rate appreciably. Using convolutional coding was considered but it was determined as not worth the effort given the performance obtained and the added complexity.</span><br />
<span style="white-space: pre-wrap;"><br /></span>
<span style="white-space: pre-wrap;">I expect to write another post soon to discuss some technical background behind OFDM, training and synchronization. Let me know what you think and if there's something else from the project you'd like me to cover in more detail!</span></div>
Tahmidhttp://www.blogger.com/profile/09117804893438710050noreply@blogger.com2tag:blogger.com,1999:blog-6338993703407602171.post-87564602389733152892016-12-16T09:24:00.002-08:002016-12-16T09:50:45.089-08:00PIC32 JTAG Loader / ICSP programmerThis past semester, I worked on an independent study/project where I explored the programming of the PIC32. I've provided the details in the following PDF document. The key takeaway I believe is:<br />
<br />
"This document presents sufficient
background information on the project, and implementation specific details. The
most important contribution this makes is adding the experiences and a full implementation
of the project. For even more detail and a thorough understanding, it is
recommended that this report be read along with the reference documents
mentioned in Section 4.1."<br />
<div class="MsoNormal" style="text-align: justify;">
<br /></div>
<div class="MsoNormal" style="text-align: justify;">
I plan on improving this, as well as exploring the option of programming other PICs this summer. A cursory look made me think that the PIC32 programming standard was more complicated than the PIC16's. I'll find out!</div>
<div class="MsoNormal" style="text-align: justify;">
<br /></div>
<div class="MsoNormal" style="text-align: justify;">
All the project code and settings can be found <a href="https://drive.google.com/open?id=0B4SoPFPRNziHeUhXQlZSRWxyeW8"><u>here</u></a>. This includes the PIC32 project, as well as the MATLAB code for the programmer software <br />
<a href="https://drive.google.com/open?id=0B4SoPFPRNziHeUhXQlZSRWxyeW8"><u>https://drive.google.com/open?id=0B4SoPFPRNziHeUhXQlZSRWxyeW8</u></a> </div>
<div class="MsoNormal" style="text-align: justify;">
</div>
<div class="MsoNormal" style="text-align: justify;">
Please let me know if you have any comments or feedback!</div>
<br />
<iframe height="480" src="https://drive.google.com/file/d/0B4SoPFPRNziHR0dpc0Z4SkZINnM/preview" width="640"></iframe>
Tahmidhttp://www.blogger.com/profile/09117804893438710050noreply@blogger.com3tag:blogger.com,1999:blog-6338993703407602171.post-37090146791716175732016-02-06T15:49:00.002-08:002016-02-06T15:50:38.483-08:00Creating my own TV Tuner IR remote with a PIC16F684<div style="text-align: center;">
</div>
<div style="text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiNnxhaKiVq4hJU0qwiJp3VJJJSM4DYUfcnDlDgSASgK6N2nvCDxLf5I065bTpl0M6O7pcK5ukoNmCwuY_djXIs2m3kmUDqjahsm_0IYhYIGchWwTVpXK7fG8ayRujeiSdP9NaYL3fgMLjO/s1600/DSC_0425.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="640" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiNnxhaKiVq4hJU0qwiJp3VJJJSM4DYUfcnDlDgSASgK6N2nvCDxLf5I065bTpl0M6O7pcK5ukoNmCwuY_djXIs2m3kmUDqjahsm_0IYhYIGchWwTVpXK7fG8ayRujeiSdP9NaYL3fgMLjO/s640/DSC_0425.jpg" width="243" /></a> </div>
<br />
While I was home this winter, I saw that the remote for our TV tuner was damaged physically, causing the buttons to not function responsively. Some of them just didn't work. I saw this as an opportunity for a fun couple days' project to build a new remote controller for the tuner.<br />
<br />
The TV tuner was manufactured by a brand name RealView and, as expected, I couldn't find much detail about it. Thus, I had to reverse engineer the remote. From my previous experience in working with IR remotes, I had a hunch that the IR was most likely modulated at ~38kHz or ~56kHz. For those of you who don't know how this works, I highly recommend going through this website: <a href="http://www.sbprojects.com/knowledge/ir/"><u>http://www.sbprojects.com/knowledge/ir/</u></a><br />
<br />
Thus, I connected a 38kHz IR receiver I had at home (TSOP1738) to an oscilloscope in order to figure out what IR protocol is used by the remote. Upon pressing the 4 key on the remote, I saw the following waveform:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9jOl8eKPCS_HO-bGdWNz9NNeTI5TrMDhPdRaNhzgl1YWD7Y8wXFV0yYNCB7NrBz574z7uBt0k4cQ3bB9xBE1r5a_CslaexGmNrpyeIsUOQ9xvj7g77KRXrVvvguu5QNybRVmlPC9Bgzcc/s1600/20141221_601403.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="480" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9jOl8eKPCS_HO-bGdWNz9NNeTI5TrMDhPdRaNhzgl1YWD7Y8wXFV0yYNCB7NrBz574z7uBt0k4cQ3bB9xBE1r5a_CslaexGmNrpyeIsUOQ9xvj7g77KRXrVvvguu5QNybRVmlPC9Bgzcc/s640/20141221_601403.bmp" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<b>Fig. 1: </b>Oscilloscope waveform capture of the received IR signal </div>
<br />
Note that I inverted the signal on the oscilloscope since the IR receiver output is active-low.<br />
<br />
I then compared the waveform to some of the common IR protocols, paying particular attention to the initial first high and low states. After going through SIRC, RC5, RC6 among others, I noticed that this matched the NEC protocol: <a href="http://www.sbprojects.com/knowledge/ir/nec.php"><u>http://www.sbprojects.com/knowledge/ir/nec.php</u></a><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_qq2odtsDG3p0b6K2gLfwLUGso-Cjq9uYUAtT6X_n1sTNQU_9kPektHSyTdVPWksGjhCzd879UP2X7ZRwQqULKd27Elm95tzBiIaGiRqh9DniD1MrjgAhjXEldYuBUFllnESu34zghJAG/s1600/nectrain.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_qq2odtsDG3p0b6K2gLfwLUGso-Cjq9uYUAtT6X_n1sTNQU_9kPektHSyTdVPWksGjhCzd879UP2X7ZRwQqULKd27Elm95tzBiIaGiRqh9DniD1MrjgAhjXEldYuBUFllnESu34zghJAG/s1600/nectrain.png" /></a></div>
<div style="text-align: center;">
<b>Fig. 2: </b>Standard NEC IR protocol pulse train</div>
<div style="text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgTrB-e3qXLJm66unVcdO7846AWQRhVfBHRkQlhaGcXRaHYH4_UEcYPPZMAiHLd_3CuebobiNoJcBeIm7ct_vcGY-iIkuxgzywo7WSw4FzTYTbvGhRVunqsA4TWT1FltfIfMhHLZYA4-N7S/s1600/necmodulation.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgTrB-e3qXLJm66unVcdO7846AWQRhVfBHRkQlhaGcXRaHYH4_UEcYPPZMAiHLd_3CuebobiNoJcBeIm7ct_vcGY-iIkuxgzywo7WSw4FzTYTbvGhRVunqsA4TWT1FltfIfMhHLZYA4-N7S/s1600/necmodulation.png" /></a></div>
<div style="text-align: center;">
<b>Fig. 3: </b>NEC IR protocol logic high and logic low signals</div>
<br />
Using the waveform shown above, I found that ~address was not being sent, meaning that the extended NEC protocol was being used:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEil_U4Tu3Hh3KFDLo3wz0VBjG5bEWuqciC1ALbjC1oIibbWQvqPdE1wRwWyAW8IthmH-5uPfNFNalVg09r91WKtH0-RFpLb0shcDGxUzsJoSyXWrWG0FoB1I7jMnPr6hidUc8Qym-gO4Eoq/s1600/necexttrain.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEil_U4Tu3Hh3KFDLo3wz0VBjG5bEWuqciC1ALbjC1oIibbWQvqPdE1wRwWyAW8IthmH-5uPfNFNalVg09r91WKtH0-RFpLb0shcDGxUzsJoSyXWrWG0FoB1I7jMnPr6hidUc8Qym-gO4Eoq/s1600/necexttrain.png" /></a></div>
<div style="text-align: center;">
<b>Fig. 4: </b>Extended NEC IR protocol pulse train</div>
<br />
From the waveform, I found that the address was 0xBD02. I then proceeded to make a simple decoder with a PIC16F877A since I had a development board with an IR sensor mounted on it. Using this, I found all the required commands for the different keys of the remote. I decided to exclude some of the keys that were never used (eg play, pause, stop, fast forward, rewind).<br />
You can find this part of the project here:<br />
<a href="https://drive.google.com/file/d/0B4SoPFPRNziHZjk2N3pNLVE5V1E/view?usp=sharing"><u>https://drive.google.com/file/d/0B4SoPFPRNziHZjk2N3pNLVE5V1E/view?usp=sharing</u></a> <br />
<br />
This left me with the following keys and commands:<br />
<br />
<style type="text/css"><!--td {border: 1px solid #ccc;}br {mso-data-placement:same-cell;}--></style><br />
<table border="1" cellpadding="0" cellspacing="0" dir="ltr" style="border-collapse: collapse; border: 1px solid #ccc; font-family: arial,sans,sans-serif; font-size: 13px; table-layout: fixed;"><colgroup><col width="138"></col><col width="100"></col></colgroup><tbody align="center">
<tr style="height: 21px;"><td data-sheets-value="[null,2,"Key"]" style="font-weight: bold; padding: 2px 3px; vertical-align: bottom;">Key</td><td data-sheets-value="[null,2,"Command"]" style="font-weight: bold; padding: 2px 3px; vertical-align: bottom;">Command</td></tr>
<tr style="height: 21px;"><td data-sheets-value="[null,3,null,0]" style="padding: 2px 3px; vertical-align: bottom;">0</td><td data-sheets-value="[null,3,null,9]" style="padding: 2px 3px; vertical-align: bottom;">9</td></tr>
<tr style="height: 21px;"><td data-sheets-value="[null,3,null,1]" style="padding: 2px 3px; vertical-align: bottom;">1</td><td data-sheets-value="[null,3,null,0]" style="padding: 2px 3px; vertical-align: bottom;">0</td></tr>
<tr style="height: 21px;"><td data-sheets-value="[null,3,null,2]" style="padding: 2px 3px; vertical-align: bottom;">2</td><td data-sheets-value="[null,3,null,1]" style="padding: 2px 3px; vertical-align: bottom;">1</td></tr>
<tr style="height: 21px;"><td data-sheets-value="[null,3,null,3]" style="padding: 2px 3px; vertical-align: bottom;">3</td><td data-sheets-value="[null,3,null,2]" style="padding: 2px 3px; vertical-align: bottom;">2</td></tr>
<tr style="height: 21px;"><td data-sheets-value="[null,3,null,4]" style="padding: 2px 3px; vertical-align: bottom;">4</td><td data-sheets-value="[null,3,null,3]" style="padding: 2px 3px; vertical-align: bottom;">3</td></tr>
<tr style="height: 21px;"><td data-sheets-value="[null,3,null,5]" style="padding: 2px 3px; vertical-align: bottom;">5</td><td data-sheets-value="[null,3,null,4]" style="padding: 2px 3px; vertical-align: bottom;">4</td></tr>
<tr style="height: 21px;"><td data-sheets-value="[null,3,null,6]" style="padding: 2px 3px; vertical-align: bottom;">6</td><td data-sheets-value="[null,3,null,5]" style="padding: 2px 3px; vertical-align: bottom;">5</td></tr>
<tr style="height: 21px;"><td data-sheets-value="[null,3,null,7]" style="padding: 2px 3px; vertical-align: bottom;">7</td><td data-sheets-value="[null,3,null,6]" style="padding: 2px 3px; vertical-align: bottom;">6</td></tr>
<tr style="height: 21px;"><td data-sheets-value="[null,3,null,8]" style="padding: 2px 3px; vertical-align: bottom;">8</td><td data-sheets-value="[null,3,null,7]" style="padding: 2px 3px; vertical-align: bottom;">7</td></tr>
<tr style="height: 21px;"><td data-sheets-value="[null,3,null,9]" style="padding: 2px 3px; vertical-align: bottom;">9</td><td data-sheets-value="[null,3,null,8]" style="padding: 2px 3px; vertical-align: bottom;">8</td></tr>
<tr style="height: 21px;"><td data-sheets-value="[null,2,"UP"]" style="padding: 2px 3px; vertical-align: bottom;">UP</td><td data-sheets-value="[null,3,null,18]" style="padding: 2px 3px; vertical-align: bottom;">18</td></tr>
<tr style="height: 21px;"><td data-sheets-value="[null,2,"DOWN"]" style="padding: 2px 3px; vertical-align: bottom;">DOWN</td><td data-sheets-value="[null,3,null,19]" style="padding: 2px 3px; vertical-align: bottom;">19</td></tr>
<tr style="height: 21px;"><td data-sheets-value="[null,2,"RIGHT"]" style="padding: 2px 3px; vertical-align: bottom;">RIGHT</td><td data-sheets-value="[null,3,null,16]" style="padding: 2px 3px; vertical-align: bottom;">16</td></tr>
<tr style="height: 21px;"><td data-sheets-value="[null,2,"LEFT"]" style="padding: 2px 3px; vertical-align: bottom;">LEFT</td><td data-sheets-value="[null,3,null,17]" style="padding: 2px 3px; vertical-align: bottom;">17</td></tr>
<tr style="height: 21px;"><td data-sheets-value="[null,2,"PREVIOUS CHANNEL"]" style="padding: 2px 3px; vertical-align: bottom;">PREVIOUS CHANNEL</td><td data-sheets-value="[null,3,null,13]" style="padding: 2px 3px; vertical-align: bottom;">13</td></tr>
<tr style="height: 21px;"><td data-sheets-value="[null,2,"-/--"]" style="padding: 2px 3px; vertical-align: bottom;">-/--</td><td data-sheets-value="[null,3,null,10]" style="padding: 2px 3px; vertical-align: bottom;">10</td></tr>
<tr style="height: 21px;"><td data-sheets-value="[null,2,"POWER"]" style="padding: 2px 3px; vertical-align: bottom;">POWER</td><td data-sheets-value="[null,3,null,20]" style="padding: 2px 3px; vertical-align: bottom;">20</td></tr>
<tr style="height: 21px;"><td data-sheets-value="[null,2,"MENU"]" style="padding: 2px 3px; vertical-align: bottom;">MENU</td><td data-sheets-value="[null,3,null,21]" style="padding: 2px 3px; vertical-align: bottom;">21</td></tr>
<tr style="height: 21px;"><td data-sheets-value="[null,2,"MUTE"]" style="padding: 2px 3px; vertical-align: bottom;">MUTE</td><td data-sheets-value="[null,3,null,12]" style="padding: 2px 3px; vertical-align: bottom;">12</td></tr>
</tbody></table>
<br />
I then proceeded to write an IR transmitter using the PIC16F684 (using the MPLAB X IDE and XC8 compiler), following the timing information from the extended NEC protocol. In order to connect all the keys, I connected them in matrix keypad form.<br />
<br />
In order to power the remote off 2xAA batteries, it is necessary to use sleep mode - otherwise the battery will be drained extremely quickly. So, in order to detect when a button is pressed, an interrupt is used. After the IR command is sent, the microcontroller goes to sleep. The interrupt wakes up the microcontroller when a button is pressed. Debouncing is achieved using simple software delays. When a button is held down, the NEC command repeat sequence is not sent. Instead, the remote relies on releasing the button and pressing it again.<br />
<br />
To minimize leakage current through the input capacitor, I decided not to use an electrolytic capacitor. A red LED illuminates to confirm that a button has been pressed.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhdHcZRQWOf6SnxvIvd7zMohX-5y1eS6y6Y9ml11Ea-7Zpv3BmfA0s0wqDxStT6PUQt9rE5CCkOCeKFL8m25x9ZxD-eicxsY_tKFWKLMc6fZuLDo6l3OJb0d1EFG1Zz_zIrfY_8TENUjpZb/s1600/sch684.BMP" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="356" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhdHcZRQWOf6SnxvIvd7zMohX-5y1eS6y6Y9ml11Ea-7Zpv3BmfA0s0wqDxStT6PUQt9rE5CCkOCeKFL8m25x9ZxD-eicxsY_tKFWKLMc6fZuLDo6l3OJb0d1EFG1Zz_zIrfY_8TENUjpZb/s640/sch684.BMP" width="640" /></a></div>
<div style="text-align: center;">
<b>Fig. 5: </b>Schematic of IR remote design</div>
<br />
Everything was put together, a PCB was designed and when tested with the TV tuner, everything worked as expected! I measured the sleep current with a portable DMM and it was read as 1.6μA! I'm not sure how accurate the DMM is at such low currents, so I wouldn't entirely trust this number - however, it does seem to be within spec for the PIC16F684.<br />
<br />
Due to a lack of time, I had to put the remote together with electric tape! Here you can see pictures of the final design:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTlZgNRHBcXcZFdCeES9q_kQSj8orj4OIEM9gwxsXurqXsK73C4F822G4sY4IkRDq6Bf4xd6LD4OIdQyD-cXXZI5_12a0oSWSqumiFLpQ41oHMF83jZnZxs3I5S3KwEXm4RB9ckHv3ALbh/s1600/DSC_0427.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTlZgNRHBcXcZFdCeES9q_kQSj8orj4OIEM9gwxsXurqXsK73C4F822G4sY4IkRDq6Bf4xd6LD4OIdQyD-cXXZI5_12a0oSWSqumiFLpQ41oHMF83jZnZxs3I5S3KwEXm4RB9ckHv3ALbh/s400/DSC_0427.jpg" width="171" /> </a></div>
<div class="separator" style="clear: both; text-align: center;">
<b>Fig. 6: </b>Final IR remote, top</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhtr1LaETlkgQs2XkJwYei6oJvedVrGdKs0Hd4hqdZlvS5kOEEZWNIK6AVRxIQrT_my6ZADRi2my7FibLVMWsmZRP7apX0afllL7EPzACBqLcy1VViIBwTBWlqIyqfK86HS-E8VrxrPcbqg/s1600/DSC_0428.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhtr1LaETlkgQs2XkJwYei6oJvedVrGdKs0Hd4hqdZlvS5kOEEZWNIK6AVRxIQrT_my6ZADRi2my7FibLVMWsmZRP7apX0afllL7EPzACBqLcy1VViIBwTBWlqIyqfK86HS-E8VrxrPcbqg/s400/DSC_0428.jpg" width="195" /></a></div>
<div style="text-align: center;">
<b>Fig. 7: </b>Final IR remote, bottom</div>
<br />
I am back at college now, but I have been told that the same set of batteries are still working on the remote, and it is working perfectly fine!<br />
<br />
You can find the MPLABX project, source code, schematic and pcb files all here:<br />
<a href="https://drive.google.com/file/d/0B4SoPFPRNziHV2I1U1Bldm1OYUE/view?usp=sharing"><u>https://drive.google.com/file/d/0B4SoPFPRNziHV2I1U1Bldm1OYUE/view?usp=sharing</u></a> <br />
<br />
Let me know what you think! If you have any questions, let me know in the comments section!Tahmidhttp://www.blogger.com/profile/09117804893438710050noreply@blogger.com10tag:blogger.com,1999:blog-6338993703407602171.post-83222023455444931142015-12-28T04:41:00.001-08:002015-12-28T05:30:12.606-08:00Using an input device on Embedded Linux: An example with a USB mouse on the Intel Edison<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3o5hB8d8dg1pCQIgP62lDTMnnZ8v0b_1f0MiC068l7SeW3q54hLeCmVXRhGjziSGP3BDLk7OruUpDjNKiDvsavFHDwhme0HSSBrSTzNHntgP0I8lpZpPVJ2-0y4Bhm3ydssA6EIiPHFh_/s1600/edison.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="640" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3o5hB8d8dg1pCQIgP62lDTMnnZ8v0b_1f0MiC068l7SeW3q54hLeCmVXRhGjziSGP3BDLk7OruUpDjNKiDvsavFHDwhme0HSSBrSTzNHntgP0I8lpZpPVJ2-0y4Bhm3ydssA6EIiPHFh_/s640/edison.jpg" width="638" /></a></div>
<div style="text-align: center;">
The Intel Edison test board, along with the USB mouse</div>
<br />
<br />
I have recently been using the Intel Edison for the Cornell robotics project team (which co-hosts the Intel-Cornell Cup USA competition). Building on my previous knowledge of embedded systems, I started learning to use and program on Linux. The distro used is Yocto (all information is available on the Intel Edison website).<br />
<br />
One of the prototypes we worked on relied on using a wireless Playstation 4 controller for locomotion user interface. The concept of using an input device on Linux is not complicated, but can be a daunting task for someone new to Linux programming. Hence, I have decided to write this article giving an example of using an input device on an Embedded Linux platform. This demo application I am showing uses a USB mouse as the input device connected to the Intel Edison.<br />
<br />
<u><b>Prerequisite:</b></u> I have assumed that you have a flashed Intel Edison board, know how to access the terminal (through the USB COM port, or through SSH) and have the Eclipse IDE installed and can program with it. Of course, if you don't have the IDE, you can compile the code through the terminal and I'll tell you how to do it at the end. If you are using a platform other than the Edison, details may change but the general idea is similar. Additionally, it is assumed that you have a basic understanding of C programming.<br />
<br />
First thing to note when you connect the USB mouse is that the switch on
the board (labelled SW1) must be switched towards the USB-A connector
from the default position facing the microUSB port.<br />
<br />
The device drivers in Linux abstract away the low-level nitty gritty details of the interface with the input device, presenting an input through file descriptors that can be interfaced with as files. The input devices can be viewed and read from in the Linux environment just like files, as mentioned before. The input device appears in the <b>/dev/input</b> directory. Initially, before the mouse is plugged in, you can see that there is an event0 and an event1 file. Upon connecting the mouse, you can see an event2 file.<br />
<br />
<div style="text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwpmhsMRU7aR8geCu8KzemUO3ct3X3T-NgP_3T2HxM20GQNm1550FeOtd5XRzdjXWXx3HRSN6NBculz9VQzt1tFJZAPuWioeqTPHmGGQ3mazPQsOTKgxVK8KAIan7u_nWK1We5EjqPGjbD/s1600/input+without+mouse.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwpmhsMRU7aR8geCu8KzemUO3ct3X3T-NgP_3T2HxM20GQNm1550FeOtd5XRzdjXWXx3HRSN6NBculz9VQzt1tFJZAPuWioeqTPHmGGQ3mazPQsOTKgxVK8KAIan7u_nWK1We5EjqPGjbD/s1600/input+without+mouse.png" /></a><b> </b></div>
<div style="text-align: center;">
<b>Fig. 1:</b> Input device files without mouse connected</div>
<br />
<div style="text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiAqae-p0Hggmga0-Bq8EH2ARJKgICExPw2gk-4x4srGGn2wJ81LBOAR2vl-KGbxDM23yP48Nm63WSi9CMYcOxAXuK-cNfU_6SCvVpi19M83s4WJHd4rOzBFAqpAor1IcddTXnm1JsPT9mM/s1600/input+with+mouse.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="92" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiAqae-p0Hggmga0-Bq8EH2ARJKgICExPw2gk-4x4srGGn2wJ81LBOAR2vl-KGbxDM23yP48Nm63WSi9CMYcOxAXuK-cNfU_6SCvVpi19M83s4WJHd4rOzBFAqpAor1IcddTXnm1JsPT9mM/s320/input+with+mouse.png" width="320" /></a><b> </b></div>
<div style="text-align: center;">
<b>Fig. 2:</b> Input device files with mouse connected</div>
<br />
By reading the event2 file, you can read the mouse data. To dump data from the file, you can use the <b>od</b> command (man page: <a href="http://man7.org/linux/man-pages/man1/od.1.html"><u>http://man7.org/linux/man-pages/man1/od.1.html</u></a>)<br />
<br />
For example, to view the output dump in hex format:<br />
<span style="font-family: "Courier New",Courier,monospace;">od -x event2</span><br />
<br />
Move the mouse around, press the buttons, scroll the wheel and you'll see data appear on the console:<br />
<div style="text-align: center;">
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhJKs4KV9jDkmh5T7DY_BFsXFlApNsGg_M_5hYoNI5lXv6Z_MIkjvACC7n4gNZn8FHiHh6CxeOrL0Se59iRgQYsu1wDbyPwSwIPAE3lKffsqU7El1m_8AuHBBnAJz7x66sPL3U5fi3IvSBn/s1600/file+data+dump.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhJKs4KV9jDkmh5T7DY_BFsXFlApNsGg_M_5hYoNI5lXv6Z_MIkjvACC7n4gNZn8FHiHh6CxeOrL0Se59iRgQYsu1wDbyPwSwIPAE3lKffsqU7El1m_8AuHBBnAJz7x66sPL3U5fi3IvSBn/s1600/file+data+dump.png" /></a></div>
</div>
<div style="text-align: center;">
<b>Fig. 3:</b> File event2 data dump using od command</div>
<br />
Hit Ctrl+C when you're satisfied you've seen enough of the dump.<br />
<br />
Now to make sense of this input, decipher it and meaningfully use it, I have written a simple C application. I'll walk you through the process of developing it before I provide the code.<br />
<br />
First thing to do is to go through these references as part of the kernel documentation:<br />
<a href="https://www.kernel.org/doc/Documentation/input/event-codes.txt"><u>https://www.kernel.org/doc/Documentation/input/event-codes.txt</u></a><br />
<a href="https://www.kernel.org/doc/Documentation/input/input.txt"><u>https://www.kernel.org/doc/Documentation/input/input.txt</u></a><br />
<br />
Additionally, you should go through the linux/input.h header file. You can find a copy here:<br />
<a href="http://lxr.free-electrons.com/source/include/linux/input.h?v=2.6.38"><u>http://lxr.free-electrons.com/source/include/linux/input.h?v=2.6.38</u></a><br />
<br />
You can also type it into Eclipse, hit Ctrl on your keypad and left mouse click on the header file name to view the file itself.<br />
<br />
From the kernel documentation and the input.h file, you should find that the data output happens such that every time an event occurs, it can be "fit" into the following structure (defined in linux/input.h):<br />
<br />
<span style="font-size: small;"><span style="font-family: "Courier New",Courier,monospace;">struct input_event {<br /> struct timeval time;<br /> __u16 type;<br /> __u16 code;<br /> __s32 value;<br />};</span></span><br />
<br />
You can find that this has a total length of 16 bytes. You can look through the different data types and add, and confirm using the sizeof function in Eclipse:<br />
<span style="font-size: small;"><span style="font-family: "Courier New",Courier,monospace;">fprintf(stdout, "Size of event is: %d\n", sizeof(event));</span></span><br />
<br />
Each event has a timestamp, type, code and value as you can guess from the input structure. Additionally events are separated by EV_SYN type events which are just markers. EV_SYN is defined as 0.<br />
<br />
You can read the file in a C program and then just print out the values separated as fields in the input event structure to confirm that and observe the different types of data as you interact with the mouse. You can limit the type of event as you interact with your mouse. To understand the meaning of the numbers you receive, peruse the linux/input.h file and the kernel documentation linked above. You will see a section describing the events:<br />
<br />
<span style="font-size: small;">/*<br /> * Event types<br /> */<br /><br /><span style="font-family: "Courier New",Courier,monospace;">#define EV_SYN 0x00<br />#define EV_KEY 0x01<br />#define EV_REL 0x02<br />#define EV_ABS 0x03<br />#define EV_MSC 0x04<br />#define EV_SW 0x05<br />#define EV_LED 0x11<br />#define EV_SND 0x12<br />#define EV_REP 0x14<br />#define EV_FF 0x15<br />#define EV_PWR 0x16<br />#define EV_FF_STATUS 0x17<br />#define EV_MAX 0x1f<br />#define EV_CNT (EV_MAX+1)</span></span><br />
<span style="font-size: small;"><br /></span>
You can also find a section describing the different keys/buttons for a keyboard, gamepad, mouse, etc. The section describing the mouse is:<br />
<br />
<span style="font-size: small;"><span style="font-family: "Courier New",Courier,monospace;">#define BTN_MOUSE 0x110<br />#define BTN_LEFT 0x110<br />#define BTN_RIGHT 0x111<br />#define BTN_MIDDLE 0x112<br />#define BTN_SIDE 0x113<br />#define BTN_EXTRA 0x114<br />#define BTN_FORWARD 0x115<br />#define BTN_BACK 0x116<br />#define BTN_TASK 0x117</span></span><br />
<br />
<span style="font-size: small;"><span style="font-family: "Courier New",Courier,monospace;">/*<br /> * Relative axes<br /> */<br /><br />#define REL_X 0x00<br />#define REL_Y 0x01<br />#define REL_Z 0x02<br />#define REL_RX 0x03<br />#define REL_RY 0x04<br />#define REL_RZ 0x05<br />#define REL_HWHEEL 0x06<br />#define REL_DIAL 0x07<br />#define REL_WHEEL 0x08<br />#define REL_MISC 0x09<br />#define REL_MAX 0x0f<br />#define REL_CNT (REL_MAX+1) </span></span><br />
<span style="font-size: small;"><br /></span>
You can compare these against the values you see to see if they make sense (they should!). Then, you can proceed to mold this to read the different codes, types and values based on these. This is what I have done in my demo application, which should be commented enough for you to understand. (Obviously, if you have questions, let me know in the comments section!)<br />
<br />
One last thing that I haven't covered yet (but you may already know) is how to do the file read. I have used the low-level file IO functions <b>open </b>and <b>read</b>:<br />
<br />
<u><b>Opening the file:</b></u><br />
<br />
<span style="font-size: small;"><span style="font-family: "Courier New",Courier,monospace;">// Use low-level Linux file IO operations<br />// Device is presented as a file, event2 in /dev/input for the Edison<br />int fid = open("/dev/input/event2", O_RDONLY);<br />if (fid == 0){<br /> fprintf(stderr, "Could not open event2 device!\n");<br /> return EXIT_FAILURE;<br />}<br />fprintf(stdout, "Opened event2 device!\n");</span></span><br />
<span style="font-size: small;"><br /></span>
<u><b>Reading the file:</b></u><br />
<br />
<span style="font-size: small;"><span style="font-family: "Courier New",Courier,monospace;">int nbytes;<br />struct input_event event; </span></span><br />
<span style="font-size: small;"><span style="font-family: "Courier New",Courier,monospace;"><span style="font-size: small;"><span style="font-family: "Courier New",Courier,monospace;">// Event type from <linux/input.h></span></span></span></span><br />
<span style="font-size: small;"><span style="font-family: "Courier New",Courier,monospace;">nbytes = read(fid, &event, sizeof(event));</span></span><br />
<br />
The demo application prints out messages describing mouse motion, wheel motion and left, middle (wheel) and right button presses. See Fig. 4 below.<br />
<br />
You can find the full code for my demo project here: <a href="https://drive.google.com/file/d/0B4SoPFPRNziHUUVCRHVPNjkwZ2s/view?usp=sharing"><u>https://drive.google.com/file/d/0B4SoPFPRNziHUUVCRHVPNjkwZ2s/view?usp=sharing</u></a><br />
<br />
A typical output is shown below:<br />
<div style="text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYUYvAFvY_ZhGNgHEbocSQB7pPKkxb16d6IXmg57ziMP66qtz69Zr0Ly1udwUwFSXYj71JH4_BMJtjWCKf9niTdGTFIToYCyoRz7k6YA0cF7lo3n_06_9405jkEJYPmOWomN1JJ4_CI5Pd/s1600/demo+project+output.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYUYvAFvY_ZhGNgHEbocSQB7pPKkxb16d6IXmg57ziMP66qtz69Zr0Ly1udwUwFSXYj71JH4_BMJtjWCKf9niTdGTFIToYCyoRz7k6YA0cF7lo3n_06_9405jkEJYPmOWomN1JJ4_CI5Pd/s1600/demo+project+output.png" /></a><b> </b></div>
<div style="text-align: center;">
<b>Fig. 4:</b> Output of the demo application </div>
<br />
<br />
<u><b>Programming without the Eclipse IDE:</b></u> As I have mentioned before, even if you don't have the Eclipse IDE (which you should get), you can still program the Edison. Here are a few ways you can do so. You can copy-paste the code from a text editor to the terminal (using PuTTY, mouse right-click is paste), or even write the code on the terminal. Additionally, you can use a program such as WinSCP to transfer a C file. Be careful with Windows files since lines end in a newline and a carriage return character, whereas on Linux, they end with only a newline character. The carriage return character will be displayed as ^M if you open the file with the text editor. Once the file is on the Edison file system somewhere, cd into that folder and compile it:<br />
<br />
<span style="font-size: small;"><span style="font-family: "Courier New",Courier,monospace;">gcc -o <output name> <source file name></span></span><br />
<span style="font-size: small;">eg: <span style="font-family: "Courier New",Courier,monospace;">gcc -o mouse mouse.c</span></span><br />
<br />
Then you can run it:<br />
<span style="font-family: "Courier New",Courier,monospace;"><span style="font-family: Times,"Times New Roman",serif;">eg:</span> <span style="font-size: small;">./mouse</span></span><br />
<br />
I have attempted to make the code self-explanatory and provide
sufficient background detail here for you to understand what's going on.
By changing the code and type checks, you can extend this to other devices. Hopefully you'll find this useful! Let me know what you think!Tahmidhttp://www.blogger.com/profile/09117804893438710050noreply@blogger.com1tag:blogger.com,1999:blog-6338993703407602171.post-61371204641408012092015-08-02T13:04:00.000-07:002015-08-02T19:31:50.215-07:00PIC32 Tic-Tac-Toe: Demonstration of using touch-screen, TFT and the Protothreads threading library<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbOBKyipPU7tPOwI4EImOgJm9IGSAXPLKmZuEpu4O9-SylMJI7wQI_xNyhFVkzNAuH5bPaTZAPsiSqQKyvZKd6S-OxFexiAvA1mg8DU738For8YoXewGpjRxNnN_sAv3kV942iokIns5y3/s1600/2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbOBKyipPU7tPOwI4EImOgJm9IGSAXPLKmZuEpu4O9-SylMJI7wQI_xNyhFVkzNAuH5bPaTZAPsiSqQKyvZKd6S-OxFexiAvA1mg8DU738For8YoXewGpjRxNnN_sAv3kV942iokIns5y3/s320/2.jpg" width="228" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg8H-AnStuy4LFV-Amcq5c2gNHU06VA3sgT4VrsQcFIGtGMYFPbKohIHQkMQhpXxNeBCABJl_VCCXpv_Cg6dBCi2NxBYtjBQn8ybTw4sduflPDPXmjOg9E2b2lp4LCEWlYUvaLnTlZZ9uQq/s1600/4.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg8H-AnStuy4LFV-Amcq5c2gNHU06VA3sgT4VrsQcFIGtGMYFPbKohIHQkMQhpXxNeBCABJl_VCCXpv_Cg6dBCi2NxBYtjBQn8ybTw4sduflPDPXmjOg9E2b2lp4LCEWlYUvaLnTlZZ9uQq/s320/4.jpg" width="247" /></a></div>
<br />
<br />
I had previously used the Adafruit TFT display using my
library (ported from the Adafruit Arduino library). I decided to
optimize the library to improve drawing speed. The same
display I use comes with a 4-wire resistive touch-screen as well. I
decided to write a simple library for the touch-screen and give
<a href="http://dunkels.com/adam/pt/"><u>Protothreads </u></a>a try. To incorporate all this, I thought it would be cool
if I used these to make a simple game. Tic-tac-toe came to mind as a fun
little demo.<br />
<br />
<br />
I'm sure everyone's familiar with the game
so I won't explain the rules there. The touch-screen is simply two
resistive sheets placed on top of each other on top of the TFT screen.
When it is pressed down at a given place, the two sheets make contact
and a voltage divider is formed. Using the IO's and the ADC, this
voltage is read in the X and Y directions to register a touch.<br />
<br />
Here is a very good pictorial depiction of the resistive touch screen (taken from the <a href="http://www.atmel.com/Images/doc8091.pdf"><u>Atmel AVR341 document</u></a>):<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxFki1vOJPN9kWR1z373NX5DurXpB6goS082o24cmnDEw8itmb3HYHwEnnXPI4ysyg89vxAtyiqF0mqy1AKb6g8A1ecEtkgdo-h_WOD1wiUzHTnoCaRLk4JpWb8CxcMcbMgU8_7MbMN9BQ/s1600/atmel+touch+screen.PNG" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="269" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxFki1vOJPN9kWR1z373NX5DurXpB6goS082o24cmnDEw8itmb3HYHwEnnXPI4ysyg89vxAtyiqF0mqy1AKb6g8A1ecEtkgdo-h_WOD1wiUzHTnoCaRLk4JpWb8CxcMcbMgU8_7MbMN9BQ/s320/atmel+touch+screen.PNG" width="320" /></a></div>
<br />
So
in order to read the touch, the X+ and X- points are applied power, and
one of Y+ or Y- is read to read the x-coordinate. Then Y+ and Y- are
applied power and one of X+ or X- is read to read the y-coordinate. X+,
X-, Y+ and Y- are connected to four GPIO pins on the PIC32 that are
configured to outputs when driving the touch-screen and analog inputs
when reading. Every time the IO pin switches state, a long delay is
provided to allow the outputs to stabilize. Alternately, the ADC is
significantly slowed down to negate effects of capacitive charging by
high source impedance. The library is written in the form of a simple
state machine cycling through its states every few milliseconds, decided
by the application calling the library functions. In my application, I
use 5 milliseconds.<br />
<br />
To organize the game, I've made use of the Protothreads threading library. <a href="http://dunkels.com/adam/pt/">Protothreads</a>
is a very light-weight, stackless, threading library written entirely
as C macros by Adam Dunkels. Bruce Land has ported Protothreads over for
the PIC32. You can find more details on his excellent site: <a href="http://people.ece.cornell.edu/land/courses/ece4760//PIC32/index_Protothreads.html"><u>http://people.ece.cornell.edu/land/courses/ece4760//PIC32/index_Protothreads.html</u></a><br />
<br />
There
are two main executing threads, one is the main game thread and the
other is a clock thread that keeps track of, and displays, time since
the program was started. There is a third thread used to retrieve touch
information. It is spawned by the main game thread when touch input is
required. The main Protothreads functions (macros) I've
made use of are:<br />
<br />
PT_setup()<br />
PT_INIT()<br />
PT_SCHEDULE()<br />
PT_SPAWN()<br />
PT_WAIT_UNTIL()<br />
PT_YIELD_TIME_msec()<br />
PT_GET_TIME()<br />
<br />
Pin connections:<br />
<br />
BL (backlight): I left it unconnected, but you can connect it to 3.3V for backlight.<br />
SCK: connected to RB14 on the PIC<br />
MISO: left unconnected, since I'm not reading anything from the screen<br />
MOSI: connected to RB11 on the PIC<br />
CS: connected to RB1 on the PIC<br />
SDCS: left unconnected as I'm not using the microSD card for this<br />
RST: connected to RB2 on the PIC<br />
D/C: connected to RB0 on the PIC<br />
X+: connected to RA4 on the PIC<br />
X-: connected to RB13 on the PIC<br />
Y+: connected to RB5 on the PIC<br />
Y-: connected to RB15 on the PIC<br />
VIN: connected to 3.3V supply<br />
GND: connected to gnd <br />
<br />
Here is a demo of the game:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen="" class="YOUTUBE-iframe-video" data-thumbnail-src="https://i.ytimg.com/vi/77wlPeXzSJM/0.jpg" frameborder="0" height="266" src="https://www.youtube.com/embed/77wlPeXzSJM?feature=player_embedded" width="320"></iframe></div>
<br />
<br />
Besides the game itself, you can see the running clock on the bottom left right above the players' scores. To the bottom right you can see a flickering circle that is either green or red, depending on if it's player 1 or 2's turn, respectively. Once the game is over, you have the option of playing another game while score is being tracked.<br />
<br />
Here is a link to the MPLABX project with all required header and source files:<br />
<a href="https://drive.google.com/file/d/0B4SoPFPRNziHbURwVWVSN1c3VVE/view?usp=sharing"><u>https://drive.google.com/file/d/0B4SoPFPRNziHbURwVWVSN1c3VVE/view?usp=sharing</u></a> <br />
<br />
I
have commented the code to make it fairly self-explanatory. If you have
doubts or questions about anything, let me know and I'll add more
detail. Let me know what you think!Tahmidhttp://www.blogger.com/profile/09117804893438710050noreply@blogger.com6tag:blogger.com,1999:blog-6338993703407602171.post-42769242281515280582015-01-07T14:35:00.003-08:002015-01-10T13:22:49.967-08:00Stereo audio player using the PIC32, MCP4822, microSD card and the MDDFS library<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjooA7JfRE2cVyHz5GzvpRU4Lv8L8apzWdT3Ej94sFoHKqEo6h9hUcycUgEz4pBWu9cM07B7nFZK7laW5fhoW99UyZJfSeCwaBhWM6VDrSL_xYSKSUxGtc7bV9tUjvY3n5qUpdErIruqKsz/s1600/20141016_213036.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjooA7JfRE2cVyHz5GzvpRU4Lv8L8apzWdT3Ej94sFoHKqEo6h9hUcycUgEz4pBWu9cM07B7nFZK7laW5fhoW99UyZJfSeCwaBhWM6VDrSL_xYSKSUxGtc7bV9tUjvY3n5qUpdErIruqKsz/s1600/20141016_213036.png" height="480" width="640" /></a></div>
<div style="text-align: center;">
<b>Oscilloscope screen capture of output from the audio player</b></div>
<div style="text-align: center;">
Top - left channel</div>
<div style="text-align: center;">
Bottom - right channel</div>
<br />
Using the PIC32MX250F128B, I decided to make a simple audio player. I
wanted to play back good quality audio from a large memory space - a
microSD card. So, I made this WAV player that can play back 16-bit
44.1kHz WAV files with 12-bit stereo audio output. Of course that's not all it can play back. It is programmed for automatic period configuration so that the period is set on the fly based on the song sample rate. It can play back both 8-bit and 16-bit mono and stereo audio files and I have tested from 8kHz 8-bit mono to 44.1kHz 16-bit stereo. The player itself does not include an audio amplifier to drive speakers but can drive earphones. I've used an external stereo speaker for testing.<br />
<br />
The hardware is
fairly simple! Using the Microchip Memory Disk Drive File System (MDDFS)
library, and my previous work using the MCP4822 dual 12-bit DAC,
integrating these components to make a working audio player was quite
fun and a good learning experience.<br />
<br />
Here I share all my project files and source code, along with documentation regarding this project. Let me know what you think!<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhK0x1hdQ3SobgZmiVSmH8_E04lEkyu6SmVnd2Ip5bNHF-G-Y4nk1tAtGX67A0l6VoFet-fP71Ad2bk3gV3VvItlO5ZX6dwnf7Gcmt37Tl8MEjoO8zU1LBQn8ru_Hu1ehsI9aFMFUC5W7f1/s1600/schema_i2_wav_player.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhK0x1hdQ3SobgZmiVSmH8_E04lEkyu6SmVnd2Ip5bNHF-G-Y4nk1tAtGX67A0l6VoFet-fP71Ad2bk3gV3VvItlO5ZX6dwnf7Gcmt37Tl8MEjoO8zU1LBQn8ru_Hu1ehsI9aFMFUC5W7f1/s1600/schema_i2_wav_player.png" height="554" width="640" /></a></div>
<div style="text-align: center;">
Schematic of PIC32-based audio player</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div style="-x-system-font: none; display: block; font-family: Helvetica,Arial,Sans-serif; font-size-adjust: none; font-size: 14px; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; margin: 12px auto 6px auto;">
<br /></div>
<iframe class="scribd_iframe_embed" data-aspect-ratio="undefined" data-auto-height="false" frameborder="0" height="600" id="doc_62344" scrolling="no" src="https://www.scribd.com/embeds/252053802/content?start_page=1&view_mode=scroll&show_recommendations=true" width="100%"></iframe>
<br />
<br />
<br />
Running demo of the audio player:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.youtube.com/embed/PLoyxrjAPZo?feature=player_embedded' frameborder='0'></iframe></div>
<br />
<br />
All project files and schematic can be downloaded from:<br />
<a href="https://drive.google.com/file/d/0B4SoPFPRNziHRGE0bVNZYV9uVjQ/view?usp=sharing"><u>https://drive.google.com/file/d/0B4SoPFPRNziHRGE0bVNZYV9uVjQ/view?usp=sharing</u></a><br />
<br />
Documentation can be downloaded from:<br />
<a href="https://drive.google.com/file/d/0B4SoPFPRNziHaWpIWFQ3RkJFVzQ/view?usp=sharing"><u>https://drive.google.com/file/d/0B4SoPFPRNziHaWpIWFQ3RkJFVzQ/view?usp=sharing</u></a><br />
<br />Tahmidhttp://www.blogger.com/profile/09117804893438710050noreply@blogger.com6tag:blogger.com,1999:blog-6338993703407602171.post-33614167052036696812014-10-30T12:06:00.002-07:002015-04-08T10:21:49.794-07:00Interfacing a color TFT display with the PIC32MX250F128BI have been working on interfacing the PIC32MX250F128B with a small 2.2" TFT display from Adafruit. It's a nice little display that is fairly easy to communicate with, using SPI communication. The display I'm using is: <a href="http://www.adafruit.com/product/1480"><u>http://www.adafruit.com/product/1480</u></a><br />
<br />
Adafruit provides nice open-source libraries for their products. However, they are for Arduino and thus cannot be directly reused for the PIC32. I went through the library and ported it over for the PIC32, in C. I have attached my project file as a .zip file and you can download it to go through the library header and source files, as well as the demo code. I've tried heavily commenting the code so that it is self-explanatory.<br />
<br />
As far as hardware goes, with the demo code, the pin connections for the display are:<br />
<br />
BL (backlight): I left it unconnected, but you can connect it to 3.3V for backlight.<br />
SCK: connected to RB14 on the PIC<br />
MISO: left unconnected, since I'm not reading anything from the screen<br />
MOSI: connected to RB11 on the PIC<br />
CS: connected to RB1 on the PIC<br />
SDCS: left unconnected as I'm not using the microSD card for this<br />
RST: connected to RB2 on the PIC<br />
D/C: connected to RB0 on the PIC<br />
VIN: connected to 3.3V supply<br />
GND: connected to gnd<br />
<br />
The pins I used are defined in the code and you can easily change them as required.<br />
<br />
I used my custom proto-board for testing on a breadboard. You can find details here: <a href="http://tahmidmc.blogspot.com/2014/02/pic32-proto-board-details-schematic-pcb.html"><u>http://tahmidmc.blogspot.com/2014/02/pic32-proto-board-details-schematic-pcb.html</u></a> <br />
<br />
<br />
Here's a video showing the PIC32 running the demo code and doing some simple graphics on the screen. You can see that it runs fairly quickly and quite smoothly.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.youtube.com/embed/JUHIxQL1xyQ?feature=player_embedded' frameborder='0'></iframe></div>
<br />
Project files with all source and header files:<br />
<a href="https://drive.google.com/file/d/0B4SoPFPRNziHdksweU1vUkZ4SHM/view?usp=sharing"><u>https://drive.google.com/file/d/0B4SoPFPRNziHdksweU1vUkZ4SHM/view?usp=sharing</u></a> <br />
<a href="http://www.4shared.com/zip/O-LcEU0Ace/Adafruit_TFTX.html"><u>http://www.4shared.com/zip/O-LcEU0Ace/Adafruit_TFTX.html</u></a><br />
<br />
If you have any comments, questions or suggestions, do let me know!Tahmidhttp://www.blogger.com/profile/09117804893438710050noreply@blogger.com9tag:blogger.com,1999:blog-6338993703407602171.post-56692046066957794922014-10-16T22:14:00.002-07:002015-07-09T18:18:34.580-07:00PIC32 DMA+SPI+DAC : Analog output synthesis with zero CPU overheadI have previously shown how to use the PIC32 SPI module to use the 12-bit DAC MCP4822: <a href="http://tahmidmc.blogspot.com/2014/10/pic32-spi-using-mcp4822-12-bit-serial.html"><u>http://tahmidmc.blogspot.com/2014/10/pic32-spi-using-mcp4822-12-bit-serial.html</u></a>. While that does allow you to generate analog outputs as desired, it requires you to use CPU cycles to process the timer interrupt and accordingly drive the SPI module.<br />
<br />
Since the PIC32 contains DMA channels, the process can be completely offloaded from the CPU. For an idea of the PIC32 DMA module, refer to my previously written article: <a href="http://tahmidmc.blogspot.com/2014/05/simple-pic32-dma-example.html"><u>http://tahmidmc.blogspot.com/2014/05/simple-pic32-dma-example.html</u></a><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg8M5jwy15WZ7RdhI59s5zdaftcb91aIE3LdIz__zVM4CHmnkLxqKCUBAqo0ExWYeW0M8RYAuc00suY9o6DlMZnZNOGj-PxuR53LbUIYJ7ZTwkqdngfxEWat11mSlW2xrMDAjQzTurBvGWn/s1600/dac_dma_400_32.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="480" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg8M5jwy15WZ7RdhI59s5zdaftcb91aIE3LdIz__zVM4CHmnkLxqKCUBAqo0ExWYeW0M8RYAuc00suY9o6DlMZnZNOGj-PxuR53LbUIYJ7ZTwkqdngfxEWat11mSlW2xrMDAjQzTurBvGWn/s1600/dac_dma_400_32.png" width="640" /></a></div>
<div style="text-align: center;">
Fig. 1 - The generated sine wave at fpwm = 400kHz and 32 elements in the sine table</div>
<div style="text-align: center;">
<br /></div>
So, the simple way of offloading the SPI update to the DMA module would be to let the DMA channel transfer data to the SPI buffer. The SPI module is configured for 16-bit data transfer (since the MCP4822 write command requires 2 bytes). This means that the cell size for the DMA channel has been set to 2 (2 bytes to transfer once triggered). The DMA transfer is triggered by a timer interrupt. Unlike the previous example where I used Timer 1 and its interrupt for the SPI transfer, here I use Timer 2. The reason for this is that, if I want the entire process to be offloaded from the CPU, the SS (Slave Select) or CS (Chip Select) also has to be done entirely in hardware. For that I used the Output Compare 1 module. To use the OC1 module, either Timer 2 or Timer 3 (or the combined 32-bit timer) has to be used. So, I just went with Timer 2.<br />
<br />
Configuring the DMA module for transferring data to the SPI buffer was the simple part. I found the configuration of the SS/CS pin the more challenging part. The idea here was to use the OC module in "dual compare mode continuous output pulses" mode. The OC module in this mode generates continuous pulses - the output pin OC1 - which I used as CS/SS - is set high one PBCLK (peripheral bus clock) after the Timer value reaches OC1R; the OC1 pin is cleared one PBCLK after the Timer value reaches OC1RS. Since SS/CS is active low, I set ( (period register) - 4) to be OC1RS and a variable CSlength to be OC1R. CSlength was chosen to be 80% of the period register. What this meant was that. One PBCLK after the Timer reached the (period register - 4), the OC1 pin went low (CS/SS went low) "selecting" the DAC. After about 0.80*(period register) from there, the OC1 pin went high. This means that the CS pin is low for 80% of the period - it goes low a small time right before the DMA transfer happens and is raised high late enough, after the DMA transfer occurs. I determined that 80% the period was enough time since that is higher than the time required to shift out 16 bits of data at 20MHz SPI clock. See Fig. 2 below for an illustration of the operation of the output compare module in the "dual compare mode continuous output pulses" mode:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjIvrFeMC3RPaoNeQgIVlsArUZ6D_NWIloDFSqNcRlaDdNrCgDSF3NX6vFfUAkmNLI5fm3isiZiG1IvahhR1qQbquDy2azFWWmZQd2sRCFLjUJUTX0yolfQZnYSDWQDqndLNhfEKJybJkfq/s1600/oc1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjIvrFeMC3RPaoNeQgIVlsArUZ6D_NWIloDFSqNcRlaDdNrCgDSF3NX6vFfUAkmNLI5fm3isiZiG1IvahhR1qQbquDy2azFWWmZQd2sRCFLjUJUTX0yolfQZnYSDWQDqndLNhfEKJybJkfq/s1600/oc1.png" width="640" /></a></div>
<div style="text-align: center;">
Fig. 2 - Output Compare module in Dual Compare Mode: Continuous Output Pulse mode (taken from PIC32 reference manual, figure 16-16)</div>
<br />
Beyond that, the idea is simple. There is a sine table that is the DMA source. The key thing to remember here is that the 12-bit data must be OR-ed with 0x3000 since that is required for the DAC (to set gain=1, shutdown = 0 and channel = A):<br />
<br />
void generateTables(void){<br />
uint8_t i;<br />
for (i = 0; i<TABLE_SIZE; i++){<br />
sineTable[i] = (short) (2047.0 * sin(6.2832*((float)i)/(float)TABLE_SIZE));<br />
sineTable[i] = sineTable[i] + 2047;<br />
<br />
sineTable[i] = <u><b>0x3000</b></u><b> </b><b>|</b> sineTable[i];<br />
}<br />
} <br />
<br />
Since the entries in the sine table are of "short" data type (each element occupies two bytes), the source size (in bytes) is twice the number of elements. The destination source size is two bytes since I'm transferring two bytes to the SPI buffer register. The cell size is two bytes since the DMA channel has to transfer two bytes (16 bits) at a time to the SPI buffer register. The DMA configuration is:<br />
<br />
DmaChnOpen(0, 3, DMA_OPEN_AUTO);<br />
// (ch, ch priority, mode)<br />
DmaChnSetTxfer(0, sineTable, &SPI1BUF, TABLE_SIZE*2, 2, 2);<br />
// (ch, start virtual addr, dest virtual addr, source size, dest size, cell size)<br />
DmaChnSetEventControl(0, DMA_EV_START_IRQ(_TIMER_2_IRQ));<br />
// (ch, trigger irq)<br />
DmaChnEnable(0);<br />
<br />
A point of note is that, the DmaChnSetTxfer( ) takes in the virtual addresses of the source and destination, not the physical addresses. The virtual-to-physical address conversion is done by the function itself as opposed to it being required manually when doing register level operations (as done in my previous DMA example article).<br />
<br />
To demonstrate that the DAC control is done with no CPU overhead, in the main( ) function, I have an infinite loop that is just toggling RA0. The output is checked on an oscilloscope:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhQk2gd6paaCX1yClgld32HBUbCWTMGDco0RFJouugm8vQQz0VywnblHJ7zta4KXadV2WO6fGruHHbo0KFrtVdcGilhd8Y-PmXlmFHlxwFgHgPQ9s3rBp21-J4HCGEzaH849wMluWC-Eb6u/s1600/dac_dma_ra0+toggle.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="480" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhQk2gd6paaCX1yClgld32HBUbCWTMGDco0RFJouugm8vQQz0VywnblHJ7zta4KXadV2WO6fGruHHbo0KFrtVdcGilhd8Y-PmXlmFHlxwFgHgPQ9s3rBp21-J4HCGEzaH849wMluWC-Eb6u/s1600/dac_dma_ra0+toggle.png" width="640" /></a></div>
<div style="text-align: center;">
Fig. 3 - RA0 toggle being demonstrated</div>
<br />
Observe that the frequency of the square wave is 4.0MHz - the same that would be observed if all the PIC was doing was the pin toggling.<br />
<br />
This also gave better performance than my previous experiment where I did not use DMA. The output sine wave has a higher frequency than observed before and this matches exactly as expected: 400kHz/32 = 12.5kHz as seen (see Fig. 1).<br />
<br />
The rest should be very easy to understand and self-explanatory. If you have any questions or suggestions, feel free to comment!<br />
<br />
Here are the source and header files:<br />
<i>config.h</i>: <a href="https://drive.google.com/file/d/0B4SoPFPRNziHcmlxMmg2Si0zWjQ/view?usp=sharing"><u>https://drive.google.com/file/d/0B4SoPFPRNziHcmlxMmg2Si0zWjQ/view?usp=sharing</u></a><br />
<i>main.c</i>: <a href="https://drive.google.com/file/d/0B4SoPFPRNziHcmlxMmg2Si0zWjQ/view?usp=sharing"><u>https://drive.google.com/file/d/0B4SoPFPRNziHcmlxMmg2Si0zWjQ/view?usp=sharing</u></a>Tahmidhttp://www.blogger.com/profile/09117804893438710050noreply@blogger.com8tag:blogger.com,1999:blog-6338993703407602171.post-1813530196301369522014-10-11T20:57:00.001-07:002015-09-11T07:34:17.697-07:00PIC32 SPI: Using the MCP4822 12-bit serial dual DACI recently got a few pieces of the MCP4822 DAC. You can check out the datasheet here: <a href="http://ww1.microchip.com/downloads/en/DeviceDoc/22249A.pdf"><u>http://ww1.microchip.com/downloads/en/DeviceDoc/22249A.pdf</u></a><br />
<br />
I found them to be neat little devices. In a small 8-pin PDIP package, the MCP4822 comes with 2 12-bit DACs, which you can easily configure over SPI. This was a great opportunity to get a simple PIC32 SPI application going. I worked on this today to see how fast I can get the DAC output going. <br />
<br />
Here's the pinout of the MCP4822:<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgvquGnssS1PhSP2an_QGX5Ib5uUr70co0VERHaJbJHEP1QgYOTTdWfOBhSZUnfaB9N-xhHIfOmwXiDdPYOKJYfnDfJms0biVlwT-VndbxJwQnDJwl7JAoADP9avEjZ7gKQeHPkX40TnE5K/s1600/pinout.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgvquGnssS1PhSP2an_QGX5Ib5uUr70co0VERHaJbJHEP1QgYOTTdWfOBhSZUnfaB9N-xhHIfOmwXiDdPYOKJYfnDfJms0biVlwT-VndbxJwQnDJwl7JAoADP9avEjZ7gKQeHPkX40TnE5K/s1600/pinout.png" /></a></div>
<div style="text-align: center;">
Fig. 1 - MCP4822 pinout (taken from datasheet)</div>
<br />
The MCP4822 can be supplied a voltage in the range of 2.7V to 5.5V. Since I use 3.3V for my PIC32, I used the same 3.3V supply for the VDD for the MCP4822. Pin 5 is the active low signal LDAC that is used to synchronize the two DAC channels. When this pin is brought low, the data in the DAC's input register is copied to the output and both outputs are updated at the same time. I just had this tied to ground. VoutA and VoutB are the two output pins. The other pins are the regular pins for SPI communication - CS (active low) chip select, SCK serial clk, SDI serial data in.<br />
<br />
The datasheet provides a nice diagram explaining the timing and pin functions very nicely:<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg65QTkULCLyigtXktJBdT2NLOTYahlmkKztm5LVr2Mf4oAKP-cDRIgFS66tW4cJYykQ0pUbyl3fNCCIU3jkhz91HXEQ94GytVmKjvUH4lQNNU3mpfSEGxQg7C08VczbSgOQswcyW5LcmCf/s1600/timing+diagram.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="270" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg65QTkULCLyigtXktJBdT2NLOTYahlmkKztm5LVr2Mf4oAKP-cDRIgFS66tW4cJYykQ0pUbyl3fNCCIU3jkhz91HXEQ94GytVmKjvUH4lQNNU3mpfSEGxQg7C08VczbSgOQswcyW5LcmCf/s1600/timing+diagram.png" width="640" /></a></div>
<div style="text-align: center;">
Fig. 2 - Write command for MCP4822 (taken from datasheet)</div>
<br />
The write command to the MCP4822 is a 16-bit wide command sent over SPI. Bit 15 (A/B) selects which channel you're sending data to: 1 signifies channel B, 0 signifies channel A. Bit 13 (GA) selects the gain. The MCP4822 has an internal 2.048V reference it uses for the DAC. So, that means that with a gain of 1, the maximum possible output voltage is 2.04975V (4095/4096 * Vref). If a higher output is required, the gain can be increased. The MCP4822 has a configurable gain of 1 or 2. When GA = 1, gain = 1; when GA = 0, gain = 2. Bit 12 SHDN is the shutdown signal. When SHDN is low, the output of the DAC is shut down. The 12 data bits from there on: D11 to D0 ([D11:D0], [bit11:bit0]) are the 12 data bits for the digital to analog conversion.<br />
<br />
The transfer function is the very-simple, (almost) typical-for-DACs:<br />
<blockquote class="tr_bq">
Vout = (D_12 / 4096) * 2.048V * Gain</blockquote>
D_12 is the digital value given by D11 to D0 in the write command, 4096 = 2^12 (12-bit resolution), 2.048V = internal voltage reference, gain = 1 or 2 depending on bit GA in write command.<br />
<br />
While I typically use the registers and configure them manually, I decided to use the Microchip plib (peripheral library) here for the SPI module. The peripheral library consists of a lot of low-level functions and macros that essentially require understanding the peripheral but just make the code nicer and easier to read.<br />
<br />
I decided to clock the MCP4822 at 20MHz (max for MCP4822) to get quick data transfers.<br />
<br />
The SPI module can be initialized using one of 2 options:<br />
1) Using the OpenSPIx(config1, config2) and SpiChnSetBrg(spi_channel, spi_brg) functions<br />
2) Using the SpiChnOpen(spi_channel, config, spi_divider) function<br />
<br />
These are both described in the plib documentation.<br />
<br />
The DAC initialization routine I wrote is shown below:<br />
<span style="font-family: "Courier New",Courier,monospace;">//================================================================</span><br />
<span style="font-family: "Courier New",Courier,monospace;">// SS = PORTA4</span><br />
<span style="font-family: "Courier New",Courier,monospace;">#define SS LATAbits.LATA4</span><br />
<span style="font-family: "Courier New",Courier,monospace;">#define dirSS TRISAbits.TRISA4</span><br />
<span style="font-family: "Courier New",Courier,monospace;">void initDAC(void){</span><br />
<span style="font-family: "Courier New",Courier,monospace;">/* Steps:</span><br />
<span style="font-family: "Courier New",Courier,monospace;"> * 1. Setup SS as digital output.</span><br />
<span style="font-family: "Courier New",Courier,monospace;"> * 2. Map SDO to physical pin.</span><br />
<span style="font-family: "Courier New",Courier,monospace;"> * 3. Configure SPI control and clock with either of a or b:</span><br />
<span style="font-family: "Courier New",Courier,monospace;"> * a. OpenSPIx(config1, config2) and SpiChnSetBrg(spi_channel, spi_brg)</span><br />
<span style="font-family: "Courier New",Courier,monospace;"> * b. SpiChnOpen(spi_channel, config, spi_divider)</span><br />
<span style="font-family: "Courier New",Courier,monospace;"> */</span><br />
<span style="font-family: "Courier New",Courier,monospace;"><br /></span>
<span style="font-family: "Courier New",Courier,monospace;"> dirSS = 0; // make SS an output</span><br />
<span style="font-family: "Courier New",Courier,monospace;"> SS = 1; // set SS = 1 to deselect slave</span><br />
<span style="font-family: "Courier New",Courier,monospace;"> PPSOutput(2, RPB5, SDO2); // map SDO2 to RB5</span><br />
<span style="font-family: "Courier New",Courier,monospace;"><br /></span>
<span style="font-family: "Courier New",Courier,monospace;">///////</span><br />
<span style="font-family: "Courier New",Courier,monospace;">#define config1 SPI_MODE16_ON | SPI_CKE_ON | MASTER_ENABLE_ON</span><br />
<span style="font-family: "Courier New",Courier,monospace;"> /* FRAME_ENABLE_OFF</span><br />
<span style="font-family: "Courier New",Courier,monospace;"> * ENABLE_SDO_PIN -> SPI Output pin enabled</span><br />
<span style="font-family: "Courier New",Courier,monospace;"> * SPI_MODE16_ON -> 16-bit SPI mode</span><br />
<span style="font-family: "Courier New",Courier,monospace;"> * SPI_SMP_OFF -> Sample at middle of data output time</span><br />
<span style="font-family: "Courier New",Courier,monospace;"> * SPI_CKE_ON -> Output data changes on transition from active clock</span><br />
<span style="font-family: "Courier New",Courier,monospace;"> * to idle clock state</span><br />
<span style="font-family: "Courier New",Courier,monospace;"> * SLAVE_ENABLE_OFF -> Manual SW control of SS</span><br />
<span style="font-family: "Courier New",Courier,monospace;"> * MASTER_ENABLE_ON -> Master mode enable</span><br />
<span style="font-family: "Courier New",Courier,monospace;"> */</span><br />
<span style="font-family: "Courier New",Courier,monospace;">#define config2 SPI_ENABLE</span><br />
<span style="font-family: "Courier New",Courier,monospace;"> /* SPI_ENABLE -> Enable SPI module</span><br />
<span style="font-family: "Courier New",Courier,monospace;"> */</span><br />
<span style="font-family: "Courier New",Courier,monospace;">// OpenSPI2(config1, config2);</span><br />
<span style="font-family: "Courier New",Courier,monospace;"> // see pg 193 in plib reference</span><br />
<span style="font-family: "Courier New",Courier,monospace;"><br /></span>
<span style="font-family: "Courier New",Courier,monospace;">#define spi_channel 2</span><br />
<span style="font-family: "Courier New",Courier,monospace;"> // Use channel 2 since channel 1 is used by TFT display</span><br />
<span style="font-family: "Courier New",Courier,monospace;"><br /></span>
<span style="font-family: "Courier New",Courier,monospace;">#define spi_brg 0</span><br />
<span style="font-family: "Courier New",Courier,monospace;"> // Divider = 2 * (spi_brg + 1)</span><br />
<span style="font-family: "Courier New",Courier,monospace;"> // Divide by 2 to get SPI clock of FPBDIV/2 -> max SPI clock</span><br />
<span style="font-family: "Courier New",Courier,monospace;"><br /></span>
<span style="font-family: "Courier New",Courier,monospace;">// SpiChnSetBrg(spi_channel, spi_brg);</span><br />
<span style="font-family: "Courier New",Courier,monospace;"> // see pg 203 in plib reference</span><br />
<span style="font-family: "Courier New",Courier,monospace;"><br /></span>
<span style="font-family: "Courier New",Courier,monospace;">//////</span><br />
<span style="font-family: "Courier New",Courier,monospace;"><br /></span>
<span style="font-family: "Courier New",Courier,monospace;">//////</span><br />
<span style="font-family: "Courier New",Courier,monospace;"><br /></span>
<span style="font-family: "Courier New",Courier,monospace;">#define spi_divider 2</span><br />
<span style="font-family: "Courier New",Courier,monospace;">/* Unlike OpenSPIx(), config for SpiChnOpen describes the non-default</span><br />
<span style="font-family: "Courier New",Courier,monospace;"> * settings. eg for OpenSPI2(), use SPI_SMP_OFF (default) to sample</span><br />
<span style="font-family: "Courier New",Courier,monospace;"> * at the middle of the data output, use SPI_SMP_ON to sample at end. For</span><br />
<span style="font-family: "Courier New",Courier,monospace;"> * SpiChnOpen, using SPICON_SMP as a parameter will use the non-default</span><br />
<span style="font-family: "Courier New",Courier,monospace;"> * SPI_SMP_ON setting.</span><br />
<span style="font-family: "Courier New",Courier,monospace;"> */</span><br />
<span style="font-family: "Courier New",Courier,monospace;">#define config SPI_OPEN_MSTEN | SPI_OPEN_MODE16 | SPI_OPEN_DISSDI | SPI_OPEN_CKE_REV</span><br />
<span style="font-family: "Courier New",Courier,monospace;"> /* SPI_OPEN_MSTEN -> Master mode enable</span><br />
<span style="font-family: "Courier New",Courier,monospace;"> * SPI_OPEN_MODE16 -> 16-bit SPI mode</span><br />
<span style="font-family: "Courier New",Courier,monospace;"> * SPI_OPEN_DISSDI -> Disable SDI pin since PIC32 to DAC is a</span><br />
<span style="font-family: "Courier New",Courier,monospace;"> * master-to-slave only communication</span><br />
<span style="font-family: "Courier New",Courier,monospace;"> * SPI_OPEN_CKE_REV -> Output data changes on transition from active</span><br />
<span style="font-family: "Courier New",Courier,monospace;"> * clock to idle clock state</span><br />
<span style="font-family: "Courier New",Courier,monospace;"> */</span><br />
<span style="font-family: "Courier New",Courier,monospace;">// SpiChnOpen(spi_channel, config, spi_divider);</span><br />
<span style="font-family: "Courier New",Courier,monospace;">//////</span><br />
<span style="font-family: "Courier New",Courier,monospace;">}</span><br />
<span style="font-family: "Courier New",Courier,monospace;">//================================================================</span><br />
<br />
The code block above has code written using both the initialization functions (one is commented out). Essentially, the configuration is that SPI channel 2 is enabled as a master, it is configured for 16-bit data transmission, the SDI pin is disabled, it is configured for serial output change from active high (1) to active low (0) as required by the MCP4822 (see Fig. 2) and the clock divisor is set to 2 so that SPI clock = 20MHz.<br />
<br />
The SCK pins for the PIC32 are mapped physically to the RB15 (SCK2) and RB14 (SCK1) pins (check pinout on page 4 in datasheet). The SDO and SDI pins are remappable pins and thus require you to map them to physical pins. The SDI pin here is unused since the PIC32-to-MCP4822 is a one way communication with the PIC32 as the master and the MCP4822 as the slave.<br />
<br />
The datasheet provides the table for all the PPS (peripheral pin select) mappings. The relevant section for the SDO is:<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgfPuOfMvKyiTuwV6v6Y6zamVfV4fnUMDImomY6w9mb-ZFkDZWQIfF3c2vZSp35y98nQTkHltPhZH_MKD_J1ifKfzgAi6m_5x0W8B-OBAR7fLhpzhjbrWqEiZEvSpH5UCWbkHFB1iC_GEPw/s1600/mapping.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="182" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgfPuOfMvKyiTuwV6v6Y6zamVfV4fnUMDImomY6w9mb-ZFkDZWQIfF3c2vZSp35y98nQTkHltPhZH_MKD_J1ifKfzgAi6m_5x0W8B-OBAR7fLhpzhjbrWqEiZEvSpH5UCWbkHFB1iC_GEPw/s1600/mapping.png" width="640" /></a></div>
<div style="text-align: center;">
Table 1 - PPS configuration for SDO</div>
<br />
I decided to use RPB5:<br />
<br />
PPSOutput(2, RPB5, SDO2); // map SDO2 to RB5<br />
<br />
The connections I used for the MCP4822 are:<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh-uuHGkx-wmRUgN78esKU1oei4so0GXnSb8NnfT73kDuBkCygJD1EbS5VkLMXPJPCGRJPRhLnn7CnRw9QxFOep0SAoJgKtJYU7leaprX77SIzAK0kskGo6oqM6Seg4XHAwmY_ieQL2GgBG/s1600/mcp4822+pins.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh-uuHGkx-wmRUgN78esKU1oei4so0GXnSb8NnfT73kDuBkCygJD1EbS5VkLMXPJPCGRJPRhLnn7CnRw9QxFOep0SAoJgKtJYU7leaprX77SIzAK0kskGo6oqM6Seg4XHAwmY_ieQL2GgBG/s1600/mcp4822+pins.png" /> </a></div>
<div class="separator" style="clear: both; text-align: center;">
Fig. 3 - MCP4822 connections </div>
<br />
<br />
The chip select / slave select line (CS as shown on the MCP4822 pinout, see Fig. 1) has to be controlled manually. (For a hardware-based processor-free control scheme, see <a href="http://tahmidmc.blogspot.com/2014/10/pic32-dmaspidac-analog-output-synthesis.html">PIC32 DMA+SPI+DAC : Analog output synthesis with zero CPU overhead</a>.) This is an active low chip select signal. When data is being sent to the MCP4822, while the SPI transaction is occurring, the CS pin must be kept low. Initially I checked to see if there was a way the hardware would take care of that. I looked into the framed SPI mode. However, this did not serve my purpose. From what I've read, the framed SPI mode is an SPI mode where the clock is always output (instead of only during transactions as traditionally done). However, the hardware generates a low sync signal (by pulling CS low) before the data is transmitted from the PIC32. The problem here was that the CS pin was pulled low and kept low for one SPI clock period before raising CS high as data is transmitted out from SDO. This isn't going to work for the MCP4822 since the chip requires that CS be held low during the entirety of data transmission (see Fig. 2). So I just decided to use RA4 as the pin for CS. Before starting any transmission, I pull CS low in software and raise it high at the end.<br />
<br />
Here's the code for writing to the DAC:<br />
<br />
<pre class="drive-viewer-text-page drive-viewer-focus-to-default"><span style="font-family: "Courier New",Courier,monospace;"><span style="font-size: small;">inline void writeDAC(uint16_t data){
SS = 0; // select slave device: MCP4822 DAC
while (TxBufFullSPI2()); // ensure buffer is free before writing
WriteSPI2(data); // send the data through SPI
while (SPI2STATbits.SPIBUSY); // blocking wait for end of transaction
SS = 1; // deselect slave device, transmission complete
}</span></span></pre>
<br />
Since I called this function from the ISR in my code, I decided to make it an inline function to eliminate function call overhead.<br />
<br />
In my test code, I just wanted to see how fast an output I can get. So I clocked the MCP4822 at 20MHz and tried to maximize the frequency of the output signal I generate: I used channel A to generate a sine wave output and channel B to generate a triangle wave output. I used a timer (Timer 1) to control the timing and in the ISR, I just called the writeDAC inline function to generate outputs as required from two pre-generated tables.<br />
<br />
Here are the different waveforms and outputs I generated:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjobd5L1_LZtE26JR6PdtxuRz5Wyow4ZaNCrjqYDZncM3VLrpzjzCsV7f9jkw_S1JkbPDZuDYfX20MxwrsRHhwgMabeEFwP0SOxi0-0UjGi5HOBA9LmYxxbFu1nfhqyyhoggPdPfdBzSJ9S/s1600/2+channel+dac+400khz+64.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjobd5L1_LZtE26JR6PdtxuRz5Wyow4ZaNCrjqYDZncM3VLrpzjzCsV7f9jkw_S1JkbPDZuDYfX20MxwrsRHhwgMabeEFwP0SOxi0-0UjGi5HOBA9LmYxxbFu1nfhqyyhoggPdPfdBzSJ9S/s1600/2+channel+dac+400khz+64.png" width="320" /> </a></div>
<div class="separator" style="clear: both; text-align: center;">
Fig. 4 - Generating the outputs with timer period = 400kHz, sine table entries = 64</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgFApEG450exXIHaUGWEPjzeHHjX5-IX0llPiv5Icr_jdpOyVx6tNn-lEmoDE6kMOU9HH56u9zfXLGZTX2NcqQzy-CkTx1kydXy5hNuc8w2E87Sz53OBTC6doeGN6rhhigStdKkiIrnzb0t/s1600/2+channel+dac+550khz+32.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgFApEG450exXIHaUGWEPjzeHHjX5-IX0llPiv5Icr_jdpOyVx6tNn-lEmoDE6kMOU9HH56u9zfXLGZTX2NcqQzy-CkTx1kydXy5hNuc8w2E87Sz53OBTC6doeGN6rhhigStdKkiIrnzb0t/s1600/2+channel+dac+550khz+32.png" width="320" /> </a></div>
<div class="separator" style="clear: both; text-align: center;">
Fig. 5 - Generating the outputs with timer period = 550kHz, sine table entries = 32</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiaU_GeHGVIhuAqBdhAIgmMeh_9eUuBM_Cla1IcJ9FsHYiO_dnjIZs4B4SuqKRlorLYuDDzqi_eGVTjmYMMMhfyIpewFGPusgpuxwdJ1lGfMKLB3Y4XtTzUwm_lPVGgO8d6T_APQmnglU_l/s1600/2+channel+dac+550khz+64.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiaU_GeHGVIhuAqBdhAIgmMeh_9eUuBM_Cla1IcJ9FsHYiO_dnjIZs4B4SuqKRlorLYuDDzqi_eGVTjmYMMMhfyIpewFGPusgpuxwdJ1lGfMKLB3Y4XtTzUwm_lPVGgO8d6T_APQmnglU_l/s1600/2+channel+dac+550khz+64.png" width="320" /> </a></div>
<div class="separator" style="clear: both; text-align: center;">
Fig. 6 - Generating the outputs with timer period = 550kHz, sine table entries = 64</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhlbwSRXYqLBqxC45XC19-Nz1wR9Z8EeTkkH_H9gdtyt4whSVaAueBU4sLKQPAt4fmKdgo2t64h9ybOjIbJXi2_FooBUL3Q6oTTaUtDSyQFZXK5aUz3cIVrK9LOcS566guTWzW-NVSQwuYU/s1600/spi+clk+20mhz+and+data.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhlbwSRXYqLBqxC45XC19-Nz1wR9Z8EeTkkH_H9gdtyt4whSVaAueBU4sLKQPAt4fmKdgo2t64h9ybOjIbJXi2_FooBUL3Q6oTTaUtDSyQFZXK5aUz3cIVrK9LOcS566guTWzW-NVSQwuYU/s1600/spi+clk+20mhz+and+data.png" width="320" /> </a></div>
<div class="separator" style="clear: both; text-align: center;">
Fig. 7 - SPI clock and data transmission</div>
<div class="separator" style="clear: both; text-align: left;">
You can clearly see the SPI clock during transmission here. From the measurement panel on the right you can see that the SPI clock is 20MHz. There are also 16 pulses you can count - since a write command to the DAC consists of 16 bit transfers. CH2, on the bottom, shows the data being transmitted. Since the first signal (leftmost) is a 1, and since this corresponds to bit 15, this is a snapshot of data being transmitted to DAC channel B.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiO9XWKdD0g3skifS56FZk1Y7L-vW2UBmPO26fw5vQqc1QGnoyq3WZEw9V57XCBe8dCf9Exgfccby0frxck9t7p5ucO_8xEXhhk5LZIw08qixSQLypFvkFMdCOm5VtpX0jwBUynhjB21kkf/s1600/zoomed+in+quantization+2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiO9XWKdD0g3skifS56FZk1Y7L-vW2UBmPO26fw5vQqc1QGnoyq3WZEw9V57XCBe8dCf9Exgfccby0frxck9t7p5ucO_8xEXhhk5LZIw08qixSQLypFvkFMdCOm5VtpX0jwBUynhjB21kkf/s1600/zoomed+in+quantization+2.png" width="320" /> </a></div>
<div style="text-align: center;">
Fig. 8 - DAC steps - zoomed in</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjh5dw16h1HNJqNVRCmtdCpJ4oN_I-dsdXbZtoOre2jTEW8QzlN4EA4AxuiriqxuX0ciF60IAH9FmVdT5KJdH-fSi0uD4U2MFfPBWGIt64QmuhmC4VmBrKZDr6KjLn4MAdvark6Nl1mVykb/s1600/zoomed+in+quantization.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjh5dw16h1HNJqNVRCmtdCpJ4oN_I-dsdXbZtoOre2jTEW8QzlN4EA4AxuiriqxuX0ciF60IAH9FmVdT5KJdH-fSi0uD4U2MFfPBWGIt64QmuhmC4VmBrKZDr6KjLn4MAdvark6Nl1mVykb/s1600/zoomed+in+quantization.png" width="320" /> </a></div>
<div class="separator" style="clear: both; text-align: center;">
Fig. 9 - DAC steps - zoomed out</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimXtTAVRIXdrienxHo2nPxBlal3vMFijoV4wDrW0KrHrw2KlcXktWByCarryUZo1X28LDiRjDR-5feEFPyUl0tDhgLqOXKJjcKyRWsHHNdfk_pFhulhMQMxB-rhjqEYb-O0YGuIv-y4WV-/s1600/DSC_0291.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimXtTAVRIXdrienxHo2nPxBlal3vMFijoV4wDrW0KrHrw2KlcXktWByCarryUZo1X28LDiRjDR-5feEFPyUl0tDhgLqOXKJjcKyRWsHHNdfk_pFhulhMQMxB-rhjqEYb-O0YGuIv-y4WV-/s1600/DSC_0291.jpg" width="276" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
Fig. 10 - Hardware test setup</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
For the PIC32 proto board, I used my own custom proto board: <a href="http://tahmidmc.blogspot.com/2014/02/pic32-proto-board-details-schematic-pcb.html"><u>http://tahmidmc.blogspot.com/2014/02/pic32-proto-board-details-schematic-pcb.html</u></a></div>
<br />
<br />
Here are the header and source files for my test program:<br />
<br />
<i>config.h:</i> <a href="https://drive.google.com/open?id=0B4SoPFPRNziHdk5KT2hWNUNCckE"><u>https://drive.google.com/open?id=0B4SoPFPRNziHdk5KT2hWNUNCckE</u></a><br />
<i>main.c: </i><a href="https://drive.google.com/open?id=0B4SoPFPRNziHWFc0Y01qSW5XUkE"><u>https://drive.google.com/open?id=0B4SoPFPRNziHWFc0Y01qSW5XUkE</u></a><i><br /></i><br />
<br />
While this was a quick test I did to test the PIC32 SPI and the MCP4822, this is in no means a complete evaluation of the MCP4822. For example, I updated the DAC more quickly than I should have, to push for speed, as this didn't give enough of a settling time. However, I was satisfied with the results and so, stuck with that. I will do some further testing on this later.<br />
<br />
For more details of the PIC32MX250F128B SPI module, refer to the datasheet and reference manual. For more details on the MCP4822, refer to its datasheet.<br />
<br />
If you have any questions, feel free to ask. Let me know what you think, in the comments section below!<br />
<br />
Note: Updated September 10, 2015 Tahmidhttp://www.blogger.com/profile/09117804893438710050noreply@blogger.com3tag:blogger.com,1999:blog-6338993703407602171.post-72853236311019999472014-06-23T08:48:00.000-07:002014-07-02T12:29:33.026-07:00PIC32MX250F128B ipl7: odd shadow register set behavior and observations<div>
<div>
<span style="font-size: large;"><b><u>This issue has now been solved. Scroll to the bottom for the update.</u></b></span> <br />
<br />
I started working on a pure sine wave inverter based on the PIC32MX250F128B. The first stage was to just get the SPWM working and test that before proceeding to add the power stage, feedback and other control, etc.</div>
<div>
<br /></div>
<div>
This led me to some interesting observations regarding the PIC32MX250F128B interrupts, especially the use of the shadow register set and a related problem.</div>
<div>
<br /></div>
<div>
I set up Timer 2 to be the time base for sine wave generation
(DDS/SPWM) using OC1. In the Timer 2 interrupt, the duty cycle update request
is performed (OC1RS is updated). Timer 2 interrupt priority was set to
7.</div>
This all worked fine. The initial ISR definition was:</div>
<div>
<br /></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">void __ISR(_TIMER_2_VECTOR, ipl7) T2int(void) {<br />.....<br />}</span><br />
<br />
However, when I used the ADC
(input from potentiometer for amplitude control - a start at implementing feedback), accessing any of the
ADC registers in the while (1) loop in main stopped the PIC32 from
working. </div>
<div>
<br /></div>
<div>
I then added a line of code in main to continuously toggle RA0 (PORTA bit 0). This would stop when trying to access the ADC registers as well. (It worked fine if I removed the code that accessed the ADC.) This meant that the core was being stopped. So, I thought that it might be some kind
of exception being thrown (?).</div>
<div>
</div>
However, changing the timer 2 interrupt priority from 7 (which
I had initially) to anything else fixes the problem. My guess was that
something went wrong when the shadow register set was being used for
interrupt priority level 7 (?).<br />
<br />
So I did some more tests and came up with this:<br />
<br />
<div>
<div>
The
way I have the ISR defined initially selects the "AUTO" mode of selection where, I
believe, the compiler decides whether to use the shadow register set or
software for context save/restore.</div>
Forcing the compiler to use the software context save/restore instead of the shadow register set seems to fix it:<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">void __ISR(_TIMER_2_VECTOR, ipl7SOFT) T2int(void) {<br />.....<br />}</span><br />
<br />
I forced the shadow register set just to confirm:<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">void __ISR(_TIMER_2_VECTOR, ipl7SRS) T2int(void) {<br />.....<br />}</span></div>
<div>
and sure enough it didn't work.<br />
<br />
So,
since it worked with ipl6, my guess was that for ipl6 (and for any ipl
except 7), the compiler chooses software for AUTO, whereas for ipl7, the
compiler chooses SRS.<br />
<br />
So, I forced the shadow register set on ipl6:<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">void __ISR(_TIMER_2_VECTOR, ipl6SRS) T2int(void) {<br />.....<br />}</span></div>
<div>
and sure enough, it didn't work.</div>
<div>
<br />
Forcing software for ipl6 fixes it (as does AUTO).</div>
<div>
<br />
<strike>I looked through the errata of the chip and couldn't find
anything. (The errata is an interesting read.) I am also a little
surprised since I did have ipl7 running fine previously. Maybe something weird happens with a certain combination of peripherals
(?) that I unfortunately happened to use. I'll still see if I can find
this documented, and I'll have to check whether an exception is thrown and if so, what type. If nothing else, at least it was a nice, albeit frustrating,
lesson. Hopefully, it'll help someone else who might run into a similar problem.</strike><br />
<br />
<u><b>UPDATE/SOLUTION:</b></u> It turns out that the PIC32MX250F128B does not have a shadow register set, as mentioned in the datasheet. I seemed to have missed that while concentrating on the reference manual which talks about the shadow register set for the PIC32 series. Thus, from the point of view of my 'experiments', the lesson learnt could very well just be that when using ipl7, force the compiler to use software instead of the default AUTO mode (which may make the compiler try to use the shadow register set, which doesn't exist - explaining the problem I faced earlier).</div>
<div>
<br /></div>
<div>
---------------------------------------------------</div>
<div>
DDS = direct digital synthesis</div>
<div>
ipl = interrupt priority level</div>
<div>
ISR = interrupt service routine </div>
<div>
SPWM = sinusoidal pulse width modulation</div>
<div>
SRS = shadow register set</div>
Tahmidhttp://www.blogger.com/profile/09117804893438710050noreply@blogger.com8tag:blogger.com,1999:blog-6338993703407602171.post-7428649779027257582014-06-17T11:27:00.001-07:002014-06-23T09:29:26.147-07:00Simple AC voltmeterI had long been thinking of designing a simple AC voltmeter but had
somehow never gotten to it. However, with school just ending, and me
going back to electronics, this was a neat simple yet useful circuit
that I felt I could just get done with in a day or two.<br />
<br />
The
concept is fairly straight forward. Since I needed this only to measure
the mains AC voltage and the output voltage of the sine wave inverter I
was working on (based on the PIC32MX250F128B - more on this later), I
didn't need to do any "true RMS" measurement. All I had to do was to
convert the mains AC to DC, filter it and measure the peak voltage. Of
course this had to be scaled down to a safe range for the
microcontroller. The RMS voltage for a sine wave is equal to 0.707 (to 3
decimal places) the peak voltage.<br />
<br />
The design was based
on the Microchip PIC16F676. However I realized that I didn't have any
in stock with me. So, I just used the pin-compatible PIC16F684. On the
software side of things, the difference between the code for PIC16F676
and PIC16F684 is just one line. (See source file attached below.)<br />
<br />
The
variable resistor is adjusted so that the reading of my AC voltmeter
matches that of a commercial voltmeter (Extech MA640 DMM). This is a sort of calibration.<br />
<br />
<b><span style="color: red;">CAUTION: THIS CIRCUIT IS NOT ISOLATED FROM THE MAINS AC AND HAS THE POTENTIAL TO BE LETHAL. YOU MUST BE VERY CAREFUL IF YOU ARE GOING TO USE THIS DESIGN. DO NOT ATTEMPT IF INEXPERIENCED. I CANNOT AND WILL NOT BE HELD RESPONSIBLE FOR ANY DAMAGE DONE WHILE USING THIS CIRCUIT.</span></b><br />
<br />
Here's the schematic:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYjLHA8MdJ2CaZFlmuZPpAb88ci7IW9mE-p2cvPb7U5-6M0MOGScTMBYFByLBRVLXGiLl104TueQtd65CsDEJD-Ub7KkhljxhRVZYDS2d6hBAVqM4I7WLGKsXoAVAniodLd9POGs4jKpIj/s1600/schematic.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYjLHA8MdJ2CaZFlmuZPpAb88ci7IW9mE-p2cvPb7U5-6M0MOGScTMBYFByLBRVLXGiLl104TueQtd65CsDEJD-Ub7KkhljxhRVZYDS2d6hBAVqM4I7WLGKsXoAVAniodLd9POGs4jKpIj/s1600/schematic.png" height="450" width="640" /></a></div>
<div style="text-align: center;">
Fig. 1 - Voltmeter</div>
<div style="text-align: center;">
<br /></div>
Here are some pictures:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6kmUVyFJqp9fNEwLwFwm-X5PaQ0hdZXz1kf6NojexsEeAZyrR54uluurGWXGYd0tzhqsdINtCSSgM2lWQqTxrl2F2ReB_QKx3GBrQ8Hl2Zq_VmlEsTg68AyMRALNpQPEDjPVW8Ip-y10e/s1600/DSC_0024.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6kmUVyFJqp9fNEwLwFwm-X5PaQ0hdZXz1kf6NojexsEeAZyrR54uluurGWXGYd0tzhqsdINtCSSgM2lWQqTxrl2F2ReB_QKx3GBrQ8Hl2Zq_VmlEsTg68AyMRALNpQPEDjPVW8Ip-y10e/s1600/DSC_0024.jpg" height="478" width="640" /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhe0yVd80FFAxBnReZhNCqDSTTqc8gO552k_fmnxiv0l6PKdUVgNgxCzYh2jA1Nq4FCXpxW8aRST3IN1BIaA4heBMCTbNWkEqVGyYDUIF_5zkE98taInahqW9t6Wken_jqp2XrhwDcQxb1U/s1600/DSC_0025.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhe0yVd80FFAxBnReZhNCqDSTTqc8gO552k_fmnxiv0l6PKdUVgNgxCzYh2jA1Nq4FCXpxW8aRST3IN1BIaA4heBMCTbNWkEqVGyYDUIF_5zkE98taInahqW9t6Wken_jqp2XrhwDcQxb1U/s1600/DSC_0025.jpg" height="478" width="640" /></a></div>
<div style="text-align: center;">
Fig. 2 - The PCB without (above) and with (below) the transformer</div>
<div style="text-align: center;">
<br /></div>
<div style="text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0Uoy0ewihTr7Djxhiplaps0qkEWg3gvshqs7ZLNZmN_4LoMEhqqdn8eOKOXlFisAC2Ma5T5aulXShU1RL2lcfr6yDlf7iAa0H8Hg2Eyk2Y6o1Tr8IJM-uRfc2AnRgF7X_Eiarh0HI_xk6/s1600/DSC_0027.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0Uoy0ewihTr7Djxhiplaps0qkEWg3gvshqs7ZLNZmN_4LoMEhqqdn8eOKOXlFisAC2Ma5T5aulXShU1RL2lcfr6yDlf7iAa0H8Hg2Eyk2Y6o1Tr8IJM-uRfc2AnRgF7X_Eiarh0HI_xk6/s1600/DSC_0027.jpg" height="640" width="478" /></a></div>
<div style="text-align: center;">
Fig. 3 - The test setup</div>
<div style="text-align: center;">
<br /></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGjHBjUbT_Zx8LkR2JP-okspI5HHYQKddh44UR_Jjg_fxfb1r7wbLTrQD8HQQtAxgJo2ov-Vi-0v-aXIGsSoZLRonYcDYnyic0lOPLSvihTvyvbXvBZigmg3SnL4c8Go0OmCLhKqL2ZXMT/s1600/DSC_0028.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGjHBjUbT_Zx8LkR2JP-okspI5HHYQKddh44UR_Jjg_fxfb1r7wbLTrQD8HQQtAxgJo2ov-Vi-0v-aXIGsSoZLRonYcDYnyic0lOPLSvihTvyvbXvBZigmg3SnL4c8Go0OmCLhKqL2ZXMT/s1600/DSC_0028.jpg" height="478" width="640" /></a></div>
<div style="text-align: center;">
Fig. 4 - Measuring voltage set with the variac</div>
<div style="text-align: center;">
<br /></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgh2igyEuK__dMubUEjDAtve9YY3P4kFIZ4OC5ho2_klw1FPiPYkV7OEwV9raROAlubjiEDigd7pTjUk58JhoYaOjatAc64XEK9zE7oDxGz7GrukLaxCHSFkGyQuaqlZ9GhH0Nvq77KjFPD/s1600/DSC_0031.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgh2igyEuK__dMubUEjDAtve9YY3P4kFIZ4OC5ho2_klw1FPiPYkV7OEwV9raROAlubjiEDigd7pTjUk58JhoYaOjatAc64XEK9zE7oDxGz7GrukLaxCHSFkGyQuaqlZ9GhH0Nvq77KjFPD/s1600/DSC_0031.jpg" height="478" width="640" /></a></div>
<div style="text-align: center;">
Fig. 5 - Measuring voltage set with the variac</div>
<div style="text-align: center;">
<br /></div>
<div style="text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-pH2m8zwJNKQXRNVoE-F8dY1DQS-INktX3MoMRAgg2QhXEKmw45SG2D1ex_paqEaSyyBFkf51ARmBSYdTz77CWSrif9wSChiCsVotnmIS9CeJo8avw3Nwr776S0YqLUmmQE8tZEz4bPh0/s1600/DSC_0033.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-pH2m8zwJNKQXRNVoE-F8dY1DQS-INktX3MoMRAgg2QhXEKmw45SG2D1ex_paqEaSyyBFkf51ARmBSYdTz77CWSrif9wSChiCsVotnmIS9CeJo8avw3Nwr776S0YqLUmmQE8tZEz4bPh0/s1600/DSC_0033.jpg" height="478" width="640" /></a></div>
<div style="text-align: center;">
Fig. 6 - Measuring voltage set with the variac</div>
<div style="text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhIP40ibClNJ8XhH99Bh8CAUn9wkEFEMlSGtg19RCGivgvNqoUlHwN2HlZqwcqoA6Im7R050ST6BryObprOOxO-7BMqnTFvTuyAIY8iTlSVt4sR3LdKERt0NDFLBnBfcpAbcJY7hOf2clwL/s1600/DSC_0038.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhIP40ibClNJ8XhH99Bh8CAUn9wkEFEMlSGtg19RCGivgvNqoUlHwN2HlZqwcqoA6Im7R050ST6BryObprOOxO-7BMqnTFvTuyAIY8iTlSVt4sR3LdKERt0NDFLBnBfcpAbcJY7hOf2clwL/s1600/DSC_0038.jpg" height="640" width="478" /></a></div>
<div style="text-align: center;">
Fig. 7 - Measuring voltage set with the variac</div>
<br />
<br />
C source file:<br />
<u><a href="https://drive.google.com/file/d/0B4SoPFPRNziHdDB6cDdzNGZPdXc/edit?usp=sharing"><u>https://drive.google.com/file/d/0B4SoPFPRNziHdDB6cDdzNGZPdXc/edit?usp=sharing</u></a> </u><br />
<br />
<a href="http://www.4shared.com/file/Cz56s9Zlba/ACvoltmeter.html"><u>http://www.4shared.com/file/Cz56s9Zlba/ACvoltmeter.html</u></a><br />
<br />
mikroC project file: <br />
<a href="https://drive.google.com/file/d/0B4SoPFPRNziHN2MydDRDalRWS1k/edit?usp=sharing"><u>https://drive.google.com/file/d/0B4SoPFPRNziHN2MydDRDalRWS1k/edit?usp=sharing</u></a> <br />
<a href="http://www.4shared.com/file/JwW3bpJNce/ACvoltmeter.html"><u>http://www.4shared.com/file/JwW3bpJNce/ACvoltmeter.html</u></a><br />
<br />
Parts list (Excel XLSX file): <br />
<a href="https://drive.google.com/file/d/0B4SoPFPRNziHb2ZCcnFNVnNpc2s/edit?usp=sharing"><u>https://drive.google.com/file/d/0B4SoPFPRNziHb2ZCcnFNVnNpc2s/edit?usp=sharing</u></a><br />
<a href="http://www.4shared.com/file/b_NcW4vdce/parts_list.html"><u>http://www.4shared.com/file/b_NcW4vdce/parts_list.html</u></a> <br />
<br />
Schematic (ARES DSN file): <br />
<u><a href="https://drive.google.com/file/d/0B4SoPFPRNziHb1NFWDdwcWpJV2M/edit?usp=sharing"><u>https://drive.google.com/file/d/0B4SoPFPRNziHb1NFWDdwcWpJV2M/edit?usp=sharing</u></a> </u><br />
<a href="http://www.4shared.com/file/U6kPQH_rce/schematic.html"><u>http://www.4shared.com/file/U6kPQH_rce/schematic.html</u></a> <br />
<br />
PCB (ARES LYT file): <br />
<a href="https://drive.google.com/file/d/0B4SoPFPRNziHNDhhMDBkNFlnWW8/edit?usp=sharing"><u>https://drive.google.com/file/d/0B4SoPFPRNziHNDhhMDBkNFlnWW8/edit?usp=sharing</u></a><br />
<a href="http://www.4shared.com/file/ZVczMJ7Wba/schematic.html"><u>http://www.4shared.com/file/ZVczMJ7Wba/schematic.html</u></a><br />
<br />
PCB (PDF files):<br />
<a href="https://drive.google.com/file/d/0B4SoPFPRNziHMV9LdTBab1BXeDg/edit?usp=sharing"><u>https://drive.google.com/file/d/0B4SoPFPRNziHMV9LdTBab1BXeDg/edit?usp=sharing</u></a> <br />
Mirrored: <u></u><a href="https://drive.google.com/file/d/0B4SoPFPRNziHSmxvT1pSbXBWOTA/edit?usp=sharing"><u>https://drive.google.com/file/d/0B4SoPFPRNziHSmxvT1pSbXBWOTA/edit?usp=sharing</u></a><br />
<br />
It's
a fun simple yet useful project that you can build pretty easily if you
want. Let me know what you think in the comments section below!Tahmidhttp://www.blogger.com/profile/09117804893438710050noreply@blogger.com35tag:blogger.com,1999:blog-6338993703407602171.post-35694563057392021742014-05-22T23:15:00.005-07:002014-05-22T23:45:39.196-07:00 A further study into the use of the PIC32MX250F128B, with side projects using the AT91SAM3X8E (Arduino Due) and the Intel Galileo <iframe class="scribd_iframe_embed" data-aspect-ratio="undefined" data-auto-height="false" frameborder="0" height="600" id="doc_87642" scrolling="no" src="//www.scribd.com/embeds/225743783/content?start_page=1&view_mode=scroll&show_recommendations=true" width="100%"></iframe>
<br />
<br />
Download PDF from:<br />
<a href="http://www.4shared.com/office/kRJ8hVWPce/A_further_study_into_the_use_o.html">http://www.4shared.com/office/kRJ8hVWPce/A_further_study_into_the_use_o.html</a>Tahmidhttp://www.blogger.com/profile/09117804893438710050noreply@blogger.com4tag:blogger.com,1999:blog-6338993703407602171.post-48670266399589846032014-05-13T00:41:00.001-07:002014-05-13T00:57:46.946-07:00Simple PIC32 DMA example<div style="text-align: justify;">
<span style="font-size: small;">I've been testing the PIC32 DMA recently. The PIC32 has a DMA (direct memory access) module that allows the data transfer in the PIC32 without CPU intervention during data transfer - thus freeing up CPU to perform other tasks while the data is transferred).</span></div>
<div style="text-align: justify;">
<span style="font-size: small;"><br /></span></div>
<div style="text-align: justify;">
<span style="font-size: small;">First, I did a simple test to just see if it works (I've also done some DMA timing testing - I'll talk about them soon in another article). The first test was to just use the DMA module to transfer data from a constant array (from FLASH) to PORTA (LATA for output). This would be visually seen as LEDs connected to PORTA blinking.</span></div>
<div style="text-align: justify;">
<span style="font-size: small;"><br /></span></div>
<div style="text-align: justify;">
<span style="font-size: small;">The code is:</span></div>
<div style="text-align: justify;">
<span style="font-family: "Courier New",Courier,monospace; font-size: small;"><span style="background-color: white;"><br /></span></span></div>
<span style="font-family: "Courier New",Courier,monospace; font-size: small;">//================================</span><br />
<span style="font-family: "Courier New",Courier,monospace; font-size: small;"><br /></span>
<span style="font-family: "Courier New",Courier,monospace; font-size: small;">/***************************************************</span><br />
<span style="font-family: "Courier New",Courier,monospace; font-size: small;"> * Programmer: Syed Tahmid Mahbub</span><br />
<span style="font-family: "Courier New",Courier,monospace; font-size: small;"> * Target PIC: PIC32MX250F128B</span><br />
<span style="font-family: "Courier New",Courier,monospace; font-size: small;"> * </span><br />
<span style="font-family: "Courier New",Courier,monospace; font-size: small;"> * Date: 05/08/2014 - 05/10/2014</span><br />
<span style="font-family: "Courier New",Courier,monospace; font-size: small;"> *</span><br />
<span style="font-family: "Courier New",Courier,monospace; font-size: small;"> * Program to test DMA operation</span><br />
<span style="font-family: "Courier New",Courier,monospace; font-size: small;"> * DMA will transfer const (from FLASH) to PORTA</span><br />
<span style="font-family: "Courier New",Courier,monospace; font-size: small;"> ***************************************************/</span><br />
<span style="font-family: "Courier New",Courier,monospace; font-size: small;"><br /></span>
<span style="font-family: "Courier New",Courier,monospace; font-size: small;">#include "plib.h" // peripheral library</span><br />
<span style="font-family: "Courier New",Courier,monospace; font-size: small;">#include "settings.h" // configuration bits settings</span><br />
<span style="font-family: "Courier New",Courier,monospace; font-size: small;"><br /></span>
<span style="font-family: "Courier New",Courier,monospace; font-size: small;">const unsigned char portOut[] = {0x05, 0x0A};</span><br />
<span style="font-family: "Courier New",Courier,monospace; font-size: small;"><br /></span>
<span style="font-family: "Courier New",Courier,monospace; font-size: small;">unsigned int sourceAddr;</span><br />
<span style="font-family: "Courier New",Courier,monospace; font-size: small;">unsigned int destinationAddr;</span><br />
<span style="font-family: "Courier New",Courier,monospace; font-size: small;"><br /></span>
<span style="font-family: "Courier New",Courier,monospace; font-size: small;">void Initialize(void){</span><br />
<span style="font-family: "Courier New",Courier,monospace; font-size: small;"><br /></span><span style="font-size: small;">
<span style="font-family: "Courier New",Courier,monospace;"> SYSTEMConfigPerformance(8000000); // Running at 8MHz for now</span></span><br />
<span style="font-family: "Courier New",Courier,monospace; font-size: small;"> ANSELA = 0; ANSELB = 0;</span><br />
<span style="font-family: "Courier New",Courier,monospace; font-size: small;"> TRISA = 0; TRISB = 0;</span><br />
<span style="font-family: "Courier New",Courier,monospace; font-size: small;"><br /></span><span style="font-size: small;">
<span style="font-family: "Courier New",Courier,monospace;"> ///// Virtual to physical memory</span></span><br />
<span style="font-family: "Courier New",Courier,monospace; font-size: small;"><br /></span><span style="font-size: small;">
<span style="font-family: "Courier New",Courier,monospace;"> /* using a pointer returns virtual memory address:</span></span><br />
<span style="font-family: "Courier New",Courier,monospace; font-size: small;"> * eg. const unsigned int* src = (void*) &LATA;</span><br />
<span style="font-family: "Courier New",Courier,monospace; font-size: small;"> * returns 0xBF886030 -> agrees with datasheet</span><br />
<span style="font-family: "Courier New",Courier,monospace; font-size: small;"> *</span><br />
<span style="font-family: "Courier New",Courier,monospace; font-size: small;"> * reference manual says that to convert this to physical</span><br />
<span style="font-family: "Courier New",Courier,monospace; font-size: small;"> * address, AND it with 0x1FFFFFFF and get the</span><br />
<span style="font-family: "Courier New",Courier,monospace; font-size: small;"> * corresponding physical address</span><br />
<span style="font-family: "Courier New",Courier,monospace; font-size: small;"> */</span><br />
<span style="font-family: "Courier New",Courier,monospace; font-size: small;"><br /></span><span style="font-size: small;">
<span style="font-family: "Courier New",Courier,monospace;"> ///// Set source and destination addresses</span></span><br />
<span style="font-family: "Courier New",Courier,monospace; font-size: small;"> </span><br />
<span style="font-family: "Courier New",Courier,monospace; font-size: small;"> sourceAddr = (unsigned int) &portOut & 0x1FFFFFFF; // Physical address of portOut</span><br />
<span style="font-family: "Courier New",Courier,monospace; font-size: small;"> destinationAddr = (unsigned int) &LATA & 0x1FFFFFFF; // Physical address of LATA</span><br />
<span style="font-family: "Courier New",Courier,monospace; font-size: small;"><br /></span><span style="font-size: small;">
<span style="font-family: "Courier New",Courier,monospace;"> ///// Initialize dma first</span></span><br />
<span style="font-family: "Courier New",Courier,monospace; font-size: small;"> DMACON = 0x8000; // dma module on</span><br />
<span style="font-family: "Courier New",Courier,monospace; font-size: small;"> DCRCCON = 0; // crc module off</span><br />
<span style="font-family: "Courier New",Courier,monospace; font-size: small;"> DCH0INT = 0; // interrupts disabled</span><br />
<span style="font-family: "Courier New",Courier,monospace; font-size: small;"> DCH0SSA = sourceAddr; // source start address</span><br />
<span style="font-family: "Courier New",Courier,monospace; font-size: small;"> DCH0DSA = destinationAddr; // destination start address</span><br />
<span style="font-family: "Courier New",Courier,monospace; font-size: small;"> DCH0SSIZ = 2; // source size - 2 bytes</span><br />
<span style="font-family: "Courier New",Courier,monospace; font-size: small;"> DCH0DSIZ = 1; // destination size - 1 byte</span><br />
<span style="font-family: "Courier New",Courier,monospace; font-size: small;"> DCH0CSIZ = 1; // cell size - 1 bytes</span><br />
<span style="font-family: "Courier New",Courier,monospace; font-size: small;"> DCH0ECON = 0x1310; // dma transfer triggered by interrupt 19: Timer 4</span><br />
<span style="font-family: "Courier New",Courier,monospace; font-size: small;"><br /></span><span style="font-size: small;">
<span style="font-family: "Courier New",Courier,monospace;"> ///// Initialize timer 4 now - timer 4 interrupt triggers dma transfer</span></span><br />
<span style="font-family: "Courier New",Courier,monospace; font-size: small;"> PR4 = 3124; // 100 milliseconds</span><br />
<span style="font-family: "Courier New",Courier,monospace; font-size: small;"> T4CON = 0x70; // prescaler 1:256, timer currently off</span><br />
<span style="font-family: "Courier New",Courier,monospace; font-size: small;"> // timer 4 interrupt request triggers dma</span><br />
<span style="font-family: "Courier New",Courier,monospace; font-size: small;"><br /></span><span style="font-size: small;">
<span style="font-family: "Courier New",Courier,monospace;"> ///// Enable dma channel</span></span><br />
<span style="font-family: "Courier New",Courier,monospace; font-size: small;"> DCH0CON = 0x93; // channel enabled, always on, priority 3</span><br />
<span style="font-family: "Courier New",Courier,monospace; font-size: small;">}</span><br />
<span style="font-family: "Courier New",Courier,monospace; font-size: small;"><br /></span>
<span style="font-family: "Courier New",Courier,monospace; font-size: small;"><br /></span>
<span style="font-family: "Courier New",Courier,monospace; font-size: small;">void main(void){</span><br />
<span style="font-family: "Courier New",Courier,monospace; font-size: small;"><br /></span><span style="font-size: small;">
<span style="font-family: "Courier New",Courier,monospace;"> Initialize();</span></span><br />
<span style="font-family: "Courier New",Courier,monospace; font-size: small;"> T4CONSET = 0x8000; // turn on timer 4</span><br />
<span style="font-family: "Courier New",Courier,monospace; font-size: small;"> while (1){</span><br />
<span style="font-family: "Courier New",Courier,monospace; font-size: small;"> </span><br />
<span style="font-family: "Courier New",Courier,monospace; font-size: small;"> }</span><br />
<span style="font-family: "Courier New",Courier,monospace; font-size: small;"><br /></span>
<span style="font-family: "Courier New",Courier,monospace; font-size: small;">}</span><br />
<span style="font-family: "Courier New",Courier,monospace; font-size: small;"><br /></span><span style="font-family: "Courier New",Courier,monospace; font-size: small;">//==========================<span style="color: #222222;">======</span></span><br />
<br />
<span style="font-family: inherit;">The DMA module allows data transfer from a source to a destination without CPU intervention during data transfer. The data transfer can be triggered by any interrupt request within the PIC. An interesting point of note is that the DMA module maintains its own flags for detecting interrupt requests for data transfer start/abort requests. This is completely independent of the INT interrupt controller enable and flag settings/configuration.<br /><br />Points of note on the DMA:<br /></span><br />
<ul>
<li><span style="font-family: inherit;">Data is transferred from the source register to the destination register upon a transfer request.</span></li>
<li><span style="font-family: inherit;">The source size and destination size registers define the size of the source and destination to which you want to transfer data. For example, LATA is a 32-bit register (typical for the PIC32). However, since I'm only planning to transfer data to the lowest byte in LATA (see code above), my destination size is one byte.</span></li>
<li><span style="font-family: inherit;">The cell size describes the number of bytes to transfer upon one DMA transfer request. For example, in my code I was transferring just one byte every DMA request (either 0x05 or 0x0A) - so the cell size is 1 byte.</span></li>
<li><span style="font-family: inherit;">The DMA transfer is complete when either a block transfer occurs or you abort the transfer. A block transfer occurs when the number of bytes equal to the size of the larger of the source and destination register sizes is transferred. So, in my code, a block transfer is when both byte 0x05 and 0x0A are transferred. So, that's two DMA cell transfers upon two interrupt requests (only one cell transfer occurs upon one interrupt request).</span></li>
<li><span style="font-family: inherit;">The source and destination addresses are PHYSICAL ADDRESSES, NOT VIRTUAL ADDRESSES used by the MIPS core. The reference manual mentions the easy translation between physical and virtual addresses: (Physical address) = (Virutal address) & 0x1FFFFFFF. Remember that when you point to a register address (eg &LATA), that returns the virtual address and not the physical address.</span></li>
<li><span style="font-family: inherit;">The DMA transfer is triggered by an interrupt request (IRQ). So, in the DMA event control register, you must specify which IRQ is to trigger the data transfer. To ensure that this IRQ triggers a DMA transfer, the SIRQEN (Channel Start IRQ Enable bit) bit (bit 4 of the DCHxECON register) must be set. Additionally, when you specify the IRQ in the event control register, make sure you use the IRQ # and not the vector #.</span></li>
<li><span style="font-family: inherit;">The maximum source size, destination size and cell size are all 65,535 bytes (wow!). You can transfer that many bytes on an event. </span></li>
</ul>
<span style="font-family: inherit;">For further details on the DMA controller, go through the <a href="http://ww1.microchip.com/downloads/en/DeviceDoc/60001117H.pdf">reference manual</a>.<br /><br />For information on using the DMA plib (peripheral library) functions, see: <a href="http://people.ece.cornell.edu/land/courses/ece4760/PIC32/">http://people.ece.cornell.edu/land/courses/ece4760/PIC32/</a></span><br />
<span style="font-family: "Courier New",Courier,monospace; font-size: small;"></span><br />
<span style="font-family: inherit;"><span style="background: none repeat scroll 0% 0% white; color: #222222;"><a href="http://people.ece.cornell.edu/land/courses/ece4760/PIC32/"><span style="color: blue;"></span></a></span></span><br />
<span style="font-family: "Courier New",Courier,monospace; font-size: small;"><span style="color: #222222;">
</span></span>Tahmidhttp://www.blogger.com/profile/09117804893438710050noreply@blogger.com7tag:blogger.com,1999:blog-6338993703407602171.post-52875600271496094872014-04-05T20:25:00.001-07:002014-04-05T21:12:09.785-07:00Hacking the PIC32 Comparator Reference to obtain a DAC<!--[if gte mso 9]><xml>
<w:WordDocument>
<w:View>Normal</w:View>
<w:Zoom>0</w:Zoom>
<w:TrackMoves/>
<w:TrackFormatting/>
<w:PunctuationKerning/>
<w:ValidateAgainstSchemas/>
<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
<w:IgnoreMixedContent>false</w:IgnoreMixedContent>
<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
<w:DoNotPromoteQF/>
<w:LidThemeOther>EN-US</w:LidThemeOther>
<w:LidThemeAsian>X-NONE</w:LidThemeAsian>
<w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript>
<w:Compatibility>
<w:BreakWrappedTables/>
<w:SnapToGridInCell/>
<w:WrapTextWithPunct/>
<w:UseAsianBreakRules/>
<w:DontGrowAutofit/>
<w:SplitPgBreakAndParaMark/>
<w:DontVertAlignCellWithSp/>
<w:DontBreakConstrainedForcedTables/>
<w:DontVertAlignInTxbx/>
<w:Word11KerningPairs/>
<w:CachedColBalance/>
</w:Compatibility>
<w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
<m:mathPr>
<m:mathFont m:val="Cambria Math"/>
<m:brkBin m:val="before"/>
<m:brkBinSub m:val="--"/>
<m:smallFrac m:val="off"/>
<m:dispDef/>
<m:lMargin m:val="0"/>
<m:rMargin m:val="0"/>
<m:defJc m:val="centerGroup"/>
<m:wrapIndent m:val="1440"/>
<m:intLim m:val="subSup"/>
<m:naryLim m:val="undOvr"/>
</m:mathPr></w:WordDocument>
</xml><![endif]--><span style="font-size: small;"><br /></span>
<!--[if gte mso 9]><xml>
<w:LatentStyles DefLockedState="false" DefUnhideWhenUsed="true"
DefSemiHidden="true" DefQFormat="false" DefPriority="99"
LatentStyleCount="267">
<w:LsdException Locked="false" Priority="0" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Normal"/>
<w:LsdException Locked="false" Priority="9" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="heading 1"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 2"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 3"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 4"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 5"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 6"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 7"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 8"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 9"/>
<w:LsdException Locked="false" Priority="39" Name="toc 1"/>
<w:LsdException Locked="false" Priority="39" Name="toc 2"/>
<w:LsdException Locked="false" Priority="39" Name="toc 3"/>
<w:LsdException Locked="false" Priority="39" Name="toc 4"/>
<w:LsdException Locked="false" Priority="39" Name="toc 5"/>
<w:LsdException Locked="false" Priority="39" Name="toc 6"/>
<w:LsdException Locked="false" Priority="39" Name="toc 7"/>
<w:LsdException Locked="false" Priority="39" Name="toc 8"/>
<w:LsdException Locked="false" Priority="39" Name="toc 9"/>
<w:LsdException Locked="false" Priority="35" QFormat="true" Name="caption"/>
<w:LsdException Locked="false" Priority="10" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Title"/>
<w:LsdException Locked="false" Priority="1" Name="Default Paragraph Font"/>
<w:LsdException Locked="false" Priority="11" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtitle"/>
<w:LsdException Locked="false" Priority="22" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Strong"/>
<w:LsdException Locked="false" Priority="20" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Emphasis"/>
<w:LsdException Locked="false" Priority="59" SemiHidden="false"
UnhideWhenUsed="false" Name="Table Grid"/>
<w:LsdException Locked="false" UnhideWhenUsed="false" Name="Placeholder Text"/>
<w:LsdException Locked="false" Priority="1" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="No Spacing"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 1"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 1"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 1"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 1"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 1"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 1"/>
<w:LsdException Locked="false" UnhideWhenUsed="false" Name="Revision"/>
<w:LsdException Locked="false" Priority="34" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="List Paragraph"/>
<w:LsdException Locked="false" Priority="29" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Quote"/>
<w:LsdException Locked="false" Priority="30" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Quote"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 1"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 1"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 1"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 1"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 1"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 1"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 1"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 1"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 2"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 2"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 2"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 2"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 2"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 2"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 2"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 2"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 2"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 2"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 2"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 2"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 2"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 2"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 3"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 3"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 3"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 3"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 3"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 3"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 3"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 3"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 3"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 3"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 3"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 3"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 3"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 3"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 4"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 4"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 4"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 4"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 4"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 4"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 4"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 4"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 4"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 4"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 4"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 4"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 4"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 4"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 5"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 5"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 5"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 5"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 5"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 5"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 5"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 5"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 5"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 5"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 5"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 5"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 5"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 5"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 6"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 6"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 6"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 6"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 6"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 6"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 6"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 6"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 6"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 6"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 6"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 6"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 6"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 6"/>
<w:LsdException Locked="false" Priority="19" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtle Emphasis"/>
<w:LsdException Locked="false" Priority="21" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Emphasis"/>
<w:LsdException Locked="false" Priority="31" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtle Reference"/>
<w:LsdException Locked="false" Priority="32" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Reference"/>
<w:LsdException Locked="false" Priority="33" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Book Title"/>
<w:LsdException Locked="false" Priority="37" Name="Bibliography"/>
<w:LsdException Locked="false" Priority="39" QFormat="true" Name="TOC Heading"/>
</w:LatentStyles>
</xml><![endif]--><!--[if gte mso 10]>
<style>
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Table Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-qformat:yes;
mso-style-parent:"";
mso-padding-alt:0in 5.4pt 0in 5.4pt;
mso-para-margin-top:0in;
mso-para-margin-right:0in;
mso-para-margin-bottom:10.0pt;
mso-para-margin-left:0in;
line-height:115%;
mso-pagination:widow-orphan;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-ascii-font-family:Calibri;
mso-ascii-theme-font:minor-latin;
mso-fareast-font-family:"Times New Roman";
mso-fareast-theme-font:minor-fareast;
mso-hansi-font-family:Calibri;
mso-hansi-theme-font:minor-latin;
mso-bidi-font-family:"Times New Roman";
mso-bidi-theme-font:minor-bidi;}
</style>
<![endif]--><span style="font-size: small;">The
PIC32MX250F128B has a myriad of peripheral features that makes this cheap little
28-pin 32-bit microcontroller extremely powerful. However, it does lack a
digital-to-analog converter (DAC). A simple approach to digital-to-analog conversion
is to use one of the PWM channels and then to use an RC low-pass filter at the
output.</span><br />
<span style="font-size: small;"><br /></span>
<span style="font-size: small;">However, there
is another neat little feature of the device that can be exploited or rather
utilized to obtain a rather crude DAC – the analog comparator module. Rather,
the analog comparator reference module. The PIC32MX250F128B contains an
internal voltage reference module that was created to be used as a reference voltage
for the internal analog comparator module. However, it does allow you to output
this reference voltage to an output pin. Analog voltage output with digital control? Sounds like a DAC.</span><br />
<span style="font-size: small;"><br /></span>
<span style="font-size: small;">The voltage
reference module is built off of a 16-tap resistor ladder network with two
selectable ranges – from 0 to 0.67 CVREF or from 0.25 to 0.75 CVREF. CVREF is
the reference voltage for the module and can be connected to VDD (or an external VREF+). Thus there
are 32 possible voltage combinations. However, there are some voltages present
in both ranges, and additionally, “interleaving” the two ranges does not give
a linear set of 32 values. Thus this cannot be used to achieve a full 5-bit
resolution DAC. Cleverly selecting the values from the two ranges can, however,
lead to more than 16 steps. 16 steps is the number of steps achievable from
either range.</span><br />
<span style="font-size: small;"><br /></span>
<span style="font-size: small;">The stabilizing
time for the internal reference module is listed in the datasheet as 10µs.
However, this is defined as the time required to stabilize for a transition from 0000 to 1111
in the voltage selection bits (4bits = 16steps). This means that this can be
pushed to relatively high speeds (in the tens of kilohertz) pretty easily
depending on the range of the swing of the voltage.</span><br />
<span style="font-size: small;"><br /></span>
<span style="font-size: small;">I have received
good results with frequencies in the tens of kilohertz. At about 100kHz
(10µs
between samples), I can see the waveform “curve” a bit but even then it doesn’t
look too bad and is definitely useable.</span><br />
<span style="font-size: small;"><br /></span>
<span style="font-size: small;">Why use this as
a DAC? Well, it’s a nice little tool available to you. Consider the fact that
this outputs an analog value with no required additional filtering. Additionally,
if you don’t need anything that requires a high resolution (ie no need for a
high resolution DAC), this will allow you to leave a valuable output compare /
PWM channel to use for something else. If not for anything else, it’s just a
fun thing to explore.</span><br />
<span style="font-size: small;"><br /></span>
<span style="font-size: small;">I have written a sample piece of code to test this. There are four modes of operation here:</span><br />
<span style="font-size: small;"><br /></span>
<br />
<ul>
<li><span style="font-size: small;">Sawtooth mode - Generate sawtooth waveform with 16 steps (only 1 DAC range) (see Fig. 1 below)</span></li>
<li><span style="font-size: small;">DAC_Out mode - Output all the values of the DAC full range (32 steps) - this clearly illustrates the non-linearity I was talking about. (see Fig. 2 below) Observe the apparently linear region in the middle.</span></li>
<li><span style="font-size: small;">Sine_1 mode - Generate half sine wave output with 16 point sine table. The 16 DAC points are used for the entire sine half wave. DAC used with 16 steps (see Fig. 3 below)</span></li>
<li><span style="font-size: small;">Sine_2 mode - Generate half sine wave output with 32 point sine table (16 step DAC mode) - ie this uses the 16 DAC points for half of a sine half wave and then repeats these for the second half, utilizing the 16 step DAC more fully (see Fig. 4 below)</span></li>
</ul>
<span style="font-size: small;">Here are some pictures from my experiments:</span><br />
<div class="MsoNormal" style="text-align: justify; text-indent: .5in;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiDXTf62CSlWjvB4jwU5pzqpkHsFVDh1jX16d8e3v0XyZ1bjabERNfyBcXz8sKnymddKd1TinVbpj80mDiND5qWYMiUkDY3CDwYgTbTs2UkttZZ92mlfcR4wP8sw8b1STt0JqU37zoJCOmr/s1600/sawtooth.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiDXTf62CSlWjvB4jwU5pzqpkHsFVDh1jX16d8e3v0XyZ1bjabERNfyBcXz8sKnymddKd1TinVbpj80mDiND5qWYMiUkDY3CDwYgTbTs2UkttZZ92mlfcR4wP8sw8b1STt0JqU37zoJCOmr/s1600/sawtooth.jpg" height="223" width="400" /> </a></div>
<div class="separator" style="clear: both; text-align: center;">
Fig. 1 - Sawtooth mode </div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEioCv0Q49LpDuD343hxO1_wWL6ACCm0toOUvmAFJQ96jN8GO5N-z4vnkZnLd35dp2Xz9IvPpcMqS3E45aUVRc-_qIeV_tEvwGJ003555dxfYhBLPt7aTjzVLFiRdDdsFyMXSsAEtvBySjUR/s1600/dac_out.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEioCv0Q49LpDuD343hxO1_wWL6ACCm0toOUvmAFJQ96jN8GO5N-z4vnkZnLd35dp2Xz9IvPpcMqS3E45aUVRc-_qIeV_tEvwGJ003555dxfYhBLPt7aTjzVLFiRdDdsFyMXSsAEtvBySjUR/s1600/dac_out.jpg" height="223" width="400" /></a></div>
<div style="text-align: center;">
Fig. 2 - DAC_Out mode</div>
<div style="text-align: center;">
<br /></div>
<div style="text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqg6YSbUn0rNvFqdTwb-dpBHvkClOUbZB9UaSKZ6fedXv3GX_iJZmvJ34g3Sv-YgOGNetV9YtPNYkMwwb7qCxRcKLR85hEvGGPEzA_Wonff220qYQbV4h8ddjz_uS2QEbu0ZW8s_elMzsz/s1600/sine_1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqg6YSbUn0rNvFqdTwb-dpBHvkClOUbZB9UaSKZ6fedXv3GX_iJZmvJ34g3Sv-YgOGNetV9YtPNYkMwwb7qCxRcKLR85hEvGGPEzA_Wonff220qYQbV4h8ddjz_uS2QEbu0ZW8s_elMzsz/s1600/sine_1.jpg" height="223" width="400" /></a></div>
<div style="text-align: center;">
Fig. 3 - Sine_1 mode</div>
<div style="text-align: center;">
<br /></div>
<div style="text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEga9W3yLvbIai_-b87ifU7g8xBOj5qPK7x_ZTSN4DMXGZom-TQzs12mLSLMJHNdr1K-pwgvRw5Ii0UrqRrHE0NPbTQPxQojJflCBZUNPdFsoV2_mGg_83hbXPuP9kim_83Wg1AWtHZ_p1mh/s1600/sine_2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEga9W3yLvbIai_-b87ifU7g8xBOj5qPK7x_ZTSN4DMXGZom-TQzs12mLSLMJHNdr1K-pwgvRw5Ii0UrqRrHE0NPbTQPxQojJflCBZUNPdFsoV2_mGg_83hbXPuP9kim_83Wg1AWtHZ_p1mh/s1600/sine_2.jpg" height="223" width="400" /></a></div>
<div style="text-align: center;">
Fig. 4 - Sine_2 mode</div>
<br />
Here are download links to the source code:<br />
<br />
Source code (main.c):<br />
<a href="https://drive.google.com/file/d/0B4SoPFPRNziHZUd5NHM5UDhiSGs/edit?usp=sharing"><u>https://drive.google.com/file/d/0B4SoPFPRNziHZUd5NHM5UDhiSGs/edit?usp=sharing</u></a><br />
<a href="http://www.4shared.com/file/HaU5syz-ba/main.html"><u>http://www.4shared.com/file/HaU5syz-ba/main.html</u></a><br />
<br />
Any ideas? Comments? Feedback? Let me know in the comments section below!Tahmidhttp://www.blogger.com/profile/09117804893438710050noreply@blogger.com2tag:blogger.com,1999:blog-6338993703407602171.post-64780799438253523332014-02-16T23:12:00.000-08:002015-01-07T16:09:43.028-08:00Automatic voltage stabilizer (AC-AC) with PIC16F873A - circuit, explanation, PCB, source code, videos and loads of pictures!<div style="-x-system-font: none; display: block; font-family: Helvetica,Arial,Sans-serif; font-size-adjust: none; font-size: 14px; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; margin: 12px auto 6px auto;">
<a href="http://www.scribd.com/doc/207498741/Automatic-Voltage-Stabilizer-with-PIC16F873A" style="text-decoration: underline;" title="View Automatic Voltage Stabilizer with PIC16F873A on Scribd">Automatic Voltage Stabilizer with PIC16F873A</a></div>
<iframe class="scribd_iframe_embed" data-aspect-ratio="undefined" data-auto-height="false" frameborder="0" height="600" id="doc_69892" scrolling="no" src="//www.scribd.com/embeds/207498741/content?start_page=1&view_mode=scroll&show_recommendations=true" width="100%"></iframe>
<br />
<br />
<b>Download links for the article: </b><br />
<br />
Google docs (go to the link, click File in the PDF window, then click Download):<br />
<a href="https://docs.google.com/file/d/0B4SoPFPRNziHb3VrX3JhWko3d1E/edit"><u>https://docs.google.com/file/d/0B4SoPFPRNziHb3VrX3JhWko3d1E/edit</u></a><br />
<br />
Scribd link: <a href="http://www.scribd.com/doc/207498741/Automatic-Voltage-Stabilizer-with-PIC16F873A"><u>http://www.scribd.com/doc/207498741/Automatic-Voltage-Stabilizer-with-PIC16F873A</u></a><br />
<br />
4shared download link: <u><a href="http://www.4shared.com/office/ktU0k9dqba/Voltage_Stabilizer.html">http://www.4shared.com/office/ktU0k9dqba/Voltage_Stabilizer.html</a></u><br />
<!--[if gte mso 9]><xml>
<w:WordDocument>
<w:View>Normal</w:View>
<w:Zoom>0</w:Zoom>
<w:TrackMoves/>
<w:TrackFormatting/>
<w:PunctuationKerning/>
<w:ValidateAgainstSchemas/>
<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
<w:IgnoreMixedContent>false</w:IgnoreMixedContent>
<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
<w:DoNotPromoteQF/>
<w:LidThemeOther>EN-US</w:LidThemeOther>
<w:LidThemeAsian>X-NONE</w:LidThemeAsian>
<w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript>
<w:Compatibility>
<w:BreakWrappedTables/>
<w:SnapToGridInCell/>
<w:WrapTextWithPunct/>
<w:UseAsianBreakRules/>
<w:DontGrowAutofit/>
<w:SplitPgBreakAndParaMark/>
<w:DontVertAlignCellWithSp/>
<w:DontBreakConstrainedForcedTables/>
<w:DontVertAlignInTxbx/>
<w:Word11KerningPairs/>
<w:CachedColBalance/>
</w:Compatibility>
<m:mathPr>
<m:mathFont m:val="Cambria Math"/>
<m:brkBin m:val="before"/>
<m:brkBinSub m:val="--"/>
<m:smallFrac m:val="off"/>
<m:dispDef/>
<m:lMargin m:val="0"/>
<m:rMargin m:val="0"/>
<m:defJc m:val="centerGroup"/>
<m:wrapIndent m:val="1440"/>
<m:intLim m:val="subSup"/>
<m:naryLim m:val="undOvr"/>
</m:mathPr></w:WordDocument>
</xml><![endif]--><br />
<!--[if gte mso 9]><xml>
<w:LatentStyles DefLockedState="false" DefUnhideWhenUsed="true"
DefSemiHidden="true" DefQFormat="false" DefPriority="99"
LatentStyleCount="267">
<w:LsdException Locked="false" Priority="0" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Normal"/>
<w:LsdException Locked="false" Priority="9" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="heading 1"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 2"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 3"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 4"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 5"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 6"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 7"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 8"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 9"/>
<w:LsdException Locked="false" Priority="39" Name="toc 1"/>
<w:LsdException Locked="false" Priority="39" Name="toc 2"/>
<w:LsdException Locked="false" Priority="39" Name="toc 3"/>
<w:LsdException Locked="false" Priority="39" Name="toc 4"/>
<w:LsdException Locked="false" Priority="39" Name="toc 5"/>
<w:LsdException Locked="false" Priority="39" Name="toc 6"/>
<w:LsdException Locked="false" Priority="39" Name="toc 7"/>
<w:LsdException Locked="false" Priority="39" Name="toc 8"/>
<w:LsdException Locked="false" Priority="39" Name="toc 9"/>
<w:LsdException Locked="false" Priority="35" QFormat="true" Name="caption"/>
<w:LsdException Locked="false" Priority="10" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Title"/>
<w:LsdException Locked="false" Priority="1" Name="Default Paragraph Font"/>
<w:LsdException Locked="false" Priority="11" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtitle"/>
<w:LsdException Locked="false" Priority="22" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Strong"/>
<w:LsdException Locked="false" Priority="20" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Emphasis"/>
<w:LsdException Locked="false" Priority="59" SemiHidden="false"
UnhideWhenUsed="false" Name="Table Grid"/>
<w:LsdException Locked="false" UnhideWhenUsed="false" Name="Placeholder Text"/>
<w:LsdException Locked="false" Priority="1" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="No Spacing"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 1"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 1"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 1"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 1"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 1"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 1"/>
<w:LsdException Locked="false" UnhideWhenUsed="false" Name="Revision"/>
<w:LsdException Locked="false" Priority="34" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="List Paragraph"/>
<w:LsdException Locked="false" Priority="29" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Quote"/>
<w:LsdException Locked="false" Priority="30" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Quote"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 1"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 1"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 1"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 1"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 1"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 1"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 1"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 1"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 2"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 2"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 2"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 2"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 2"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 2"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 2"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 2"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 2"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 2"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 2"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 2"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 2"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 2"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 3"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 3"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 3"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 3"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 3"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 3"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 3"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 3"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 3"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 3"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 3"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 3"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 3"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 3"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 4"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 4"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 4"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 4"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 4"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 4"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 4"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 4"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 4"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 4"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 4"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 4"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 4"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 4"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 5"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 5"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 5"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 5"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 5"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 5"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 5"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 5"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 5"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 5"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 5"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 5"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 5"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 5"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 6"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 6"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 6"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 6"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 6"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 6"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 6"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 6"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 6"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 6"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 6"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 6"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 6"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 6"/>
<w:LsdException Locked="false" Priority="19" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtle Emphasis"/>
<w:LsdException Locked="false" Priority="21" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Emphasis"/>
<w:LsdException Locked="false" Priority="31" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtle Reference"/>
<w:LsdException Locked="false" Priority="32" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Reference"/>
<w:LsdException Locked="false" Priority="33" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Book Title"/>
<w:LsdException Locked="false" Priority="37" Name="Bibliography"/>
<w:LsdException Locked="false" Priority="39" QFormat="true" Name="TOC Heading"/>
</w:LatentStyles>
</xml><![endif]--><!--[if gte mso 10]>
<style>
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Table Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-qformat:yes;
mso-style-parent:"";
mso-padding-alt:0in 5.4pt 0in 5.4pt;
mso-para-margin-top:0in;
mso-para-margin-right:0in;
mso-para-margin-bottom:10.0pt;
mso-para-margin-left:0in;
line-height:115%;
mso-pagination:widow-orphan;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-ascii-font-family:Calibri;
mso-ascii-theme-font:minor-latin;
mso-fareast-font-family:"Times New Roman";
mso-fareast-theme-font:minor-fareast;
mso-hansi-font-family:Calibri;
mso-hansi-theme-font:minor-latin;
mso-bidi-font-family:"Times New Roman";
mso-bidi-theme-font:minor-bidi;}
</style>
<![endif]-->
<br />
<div class="MsoNormal">
<br />
<span style="font-size: 12.0pt; line-height: 115%; mso-bidi-font-size: 11.0pt;">You can download all the files related to the voltage
stabilizer:</span><br />
<br />
<span style="font-size: 12.0pt; line-height: 115%; mso-bidi-font-size: 11.0pt;">Google docs (go to the link, click File in the PDF window, then click Download):</span></div>
<div class="MsoNormal">
<span style="font-size: 12.0pt; line-height: 115%; mso-bidi-font-size: 11.0pt;">Code: <a href="https://drive.google.com/file/d/0B4SoPFPRNziHbWtkVUc1VUM1REU/edit?usp=sharing"><u>https://drive.google.com/file/d/0B4SoPFPRNziHbWtkVUc1VUM1REU/edit?usp=sharing</u></a></span></div>
<div class="MsoNormal">
<span style="font-size: 12.0pt; line-height: 115%; mso-bidi-font-size: 11.0pt;">HEX:</span> <a href="https://drive.google.com/file/d/0B4SoPFPRNziHSVJ1a0t2STNDd3M/edit?usp=sharing"><u><span style="font-size: 12.0pt; line-height: 115%; mso-bidi-font-size: 11.0pt;">https://drive.google.com/file/d/0B4SoPFPRNziHSVJ1a0t2STNDd3M/edit?usp=sharing</span></u></a></div>
<div class="MsoNormal">
<span style="font-size: 12.0pt; line-height: 115%; mso-bidi-font-size: 11.0pt;">PCB: <a href="https://drive.google.com/file/d/0B4SoPFPRNziHdkE0SzI4SDQ5V3M/edit?usp=sharing"><u>https://drive.google.com/file/d/0B4SoPFPRNziHdkE0SzI4SDQ5V3M/edit?usp=sharing</u></a></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-size: 12.0pt; line-height: 115%; mso-bidi-font-size: 11.0pt;">PCB images:</span></div>
<div class="MsoNormal">
<a href="https://drive.google.com/file/d/0B4SoPFPRNziHNEtSQlVtX2x4VWc/edit?usp=sharing"><u><span style="font-size: 12.0pt; line-height: 115%; mso-bidi-font-size: 11.0pt;">https://drive.google.com/file/d/0B4SoPFPRNziHNEtSQlVtX2x4VWc/edit?usp=sharing</span></u></a></div>
<div class="MsoNormal">
<a href="https://drive.google.com/file/d/0B4SoPFPRNziHQXl2eWtydmh3WkU/edit?usp=sharing"><u><span style="font-size: 12.0pt; line-height: 115%; mso-bidi-font-size: 11.0pt;">https://drive.google.com/file/d/0B4SoPFPRNziHQXl2eWtydmh3WkU/edit?usp=sharing</span></u></a></div>
<div class="MsoNormal">
<a href="https://drive.google.com/file/d/0B4SoPFPRNziHTktlc3dMamlFTjA/edit?usp=sharing"><u><span style="font-size: 12.0pt; line-height: 115%; mso-bidi-font-size: 11.0pt;">https://drive.google.com/file/d/0B4SoPFPRNziHTktlc3dMamlFTjA/edit?usp=sharing</span></u></a></div>
<div class="MsoNormal">
<a href="https://drive.google.com/file/d/0B4SoPFPRNziHdktCQ29kVkNJd1k/edit?usp=sharing"><u><span style="font-size: 12.0pt; line-height: 115%; mso-bidi-font-size: 11.0pt;">https://drive.google.com/file/d/0B4SoPFPRNziHdktCQ29kVkNJd1k/edit?usp=sharing</span></u></a><u><span style="font-size: 12.0pt; line-height: 115%; mso-bidi-font-size: 11.0pt;"> </span></u></div>
<div class="MsoNormal">
<u><span style="font-size: 12.0pt; line-height: 115%; mso-bidi-font-size: 11.0pt;"><br /></span></u>
<br />
<div style="text-align: center;">
<div style="text-align: left;">
<b><span style="font-size: 12.0pt; line-height: 115%; mso-bidi-font-size: 11.0pt;"> </span></b><span style="font-size: 12.0pt; line-height: 115%; mso-bidi-font-size: 11.0pt;">Schematic (2 parts):</span></div>
<div style="text-align: left;">
<a href="https://drive.google.com/file/d/0B4SoPFPRNziHM0xELW8zd1loMXc/edit?usp=sharing"><u><span style="font-size: 12.0pt; line-height: 115%; mso-bidi-font-size: 11.0pt;">https://drive.google.com/file/d/0B4SoPFPRNziHM0xELW8zd1loMXc/edit?usp=sharing</span></u></a></div>
<div style="text-align: left;">
<u><span style="font-size: 12.0pt; line-height: 115%; mso-bidi-font-size: 11.0pt;"><a href="https://drive.google.com/file/d/0B4SoPFPRNziHdGZsWExJRktJYmM/edit?usp=sharing">https://drive.google.com/file/d/0B4SoPFPRNziHdGZsWExJRktJYmM/edit?usp=sharing</a> </span></u></div>
<div style="text-align: left;">
</div>
<br />
<br />
<div style="text-align: left;">
<span style="font-size: 12.0pt; line-height: 115%; mso-bidi-font-size: 11.0pt;">Parts list:</span></div>
<div style="text-align: left;">
<a href="https://drive.google.com/file/d/0B4SoPFPRNziHU25iRHF3eHIyN0U/edit?usp=sharing"><u><span style="font-size: 12.0pt; line-height: 115%; mso-bidi-font-size: 11.0pt;">https://drive.google.com/file/d/0B4SoPFPRNziHU25iRHF3eHIyN0U/edit?usp=sharing</span></u></a><b><span style="font-size: 12.0pt; line-height: 115%; mso-bidi-font-size: 11.0pt;"> </span></b></div>
<br />
<b><span style="font-size: 12.0pt; line-height: 115%; mso-bidi-font-size: 11.0pt;">Youtube videos of the automatic voltage stabilizer (in Bangla and in English):</span></b><br />
<span style="font-size: 12.0pt; line-height: 115%; mso-bidi-font-size: 11.0pt;"> </span></div>
</div>
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.youtube.com/embed/C84hwaacdfo?feature=player_embedded' frameborder='0'></iframe> </div>
<div class="separator" style="clear: both; text-align: center;">
Youtube link: <a href="http://www.youtube.com/watch?v=C84hwaacdfo"><u>http://www.youtube.com/watch?v=C84hwaacdfo</u></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.youtube.com/embed/Ds7M1bBSyEU?feature=player_embedded' frameborder='0'></iframe> </div>
<br />
<div style="text-align: center;">
Youtube link: <a href="http://www.youtube.com/watch?v=Ds7M1bBSyEU"><u>http://www.youtube.com/watch?v=Ds7M1bBSyEU</u></a> </div>
<br />Tahmidhttp://www.blogger.com/profile/09117804893438710050noreply@blogger.com110tag:blogger.com,1999:blog-6338993703407602171.post-71742321696827626572014-02-11T00:10:00.001-08:002014-02-11T20:50:23.874-08:00PIC32 Proto Board: Details, Schematic, PCB and Pictures<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]--><br />
<!--[if gte mso 9]><xml>
<w:WordDocument>
<w:View>Normal</w:View>
<w:Zoom>0</w:Zoom>
<w:TrackMoves>false</w:TrackMoves>
<w:TrackFormatting/>
<w:PunctuationKerning/>
<w:ValidateAgainstSchemas/>
<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
<w:IgnoreMixedContent>false</w:IgnoreMixedContent>
<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
<w:DoNotPromoteQF/>
<w:LidThemeOther>EN-US</w:LidThemeOther>
<w:LidThemeAsian>X-NONE</w:LidThemeAsian>
<w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript>
<w:Compatibility>
<w:BreakWrappedTables/>
<w:SnapToGridInCell/>
<w:WrapTextWithPunct/>
<w:UseAsianBreakRules/>
<w:DontGrowAutofit/>
<w:SplitPgBreakAndParaMark/>
<w:DontVertAlignCellWithSp/>
<w:DontBreakConstrainedForcedTables/>
<w:DontVertAlignInTxbx/>
<w:Word11KerningPairs/>
<w:CachedColBalance/>
</w:Compatibility>
<m:mathPr>
<m:mathFont m:val="Cambria Math"/>
<m:brkBin m:val="before"/>
<m:brkBinSub m:val="--"/>
<m:smallFrac m:val="off"/>
<m:dispDef/>
<m:lMargin m:val="0"/>
<m:rMargin m:val="0"/>
<m:defJc m:val="centerGroup"/>
<m:wrapIndent m:val="1440"/>
<m:intLim m:val="subSup"/>
<m:naryLim m:val="undOvr"/>
</m:mathPr></w:WordDocument>
</xml><![endif]--><!--[if gte mso 9]><xml>
<w:LatentStyles DefLockedState="false" DefUnhideWhenUsed="true"
DefSemiHidden="true" DefQFormat="false" DefPriority="99"
LatentStyleCount="267">
<w:LsdException Locked="false" Priority="0" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Normal"/>
<w:LsdException Locked="false" Priority="9" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="heading 1"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 2"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 3"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 4"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 5"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 6"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 7"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 8"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 9"/>
<w:LsdException Locked="false" Priority="39" Name="toc 1"/>
<w:LsdException Locked="false" Priority="39" Name="toc 2"/>
<w:LsdException Locked="false" Priority="39" Name="toc 3"/>
<w:LsdException Locked="false" Priority="39" Name="toc 4"/>
<w:LsdException Locked="false" Priority="39" Name="toc 5"/>
<w:LsdException Locked="false" Priority="39" Name="toc 6"/>
<w:LsdException Locked="false" Priority="39" Name="toc 7"/>
<w:LsdException Locked="false" Priority="39" Name="toc 8"/>
<w:LsdException Locked="false" Priority="39" Name="toc 9"/>
<w:LsdException Locked="false" Priority="35" QFormat="true" Name="caption"/>
<w:LsdException Locked="false" Priority="10" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Title"/>
<w:LsdException Locked="false" Priority="1" Name="Default Paragraph Font"/>
<w:LsdException Locked="false" Priority="11" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtitle"/>
<w:LsdException Locked="false" Priority="22" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Strong"/>
<w:LsdException Locked="false" Priority="20" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Emphasis"/>
<w:LsdException Locked="false" Priority="59" SemiHidden="false"
UnhideWhenUsed="false" Name="Table Grid"/>
<w:LsdException Locked="false" UnhideWhenUsed="false" Name="Placeholder Text"/>
<w:LsdException Locked="false" Priority="1" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="No Spacing"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 1"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 1"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 1"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 1"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 1"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 1"/>
<w:LsdException Locked="false" UnhideWhenUsed="false" Name="Revision"/>
<w:LsdException Locked="false" Priority="34" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="List Paragraph"/>
<w:LsdException Locked="false" Priority="29" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Quote"/>
<w:LsdException Locked="false" Priority="30" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Quote"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 1"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 1"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 1"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 1"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 1"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 1"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 1"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 1"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 2"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 2"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 2"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 2"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 2"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 2"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 2"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 2"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 2"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 2"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 2"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 2"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 2"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 2"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 3"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 3"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 3"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 3"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 3"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 3"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 3"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 3"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 3"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 3"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 3"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 3"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 3"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 3"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 4"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 4"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 4"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 4"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 4"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 4"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 4"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 4"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 4"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 4"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 4"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 4"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 4"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 4"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 5"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 5"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 5"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 5"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 5"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 5"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 5"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 5"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 5"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 5"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 5"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 5"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 5"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 5"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 6"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 6"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 6"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 6"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 6"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 6"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 6"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 6"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 6"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 6"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 6"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 6"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 6"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 6"/>
<w:LsdException Locked="false" Priority="19" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtle Emphasis"/>
<w:LsdException Locked="false" Priority="21" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Emphasis"/>
<w:LsdException Locked="false" Priority="31" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtle Reference"/>
<w:LsdException Locked="false" Priority="32" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Reference"/>
<w:LsdException Locked="false" Priority="33" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Book Title"/>
<w:LsdException Locked="false" Priority="37" Name="Bibliography"/>
<w:LsdException Locked="false" Priority="39" QFormat="true" Name="TOC Heading"/>
</w:LatentStyles>
</xml><![endif]--><!--[if gte mso 10]>
<style>
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Table Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-qformat:yes;
mso-style-parent:"";
mso-padding-alt:0in 5.4pt 0in 5.4pt;
mso-para-margin-top:0in;
mso-para-margin-right:0in;
mso-para-margin-bottom:10.0pt;
mso-para-margin-left:0in;
line-height:115%;
mso-pagination:widow-orphan;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-ascii-font-family:Calibri;
mso-ascii-theme-font:minor-latin;
mso-hansi-font-family:Calibri;
mso-hansi-theme-font:minor-latin;
mso-bidi-font-family:"Times New Roman";
mso-bidi-theme-font:minor-bidi;}
</style>
<![endif]-->
<br />
<div class="MsoNormal">
I previously showed you my PIC32 proto board I made on
verroboard (<a href="http://tahmidmc.blogspot.com/2014/02/pic32-development-proto-board-on.html">http://tahmidmc.blogspot.com/2014/02/pic32-development-proto-board-on.html</a>).
To make the proto board “more of a product” and easy to reproduce, I was
working to make the proto board on a PCB.</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
I used ExpressSCH to draw the schematic, and used ExpressPCB
to design the PCB. Once designed, Professor Bruce Land got the PCB made from
ExpressPCB themselves.</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
The PCB is just to be a basic board with the PIC32MX250F128B placed on it. The power supply connections are provided as are external oscillator connections (if needed). Additionally, there is a nice convenient power supply input connector (standard 2.5mm jack/plug). All the IO pins along with power (Vin and +3.3V) and ground are placed on a SIL connector at the edge of the board so that the board can be conveniently placed on a breadboard for experimenting and prototyping (see pictures below).</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
It's a nice little 2-layer PCB measuring only 3.1 inches by 1.8 inches. I chose to use all through-hole components to make soldering and construction easy for everyone. Now let's look at the schematic, PCB mechanical view and some pictures of the actual PCB itself.</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
Here is the schematic: </div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGrsnyiJEBQ6FPrse_hZ05I-Q8_Q2esEuOpTBNqOJHYqMvYnkfM8RO5cO3iTxOjcPXrX11_i6WIWnbvaIkMTbejzK4Tuj4ADtsn1Lf2fREml2wrj3f5bDQRrsvsG9iyNlgE_Gg13C4z6J0/s1600/basic_layout_minimalist_i2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGrsnyiJEBQ6FPrse_hZ05I-Q8_Q2esEuOpTBNqOJHYqMvYnkfM8RO5cO3iTxOjcPXrX11_i6WIWnbvaIkMTbejzK4Tuj4ADtsn1Lf2fREml2wrj3f5bDQRrsvsG9iyNlgE_Gg13C4z6J0/s1600/basic_layout_minimalist_i2.png" height="482" width="640" /></a></div>
<div style="text-align: center;">
Fig. 1 - Schematic (Click on image to expand/zoom)</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="mso-no-proof: yes;"></span></div>
<div class="MsoNormal">
Here is a mechanical diagram of the PCB:</div>
<div class="MsoNormal">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjHDLjzGEsLHJagrEFfTcLekMeA0mdFpv8ynVClbjMY3g_ieESEqTwel0E1B_xNwS9lsMn9vScDN8yGoJ4pN6meNDIIsJTrUqhI9upDdLYyT6ZztbsD8Z6KL5h8qV2r578FDsjxfb4sAFU2/s1600/v1_i6.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjHDLjzGEsLHJagrEFfTcLekMeA0mdFpv8ynVClbjMY3g_ieESEqTwel0E1B_xNwS9lsMn9vScDN8yGoJ4pN6meNDIIsJTrUqhI9upDdLYyT6ZztbsD8Z6KL5h8qV2r578FDsjxfb4sAFU2/s1600/v1_i6.png" height="412" width="640" /></a></div>
<div class="MsoNormal" style="text-align: center;">
Fig. 2 - Mechanical diagram of PIC32 proto board PCB</div>
<div class="MsoNormal">
<span style="mso-no-proof: yes;"></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
You can find the ExpressSCH and ExpressPCB schematic and PCB
design files at the end of this article.</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
There are some key things to note here.</div>
<br />
<ul>
<li>Use a ua78M33C or similar regulator for wide
range voltage. Use an LDO voltage regulator if there is intention to power off
of USB. Be careful about the LDO maximum input voltage rating. Currently, as it
stands, the USB is not going to power the microcontroller (at least not
reliably) due to the dropout voltage of the ua78M33C regulator. A regulator
that can be used in its place so that the board can be powered either off of an
external supply or the USB is the MIC2940A-3.3. Here’s the datasheet if you’re
interested: <a href="http://www.micrel.com/_PDF/mic2940.pdf">http://www.micrel.com/_PDF/mic2940.pdf</a></li>
<li>I used the 0.4in spacing PDIP28 component in
ExpressPCB. I used a socket that allowed for that. But you may want to change it
to a 0.3in spacing PDIP 28 package. It’s fine and working now. But I will
change it in a later revision.</li>
<li>C4 is VCAP. It is required for the stable operation
of the PIC32MX250F128B. Use a low-ESR capacitor: defined by Microchip as having
an ESR lower than 1<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;">Ω</span></li>
<li>Mount X1, C6 and C7 onto the PCB only if there
is a plan to use the external oscillator. Here the external oscillator is a
standard crystal oscillator. If the internal oscillator is being used, don’t
mount X1, C6 and C7 so that the associated IO pins can be used. Since the
PIC32MX250F128B is only a 28-pin device, every single IO pin is valuable.</li>
<li>Variable resistor VR1 is used to supply a
variable voltage output to the PIC32MX250F128B pin 26, which is RB15 which is
also AN9. This is just to provide a variable voltage to the PIC32MX250F128B for
testing with ADC. There is a switch/jumper between the wiper of the variable
resistor and the PIC32MX250F128B RB15. When the switch is not closed or the
jumper is not shorted, the wiper is disconnected from the PIC32MX250F128B so
that RB15 can be used for other purposes, eg external input voltage sensing,
use as digital IO, etc.</li>
<li>“Debug LED” is connected to RA0 (PORTA bit 0<span style="font-family: Wingdings;"> --></span> pin 2) of the
PIC32MX250F128B.</li>
</ul>
<br />
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
Here are some pictures of my PCB:</div>
<div class="MsoNormal">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgdP9M2aliWouvVCeJwVyLm1Hpc3x0w7QddR3BReBEy3yXyU3BvPsPHeLzMtR-Gegiu7Mlm5kPWSM69U741UbSpDb3Y0aqtcFN1icinufiezSdzTu4aESmnklXf1Qd1vOATwksCuFsl-YZA/s1600/1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgdP9M2aliWouvVCeJwVyLm1Hpc3x0w7QddR3BReBEy3yXyU3BvPsPHeLzMtR-Gegiu7Mlm5kPWSM69U741UbSpDb3Y0aqtcFN1icinufiezSdzTu4aESmnklXf1Qd1vOATwksCuFsl-YZA/s1600/1.jpg" height="358" width="640" /></a></div>
<div class="" style="clear: both; text-align: center;">
Fig. 3 - PCB just being mounted with components</div>
<div class="" style="clear: both; text-align: center;">
<br /></div>
<div class="" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjpc2EbG9mubO0DZWaf4PpEVSZcnYZj_TUryNjZ7pPh5OtgcXgfxdDcBNLr0WZKYUXQ-1tSf0KTZutp6p0oeOpXXGYIYZxEJXRYjkWzUoteoKL6MhqOCBzSsViAGXsVeAthYJMzcj3rn-Jg/s1600/2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjpc2EbG9mubO0DZWaf4PpEVSZcnYZj_TUryNjZ7pPh5OtgcXgfxdDcBNLr0WZKYUXQ-1tSf0KTZutp6p0oeOpXXGYIYZxEJXRYjkWzUoteoKL6MhqOCBzSsViAGXsVeAthYJMzcj3rn-Jg/s1600/2.jpg" height="358" width="640" /></a></div>
<div class="" style="clear: both; text-align: center;">
Fig. 4 - PCB reverse side</div>
<div class="" style="clear: both; text-align: center;">
<br /></div>
<div class="" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgh3TR6RGbmrubZuwNJIVtsVAVPO7xGs57is7ImFjRcEPWgcdpRPZnedR2APYEvYMR6lvxKHcjhuoey_b3iJRJu48dgMhO9prFpGOFI4esFe4gUkV_U-D2gT3Gvq05CDSB4sm4YyXxZxYdP/s1600/3.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgh3TR6RGbmrubZuwNJIVtsVAVPO7xGs57is7ImFjRcEPWgcdpRPZnedR2APYEvYMR6lvxKHcjhuoey_b3iJRJu48dgMhO9prFpGOFI4esFe4gUkV_U-D2gT3Gvq05CDSB4sm4YyXxZxYdP/s1600/3.jpg" height="372" width="640" /></a></div>
<div class="" style="clear: both; text-align: center;">
Fig. 5 - PCB top view (ignore the glare)</div>
<div class="" style="clear: both; text-align: center;">
<br /></div>
<div class="" style="clear: both; text-align: center;">
<br /></div>
<div class="" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgyDEripuwA9daEPJBB8xmDDLUGIhxBNXrfjSFmSgQEpQ5_Np1Gtmp36-BBcZ90Dz-fLCN4hWH3KNPsO96Hr2X7QVHxXT6pMjbEunm7RhIls4DJz_RR-TFAkqJyyP3GaVU-H-LWg61Q4K1O/s1600/4.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgyDEripuwA9daEPJBB8xmDDLUGIhxBNXrfjSFmSgQEpQ5_Np1Gtmp36-BBcZ90Dz-fLCN4hWH3KNPsO96Hr2X7QVHxXT6pMjbEunm7RhIls4DJz_RR-TFAkqJyyP3GaVU-H-LWg61Q4K1O/s1600/4.jpg" height="378" width="640" /></a></div>
<div class="" style="clear: both; text-align: center;">
Fig. 6 - PCB placed onto breadboard</div>
<div class="" style="clear: both; text-align: center;">
<br /></div>
<div class="" style="clear: both; text-align: center;">
<br /></div>
<div class="" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiQtibLDdpAm9OJ4QWNqZgPEoqJ4O1xPfFdYGbNzXmvDpZH38FOWhySH2Wdo0Efbjc_2_zqNXLHTjGDymUB8Urv7981Nkj6ePSLWSx9R5PBtdkiaULVPCiZxjbmC-PFYHHUvEh6pE9SULgy/s1600/5.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiQtibLDdpAm9OJ4QWNqZgPEoqJ4O1xPfFdYGbNzXmvDpZH38FOWhySH2Wdo0Efbjc_2_zqNXLHTjGDymUB8Urv7981Nkj6ePSLWSx9R5PBtdkiaULVPCiZxjbmC-PFYHHUvEh6pE9SULgy/s1600/5.jpg" height="334" width="640" /></a></div>
<div class="MsoNormal" style="text-align: center;">
Fig. 7 - PCB placed onto breadboard - front view</div>
<div class="MsoNormal" style="text-align: center;">
<br /></div>
<div class="MsoNormal" style="text-align: center;">
<br /></div>
<div class="MsoNormal" style="text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhtzCfvAaQPQyTH6ue51Xz1CVBxNhKhVJWNS97g2fZOCNpuRXFzifLqrB9ORX5qUG02gwcNNNRZ-K9NUgFcnQVbKpTUT__-4OGPAeBqmOOCc3kj2csMrUJqsgTxEFvwxJsV0PkZamt9oJr_/s1600/6.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhtzCfvAaQPQyTH6ue51Xz1CVBxNhKhVJWNS97g2fZOCNpuRXFzifLqrB9ORX5qUG02gwcNNNRZ-K9NUgFcnQVbKpTUT__-4OGPAeBqmOOCc3kj2csMrUJqsgTxEFvwxJsV0PkZamt9oJr_/s1600/6.jpg" height="312" width="640" /></a></div>
<div class="MsoNormal" style="text-align: center;">
Fig. 8 - PCB placed on table - you can see the IO pins</div>
<div class="MsoNormal" style="text-align: center;">
<br /></div>
<div class="MsoNormal" style="text-align: center;">
<br /></div>
<div class="MsoNormal" style="text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLmB5NhGKuYS0Jwr3hmgkn6sbIIBTUZTg4tvn4ZI6nEpZefmI1hwEHwv3tU_6j56lszjnqFaf51lDsT5kSQCtiJzCkE4cQ0dAu5JvUJGfUgbX-LREPrKOnXO9rCrKKUXcnqrFkp8hZ2ieW/s1600/7.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLmB5NhGKuYS0Jwr3hmgkn6sbIIBTUZTg4tvn4ZI6nEpZefmI1hwEHwv3tU_6j56lszjnqFaf51lDsT5kSQCtiJzCkE4cQ0dAu5JvUJGfUgbX-LREPrKOnXO9rCrKKUXcnqrFkp8hZ2ieW/s1600/7.jpg" height="358" width="640" /></a></div>
<div class="MsoNormal" style="text-align: center;">
Fig. 9 - PICKIT3 connected to PCB</div>
<div class="MsoNormal" style="text-align: center;">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
Here are links to the .sch ExpressSCH schematic file:<br />
<a href="https://drive.google.com/file/d/0B4SoPFPRNziHU3pKMFFWSEdWOGs/edit?usp=sharing"><u>https://drive.google.com/file/d/0B4SoPFPRNziHU3pKMFFWSEdWOGs/edit?usp=sharing</u></a></div>
<div class="MsoNormal">
<a href="http://www.4shared.com/file/MEwFYLQAba/basic_layout_minimalist_i2.html"><u>http://www.4shared.com/file/MEwFYLQAba/basic_layout_minimalist_i2.html</u></a><br />
<br /></div>
<div class="MsoNormal">
Here are links to the .pcb ExpressPCB PCB file:<br />
<a href="https://drive.google.com/file/d/0B4SoPFPRNziHMWQtbVFHWU1JMXM/edit?usp=sharing"><u>https://drive.google.com/file/d/0B4SoPFPRNziHMWQtbVFHWU1JMXM/edit?usp=sharing</u></a><br />
<a href="http://www.4shared.com/file/SdMQQzTyce/v1_i6.html"><u>http://www.4shared.com/file/SdMQQzTyce/v1_i6.html </u></a></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
You need the ExpressPCB software package to view and edit
the .sch and .pcb files. You can get it from here: <a href="http://www.expresspcb.com/ExpressPCBHtm/Download.htm"><u>http://www.expresspcb.com/ExpressPCBHtm/Download.htm</u></a>
</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
Let me know what you think and I’d love to see what you do
with this board. I’ve done quite a few projects with my verroboard proto board and I'll be doing a series of small projects with this board. I’ll post them
here from time to time.</div>
Tahmidhttp://www.blogger.com/profile/09117804893438710050noreply@blogger.com4tag:blogger.com,1999:blog-6338993703407602171.post-9126659077850315302014-02-09T01:20:00.003-08:002014-02-09T01:22:02.652-08:00PIC32 Development: Proto board on verroboard<!--[if gte mso 9]><xml>
<w:WordDocument>
<w:View>Normal</w:View>
<w:Zoom>0</w:Zoom>
<w:TrackMoves/>
<w:TrackFormatting/>
<w:PunctuationKerning/>
<w:ValidateAgainstSchemas/>
<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
<w:IgnoreMixedContent>false</w:IgnoreMixedContent>
<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
<w:DoNotPromoteQF/>
<w:LidThemeOther>EN-US</w:LidThemeOther>
<w:LidThemeAsian>X-NONE</w:LidThemeAsian>
<w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript>
<w:Compatibility>
<w:BreakWrappedTables/>
<w:SnapToGridInCell/>
<w:WrapTextWithPunct/>
<w:UseAsianBreakRules/>
<w:DontGrowAutofit/>
<w:SplitPgBreakAndParaMark/>
<w:DontVertAlignCellWithSp/>
<w:DontBreakConstrainedForcedTables/>
<w:DontVertAlignInTxbx/>
<w:Word11KerningPairs/>
<w:CachedColBalance/>
</w:Compatibility>
<w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
<m:mathPr>
<m:mathFont m:val="Cambria Math"/>
<m:brkBin m:val="before"/>
<m:brkBinSub m:val="--"/>
<m:smallFrac m:val="off"/>
<m:dispDef/>
<m:lMargin m:val="0"/>
<m:rMargin m:val="0"/>
<m:defJc m:val="centerGroup"/>
<m:wrapIndent m:val="1440"/>
<m:intLim m:val="subSup"/>
<m:naryLim m:val="undOvr"/>
</m:mathPr></w:WordDocument>
</xml><![endif]--><br />
<!--[if gte mso 9]><xml>
<w:LatentStyles DefLockedState="false" DefUnhideWhenUsed="true"
DefSemiHidden="true" DefQFormat="false" DefPriority="99"
LatentStyleCount="267">
<w:LsdException Locked="false" Priority="0" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Normal"/>
<w:LsdException Locked="false" Priority="9" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="heading 1"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 2"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 3"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 4"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 5"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 6"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 7"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 8"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 9"/>
<w:LsdException Locked="false" Priority="39" Name="toc 1"/>
<w:LsdException Locked="false" Priority="39" Name="toc 2"/>
<w:LsdException Locked="false" Priority="39" Name="toc 3"/>
<w:LsdException Locked="false" Priority="39" Name="toc 4"/>
<w:LsdException Locked="false" Priority="39" Name="toc 5"/>
<w:LsdException Locked="false" Priority="39" Name="toc 6"/>
<w:LsdException Locked="false" Priority="39" Name="toc 7"/>
<w:LsdException Locked="false" Priority="39" Name="toc 8"/>
<w:LsdException Locked="false" Priority="39" Name="toc 9"/>
<w:LsdException Locked="false" Priority="35" QFormat="true" Name="caption"/>
<w:LsdException Locked="false" Priority="10" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Title"/>
<w:LsdException Locked="false" Priority="1" Name="Default Paragraph Font"/>
<w:LsdException Locked="false" Priority="11" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtitle"/>
<w:LsdException Locked="false" Priority="22" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Strong"/>
<w:LsdException Locked="false" Priority="20" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Emphasis"/>
<w:LsdException Locked="false" Priority="59" SemiHidden="false"
UnhideWhenUsed="false" Name="Table Grid"/>
<w:LsdException Locked="false" UnhideWhenUsed="false" Name="Placeholder Text"/>
<w:LsdException Locked="false" Priority="1" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="No Spacing"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 1"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 1"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 1"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 1"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 1"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 1"/>
<w:LsdException Locked="false" UnhideWhenUsed="false" Name="Revision"/>
<w:LsdException Locked="false" Priority="34" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="List Paragraph"/>
<w:LsdException Locked="false" Priority="29" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Quote"/>
<w:LsdException Locked="false" Priority="30" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Quote"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 1"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 1"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 1"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 1"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 1"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 1"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 1"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 1"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 2"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 2"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 2"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 2"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 2"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 2"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 2"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 2"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 2"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 2"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 2"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 2"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 2"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 2"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 3"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 3"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 3"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 3"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 3"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 3"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 3"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 3"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 3"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 3"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 3"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 3"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 3"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 3"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 4"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 4"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 4"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 4"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 4"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 4"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 4"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 4"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 4"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 4"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 4"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 4"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 4"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 4"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 5"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 5"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 5"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 5"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 5"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 5"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 5"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 5"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 5"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 5"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 5"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 5"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 5"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 5"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 6"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 6"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 6"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 6"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 6"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 6"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 6"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 6"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 6"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 6"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 6"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 6"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 6"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 6"/>
<w:LsdException Locked="false" Priority="19" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtle Emphasis"/>
<w:LsdException Locked="false" Priority="21" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Emphasis"/>
<w:LsdException Locked="false" Priority="31" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtle Reference"/>
<w:LsdException Locked="false" Priority="32" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Reference"/>
<w:LsdException Locked="false" Priority="33" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Book Title"/>
<w:LsdException Locked="false" Priority="37" Name="Bibliography"/>
<w:LsdException Locked="false" Priority="39" QFormat="true" Name="TOC Heading"/>
</w:LatentStyles>
</xml><![endif]--><!--[if gte mso 10]>
<style>
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Table Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-qformat:yes;
mso-style-parent:"";
mso-padding-alt:0in 5.4pt 0in 5.4pt;
mso-para-margin-top:0in;
mso-para-margin-right:0in;
mso-para-margin-bottom:10.0pt;
mso-para-margin-left:0in;
line-height:115%;
mso-pagination:widow-orphan;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-ascii-font-family:Calibri;
mso-ascii-theme-font:minor-latin;
mso-hansi-font-family:Calibri;
mso-hansi-theme-font:minor-latin;
mso-bidi-font-family:"Times New Roman";
mso-bidi-theme-font:minor-bidi;}
</style>
<![endif]-->
<br />
<div class="MsoNormal">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgVe4fykepWT2CL1kUEzKt1M2aOzC7Vd0_hwMXrdeIOydGnJvHkBo9fYAbfBM61LtBUmexW1jLLiNunwLH2Alr11HzH06OceX6F57HMGd4XrA02C7rB9fvZBdiM4ZdTwlLos0JycBaC4hNj/s1600/adc.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgVe4fykepWT2CL1kUEzKt1M2aOzC7Vd0_hwMXrdeIOydGnJvHkBo9fYAbfBM61LtBUmexW1jLLiNunwLH2Alr11HzH06OceX6F57HMGd4XrA02C7rB9fvZBdiM4ZdTwlLos0JycBaC4hNj/s1600/adc.jpg" height="402" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="MsoNormal" style="text-align: center;">
<u><b>My PIC32 protoboard in action</b><b> - Measuring the speed of the internal ADC and displaying it on the 7 Segment Display board</b></u> </div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
It’s been a while since I last posted. My second semester at
Cornell has begun and it <i>has </i>been busy.</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
My first semester ended mid December
2013. So I went back home to Dhaka, Bangladesh for winter break.</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
Unfortunately, due to the ongoing political crisis in
Bangladesh at the time, I could not spend too much time outside home. Thus I ended
up spending a lot of time on electronics. There were two aspects to this over
my winter break. One, I spent a lot of time with the PIC32, writing some code,
doing tests with the peripherals and making a “proto board”. That, I must admit,
was a lot of fun. It was a continuation of my independent study (see: <a href="http://tahmidmc.blogspot.com/2013/09/200000-views-ithaca-arm-and-dmips.html">http://tahmidmc.blogspot.com/2013/09/200000-views-ithaca-arm-and-dmips.html</a>
and <a href="http://www.tahmidmc.blogspot.com/2014/01/a-comparative-study-between-at91sam3x8e.html">http://www.tahmidmc.blogspot.com/2014/01/a-comparative-study-between-at91sam3x8e.html</a>).
The second part was me developing an AC-AC voltage stabilizer (more on that
later, in another article) and also toying around with the Arduino Due (also
part of my independent study).</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
I had previously used the Microstick II from Microchip for
experimenting with the PIC32. However, I felt a need to use a more “robust”
board for prototyping (don’t get me wrong; I’m not bashing the Microstick II –
it’s a neat little board). So, I decided to make one myself. I used a
verroboard and just put on the microcontroller and also the required basic
connections. For the microcontroller, I used the PIC32MX250F128B which comes in
a nice user-friendly PDIP28 package. This is the same microcontroller on the
Microstick II and is the same microcontroller I had been working on.</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
The basic layout of the board is:</div>
<br />
<ul>
<li><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;"><span style="font: 7.0pt "Times New Roman";"></span></span></span>There is an on-board 3.3V regulator for powering
the PIC32. I chose against using an LDO voltage regulator since I did not have
in hand any LDO regulator that can accept reasonably high voltages (by that I mean
about 12-16V). I wanted to use an external 12V or 15V power supply for powering
the board, so that I could use that same supply voltage for other stuff running
at the same time. Thus I used the TI ua78M33C voltage regulator that I had with
me (I had gotten them off of Mouser a while before going home).</li>
<li>Decoupling capacitors on the power lines.</li>
<li>A 10uF “filter capacitor” necessary for the
microcontroller. This capacitor is placed between the VCAP and VSS pins on the
microcontroller. The crucial part here is that, the capacitor must have
relatively low ESR (equivalent series resistance), defined by Microchip as
<1<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;">Ω</span>.
I had to go through my collection of capacitors and manually measure the
capacitors’ ESR using the ESR meter.</li>
<li><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;"><span style="font: 7.0pt "Times New Roman";"></span></span></span>A push-button for enabling/disabling the PIC32.
When pushed/closed, the PIC is disabled (MCLR – master clear – is held low).
When the switch is open, the PIC is enabled (MCLR is pulled up by a pull-up
resistor).</li>
<li>Connectors for taking connections/wires out of
the board onto a breadboard or other board. The connectors are connected so
that every single pin of the microcontroller is connected to one connector
pin/line.</li>
<li>ICSP (in-circuit serial programming) header to
allow in-circuit programming of the PIC32 using a Microchip PICKIT3
programmer/debugger.</li>
<li>An LED connected to RA0 (pin 2) of the PIC32.
This LED is used as a “debug LED” – just as an indicator of sorts that is already
connected on the board for use. LEDs are always used in circuits after all. I
chose to use RA0 for connecting the LED since this was the same pin to which
the LED was connected to on the Microstick II board.</li>
<li>A variable resistor. This is used to provide a
varying analog voltage (from 0V to 3.3V) to the PIC32 RB15 (AN9 – pin 26). This
was put on the board so that I could have an analog voltage for testing if/when
I needed it. However, since this won’t be necessary in every circuit and I might
want to use RB15 for something else, I put in a latching push switch which when
pushed/closed will connect the analog voltage (the wiper of the variable
resistor) to RB15 of the PIC. When the switch is open the wiper of the variable
resistor is NOT connected to RB15, freeing that pin up for other use.</li>
</ul>
<br />
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
That’s about it as far as the PIC32MX250F128B “proto board”
goes. There’s another board that I made on verroboard for testing – that’s the 3
digit 7 segment display board. This board consists of – you guessed it – a 3
digit 7 segment display. But the key thing is that it has driver transistors on
the board so that I don’t have to worry about drive current from the
microcontroller. There are 7 seven driver transistors BC547 working in the
common collector (emitter follower) mode to just act as an analog buffer and a
current amplifier. The display itself consists of 3 common cathode “digits”.
So, for each of the digit common cathodes, there is a driver transistor – I have
used the 2SD882 transistors. In all honesty, such a high capacity transistor is
not needed; but I did not have any BC337/PN2222A transistors in hand and this
was the only non-power transistor I had that was capable of withstanding more
than 100mA current.</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
I’ve done quite a few projects with these boards. I’ll be
posting these from time to time. For now, here are some pictures. </div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
Here’s a picture of the two boards along with some wiring
between them and some additional components on a breadboard.</div>
<div class="MsoNormal">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgM7z_uakooUQQgmEIW4HKh0B0VtE0t2uhFwHZ1PaMuShfaMvcsdWyphLAypKE8yJSqY7KCzBt2wby28PnKblH2NlXMBhTDPKr4c7qnnn2sDMOs6CYguuJ3F2URsXajERgYSQjc0xQwfxuh/s1600/basic_board.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgM7z_uakooUQQgmEIW4HKh0B0VtE0t2uhFwHZ1PaMuShfaMvcsdWyphLAypKE8yJSqY7KCzBt2wby28PnKblH2NlXMBhTDPKr4c7qnnn2sDMOs6CYguuJ3F2URsXajERgYSQjc0xQwfxuh/s1600/basic_board.jpg" height="470" width="640" /></a></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<!--[if gte mso 9]><xml>
<w:WordDocument>
<w:View>Normal</w:View>
<w:Zoom>0</w:Zoom>
<w:TrackMoves/>
<w:TrackFormatting/>
<w:PunctuationKerning/>
<w:ValidateAgainstSchemas/>
<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
<w:IgnoreMixedContent>false</w:IgnoreMixedContent>
<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
<w:DoNotPromoteQF/>
<w:LidThemeOther>EN-US</w:LidThemeOther>
<w:LidThemeAsian>X-NONE</w:LidThemeAsian>
<w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript>
<w:Compatibility>
<w:BreakWrappedTables/>
<w:SnapToGridInCell/>
<w:WrapTextWithPunct/>
<w:UseAsianBreakRules/>
<w:DontGrowAutofit/>
<w:SplitPgBreakAndParaMark/>
<w:DontVertAlignCellWithSp/>
<w:DontBreakConstrainedForcedTables/>
<w:DontVertAlignInTxbx/>
<w:Word11KerningPairs/>
<w:CachedColBalance/>
</w:Compatibility>
<w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
<m:mathPr>
<m:mathFont m:val="Cambria Math"/>
<m:brkBin m:val="before"/>
<m:brkBinSub m:val="--"/>
<m:smallFrac m:val="off"/>
<m:dispDef/>
<m:lMargin m:val="0"/>
<m:rMargin m:val="0"/>
<m:defJc m:val="centerGroup"/>
<m:wrapIndent m:val="1440"/>
<m:intLim m:val="subSup"/>
<m:naryLim m:val="undOvr"/>
</m:mathPr></w:WordDocument>
</xml><![endif]--></div>
<br />
<div class="MsoNormal">
<!--[if gte mso 9]><xml>
<w:LatentStyles DefLockedState="false" DefUnhideWhenUsed="true"
DefSemiHidden="true" DefQFormat="false" DefPriority="99"
LatentStyleCount="267">
<w:LsdException Locked="false" Priority="0" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Normal"/>
<w:LsdException Locked="false" Priority="9" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="heading 1"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 2"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 3"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 4"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 5"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 6"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 7"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 8"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 9"/>
<w:LsdException Locked="false" Priority="39" Name="toc 1"/>
<w:LsdException Locked="false" Priority="39" Name="toc 2"/>
<w:LsdException Locked="false" Priority="39" Name="toc 3"/>
<w:LsdException Locked="false" Priority="39" Name="toc 4"/>
<w:LsdException Locked="false" Priority="39" Name="toc 5"/>
<w:LsdException Locked="false" Priority="39" Name="toc 6"/>
<w:LsdException Locked="false" Priority="39" Name="toc 7"/>
<w:LsdException Locked="false" Priority="39" Name="toc 8"/>
<w:LsdException Locked="false" Priority="39" Name="toc 9"/>
<w:LsdException Locked="false" Priority="35" QFormat="true" Name="caption"/>
<w:LsdException Locked="false" Priority="10" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Title"/>
<w:LsdException Locked="false" Priority="1" Name="Default Paragraph Font"/>
<w:LsdException Locked="false" Priority="11" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtitle"/>
<w:LsdException Locked="false" Priority="22" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Strong"/>
<w:LsdException Locked="false" Priority="20" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Emphasis"/>
<w:LsdException Locked="false" Priority="59" SemiHidden="false"
UnhideWhenUsed="false" Name="Table Grid"/>
<w:LsdException Locked="false" UnhideWhenUsed="false" Name="Placeholder Text"/>
<w:LsdException Locked="false" Priority="1" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="No Spacing"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 1"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 1"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 1"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 1"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 1"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 1"/>
<w:LsdException Locked="false" UnhideWhenUsed="false" Name="Revision"/>
<w:LsdException Locked="false" Priority="34" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="List Paragraph"/>
<w:LsdException Locked="false" Priority="29" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Quote"/>
<w:LsdException Locked="false" Priority="30" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Quote"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 1"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 1"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 1"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 1"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 1"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 1"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 1"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 1"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 2"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 2"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 2"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 2"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 2"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 2"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 2"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 2"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 2"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 2"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 2"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 2"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 2"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 2"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 3"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 3"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 3"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 3"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 3"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 3"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 3"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 3"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 3"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 3"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 3"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 3"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 3"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 3"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 4"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 4"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 4"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 4"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 4"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 4"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 4"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 4"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 4"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 4"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 4"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 4"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 4"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 4"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 5"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 5"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 5"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 5"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 5"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 5"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 5"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 5"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 5"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 5"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 5"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 5"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 5"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 5"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 6"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 6"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 6"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 6"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 6"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 6"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 6"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 6"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 6"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 6"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 6"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 6"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 6"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 6"/>
<w:LsdException Locked="false" Priority="19" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtle Emphasis"/>
<w:LsdException Locked="false" Priority="21" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Emphasis"/>
<w:LsdException Locked="false" Priority="31" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtle Reference"/>
<w:LsdException Locked="false" Priority="32" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Reference"/>
<w:LsdException Locked="false" Priority="33" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Book Title"/>
<w:LsdException Locked="false" Priority="37" Name="Bibliography"/>
<w:LsdException Locked="false" Priority="39" QFormat="true" Name="TOC Heading"/>
</w:LatentStyles>
</xml><![endif]--><!--[if gte mso 10]>
<style>
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Table Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-qformat:yes;
mso-style-parent:"";
mso-padding-alt:0in 5.4pt 0in 5.4pt;
mso-para-margin-top:0in;
mso-para-margin-right:0in;
mso-para-margin-bottom:10.0pt;
mso-para-margin-left:0in;
line-height:115%;
mso-pagination:widow-orphan;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-ascii-font-family:Calibri;
mso-ascii-theme-font:minor-latin;
mso-hansi-font-family:Calibri;
mso-hansi-theme-font:minor-latin;
mso-bidi-font-family:"Times New Roman";
mso-bidi-theme-font:minor-bidi;}
</style>
<![endif]-->
</div>
<div class="MsoNormal">
Here’s one with the 7 segment display in action:</div>
<div class="MsoNormal">
<br /></div>
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZAWWma2DBVTNgX0hCtitQm4m4f8oIJB9-lgoZdkG7XIltQTW0MAraBFRDuwYEUv642WVjGMv869frAGkDUxY7d4UPh9Ed8HP9ppWVeslKmzUWTPlE6XbM4jwZgkLUnlI20J-CmRaHrNj-/s1600/boards_with_pickit3.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZAWWma2DBVTNgX0hCtitQm4m4f8oIJB9-lgoZdkG7XIltQTW0MAraBFRDuwYEUv642WVjGMv869frAGkDUxY7d4UPh9Ed8HP9ppWVeslKmzUWTPlE6XbM4jwZgkLUnlI20J-CmRaHrNj-/s1600/boards_with_pickit3.jpg" height="502" width="640" /></a></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
You can see the PICKIT3 connected as well.</div>
<div class="MsoNormal">
</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
Here’s a view of just the PIC32 protoboard:</div>
<div class="MsoNormal">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHdxgNoLV9NqWBYLfom2rGcAxp__V49oQQkqHVDDrHb46mQj62Ugz1qap4RspLtEDm1qfGpkrPlQkeiegLuqEcAR1ojHt2j4RuM4Qby6eCHRRfpXc5jqpMGX-T-f-YHYKCDNZPm4Ae1vK4/s1600/board_itself.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHdxgNoLV9NqWBYLfom2rGcAxp__V49oQQkqHVDDrHb46mQj62Ugz1qap4RspLtEDm1qfGpkrPlQkeiegLuqEcAR1ojHt2j4RuM4Qby6eCHRRfpXc5jqpMGX-T-f-YHYKCDNZPm4Ae1vK4/s1600/board_itself.jpg" height="640" width="590" /></a></div>
<div class="MsoNormal">
</div>
<br />Tahmidhttp://www.blogger.com/profile/09117804893438710050noreply@blogger.com1tag:blogger.com,1999:blog-6338993703407602171.post-52072392426203407582014-01-02T07:42:00.000-08:002015-06-30T21:41:46.544-07:00A Comparative Study between two 32-bit microcontrollers - the Atmel AT91SAM3X8E and the Microchip PIC32MX250F128B <span style="font-size: small;">As previously mentioned (<a href="http://tahmidmc.blogspot.com/2013/09/200000-views-ithaca-arm-and-dmips.html">http://tahmidmc.blogspot.com/2013/09/200000-views-ithaca-arm-and-dmips.html</a>) I’m doing an independent study under the
supervision of Professor Bruce Land here at Cornell University. A semester has passed and I will be continuing my independent study next semester.</span><br />
<div class="MsoNormal">
<br />
<span style="font-size: small;">The independent study (that I'm doing and will be continuing) is on exploring and comparing the peripheral modules of the Microchip PIC32MX250F128B (on the Microstick II platform) and the Atmel AT91SAM3X8E (on the Arduino Due platform). </span><span style="font-size: small;"><span style="font-size: small;">This semester, I've done a good amount of introductory exploration of the two 32-bit microcontrollers.</span></span><br />
<br />
<div class="MsoNormal">
<span style="font-size: small;">Here are the links to the datasheets
of the two microcontrollers on which my independent study is based:</span></div>
<div class="MsoNormal">
<span style="font-size: small;"><br /></span></div>
<div class="MsoNormal">
<span style="font-size: small;">AT91SAM3X8E: <a href="http://www.atmel.com/Images/doc11057.pdf">www.atmel.com/Images/doc11057.pdf</a><cite></cite></span></div>
<span style="font-size: small;"><cite><span style="font-family: "Calibri","sans-serif"; font-style: normal;">PIC32MX250F128B: </span></cite><a href="http://ww1.microchip.com/downloads/en/DeviceDoc/61168E.pdf">http://ww1.microchip.com/downloads/en/DeviceDoc/61168E.pdf</a></span><br />
<br />
<span style="font-size: small;">The Microchip PIC32MX250F128B is a 32-bit RISC microcontroller based on the MIPS M4K core. In this independent study, I have used the Microstick II platform provided by Microchip. The Atmel AT91SAM3X8E is a 32-bit ARM microcontroller based on the Cortex-M3 core. In this independent study, I have used the Arduino Due platform (which is based on the Atmel AT91SAM3X8E microcontroller) provided by Arduino.</span><br />
<br />
<span style="font-size: small;">Here is the report of my independent study for the first semester, where I have presented my findings and learning:</span><br />
<br />
<br />
<iframe height="480" src="https://drive.google.com/file/d/0B4SoPFPRNziHQ0NsT2dIMHVzcDA/preview" width="640"></iframe>
<br />
<br />
<br />
<span style="font-size: small;">After writing up the independent study, I have been playing more with both the controllers and experimenting on a bunch of stuff, including (but not limited to) tinkering with different compilers (mikroC PRO for PIC32 and XC32), a mini oscilloscope using the AT91SAM3X8E which I hope to expand into an ECG device, a similar project with the PIC32 and documenting all the different peripherals I'm working on.</span><br />
<br />
<span style="font-size: small;">I have posted my independent study report in the hope that it will help others who are studying on these two 32-bit controllers (PIC32MX250F128B and AT91SAM3X8E) and hope that it will help them get introduced to the controllers, the two microcontroller series (PIC32 and AT91SAM3) and the corresponding platforms (Microstick II and Arduino Due) mentioned in the independent study report. I will be posting more as I continue my independent study. Please let me know what you think in the comments section below! </span></div>
Tahmidhttp://www.blogger.com/profile/09117804893438710050noreply@blogger.com8tag:blogger.com,1999:blog-6338993703407602171.post-20004791293029379442013-11-03T17:41:00.001-08:002013-11-04T13:30:32.841-08:00Introduction to the PIC32 - The Basics, Getting Started, IO ports and the First Program<br />
<iframe height="700" src="https://drive.google.com/file/d/0B4SoPFPRNziHQlFUWHlTamFvajg/edit?usp=sharing" width="850"></iframe>
<br />
<br />
<br />
<a href="http://www.scribd.com/doc/181530072/Introduction-to-the-PIC32-The-Basics-Getting-Started-IO-ports-and-the-First-Program">View on Scribd</a><br />
<br />
<a href="https://drive.google.com/file/d/0B4SoPFPRNziHQlFUWHlTamFvajg/edit?usp=sharing">View in Google Docs</a> <br />
<br />
<a href="http://www.4shared.com/office/ZM2NuDvy/Introduction_to_the_PIC32_-_Th.html">Download PDF (4shared)</a>Tahmidhttp://www.blogger.com/profile/09117804893438710050noreply@blogger.com3tag:blogger.com,1999:blog-6338993703407602171.post-7736060280814445292013-09-24T22:39:00.002-07:002013-09-24T22:57:11.003-07:00200000 views, Ithaca, ARM and DMIPS<!--[if gte mso 9]><xml>
<w:WordDocument>
<w:View>Normal</w:View>
<w:Zoom>0</w:Zoom>
<w:TrackMoves/>
<w:TrackFormatting/>
<w:PunctuationKerning/>
<w:ValidateAgainstSchemas/>
<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
<w:IgnoreMixedContent>false</w:IgnoreMixedContent>
<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
<w:DoNotPromoteQF/>
<w:LidThemeOther>EN-US</w:LidThemeOther>
<w:LidThemeAsian>X-NONE</w:LidThemeAsian>
<w:LidThemeComplexScript>BN-BD</w:LidThemeComplexScript>
<w:Compatibility>
<w:BreakWrappedTables/>
<w:SnapToGridInCell/>
<w:WrapTextWithPunct/>
<w:UseAsianBreakRules/>
<w:DontGrowAutofit/>
<w:SplitPgBreakAndParaMark/>
<w:DontVertAlignCellWithSp/>
<w:DontBreakConstrainedForcedTables/>
<w:DontVertAlignInTxbx/>
<w:Word11KerningPairs/>
<w:CachedColBalance/>
</w:Compatibility>
<m:mathPr>
<m:mathFont m:val="Cambria Math"/>
<m:brkBin m:val="before"/>
<m:brkBinSub m:val="--"/>
<m:smallFrac m:val="off"/>
<m:dispDef/>
<m:lMargin m:val="0"/>
<m:rMargin m:val="0"/>
<m:defJc m:val="centerGroup"/>
<m:wrapIndent m:val="1440"/>
<m:intLim m:val="subSup"/>
<m:naryLim m:val="undOvr"/>
</m:mathPr></w:WordDocument>
</xml><![endif]--><br />
<!--[if gte mso 9]><xml>
<w:LatentStyles DefLockedState="false" DefUnhideWhenUsed="true"
DefSemiHidden="true" DefQFormat="false" DefPriority="99"
LatentStyleCount="267">
<w:LsdException Locked="false" Priority="0" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Normal"/>
<w:LsdException Locked="false" Priority="9" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="heading 1"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 2"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 3"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 4"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 5"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 6"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 7"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 8"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 9"/>
<w:LsdException Locked="false" Priority="39" Name="toc 1"/>
<w:LsdException Locked="false" Priority="39" Name="toc 2"/>
<w:LsdException Locked="false" Priority="39" Name="toc 3"/>
<w:LsdException Locked="false" Priority="39" Name="toc 4"/>
<w:LsdException Locked="false" Priority="39" Name="toc 5"/>
<w:LsdException Locked="false" Priority="39" Name="toc 6"/>
<w:LsdException Locked="false" Priority="39" Name="toc 7"/>
<w:LsdException Locked="false" Priority="39" Name="toc 8"/>
<w:LsdException Locked="false" Priority="39" Name="toc 9"/>
<w:LsdException Locked="false" Priority="35" QFormat="true" Name="caption"/>
<w:LsdException Locked="false" Priority="10" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Title"/>
<w:LsdException Locked="false" Priority="1" Name="Default Paragraph Font"/>
<w:LsdException Locked="false" Priority="11" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtitle"/>
<w:LsdException Locked="false" Priority="22" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Strong"/>
<w:LsdException Locked="false" Priority="20" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Emphasis"/>
<w:LsdException Locked="false" Priority="59" SemiHidden="false"
UnhideWhenUsed="false" Name="Table Grid"/>
<w:LsdException Locked="false" UnhideWhenUsed="false" Name="Placeholder Text"/>
<w:LsdException Locked="false" Priority="1" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="No Spacing"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 1"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 1"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 1"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 1"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 1"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 1"/>
<w:LsdException Locked="false" UnhideWhenUsed="false" Name="Revision"/>
<w:LsdException Locked="false" Priority="34" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="List Paragraph"/>
<w:LsdException Locked="false" Priority="29" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Quote"/>
<w:LsdException Locked="false" Priority="30" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Quote"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 1"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 1"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 1"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 1"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 1"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 1"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 1"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 1"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 2"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 2"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 2"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 2"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 2"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 2"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 2"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 2"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 2"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 2"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 2"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 2"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 2"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 2"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 3"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 3"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 3"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 3"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 3"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 3"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 3"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 3"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 3"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 3"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 3"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 3"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 3"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 3"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 4"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 4"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 4"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 4"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 4"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 4"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 4"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 4"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 4"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 4"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 4"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 4"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 4"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 4"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 5"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 5"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 5"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 5"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 5"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 5"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 5"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 5"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 5"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 5"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 5"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 5"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 5"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 5"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 6"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 6"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 6"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 6"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 6"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 6"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 6"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 6"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 6"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 6"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 6"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 6"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 6"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 6"/>
<w:LsdException Locked="false" Priority="19" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtle Emphasis"/>
<w:LsdException Locked="false" Priority="21" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Emphasis"/>
<w:LsdException Locked="false" Priority="31" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtle Reference"/>
<w:LsdException Locked="false" Priority="32" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Reference"/>
<w:LsdException Locked="false" Priority="33" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Book Title"/>
<w:LsdException Locked="false" Priority="37" Name="Bibliography"/>
<w:LsdException Locked="false" Priority="39" QFormat="true" Name="TOC Heading"/>
</w:LatentStyles>
</xml><![endif]--><!--[if gte mso 10]>
<style>
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Table Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-qformat:yes;
mso-style-parent:"";
mso-padding-alt:0in 5.4pt 0in 5.4pt;
mso-para-margin-top:0in;
mso-para-margin-right:0in;
mso-para-margin-bottom:10.0pt;
mso-para-margin-left:0in;
line-height:115%;
mso-pagination:widow-orphan;
font-size:11.0pt;
mso-bidi-font-size:14.0pt;
font-family:"Calibri","sans-serif";
mso-ascii-font-family:Calibri;
mso-ascii-theme-font:minor-latin;
mso-fareast-font-family:"Times New Roman";
mso-fareast-theme-font:minor-fareast;
mso-hansi-font-family:Calibri;
mso-hansi-theme-font:minor-latin;
mso-bidi-font-family:Vrinda;
mso-bidi-theme-font:minor-bidi;}
</style>
<![endif]-->
<br />
<div class="MsoNormal">
<span style="font-size: small;">My blog has now just crossed 200,000 views! I am extremely
happy that it’s gotten this many views and that I’ve been able to reach out to
so many people from all across the world. I love writing tutorials and articles
about microcontrollers, power electronics, SMPS and everything electronics! I
love it even more when my writing reaches out to people from all over the world
to help them learn something new or to find the solution to some problem! So, I
say thank you to all my readers and followers and hope that I have been able to
help you and that I can continue helping you!</span></div>
<div class="MsoNormal">
<span style="font-size: small;"><br /></span></div>
<div class="MsoNormal">
<span style="font-size: small;">If you have any topic in mind that you want me to write
about, please mention that in the comments. While I cannot promise you that I
will write up on it, I will certainly try.</span></div>
<div class="MsoNormal">
<span style="font-size: small;"><br /></span></div>
<div class="MsoNormal">
<span style="font-size: small;">University has started (if you’re wondering why the title
says Ithaca, that’s because Cornell University is located in Ithaca, New York,
USA) and it’s been a month. The work load is quite high, so I may take quite a
while to write some new article or tutorial or even to answer to your comments.
So, please be patient.</span></div>
<div class="MsoNormal">
<span style="font-size: small;"><br /></span></div>
<div class="MsoNormal">
<span style="font-size: small;">On that note, I’m doing an independent study under the
supervision of Professor Bruce Land here at Cornell University. My project is to
explore the different peripherals on the two microcontrollers: AT91SAM3X8E (ARM
Cortex M3) and the PIC32MX250F128B (DMIPS), write up documentation on the
different peripherals and then compare and contrast the two microcontrollers in
terms of peripheral functionality, ease of learning, ease of programming and
ease of use.</span></div>
<div class="MsoNormal">
<span style="font-size: small;"><br /></span></div>
<div class="MsoNormal">
<span style="font-size: small;">So, in the coming days, I will post quite a lot of articles
or tutorials based on these two microcontrollers and their peripherals.</span></div>
<div class="MsoNormal">
<span style="font-size: small;"><br /></span></div>
<div class="MsoNormal">
<span style="font-size: small;">If you’re interested, here are the links to the datasheets
of the two microcontrollers:</span></div>
<div class="MsoNormal">
<span style="font-size: small;"><br /></span></div>
<div class="MsoNormal">
<span style="font-size: small;">AT91SAM3X8E: <a href="http://www.atmel.com/Images/doc11057.pdf">www.atmel.com/Images/doc11057.pdf</a><cite></cite></span></div>
<div class="MsoNormal">
<span style="font-size: small;"><cite><span style="font-family: "Calibri","sans-serif"; font-style: normal;">PIC32MX250F128B: </span></cite><a href="http://ww1.microchip.com/downloads/en/DeviceDoc/61168E.pdf">http://ww1.microchip.com/downloads/en/DeviceDoc/61168E.pdf</a><cite></cite></span></div>
<div class="MsoNormal">
<span style="font-size: small;"><br /></span></div>
<div class="MsoNormal">
<span style="font-size: small;">For now, this is it. Again, if you want me to write up on
any topic, please mention that in the comments section. If you have any ideas,
suggestions or feedback for my blog, please let me know in your comments! Till
then, enjoy the blog and I hope it helps you in your projects and learning
endeavors.</span></div>
Tahmidhttp://www.blogger.com/profile/09117804893438710050noreply@blogger.com3