The Case for the PIC32

About 6 months ago I started a tutorial on how to setup a free development environment for a Cortex-M0 microcontroller from STMicroelectronics. This tutorial utilized a free ARM toolchain, Eclipse and OpenOCD (for debugging) to setup this environment. It was based on the $8 STM32F0Discovery board.

While the tutorial targeted the STM32F0Discovery board, the larger objective of that tutorial was to make setting up a free GCC-based development environment for Microcontroller development (Cortex-M0/M3/M4)  more accessible to everyone and not just the geeky few. And I feel that the tutorial has somewhat succeeded in this goal…

My issue with the STM32 and most other Cortex-M0/M3/M4 parts is that they’re only available in hard to solder surface mount packages. While I know that they are solderable, 0.5mm 48/64QFP packages are almost impossible to align with the naked eye (at least my eye). QFN packages are generally harder to solder at any pitch and simply not designed for people who want to mess around with microcontrollers on a breadboard. Sadly most of of the Cortex-M0/M3/M4 parts out there come in these packages. The exceptions are some of the Cortex-M0 chips (LPC1114) from NXP that come in 600mil 28-DIP and 0.65mm SSOP. Unfortunately these parts do not have a large enough memory density (32K Flash and 4KB RAM) and peripheral integration to peak my interest.

Due to my lack of interest (and possibly ability) in trying to solder these parts I’m forced to look elsewhere, specifically at Microchip’s PIC32MX1/2 offering. The PIC32MX250 Chip comes with 128KB Flash, 32KB RAM, 2-SPI, 2-I2C, 2-UART, 1Msps 10-bit ADC, plenty of timers, USB, RTC and many more peripherals are available of 28-pin DIP, 28-pin SOIC packages as well as the challenging but do-able 0.8mm 44QFP packages. The chip itself runs at 50MHz and provide upto 78 DMIPS of processing power. It is available from newark for under $4 in unit prices.

Because of this high level of integration of memory and peripherals, and availability of easy to use packages, I will probably be moving to the PIC32 for my future microcontroller projects.

The PIC32 is by no means ideal. It has some problems including the fact that its based on the older M4K MIPS core, it has longer (slower) interrupt latency and is more power hungry than the Cortex-M microcontrollers.   It still better fits my needs that the Cortex-M Microcontrollers out there due to its flexible packaging options.

Another disadvantage of the PIC32 is that the free XC32 (GCC) compiler offered my Microchip is crippled…i.e. optimization is disabled.  A workaround  that I intend to experiment with  in the future is to use the Newlib based ChipKit (MIPS-GCC) compiler  as a toolchain and to use ejtagproxy as the GDBserver for debug. A Sample minimal application for such a setup exists here. With these tools one can easily setup a free development environment for the PIC32 with Eclipse or any other IDE of their choice.

If one does not mind using Microchip’s XC32 compiler with optimization’s disabled, one can use the compiler along with Microchip’s awesome MPLABX IDE. Both of which are available on Linux, Mac and Windows.

I will start experimenting with the PIC32 (with Free Development Environment) in the near future.

 

 

This entry was posted in Uncategorized. Bookmark the permalink.

4 Responses to The Case for the PIC32

  1. John Fisher says:

    I certainly agree with the packaging problems. We have been dealing with it for years in the amateur radio community. Many have progressed in their soldering techniques and we are using them. However I hate to see you leave the ARM Cortex Mx series over packaging. Your setup has enabled me and a few of my HAM radio colleagues to really progress on our Software Defined Radio projects. Please don’t forget us :-) I would be lost without your tutorial Parts 1,2 and 3. Thank you so much for bringing this to us. I support you in going for the more easily solderable parts, too. I plan on buying Discovery boards for all my projects, to get around the soldering problem. Currently we are learning about the TFT Color displays with touch screen. All a direct result of having open source, unlimited tools :-) Thanks again,
    Regards,
    John H. Fisher K5JHF

    • halherta says:

      John, Thank you very much for your kind words! I’m very happy that my tutorial helped you and your HAM radio colleagues get started with ARM microcontrollers and help you with your software defined radio projects. And I wish you all the best. The STM32F0 tutorials are not going anywhere. In fact I will be going over them and will work on improving them from time to time but i probably will not be expanding on them anytime soon. I’m also focusing more on the embedded linux platforms such as the RaspberryPi and beagleboard and will probably not do anything with the PIC32 in the immediate future. Having said that, the PIC32 is not a bad alternative and is quite powerful. And because its a MIPS core, it has a GCC based coompiler that can be used in pretty much the same way as the ARM compilers…(It doesn’t however have an FPU).

      Good luck with your SDR projects and with getting those tft LCDs going!

      And Merry Christmas & a Happy new year to you!

  2. shimniok says:

    I can understand the frustration with 0.5mm pitch qfp and especially qfn. The latter of which I remain quite fearful. I have managed the smaller qfp parts on breadboard friendly lpc210x breakouts. There are some breakouts like the maple mini and fez cerb 40, lpcxpresso and mbed etc.

  3. krump says:

    i love the m0 series article and for some time i was waiting for a little more, and so bad news
    It give me much progress in writing emedded aplication.
    arm has so many good open tools and no code size limits :D
    there is even GNU Tools for ARM Embedded Processors which support FPU(FFT

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>