Skip to content


PIC & Electronic Development on a Shoestring

31810-1One of the many factors that can put people off learning how to use microcontrollers is the cost that can be involved. Steven show us how to minimize the costs for solid PIC microcontroller development environment for using free[1] (or very cheap) software.

This article was submitted by Steven Moughan as part of the “Hobby parts for articles” program. Steven receives a Modern Device Company Bare Bone Arduino Kit for this great article. Check out The Obsolete web site for more information and projects by Steven.

Starting with PIC development…

Ok, let’s face it, you can’t really develop anything for microcontrollers without the following tools…

  • A programmer
  • A compiler
  • An IDE[2]
  • A simulator

Programmers

There is an awful lot of commercial and hobby solutions when it comes to programming PIC microcontrollers. There is the PICKIT1 / PICKIT2 programmers from microchip that can program almost any PIC under the sun, but then there are some, very comparable hobby solutions for programming that can be put in place… Im not going to list them all, but I will however give a good overview of what is available…

http://www.instructables.com/id/EGXZT1ZXHUEX5037SA/ is a good homebrew solution to a PIC programmer, it is based on a programmer first released by David Tait

http://www.finitesite.com/d3jsys/ is another TAIT style programmer with a very low parts count.

Compilers

When it comes to compilers its all down to language choice, do I use C, do I use BASIC, Pascal, what? Don’t worry if none of this seems familiar to you, not yet anyway…

BASIC is generally a good starting point for most programmers, it boasts a loose, English style syntax which is quite easy for most people to pick up. Some basic compilers are…

Great Cow BASIC, free open source compiler released under the GPL license.
http://gcbasic.sourceforge.net/

MikroBasic, Commercial but a free (restricted) demo
http://www.mikroelektronika.co.yu/

C is my personal programming language of choice, I find it to be very robust with many, many options, but with options comes complexity…

PIC C LITE, Commercial but a free (restricted) demo
http://www.htsoft.com

CCS, Commercial but a free (restricted) demo
http://www.ccsinfo.com/

JAL is another language, syntactically similar to BASIC, but is free and open source, distributed under the GPL Licence
http://jal.sourceforge.net/

Please keep in mind that these are not the only compilers available for PIC microcontrollers, there are many many many many (get the point?) more…

IDE (Intergrated Development Environments)

IDE’s are great tools, and possibly the best one of all is MPlab which is one that Microchip themselves released, it integrates well with Hi Tech C Lite and CCS, I have never tried it with any other compilers. It also has a built in assembler and IC Prog integrates well also. http://www.microchip.com

IDE’s are available from most compiler distributors too, but one not to be over-looked is Proton IDE, which while is not one I use regularly, I have found to be very flexible…

Simulators

Simulators are _ALMOST_ essential for microcontroller development, MPlab does have a very complex, and well thought out simulator built in, along with many other great tools (are you getting the picture? MPlab is Great!)

Another very good, and very cheap simulator I have found is Virtual Breadboard which can be found at http://www.virtualbreadboard.com/. Its uses are almost endless…

That about wraps up my section on PIC development, but there is still a little more to come… general electronics development is a has a lot of room for diversity such as choice of components, wiring schemes, labeling and much more…

Software that will make electronics design much easier for you.

http://www.cadsoft.de – Eagle Layout editor, a free (limited to dual layer) schematic and PCB layout program, with a growing user base, lots of sample projects and an absolutely huge abundance of libraries…

LTSpice, a SPICE modeling and simulating package from linear technologies…
http://www.linear.com

Virtual Breadboard – Did I mention this already?
http://www.virtualbreadboard.com/

FilterLab from Microchip.com is great for active & passive filter design

555 Timer Pro is great for calculating your 555 values and variables (restricted)http://www.schematica.com/555_Timer_design/555_Timer_PRO.htm

CalCoil is great for rolling your own inductors, however I can’t find my old link, so you’re going to have to Google it.

Open Office from http://www.openoffice.org is great, although not specifically for use in electronics, it does everything MS office can do, and it’s free…

Well, that’s the end of my little info-snippet, I hope you enjoyed reading it and learned a little something new, if not a lot :p

footnotes

[1] Some software is restricted or is only for non commercial use

[2] An IDE is not strictly required, but makes life much easier

[3] A simulator is not strictly required, but makes life much easier

Posted in Development Tools, Electronics Links, Microcontroller.


14 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.

  1. mukesh kumar says

    sir, i really found your artical very useful to.i was searching all this for long a time. i am very thankful to u sir…

  2. russ_hensel says

    The compiler I use and recommend is BoostC from Source Boost ( http://www.sourceboost.com/home.html ). Some nice features of the compiler include: free version for small programs and the compiler is built into an integrated development environment ( which combines the functions of editing, building, and debugging into one user interface ). The debugging environment is particularity good, unlike some environments the debugging is in C not assembler. There is also support for external events and output devices like LED’s. You need never work in assembler with this environment, but if you wish you can include C in line, and get full assembler listings of your code. The Boost C compiler comes in a reasonably priced version ( $70.00 ) with unlimited code size, so it is not a dead end for more advanced work. If you do not like C they also support some other languages, check it out.

    I have a LED Hello World tutorial at: http://home.comcast.net/~russ_hensel/RClub/BoostCTutorial.html

    russ_hensel

  3. dfowler says

    James,

    Great news on the article. The Picaxe article will be a great addition to the site.

    We prefer plain text. Place something like [xyz.jpg] and XYZ[link: xyz.com] where you want pictures and links.

  4. James Moxham says

    Hi dfowler.

    This ‘development on a shoestring’ is a great subject.

    Ok, in the last 24 hours I have built a demo circuit, taken lots of pictures and written most of the text. How do you prefer submissions – in html or word or as raw text and pictures?

  5. dfowler says

    James and others,
    I do not intend to have a Ardunio/AVR bias here at uCHobby. I tend to write about Ardunio projects becase I have one and becase I have been giving them away. I also have more experience with AVR and C/C++ then with anyother part/language combination. I should get myself setup for PIC and Picaxe work to see what it’s like on the other side of the fence. I would like to see more PIC and Picaxe and even others (like MSP) here at uC Hobby.

  6. Hippy says

    The PICAXE may sometimes be under-rated or over-looked as being a pre-programmed “BASIC interpreter” and given its original “education” target market. PICAXE’s are used outside of education, even in commercial product, and running some applications one wouldn’t necessarily expect; driving 250kbaud DMX lighting and MIDI.

    Low-cost PICAXE chips, free downloadable IDE with simulator, simple ( near zero-cost ) programming interface, comprehensive documentation and excellent forum support for users.

    What more could a hobbyist on a budget want ?

  7. Stan. SWAN says

    Twist my arm James – I may be coerced into rolling up a joint Trans-Tasman PICAXE® article. Us colonials seem the global PICAXE champs after all!

  8. James Moxham says

    Hi Dfowler, yes, I could do an article. I have been scrolling through the website getting a feel for the target audience. There does seem to be an Ardunio emphasis – I hope it wouldn’t offend people to do something on Picaxe?

    I build all sorts of rather complex home automation things with picaxes, but in keeping with the theme of this article, I might see how quickly and cheaply I can get a led to flash. No expensive development kits – just a microcontroller chip, a small bit of protoboard and a few recycled components. Do you think this would be of interest?

  9. dfowler says

    James,

    How about writing an article about development with the Picax for uC Hobby. You can get an Ardunio kit for this.

    I like the AVR processors and have been warming up to the Ardunio platform. I have been doing embedded development for awhile and normaly perfer a straigh C compiler which you can of course do wiht the Ardunio setup as well.

  10. jwrjr says

    I program PICs in assembler. This isn’t difficult, as some PICs have only 35 instructions, most of which I rarely need. I use MPLAB, of course. Inexpensive programmers can be found on Ebay, as long as you don’t mind that many of the programmers will be made in China. The one that I have works fine with MPLAB.

  11. Alonso says

    I use PICbasic and MicroCode studio in a PC
    http://www.mecanique.co.uk/code-studio/

    ANy ideas for MAC users?

  12. John Carter says

    I haven’t seen much about the PICAXE chips (PIC line with built-in BASIC interpreter) from http://www.rev-ed.co.uk.
    Although aimed at the UK educational market, they could be considered “the 555 of the 21st century”.

    The 8 pin version starts around $3US, and the only programmer needed is a serial cable. The programming software (including a simulator) is a free download. That’s about as small a shoestring as you’ll find 😉

    The basic clock frequency is 4MHz, but some of the chips can use an external crystal of up to 20MHz.

    Features include: ADC, one-wire device interface, servo control, serial I/O, low power modes (including setting the internal clock to 31KHz). Accessories include a web server module (~$100), multi-channel servo board, and more.

    There is after-market support with prototype boards and sample software. http://www.phanderson.com/picaxe/picaxe.html

    There are also people using PICAXEs to control robots.

    John

  13. James Moxham says

    My personal bias is the Picaxe (a PIC variant). Having build embedded controllers using all sorts of micros for the last 20 years, I like to start by defining the problem, eg “How quickly and cheaply can one get a led flashing?” As an example of how bad things can be, I have a zilog Z8 development kit costing several hundred dollars and it took several weeks of C coding to get the led to flash. But things have now changed!

    Picaxes need a picaxe chip ($3), a 22k resistor (3c), a 10k resistor (3c) some wire (10c) and a D9 connecter ($1) to connect to the PC serial port for programming. The software is free http://www.rev-ed.co.uk/picaxe/ The code is very simple eg flashing a led once a second is
    main:High 1
    pause 500 ‘ 500 milliseconds
    low 1
    pause 500
    goto main

    It is possible to buy pre made modules, but really all that is needed is the chip and a breadboard and a 5V supply. http://www.picaxe.orcon.net.nz/ is a great website that explores these chips in more detail.

  14. Matt says

    I may be a bit biased to Microchip products- but you forgot to mention that Microchip offers a free version of their C18 (for PIC18) and C30 (for PIC24, PIC30, and PIC33). Both are the full (as in what you get if you buy it) version for 60 days, after that, optimizations are turned off. Other than optimizations, they work with all parts (in the series), no code size restrictions.