There are many types of microcontrollers on the market, and it would be fair to say one of the two most popular types is the Microchip PIC series. The PICs are great as there is a huge range of microcontrollers available across a broad range of prices. However learning how to get started with the PIC platform isn’t exactly simple. Not that we expect it to be, however a soft start is always better. There are some older books, however they can cost more than $100 – and are generally outdated. So where do you start?

There is plenty of material available on PICs, which can make it daunting to get started. And some of the available material is dated, originally developed before modern “flash” PICs were available, or based on older devices that are no longer the best choice for new designs. Our approach is to introduce PIC programming and design in easy stages, based on a solid grounding in theory, creating a set of building blocks and techniques and giving you the confidence to draw on as we move up to more complex designs.

So in this article we’ll examine David’s course package. First of all, let’s look at the development board and inclusions. Almost everything you will need to complete all the lessons is included in the package, including the following PIC microcontrollers:

You can choose to purchase the board in kit form or pre-assembled. If you enjoy soldering, save the money and get the kit – it’s simple to assemble and a nice way to spend a few hours with a soldering iron.

Although the board includes all the electronic components and PICs – you will need are a computer capable of running Microchip MPLAB software, a Microchip PICkit3 (or -2) programming device and an IC extractor. If you’re building the kit, a typical soldering iron and so on will be required. Being the ultra-paranoid type, I bought a couple extra of each PIC to have as spares, however none were damaged in my experimenting. Just use common-sense when handling the PICs and you will be fine.

Assembly

Putting the kit board together wasn’t difficult at all. There isn’t any surface-mount parts to worry about, and the PCB is silk-screened very well:

The rest of the parts are shipped in antistatic bags, appropriately labelled and protected:

Assembly was straight forward, just start with the low-profile parts and work your way up. The assembly guide is useful to help with component placement. After working at a normal pace, it was ready in just over an hour:

The Hardware

Once assembled (or you’ve opened the packaging) the various sections of the board are obvious and clearly labelled – as they should be for an educational board. You will notice a large amount of jumper headers – they are required to bridge in and out various LEDs, select various input methods and so on. A large amount of jumper shunts is included with the board.

It might appear a little disconcerting at first, but all is revealed and explained as you progress through the lessons. The board has decent rubber feet, and is powered either by the PICkit3 programmer, or a regulated DC power source between 5 and 6V DC, such as from a plug-pack if you want to operate your board away from a PC.

However there is a wide range of functions, input and output devices on the board – and an adjustable oscillator, as shown in the following diagram:

The Lessons

There is some assumed knowledge, which is a reasonable understanding of basic electronics, some computer and mathematical savvy and the C programming language.

You can view the first group of lessons for free on the kit website, and these are included along with the additional lessons in the included CDROM. They’re in .pdf format and easy to read. The CDROM also includes all the code so you don’t have to transcribe it from the lessons. Students start with an absolute introduction to the system, and first learn how to program in assembly language in the first group of tutorials, followed by C in the second set.

This is great as you learn about the microcontroller itself, and basically start from the bottom. Although it’s no secret I enjoy using the Arduino system – it really does hide a lot of the actual hardware knowledge away from the end user which won’t be learned. With David’s system – you will learn.

If you scroll down to the bottom of this page, you can review the tutorial summaries. Finally here’s a quick demonstration of the 7-segment displays in action:

Update – 18/06/2013

David has continued publishing more tutorials for his customers every few months – including such topics as the EEPROM and pulse-width modulation. As part of the expanded lessons you can also get a pack which allows experimenting with electric motors that includes a small DC motor, the TI SN75441 h-bridge IC, N-channel and P-channel MOSFETS and more:

So after the initial purchase, you won’t be left on your own. Kudos to David for continuing to support and develop more material for his customers.

Where to from here?

Once you run through all the tutorials, and feel confident with your knowledge, the world of Microchip PIC will be open to you. Plus you now have a great development board for prototyping with 6 to 14-pin PIC microcontrollers. Don’t forget all the pins are brought out to the row of sockets next to the solderless breadboard, so general prototyping is a breeze.

Conclusion

For those who have mastered basic electronics, and have some C or C-like programming experience from using other development environments or PCs – this package is perfect for getting started with the Microchip PIC environment. Plus you’ll learn about assembly language – which is a good thing. I genuinely recommend this to anyone who wants to learn about PIC and/or move into more advanced microcontroller work. And as the entire package is cheaper than some books – you can’t go wrong. The training course is available directly from the Gooligum website.

Disclaimer – The Baseline and Mid-Range PIC Training Course and Development Board was a promotional consideration from Gooligum Electronics.

In the meanwhile have fun and keep checking into tronixstuff.com. Why not follow things on twitter, Google+, subscribe for email updates or RSS using the links on the right-hand column? And join our friendly Google Group – dedicated to the projects and related items on this website. Sign up – it’s free, helpful to each other – and we can all learn something.

In this review we consider a Digilent chipKIT Uno32 development board made available by element14.

Introduction

This is a development board that is based on the Arduino Uno, however uses a Microchip PIC32MX320F128 microcontroller instead of the Atmel ATmega328 we are used to:

Digilent’s decision to use the PIC32 introduces some interesting changes to the Uno format, and the largest change to take note of is the clock speed – 80 MHz instead of the Uno’s 16 MHz. That certainly took my attention, and we can see this demonstrated shortly.

When shipped the board arrives alone in a cardboard box, without a USB cable:

All documentation is found on the Digilent website. There is also a support forum to discuss libraries, IDE updates and so on. The board itself is quite familiar upon initial inspection:

You can see that Arduino shield will physically fit onto the board, and the extra I/O pins are accessed through the second rows of jumpers inside the board. With some crafty PCB creation skills you could make your own Uno32 shields, or consider one of the boards available from element14 or Digilent.

As for the other specifications of the Uno32:

Clock speed – 80 MHz

128K flash program memory

16K SRAM data memory

I/O pins – 42 (12 used as analogue inputs or digital I/O)

Five PWM pins

FTDI chip for USB interface

Two user LEDs

Same form factor as Arduino Uno boards, which allows physical shield compatibility

Five interrupt pins

On board real-time clock (external crystal required)

You will need a new IDE, and you can download Uno32-modified versions of the Arduino v22 and v23 IDE from here for Windows, MacOS and 32-bit Linux (no 64-bit…). The bootloader is preinstalled on the Uno32 and after installing the special IDE it works just as our normal Arduinos do in terms of editing and uploading sketches. The board also is compatible with the Microchip MPLAB IDE and PICkit3 in-circuit debugger if you want to use the Uno32 as a normal PIC32 development board. There is a row of holes between the USB socket and the DC socket that will need header pins soldered in for PICkit3 use.

Speed comparison

Naturally you want to see the speed test. The following sketch was run on an Arduino Uno and the Uno32 boards using IDE v1.0 for the Uno and the MPIDE v23 for the Uno32:

And here are the results of running the sketch four times on each board:

Well that’s pretty impressive – over sixty times faster than the Arduino Uno. Therein lies the major reason to use this board over the Uno. The eagle-eyed among you may have also noticed the difference in the compiled binary sketch size – 6432 bytes for the Uno32 vs. 2540 bytes for the Arduino Uno. That’s interesting.

Nevertheless there are many things to take note of when moving from Arduino to Uno32, or in other words – you can’t just swap out an Arduino Uno for an Uno32, recompile and run your sketch at the faster speed. The Microchip PIC32 is very much a different beast to the Atmel AVRs we’re used to, so it is important that you understand the differences in hardware and software to take advantage of the Uno32. So let’s run through those now.

Power Differences

The Uno32 is a 3.3V board due to the PIC32. You can still power it via USB, or connect between 7~15 VDC to the power socket on the board. You can change a jumper and feed 5V directly into the board bypassing the 5V regulator. External power is regulated to 5V then to 3.3V. From a total of 1A current, the PIC32 uses 75mA, so you can draw up to 925mA from the 5V bus or 425mA from the 3.3V bus (or a mixture from both). It would pay to determine your current load before testing to avoid damaging the board, however the manual notes that the regulators will become hot at high current loads but do have thermal protection. Finally there is also a jumper that chooses between a 5V or 3.3V voltage feed to the shields. As always, consult the manual first.

I/O Differences

Although the PIC32 being a 3.3V part, the manual states that the digital I/O pins are 5V tolerant, so applying 5V to a digital input won’t damage the PIC32. Logic on the other hand is a different kettle of fish. According to the manual a digital ‘high’ when sourcing 12mA of current will only reach close to 3.3V. This may be too low in some situations so check your threshold voltages when choosing external parts. Furthermore, the analogue reference voltage (AREF) is restricted to 3.3V.

One stand-out difference is that you can only source 18mA from a digital pin, which is OK if you’re blinking some LEDs. However for logic output to keep the voltage range below 0.4V for ‘low’ and above 2.4V for ‘high’ the current must be restricted to -12~+7mA – another different limitaion. Finally, the maximum current you can source over all the I/O pins at once is 200mA.

There are two UARTs, number one where we expect it (D0/D1) and another on pins 39 and 40. I2C is on A4/A5 but needs to be activated with a jumper. Note that unlike an Arduino there aren’t any inbuilt pull-up resistors for the I2C bus, so add your own. There is also an SPI bus at the usual position (D10~13) and interestingly you can change the board between SPI master and slave via another set of jumpers. There are five pulse-width modulation outputs, however one is on D10 which is also part of the SPI bus. Finally there are five hardware interrupt pins.

Shield Compatibility

Arduino shields will physically fit onto the Uno32 – but you need to be aware of the I/O differences listed above, the voltage and current specification and also the software side of things. Again – do your research before making the commitment to the hardware.

Software Compatibility

The Uno32 is compatible with a variety of Arduino sketches, but not all. This in a large part is due to the libraries which will need to be sourced from the community or rewritten yourself if not provided with the MPIDE software. There is a community on the support forum which is contributing their own, such as the real-time clock library – but again, research needs to be done before use. When trying to use an existing Arduino sketch and hardware, you will need to spend some time checking for compatibility. Again – it’s much easier to design a new project around the Uno32 than rejig an existing one.

Open Source?

One of the things many people love about the Arduino ecosystem is that the entire system is open source hardware and software. Without causing a pro/con argument about software licensing you should note that not all of the software toolchain for the Uno32 is open, nor the USB or TCP/IP stack. There is some interesting discourse about this here.

Conclusion

A lot of work needs to be done to ensure compatibility with existing Arduino applications. The Uno32 is tempting due to the raw clock-speed increase, however the sketch/library and hardware differences may introduce a few road blocks. However, when designing a project from scratch and understand the licensing limitations, the Uno32 would be great as you know what you have to work with – a much faster board with much more I/O. And it is very inexpensive, less than ~$35. You can order your new Uno32 from element14.

Finally, if you’re looking for a very inexpensive PIC32 development board to use with Microchip MPLAB, the Uno32 is a great deal that can possibly interface with a wide variety of shields from the Arduino world.

Disclaimer – The Chipkit Uno32 board reviewed in this article was a promotional consideration made available by element14.

Have fun and keep checking into tronixstuff.com. Why not follow things on twitter, Google+, subscribe for email updates or RSS using the links on the right-hand column, or join our Google Group – dedicated to the projects and related items on this website. Sign up – it’s free, helpful to each other – and we can all learn something.