Archive for the PIC32 Category

Deep Blue PIC32

An email from Tim O. this week made me think about the possibility of computers conversing with humans, or rather the impossibility of it, as Turing once proposed it as the ultimate test of the machine intelligence.  This in turn made me think about another story that made the news a few years ago (1997) when IBMs Deep Blue computer won a historical match against the (back then) world chess champion Garry Kasparov.

Read the rest of this entry »

MIPS DSP Libraries

With the latest release of MPLAB C32 compiler v.1.04, Microchip has added a complete set of DSP functions for the PIC32 to complement the standard math libraries. Among them you will find a number of vector processing functions and as expected several different types of FFT functions. You will remember that in Chapter 7, in order to give the PIC32 some work to do while we were playing wit the cache and pre-fetch mechanism to find the optimal performance tuning, we used a FFT function. That was a simple “schoolbook” implementation of the basic algorithm in C.

If you try the new DSP library, don’t be too surprised if you discover that the speed of execution is increased by orders of magnitude. In fact the libraries are written for fractional numbers (16 and 32-bit fixed point numbers)  as most DSP algorithms do, and were hand optimized (large portions were written in assembly) by MIPS experts to obtain the maximum performance from the PIC32 instruction set.

PIC32, Harvard or Von Neumann

In Chapter 6 of the PIC32 book I briefly mention that the PIC32 differs from all previous PIC microcontrollers since it offers a Von Neumann programming model as opposed to the Harvard model adopted by all previous Microchip architectures.   Then, in a note I remind all the readers that the core of the PIC32 (MIPS M4K) is Harvard based. More than one reader has written back to me to report the apparent contradiction, while in fact there is none. Let’s see if I can make things clearer …

Read the rest of this entry »

Not a dsPIC!

The last two days of the Masters ‘08 have been such a rush that I could not possibly find the time to write any more postings during the day, and I was too exhausted, once back home, to write the night. For two days I was on duty in the “ask the experts” area behind the PIC32 table playing with a few demos derived from the last few chapters of the book(s). I met with so many PIC users/enthusiasts that I cannot possibly write about all of them and their projects/ideas. Perhaps the funniest things that happened though is when one of them, (a veteran of several Masters) after checking out a few colorful PIC32 graphic demos, lying on the table in front of me, had a sudden epiphany, looked up and with eyes of stupor and a wide smile exclaimed: “But… it is not a dsPIC!”

It had never dawned on me that someone could have had this (wrong) impression. It is true, the official marketing campaign of the PIC32 talks a lot about pin-out and software compatibility with Microchip 16-bit architecture (although when you look closely it is the PIC24F and in particular the GA0 series that all the documentation keeps referring to). Not to mention that the part number being “surrounded” by the dsPIC30 and the (ill named) dsPIC33 can further confuse the matter.

Once I reassured him that the PIC32 was a very simple, general purpose, 32-bit microcontroller that just happened to run C code very fast, I saw him sigh with relief. He grabbed a copy of the brochure and disappeared rapidly in the crowd heading toward the development tools counter.

Did you happen to think the same? Let me know, because we certainly never meant it to be!

New compiler and new libraries for the PIC32

The MPLAB C32 compiler got today its first new release v1.03!

And it is not just any minor update of the tool as the small version number change would have you believe… there are two important changes:

1- The math libraries have been significantly optimized, in particular the floating point math

Fast Math Libraries

2- The Student Edition of the compiler (free download)  is now using a scheme similar to the MPLAB C30 compiler. The first 60 days there are NO limitations of any sort. After this period, only the maximum optimizations level is limited to level 1 (still very effective).

Gone is the limitation in size that had so many of us frustrated when trying to compile the more advanced libraries (like the USB Host Stack for example)!

Check the MPLAB C32 compiler web page for more info.

freeRTOS for the PIC24 and PIC32

Today was my second day at the Masters 2008. After attending a number of excellent PIC32 classes (taught by the same architects and engineers that designed the chip and its libraries and tools) I sneaked out and went looking for a hands on class introducing the freeRTOS port for the PIC24 and PIC32.

freeRTOS

freeRTOS is one of the few Real Time Operating Systems that have been ported to a large selection of microcontrollers commonly used in embedded control applications. Previous PIC architectures had been supported in the past but of course the PIC24 and PIC32 are now part of the list.

The integration with the MPLAB C30 and C32 compilers is quite natural and even the MPLAB IDE recognizes the tool and allows you to inspect the list of active  tasks and perform some basic debugging.

If you are like me, looking for a way to run multiple software libraries (Graphics, USB, TCP/IP etc ), you are most probably looking for a small and inexpensive RTOS that can help you manage the complexity.

Check out the freeRTOS web site, it might just be what the doctor ordered!

The Masters 2008 is here!

MASTERS 2008

If you have never been at a Microchip Masters you don’t know what you are missing!

This is an event where only engineers are allowed and you get to hear of the latest products and tools directly from the people that designed them. No marketing fluff, no fancy shows, just the real thing!

I am going to be there all week long, you will find me sneaking in and out of classes trying to learn as much as I can. This year I plan on filling up on: PIC32 (of course), USB, Graphics and RTOS…

Only one design will survive!

Survive

Yawn … you will say … yet another contest…

Well, look again! This is not like anything you have seen before. At least in terms of engineering challenges … this was never done before to my knowledge.

Read the rest of this entry »

Exploring the PIC32

Exploring the PIC32

PROGRAMMING 32-BIT MICROCONTROLLERS IN C

EXPLORING THE PIC32

(ISBN-10: 0750687096 ISBN-13: 978-0750687096)

It is out! I got the first printed copy today fedex-ed directly to my office from Elsevier.

Amazon should start stocking up quickly in the next few days…

Mind this is not a sequel to the Flying PIC24 book, but rather its alter ego in the 32-bit world. The book walks the reader through most of the same steps and exercises though everything looks similar and different at the same time… The underlying theme is the exploration of a new world and the final objective is that of learning gradually to trust a C compiler (MPLAB C32) and learn to use a new PIC with a brand new (MIPS) 32-bit core!

Does it look like a PIC? Does it feel like a PIC? How similar is the PIC32 to the PIC24, really? How fast can you port code from one to the other? Is it easier or harder to use? And most importantly, how much faster does it really run?

These are some of the questions I have tried to answer in the new book. I hope you will enjoy it!

|