<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" >

<channel><title><![CDATA[VccGnd - Blog]]></title><link><![CDATA[http://blog.vccgnd.com/blog]]></link><description><![CDATA[Blog]]></description><pubDate>Wed, 30 Aug 2023 07:44:05 -0700</pubDate><generator>Weebly</generator><item><title><![CDATA[Crystal-Free USB Works!]]></title><link><![CDATA[http://blog.vccgnd.com/blog/crystal-free-usb-works]]></link><comments><![CDATA[http://blog.vccgnd.com/blog/crystal-free-usb-works#comments]]></comments><pubDate>Thu, 27 Feb 2014 23:22:38 GMT</pubDate><category><![CDATA[Crystal Free USB]]></category><category><![CDATA[PIC8]]></category><guid isPermaLink="false">http://blog.vccgnd.com/blog/crystal-free-usb-works</guid><description><![CDATA[ Finally got Crystal-Free USB working.&nbsp; I'm using the stock USB HID Keyboard demo from the June 15, 2013 edition of Microchip Libraries for Applications (MLA).&nbsp; On my PC, with the MLA folder installed at root level of C:\, it's the folder:       C:\microchip_solutions_v2013-06-15\USB\Device - HID - Keyboard       I use the PICDEM_FSUSB_K50 configuration and C18 (not XC8)&nbsp;compiler.&nbsp; Microchip's excellent online ticket support pointed me to this folder and helped me find an eva [...] ]]></description><content:encoded><![CDATA[<div class="paragraph" style="text-align:left;"> Finally got <a href="http://blog.vccgnd.com/4/post/2014/01/crystal-free-usb-pics.html">Crystal-Free USB</a> working.&nbsp; I'm using the stock USB HID Keyboard demo from the June 15, 2013 edition of <a title="" href="http://www.microchip.com/devtools/mla/"><em><u>Microchip Libraries for Applications (MLA)</u></em></a>.&nbsp; On my PC, with the MLA folder installed at root level of C:\, it's the folder: </div>  <div> <div id="139307580955873285" align="left" style="width: 100%; overflow-y: hidden;" class="wcustomhtml"> <div style="line-height: 110%; font-family: courier; font-size:medium; background:black; color:lime"> <br> C:\microchip_solutions_v2013-06-15\USB\Device - HID - Keyboard<br> <br> </div> </div> </div>  <div class="paragraph" style="text-align:left;"> I use the <em>PICDEM_FSUSB_K50</em> configuration and <em>C18</em> (not <em>XC8</em>)&nbsp;compiler.&nbsp; Microchip's excellent online ticket support pointed me to this folder and helped me find an evaluation copy of <em>C18</em>.<br> <span></span><br> <span></span>Instead of searching for the schematic of the target board, it was actually faster to just read the source code and infer the schematic.&nbsp; I skimmed it quickly, and replicated <em>LED1</em>, <em>LED2</em>, <em>LED3</em>, and <em>LED4</em> at RD0, RD1, RD2, and RD3, respectively, as well as <em>SW2</em> on RB4 and <em>SW3</em> on RB5.&nbsp; There is also a potentiometer that I ignored.&nbsp; It turned out though that only&nbsp;two of the LEDs and one of the switches are used, so I could've breadboarded less had I waited and read more of the code.&nbsp; The potentiometer that I ignored is not used in this demo, so ignoring it was correct.<br> <span></span><br> <span></span>I have not changed the code at all, but running the stock code on my breadboard has convinced me that Crystal-Free USB really does work.&nbsp; I also now have a starting point from which to make software changes.<br> <span></span><br> <span></span>The circuit is bus-powered.&nbsp; For now, I make use of a USB connector breakout board from SparkFun (the small red board into which I plug the cable).<br> <span></span><br> <span></span>The demo code emits a keyboard key everytime SW3 is pressed.&nbsp; It sends 'a' the first time, then 'b', then 'c', etc.&nbsp; Here's a video...&nbsp; <em>Look, Ma, No Crystals!</em><br> <br> <span></span><br> <span></span> </div>  <div> <div id="641122763731254837" align="left" style="width: 100%; overflow-y: hidden;" class="wcustomhtml"> <iframe frameborder="0" width="480" height="270" src="http://www.dailymotion.com/embed/video/x1dno6k" allowfullscreen=""></iframe><br> <a href="http://www.dailymotion.com/video/x1dno6k_pic18f45k50-hid-keyboard_tech" target="_blank">PIC18F45K50_HID_Keyboard</a> <i>by <a href="http://www.dailymotion.com/VccGnd" target="_blank">VccGnd</a></i> </div> </div> ]]></content:encoded></item><item><title><![CDATA[ADC, and less boring ways to verify]]></title><link><![CDATA[http://blog.vccgnd.com/blog/adc-and-less-boring-ways-to-verify]]></link><comments><![CDATA[http://blog.vccgnd.com/blog/adc-and-less-boring-ways-to-verify#comments]]></comments><pubDate>Fri, 21 Feb 2014 15:16:19 GMT</pubDate><category><![CDATA[Crystal Free USB]]></category><category><![CDATA[PIC8]]></category><guid isPermaLink="false">http://blog.vccgnd.com/blog/adc-and-less-boring-ways-to-verify</guid><description><![CDATA[ I successfully copied/pasted snippets of Analog-to-Digital conversion code using plib on the PIC18F25K50.&nbsp; Initially, I thought the potentiometer I was using was non-linear, as values tended to swing very quickly.&nbsp; It turned out that I had set the PORTC pins to digital in order to get the USART working.&nbsp; Once I made sure the pin I was using with the pot was set to analog input, it worked.  I'm using fairly safe and conservative configuration values for now (nowhere near the sampl [...] ]]></description><content:encoded><![CDATA[<div class="paragraph" style="text-align:left;"> I successfully copied/pasted snippets of Analog-to-Digital conversion code using plib on the PIC18F25K50.&nbsp; Initially, I thought the potentiometer I was using was non-linear, as values tended to swing very quickly.&nbsp; It turned out that I had set the PORTC pins to digital in order to get the USART working.&nbsp; Once I made sure the pin I was using with the pot was set to analog input, it worked.<br> <span></span><br> <span></span>I'm using fairly safe and conservative configuration values for now (nowhere near the sampling rates the A/D is capable of), so I should revisit this.&nbsp; However, it still means I have some placeholder code that can correctly read analog input.<br> <span></span><br> <span></span>The input values looked correct when printed out to putty via the UART...&nbsp; which seemed a very digital way of looking at analog values...&nbsp; which got me thinking...&nbsp; Can there be a more analog way to verify?<br> <span></span><br> <span></span>In the first video below, I use the old trick from Fortran / BASIC days of charting via a text screen by treating vertical as the X-axis and horizontal as the Y-axis.&nbsp; One would imagine viewing while rotating one's head 90 degrees, with forehead at 3-o'clock and chin at 9-o'clock.&nbsp; In this case, the X-axis is time and the Y-axis is the analog input value.<br> <span></span><br> <span></span>In the second video, I display a bar with length proportional to analog input value.&nbsp; For convenience, the value itself is printed next to the bar.&nbsp; There is no need for ncurses to keep the bar at the top of screen instead of scrolling away -- I just send a Ctrl-L ('\014') to clear the screen and position at upper-left corner before printing each bar.<br> <span></span><br> <span></span>Both these methods involve no code on the desktop -- I'm just running putty here.&nbsp; A useful trick though is changing putty's cursor from <em>block</em> to <em>underline</em> -- this reduces flicker.<br> <span></span> </div>  <div> <div id="994484018885433801" align="left" style="width: 100%; overflow-y: hidden;" class="wcustomhtml"> <iframe frameborder="0" width="480" height="270" src="http://www.dailymotion.com/embed/video/x1cvzrg" allowfullscreen=""></iframe><br> <a href="http://www.dailymotion.com/video/x1cvzrg_adcplotovertime_tech" target="_blank">ADCPlotOverTime</a> <i>by <a href="http://www.dailymotion.com/VccGnd" target="_blank">VccGnd</a></i> </div> </div>  <div> <div id="874634902878632294" align="left" style="width: 100%; overflow-y: hidden;" class="wcustomhtml"> <iframe frameborder="0" width="480" height="270" src="http://www.dailymotion.com/embed/video/x1cvyfy" allowfullscreen=""></iframe><br> <a href="http://www.dailymotion.com/video/x1cvyfy_adcbarwithvalue_tech" target="_blank">ADCBarWithValue</a> <i>by <a href="http://www.dailymotion.com/VccGnd" target="_blank">VccGnd</a></i> </div> </div> ]]></content:encoded></item><item><title><![CDATA[Nano-REPL on PIC18F25K50]]></title><link><![CDATA[http://blog.vccgnd.com/blog/nano-repl-on-pic18f25k50]]></link><comments><![CDATA[http://blog.vccgnd.com/blog/nano-repl-on-pic18f25k50#comments]]></comments><pubDate>Thu, 20 Feb 2014 01:41:29 GMT</pubDate><category><![CDATA[Crystal Free USB]]></category><category><![CDATA[PIC8]]></category><guid isPermaLink="false">http://blog.vccgnd.com/blog/nano-repl-on-pic18f25k50</guid><description><![CDATA[ The term&nbsp; REPL, for Read-eval-print loop, is quite in vogue these days.&nbsp; REPLs used to just be called interpreters, a term every 80's computer user was familiar with since in those days computers booted into BASIC.  Well, I made a Nano-REPL&nbsp;with a&nbsp;breadboarded PIC18F25K50.&nbsp; Here I have it connected to the PC via the USART and an FTDI module (not using on-chip USB yet), and interacting with putty.&nbsp; It does not wait for you to hit ENTER to evaluate your command.&nbsp [...] ]]></description><content:encoded><![CDATA[<div class="paragraph" style="text-align:left;"> The term<a title="" href="http://en.wikipedia.org/wiki/Read%E2%80%93eval%E2%80%93print_loop">&nbsp; <em>REPL</em>, for <em>Read-eval-print loop</em></a>, is quite in vogue these days.&nbsp; REPLs used to just be called interpreters, a term every 80's computer user was familiar with since in those days computers booted into BASIC.<br> <span></span><br> <span></span>Well, I made a Nano-REPL&nbsp;with a&nbsp;breadboarded PIC18F25K50.&nbsp; Here I have it connected to the PC via the USART and an FTDI module (not using on-chip USB yet), and interacting with <a title="" href="http://www.chiark.greenend.org.uk/~sgtatham/putty/"><em>putty</em></a>.&nbsp; It does not wait for you to hit ENTER to evaluate your command.&nbsp; All commands are single-character tokens.&nbsp; '1' is taken to mean turn on the LED.&nbsp; '0' means turn off the LED.&nbsp; All other tokens are considered comments.&nbsp; The print part of the REPL is to echo what you type, while the result of the eval is clearly seen from the LED on the breadboard.<br> <span></span><br> <span></span>Okay, really, all I have here is&nbsp;proof that I can use the&nbsp;plib USART routines in bidirectional mode correctly :-)&nbsp; Next up will be to try out the plib routines for analog input, then eventually, crystal-free USB.<br> <span></span> </div>  <div> <div id="109996603226172731" align="left" style="width: 100%; overflow-y: hidden;" class="wcustomhtml"> <iframe frameborder="0" width="480" height="270" src="http://www.dailymotion.com/embed/video/x1cqhii" allowfullscreen=""></iframe><br> <a href="http://www.dailymotion.com/video/x1cqhii_pic18f25k50nanorepl-1_tech" target="_blank">PIC18F25K50NanoREPL_1</a> <i>by <a href="http://www.dailymotion.com/VccGnd" target="_blank">VccGnd</a></i> </div> </div> ]]></content:encoded></item><item><title><![CDATA[plib]]></title><link><![CDATA[http://blog.vccgnd.com/blog/plib]]></link><comments><![CDATA[http://blog.vccgnd.com/blog/plib#comments]]></comments><pubDate>Thu, 20 Feb 2014 01:19:15 GMT</pubDate><category><![CDATA[Crystal Free USB]]></category><category><![CDATA[PIC8]]></category><guid isPermaLink="false">http://blog.vccgnd.com/blog/plib</guid><description><![CDATA[Microchip has a library called plib, for Peripheral Library, that abstracts some of the very chip-specific magic bit settings that one needs to deal with when programming microcontrollers.&nbsp; You still need to deal with magic numbers, e.g. when opening the serial port you still need to pass in a number that is the result of a formula involving oscillator frequency and desired baud rate.plib is not available for the PIC16F series but is available for the PIC18F series.&nbsp; It is also availab [...] ]]></description><content:encoded><![CDATA[<div class="paragraph" style="text-align:left;">Microchip has a library called <em>plib</em>, for Peripheral Library, that abstracts <em>some</em> of the very chip-specific magic bit settings that one needs to deal with when programming microcontrollers.&nbsp; You still need to deal with magic numbers, e.g. when opening the serial port you still need to pass in a number that is the result of a formula involving oscillator frequency and desired baud rate.<br /><span></span><br />plib is not available for the PIC16F series but is available for the PIC18F series.&nbsp; It is also available for PIC32s, but it's not clear if Microchip made an&nbsp;attempt made at API compatibility.<br /><span></span><br /><span></span>I'll play a bit with the PIC18F25K50 using plib so I can prototype code slightly faster.&nbsp; Once I have working code, I can then make it work on the PIC16F1459 without plib.<br /><span></span></div>]]></content:encoded></item><item><title><![CDATA[Blinky on PIC16F1459 PCB]]></title><link><![CDATA[http://blog.vccgnd.com/blog/blinky-on-pic16f1459-pcb]]></link><comments><![CDATA[http://blog.vccgnd.com/blog/blinky-on-pic16f1459-pcb#comments]]></comments><pubDate>Thu, 20 Feb 2014 00:34:41 GMT</pubDate><category><![CDATA[Crystal Free USB]]></category><category><![CDATA[PCB]]></category><category><![CDATA[PIC8]]></category><guid isPermaLink="false">http://blog.vccgnd.com/blog/blinky-on-pic16f1459-pcb</guid><description><![CDATA[ Despite the mistakes with my PCB, it's salvageable for simple circuits.&nbsp; I'm abandoning one due to poor soldering (it would be a lot of work to repair), but the other two I received from OSH Park can be put to use.&nbsp; I will still spin a new version though.  Since the crystal is optional, I am reusing one of the crystal pins as GPIO RA4.&nbsp; I also&nbsp;"convinced" the .2"-spaced capacitors to squeeze into .1" spacing.       WorkhorsePIC16F1459Blinking by VccGnd    [...] ]]></description><content:encoded><![CDATA[<div class="paragraph" style="text-align:left;"> Despite the mistakes with my PCB, it's salvageable for simple circuits.&nbsp; I'm abandoning one due to poor soldering (it would be a lot of work to repair), but the other two I received from OSH Park can be put to use.&nbsp; I will still spin a new version though.<br> <span></span><br> <span></span>Since the crystal is optional, I am reusing one of the crystal pins as GPIO RA4.&nbsp; I also&nbsp;"convinced" the .2"-spaced capacitors to squeeze into .1" spacing.<br> <span></span> </div>  <div> <div id="148015897418301652" align="left" style="width: 100%; overflow-y: hidden;" class="wcustomhtml"> <iframe frameborder="0" width="480" height="270" src="http://www.dailymotion.com/embed/video/x1cqac7" allowfullscreen=""></iframe><br> <a href="http://www.dailymotion.com/video/x1cqac7_workhorsepic16f1459blinking_tech" target="_blank">WorkhorsePIC16F1459Blinking</a> <i>by <a href="http://www.dailymotion.com/VccGnd" target="_blank">VccGnd</a></i> </div> </div> ]]></content:encoded></item><item><title><![CDATA[Right-angle Pin Headers with PICkit3]]></title><link><![CDATA[http://blog.vccgnd.com/blog/right-angle-pin-headers-with-pickit3]]></link><comments><![CDATA[http://blog.vccgnd.com/blog/right-angle-pin-headers-with-pickit3#comments]]></comments><pubDate>Thu, 20 Feb 2014 00:22:25 GMT</pubDate><category><![CDATA[Crystal Free USB]]></category><category><![CDATA[PCB]]></category><category><![CDATA[PIC8]]></category><guid isPermaLink="false">http://blog.vccgnd.com/blog/right-angle-pin-headers-with-pickit3</guid><description><![CDATA[Using right-angle headers with PICkit3 was a good decision.        [...] ]]></description><content:encoded><![CDATA[<div class="paragraph" style="text-align:left;">Using right-angle headers with PICkit3 was a good decision.</div>  <div><div class="wsite-image wsite-image-border-thin " style="padding-top:10px;padding-bottom:10px;margin-left:0;margin-right:0;text-align:center"> <a> <img src="http://blog.vccgnd.com/uploads/3/1/3/7/3137615/890663_orig.jpg" alt="Picture" style="width:100%;max-width:648px" /> </a> <div style="display:block;font-size:90%"></div> </div></div>]]></content:encoded></item><item><title><![CDATA[FTDI Module as Power Supply]]></title><link><![CDATA[http://blog.vccgnd.com/blog/ftdi-module-as-power-supply]]></link><comments><![CDATA[http://blog.vccgnd.com/blog/ftdi-module-as-power-supply#comments]]></comments><pubDate>Thu, 20 Feb 2014 00:20:54 GMT</pubDate><category><![CDATA[Crystal Free USB]]></category><category><![CDATA[dev boards]]></category><category><![CDATA[PCB]]></category><category><![CDATA[PIC8]]></category><guid isPermaLink="false">http://blog.vccgnd.com/blog/ftdi-module-as-power-supply</guid><description><![CDATA[Those USB FTDI modules work great as power supplies during testing!&nbsp; I'm not using the serial lines at all here.        [...] ]]></description><content:encoded><![CDATA[<div class="paragraph" style="text-align:left;">Those USB FTDI modules work great as power supplies during testing!&nbsp; I'm not using the serial lines at all here.</div>  <div><div class="wsite-image wsite-image-border-thin " style="padding-top:10px;padding-bottom:10px;margin-left:0;margin-right:0;text-align:center"> <a> <img src="http://blog.vccgnd.com/uploads/3/1/3/7/3137615/9853311_orig.jpg" alt="Picture" style="width:100%;max-width:648px" /> </a> <div style="display:block;font-size:90%"></div> </div></div>]]></content:encoded></item><item><title><![CDATA[VUSB3V3 Capacitor and PGD/PGC resistors]]></title><link><![CDATA[http://blog.vccgnd.com/blog/vusb3v3-capacitor-and-pgdpgc-resistors]]></link><comments><![CDATA[http://blog.vccgnd.com/blog/vusb3v3-capacitor-and-pgdpgc-resistors#comments]]></comments><pubDate>Thu, 20 Feb 2014 00:18:45 GMT</pubDate><category><![CDATA[Crystal Free USB]]></category><category><![CDATA[PCB]]></category><category><![CDATA[PIC8]]></category><guid isPermaLink="false">http://blog.vccgnd.com/blog/vusb3v3-capacitor-and-pgdpgc-resistors</guid><description><![CDATA[The PIC16F1459 has a pin called VUSB3V3.&nbsp; An internal LDO generates 3.3V for use with USB.&nbsp; An external capacitor of 0.47uF should be placed between this pin and ground.When I initially populated my board, and tried to get something going quickly, I thought this would only be necessary once I started using&nbsp;USB.&nbsp; However, without this, PICkit3 sees an ID of zero and fails to program the chip.&nbsp; Various web pages mention that an ID of zero usually means power issues, and su [...] ]]></description><content:encoded><![CDATA[<div class="paragraph" style="text-align:left;">The PIC16F1459 has a pin called VUSB3V3.&nbsp; An internal LDO generates 3.3V for use with USB.&nbsp; An external capacitor of 0.47uF should be placed between this pin and ground.<br /><span></span><br /><span></span>When I initially populated my board, and tried to get something going quickly, I thought this would only be necessary once I started using&nbsp;USB.&nbsp; However, without this, PICkit3 sees an ID of zero and fails to program the chip.&nbsp; Various web pages mention that an ID of zero usually means power issues, and sure enough, when I populated this capacitor, PICkit3 started seeing the correct ID.<br /><span></span><br /><span></span>After getting the correct ID, I also had to remove the 100&Omega; resistors on the PGC/PGD paths to actually get programming going.&nbsp; Some sample circuits have these for protection, but others say to avoid these.<br /><span></span></div>]]></content:encoded></item><item><title><![CDATA[PCB Mistakes]]></title><link><![CDATA[http://blog.vccgnd.com/blog/pcb-mistakes]]></link><comments><![CDATA[http://blog.vccgnd.com/blog/pcb-mistakes#comments]]></comments><pubDate>Wed, 19 Feb 2014 17:19:16 GMT</pubDate><category><![CDATA[Crystal Free USB]]></category><category><![CDATA[PCB]]></category><guid isPermaLink="false">http://blog.vccgnd.com/blog/pcb-mistakes</guid><description><![CDATA[I made mistakes with my PCB.&nbsp; For capacitors, I used DipTrace's CAP part from the Discrete library.&nbsp; This had a footprint with holes .1" apart.&nbsp; My capacitors needed .2" spacing.&nbsp; CAP200 from the Discrete library would've worked.For the ferrite bead, I used IND from the Discrete library.&nbsp; The footprint's holes were too small for the ferrite bead's leads to go through.&nbsp; Hole sizes about same as for pin headers would've worked.&nbsp; I'll probably make a copy of the I [...] ]]></description><content:encoded><![CDATA[<div class="paragraph" style="text-align:left;">I made mistakes with my PCB.&nbsp; For capacitors, I used DipTrace's <em>CAP</em> part from the <em>Discrete</em> library.&nbsp; This had a footprint with holes .1" apart.&nbsp; My capacitors needed .2" spacing.&nbsp; <em>CAP200</em> from the <em>Discrete</em> library would've worked.<br /><span></span><br /><span></span>For the ferrite bead, I used <em>IND</em> from the <em>Discrete</em> library.&nbsp; The footprint's holes were too small for the ferrite bead's leads to go through.&nbsp; Hole sizes about same as for pin headers would've worked.&nbsp; I'll probably make a copy of the <em>IND</em> part (to take advantage of its symbol&nbsp;in Schematic view)&nbsp;and replace the footprint in the copy.<br /><span></span></div>  <div><div class="wsite-image wsite-image-border-thin " style="padding-top:10px;padding-bottom:10px;margin-left:0;margin-right:0;text-align:center"> <a> <img src="http://blog.vccgnd.com/uploads/3/1/3/7/3137615/2828401_orig.jpg" alt="Picture" style="width:100%;max-width:800px" /> </a> <div style="display:block;font-size:90%"></div> </div></div>]]></content:encoded></item><item><title><![CDATA[Workhorse PIC16F1459 PCBs Arrived]]></title><link><![CDATA[http://blog.vccgnd.com/blog/workhorse-pic16f1459-pcbs-arrived]]></link><comments><![CDATA[http://blog.vccgnd.com/blog/workhorse-pic16f1459-pcbs-arrived#comments]]></comments><pubDate>Tue, 04 Feb 2014 02:02:39 GMT</pubDate><category><![CDATA[Crystal Free USB]]></category><category><![CDATA[PCB]]></category><category><![CDATA[PIC8]]></category><guid isPermaLink="false">http://blog.vccgnd.com/blog/workhorse-pic16f1459-pcbs-arrived</guid><description><![CDATA[Order sent to OSH Park on January 24; PCBs arrived February 3rd.&nbsp; Just 10 days!&nbsp; $17.25 for three PCBs.        [...] ]]></description><content:encoded><![CDATA[<div class="paragraph" style="text-align:left;">Order sent to OSH Park on January 24; PCBs arrived February 3rd.&nbsp; Just 10 days!&nbsp; $17.25 for <em>three</em> PCBs.</div>  <div><div class="wsite-image wsite-image-border-thin " style="padding-top:10px;padding-bottom:10px;margin-left:0;margin-right:0;text-align:center"> <a> <img src="http://blog.vccgnd.com/uploads/3/1/3/7/3137615/4289003_orig.jpg" alt="Picture" style="width:100%;max-width:420px" /> </a> <div style="display:block;font-size:90%"></div> </div></div>]]></content:encoded></item></channel></rss>