Archive for April 2008

Optimizing the graphic library

While working on the porting to the PIC32 of the code developed for the original PIC24 book it occurred to me that there were some obvious optimizations I had yet to explore.

For a starter, the graphic.c library was using several resources including Timer3, the Output Compare 3 module, the Output Compare 4 module and the SPI1 port in addition to one general purpose I/O (RG0 in this case). The OC3 module was used to generate the Horizontal Synchronization pulse portion of the composite video signal, but the module output pin RD2 (active as soon as the module is enabled) was not used. Rather RG0 was “manually” set during the OC3 interrupt service routine and reset during the Timer3 interrupt service routine. This added unnecessary overhead to the application as the OC3 module could easily be configured to do it all by itself…

Read the rest of this entry »

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 »

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 »

Visualizing Data - DMCI

I guess one of the advantages of getting older (if there is any) is that I am becoming somewhat more patient and I am learning to resist the temptation of trying out on the hardware target every single line of new code I write. I am finding myself using the simulator (MPLAB SIM) more and more every day to test thoroughly sections of my code before throwing it out to the ICD. The result is overall less development cycles (code, program (ICD), run, crash, … repeat), more bugs caught early and more productivity.

Read the rest of this entry »

Look Mom No … Linker Script

There are so many new features being added to MPLAB at each major (and minor) new release that I struggle to keep up. Just a couple of days ago for example, I was discussing with a colleague how it would be nice to have the MPLAB New Project Wizard to use a default linker script in every new project … so that in most standard cases the repetitive  task of adding one (navigating through the many subdirectories inside Program Files) can be spared and … I got stopped mid-sentence and promptly reminded that this feature was already there! In fact since last November, with the introduction of version 8.00, MPLAB has been quietly offering a default linker script when the MPLAB C30 toolsuite is selected.

Thanks !

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 »

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!

|