Archive for the Tools Category

MicroC/OS II

I finally got my hands around “the book” on Real Time Operating Systems.

uC/OS ii

Read it all in a couple of days… I loved the clarity and completeness.

Highly, highly recommended! Definitely added to my “favorites” bookshelf !

Tremor

Xiph.Org

The Xiph.Org Foundation offers an open source alternative to the omni-present MP3 audio compression: it is called Ogg Vorbis and promises same if not better performance but it is royalty-free and license free. From their web site, like in all open source project you can download the full C source code for all the tools you need to convert and play back Ogg Vorbis files/streams on most operating systems

Like most open source projects, the code is based on the assumption that you will use the classic GNU Toolchain: gcc compiler, linker, standard GNU libraries, to compile and link your application. Now as you might know the PIC32 toolchain happens to be GNU compatible … 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.

Scilab, FLEX and the Evidence

Third day of the Masters’08 and I discovered another little treasure.

If you have been dreaming about using a tool like MATLAB to model your applications and to generate automatically your control algorithms,  but you did not have the kind of money required to purchase the tool, here is an interesting Open Source alternative called Scilab:

Scilab

But wait there is more, much more. The guys from Evidence s.r.l. have actually combined the Scilab tool with a vast library of modules for the dsPIC and PIC24 so that you can generate an entire advanced control application simply by dragging and dropping graphic icons on your PC screen, it’s called SciCOS. To complete the picture they have created a line of modular components (that somewhat reminded me of the PC104 standard) called FLEX. Useless to say that all FLEX boards/components have a corresponding model in Scilab and integrate perfectly in your control solution.

I have seen some pretty impressive real time demos,  check them out!

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!

Visualizing Data - A taste of Visual C#

Our brain is wired for image processing and all things visual just reach deep in our mind faster! If there is one moment when I just cannot seem to ever get enough of a “view”, that’s when I am debugging code. The Watch windows, the local variables windows, the stack window are not what I am talking about. The Logic Analyzer window (in MPLAB SIM) and the DCMI (with simulator and emulators) are barely starting to scratch the surface, when I need to debug some complex code, I am willing to use literally everything at my disposal, beyond MPLAB, using hardware (scopes and logic analyzers) but also additional software.

Read the rest of this entry »

LINUX catch-22

Linux penguin

For some reason I used to think that Linux was destined to be a hot topic among embedded control developers, so I have been disappointed last summer, at the MASTERs (the 11th), when a couple of enthusiastic colleagues decided to try and offer a short class on Linux tools for Microchip products. The class was great, I learned a lot in that single hour and I came out with a great desire to learn more about developing code in Linux, but the attendance (statistics) turned out pretty discouraging.

Read the rest of this entry »

Addictive Tools

 Of the many tools I have used in the recent years, while working on various embedded control projects, there is one that I have quickly learned to love: the INTRONIX Logic Port.

LogicPort

Now I am sure you have seen and possibly tested plenty  of USB based tools that rely on your PC to do the heavy lifting and promise to replace some expensive and bulky traditional oscilloscope, logic analyzer or meter for a fraction of the cost. Well I have tested my share, and while they all shine for their ingenuity and often they speak well about the creativity and good intentions of the designer, they all kind of fall short of delivering on their promise and definitely pale in comparison to the LogicPort!

The LogicPort is not the cheapest of the USB logic analyzers you can find online nowadays, nor the one with the fanciest plastic case, but it does work.  It does exactly what the brochure says it would and most importantly it does what an embedded control designer needs with an effective and intuitive interface.

I know that their use has spread inside the company like a virus, by word of mouth, or I should say by our constant borrowing of each other’s tools… that’s the way I learned about it in my turn… now you are warned it’s addictive!
P.S.: Jon, I promise, I will return it to you … one day!

Of Explorer 16 boards and 5V LCD displays…

I read with interest today an errata for the Explorer16 demonstration board…

I know, it seems strange to think of an errata for a demonstration board, but it can happen and as in this case, there is a good lesson to learn for all of us, living the dangerous lives of the Embedded Control designers on the edge between 5V legacy technology and the new 3V generations of products.

In order to keep their options as open as possible, the Explorer16 designers arranged for a number of different LCD displays to be used alternatively on the board. Three different layouts were pre-wired and, depending on market conditions (price) and availability, one of several different models of LCD displays (from different manufacturers) will be mounted at any given point in time. Since they are all compatible (or I should say there is a common minimum denominator among all of them) there are virtually no changes required to the demos and code offered with the board.
Interestingly some of these LCD displays are 5V and some are 3V devices. Since most of the PIC24 digital I/O pins are 5V tolerant, theoretically the two technology can be alternated without consequences except for one case that was recently uncovered.

When the Lumex™ LCM-S01602DTR/M module was used (the errata document will teach you how to recognize it) things got more complicated. This 5V LCD module has internal pull-up resistors connected to the 5V rail. When the PIC24 I/Os connected to it (for example PMPA0 which is multiplexed with the AN15 analog input function) is left three stated (very high impedence) it will let 5V get inside the PIC24!

Notice that this will not necessarily damage the part (the pull ups are pretty weak after all), but it will produce a more subtle problem, it will skew the internal analog voltage references and produce a large offset on the A/D module readings for example.

Reading the errata carefully, you will realize how an essential part of the problem is the high impedence of the input pins once three stated, which produces, with the LCD internal pull ups, a partition with a very high output voltage (close to 5V).

Decreasing the impedence, by turning pins to outputs (as you do when you enable the PMP), or by adding pull down resistors (even if of relatively high values) solves the problem as the partition is modified to produce a lower voltage …

The lesson learned: Once more, make sure that when you interface to a 5V device you either:

  • use exclusively pins that are pure digital inputs (5V tolerant)
  • use open drain outputs if you want to swing a 5V signal

Watch out from all pins that are multiplexed with analog functions, even if you have the analog function disabled in your particular configuration.

The pin-out cross reference table published in the previous posting “The Missing Pinout Table” might help you double check…