Q&A: PIC Programmer, Oscilloscope

I get very specific questions via my contact form, but also questions about more general issues that might be of interest to a larger audience. I’m going to start posting the latter category here.

PIC Programmer

Trey asks:

Do you have any recommendations regarding a Microchip programmer? There is the PicKit 2 and the Pickit 3. I have read that there are/were issues with the PicKit 3. I know you have used Microchip parts in your designs, but was wondering what your opinion was?

Trey, I’ve never used a PIC that wasn’t already preprogrammed with the LogoChip environment, so I have no experience with PIC programmers.

After reading through PIC and Atmel datasheets in considerable detail to access hardware features on both platforms, my opinion is that I’ll never use a PIC. That’s based on a couple dozen small things that I don’t even remember any more, but which added up to a pretty powerful opinion that Atmel builds a much better thought-out microcontroller that’s much easier to use.

But … that’s not the answer you were looking for. Readers with PIC experience, can you address Trey’s question? Please clearly phrase your responses as statements of opinion (like my opinion above, which is nothing more than an opinion) or as statements of fact with links to supporting information.

Oscilloscope

I am just now starting my journey into electronics and was wondering if you have any recommendations for any particular make/model of oscilloscope?

For someone starting in electronics, before an oscilloscope, I would recommend:

  • A $3 multimeter. I’ve started buying a few of these whenever I go to Harbor Freight and find them on sale, and I give them away like candy. Ace Hardware also sometimes has cheap meters in the dump bin.

    Is this as accurate as a Fluke? Of course not — but for basic electronics troubleshooting, this is more than adequate. The one useful function it lacks is a beeper for continuity testing — you do have to look up at the screen to read low resistance.
  • A breadboard and some components with a list of projects to try. I’d suggest Adafruit’s $50 Arduino budget pack, $65 Arduino starter pack, or $85 Arduino experimentation kit. Even if you’re not that interested in embedded design, the Arduino is a great platform for trying things out and interfacing to the analog electronics, and the Adafruit kits provide a list of experiments to use as a starting point and get the ideas flowing.

But if you’re already doing PIC programming, you seem to be well past the resistors-and-LEDs stage. If you really need a way to visualize signals in order to progress, my oscilloscope recommendation would be whatever working scope you can get for the lowest price, making sure that you do end up with at least one probe (or find a cheap one on eBay).

I paid $25 for an old, used scope about 20 years ago and have only upgraded to a better scope in the last couple of years — which is 20 years old, which I got from a friend of a friend, and which I haven’t put on my bench and started using yet.

The two times I’ve used a different scope are when I found a cheap scope with X-Y inputs that I use for troubleshooting vector arcade game displays, and when I borrowed a digital Tek scope for doing some precise high-frequency measurements.

Granted, I don’t use my scope for calibrating circuits. If you need to do that, you need a better scope, and one that’s calibrated, and that’s going to cost real money. But if visualization is what you’re after, then the cheapest scope that works will do the job.

11 Responses to “Q&A: PIC Programmer, Oscilloscope”

  1. dfbbscgb says:

    PICs generally seems to have better hardware peripheral support such as USB.
    The newer PIC microcontrollers have a better architecture and support GCC.

    When I started programming PIC microcontrollers I had been using open source tools for so long I forgot how bad using closed source compilers and libraries is. I have since switched to using AVR to avoid dealing with MPLAB.

    Anyways in terms of PIC programmers here is what I suggest.
    http://www.sparkfun.com/commerce/product_info.php?products_id=9973
    or the Olimex ICD2 clone

    The main things you need in a programmer are USB, and external power. Don’t buy a programmer without both of those.

  2. Asm says:

    My two cents:

    PICkit2/3 – there’s a great discussion about them here: http://forum.sparkfun.com/viewtopic.php?f=4&t=20233 – personally, I’d probably buy a PICkit 3. I currently use an ICD2 clone which turned out to be a somewhat bad choice, as it’s vaguely annoying in some ways, and too expensive. Plus I never use the debug function.

    Also, much of the perceived “problems” with the PICkit3 stem from the EEVBlog review of it, which (as usual) largely thumps a few issues that are rather minor. (Slower programming on a few rare chips… oh, and the LEDs are dim. Whoop.)

    Oscilloscopes: What is your budget? I use a GW Instek GDS-2104 (4ch, 100 MHz, $1500), which is pretty handy for debugging serial comms and the like, and I’ve yet to run into any situation where it’s inadequate. I started out with a 1-channel analogue scope, and decided that it was just more frustration than it was worth.

    So if you have a few bucks to cough up, I’d recommend a passable DSO – the fairly popular Rigol DS1052E is $400. If your budget is “as cheap as possible”, I’d shop around eBay for a cheap used scope – just make sure it has two working channels.

    In closing – do NOT buy the various “PC oscilloscopes” that flood the market. They’re _shit_, and unless your usage scenarios fall into a few narrow areas (where you might as well buy a DAQ card), will not do what you want.

  3. J. Peterson says:

    RE: PICs – I think the PICs get a bad rap because of the bizarre architectures of their older eight bit devices. The newer chips, such as the PIC24F and dsPIC30 series, are cheap, easy to program in C and easy to interface. See Ian Lesnet’s designs for some great examples.

    If you’re seriously developing and debugging PIC code you’ll want to get something like the ICD2 or ICD3 (the latter is somewhat faster, perhaps important if you’re downloading Linux to a 32 bit PIC). These allow you to do “in circuit debugging” with Microchip’s MPLAB environment.

    For lighter use – downloading existing software, etc. the PicKit II is excellent – cheap, simple, and open source. It even has modes for doing serial I/O and acting as a simple logic analyzer. It also has the ability to program chips at the touch of a button, very handy if you’ve got a batch of chips to program.

    RE: Oscilloscopes: Another option to consider is “USB” scopes. This is essentially a little box you plug in to your PC, letting you use your PC’s screen to view the waveforms and set the scope controls. These are somewhat less expensive and use up less space on your bench (assuming you’ve already got a computer there). I’ve been using a BitScope, it works reasonably well up to a 1MHz or so, and has a handy logic analyzer as well. There are several others to choose from.

  4. Jon says:

    The PICkit 2 is my recommendation unless some feature of the PICkit 3 is specifically needed. It’s cheap and works well. The added UART tool and simple logic analyzer are great features too. Hmmm…. I see I made almost this exact comment in one of the Sparkfun links above.

    Regarding the Olimex programmers that Sparkfun sells, just say no. They are more expensive than the PICkit 2/3 and don’t work well. See this link: http://forum.sparkfun.com/viewtopic.php?f=4&t=22117

    Regarding PICkit 2 use, there are a number of articles and tutorials at http://www.digital-diy.com

  5. John Wilson says:

    Any USB oscilloscope is only good for about 20,000 – 50,000 khz. At least, that’s been my experience.

    If you’re doing audio, and you make some appropriate protection circuitry, in a pinch you can record it using your pc sound card, and then open the recorded file in an audio editor and zoom in really close.

  6. John Laur says:

    When you need a scope, only a scope will do the job. However for most hobbyists these days playing with arduino and other digital electronics, it’s not always as useful as many other tools. In particular, a logic analyzer is probably going to be more useful than a scope in a lot of cases where you are dealing with chip to chip communications with i2c, pwm, spi, usb, serial, or shift registers.

    So what are some nice logic analyzer tools for the hobbyist?

    The Saleae USB Logic analyzer is a good unit at $150 http://www.saleae.com

    The USBee SX is $170 and has a comparable set of features and my be a little bit nicer depending on your motives http://www.usbee.com/. Out of the box it decodes a couple more protocols and can also act as a signal generator which arguably justify the price difference. Note though that the Saleae unit basically forced USBee to bring their entry level hardware and software into this price range, so their other stuff may be overpriced, but at the very least they have options for ‘moving up’ which Saleae does not.

    For scopes, there are a couple of really attractive tinkerer-grade tools:
    The DSO nano is a little handheld 2 channel 1MHz scope built out of portable mp3 player type hardware – really a great deal for $100. http://www.seedstuido.com/

    Another nice little scope is the Rigol DS1052E. It’s a 2 channel 50MHz scope which is already priced fairly at around $350, but considering there is a very simple serial command that changes it to a 100MHz scope, it’s pretty well a bargain-basement piece of gear.

    A final helpful tool to throw in the bag would be the Bus Pirate. This thing has quite a learning curve but for $30 really can’t be beat for what it does.

  7. John Laur says:

    Here are a few links on the Rigol DS1052E hack:

    http://oreskovic.me/wp/?p=27

    http://www.eevblog.com/2010/03/31/eevblog-70-turn-your-rigol-ds1052e-oscilloscope-into-a-100mhz-ds1102e/

    A lot more info on the internals and modifications to extend the functionality of this scope are available here:

    http://www.eevblog.com/forum/index.php?topic=30.0

  8. Asm says:

    Well, I’d recommend against the DSO nano (proper link: http://www.seeedstudio.com/ ). It’s a toy, not an oscilloscope.

    Let’s do a quick comparison: The Nano has 1 MSPS sampling and 1 MHz bandwidth. The Rigol has 1 GSPS sampling and 50/100 MHz bandwidth. The Rigol has 4x as much memory, 5x sensitivity. The Rigol has FFT and other math operators, the Nano doesn’t. The Rigol handles up to 300 V on a channel without dying, the Nano 80 V. This is handy in case something goes wrong and you suddenly end up probing the mains current. When that happens, you want to generate as little of the magic blue smoke as possible.

    You get a lot more scope for the money – and a scope built by a test equipment maker, not a random electronics project maker.

    Logic analyzers: Handy pieces of equipment, but I’d wait until I saw the need for one before buying it. They’re one of the few pieces of test gear that works better hooked up to a PC than standalone, in any event.

  9. DanPIC32 says:

    Hello,

    I would recommend a PICkit 2 for general programming, although I currently utilize a junebug from blueroomelectronics.

  10. David says:

    I second the notion that the DSO Nano is a pretty basic scope, edging more into toy. The one I have exhibits induced noise issues confused the heck outta me for an hour or so, until I grounded the backplate and attenuated the noise substantially. It is handy when I need a scope in a tricky spot (e.g. near a RC plane without crushing it, and cheaper than a brand-name portable scope.

    My Rigol DS1052E is pretty sweet at 100mhz. Digital capture is really nice.

    Definitely go for scope first, Logic Analyzer second. You can get LAs built into scope for a hefty markup, or get one of the USB ones. This typically allows you to do much more than just basic LA work, as they can do full signal and protocol decodes, and display communication in more human readable formats.

  11. xler8ed says:

    I lucked out and gt a nice tektronix oscilloscope from a friend and I ued it quite a bit doing my xoxbox build and working on guitar amps and pedals. A oscilloscope is grea to have there are plenty of decent 2 or 4 channel ones on ebay for well under 100 bucks, some under 50 bucks. I have experience using the scopes you connect to PCs at my job and for me nothing is more frustrating. They never are as accurate as a unit tha is stand alone like a tektronix I don’t care what their specs claim I am referencing real usage and so far they have bought two, both high end and I always get conflicting data from them.
    o
    Get a real scope off ebay or warehouse sale and there a plenty of great free guides on how to use a oscilloscope that will teach you as good as classes, I have had both. Good Luck gettng one for yourself.

Leave a Reply