X Files

PICO1

I have just received from a friend a link to a piece of the history of the first “singe chip calculator”:  http://www.spingal.plus.com/micro/

The web  page is titled “Microprocessor History” and tells the story of what was research and development work done by a little know company, called  PICOElectronics Ltd, in Scotland in the late 1960′s.

Now, while I am not particularly interested in the debate wether they managed to beat INTEL to the punch, I found some of the details extremely curious for how this work seems to be eventually traveling across the world to NY first where General Instruments had its headquarters (PICO Electronics used GI to manufacture their chips) and later to a new (in those days) factory in Arizona! Among the many products developed in those years were the very first video games (Pong) components.

What a coincidence, that factory eventually was sold by GI to a group of private investors funded by venture capital  (Sequoia)  who created: Microchip Technology Inc.

Their first microcontroller product was then called the PIC!

 

 

 

In-Animate

F7

MPLAB X is evolving, and this means that new features are being added at every release. Sadly some old features that have been with us since the early days of MPLAB have gone the way of the dodo.

Animate is one of them.  I used it in all my books in the very first chapters, when showing how to use the simulator and mostly in the first simple loops. At the time I was writing  the second edition of the Flying PIC24 book (Programming 16-bit microcontrollers in C), it was still available in what was one of the last betas ( beta 7 or 8 ) but it has disappeared shortly after.

I am told there is a simple replacement for it: if  you stick a paper clip near the F7  key on your keyboard, you get a very similar result !?

Note for Mac users:  You will need a second paperclip to keep the Fn key down as well

Generating Map files with MPLAB X

I started using MPLAB X since the very first betas were made available so I have eventually acquired a little confidence with the tool. Occasionally though I can still find myself hunting around for a feature/configuration parameter that is not where it used to be (in MPLAB 8). Eventually it just takes a little random probing around in the configuration dialog boxes and the many sub-panes… it’s all there!

Continue reading

Flying Europe Now!

So it is official, I ‘ve added a JAA (European) Pilot License to my resume!

It took me a lot of patience and perseverance to work through all the nonsense and abuse of the Italian bureaucracy, but eventually I got my FAA pilot license converted. It did cost me more than the original license AND the instrument rating combined. It might also not be finished yet as more bureaucratic steps are required to extend it beyond the borders of the single country of issue (Italy), but I will spare you the details.

For now, I celebrated the accomplishment with a flight over the North Eastern Alps (Dolomites) that could well be remembered as one of the most scenic I have ever done and at the same time was my first experience on a Robin DR400 (thanks Raffaello!).

In fact I got so excited that I completely forgot to take any pictures…

Next: I am going to pursue an Ultralight License (it should be a purely formal step at this point, but never underestimate Euro-bureaucrats inventiveness) and I want to check out a Pipistrel Virus SW!

Designing a good API

I have recently re-discovered Youtube. In a sense I have been on a learning path for several years now and I have changed my perspective on this “tool” multiple times.

In the beginning there was the enthusiasm about the new media. I spent a lot of time browsing randomly and letting Youtube dictate passively where to go next from a bad video to a worse one.

Later I tried to create a little content of my own, but I was just tasting the waters to see how difficult it could be and more or less a “show off” thing: Look mom I can do a Rubik cube with the PIC32!

Then came Apple’s iTuneU, where I got a glimpse of a future I liked better.

Then I got back to Youtube, thanks to the GoogleTalks, where I realized it is finally proven that quality content can be made available to all without necessarily the restrictions and all the traps (that Apple loves to build around its products).

Here just one excellent example that made my day:  How to design a good API and why it matters – Joshua Bloch 

I guess I will need to learn now how to properly use Youtube Channels, and continue on the path of enlightenment.  Maybe one day I will even get to appreciate Tweeter?

More tools from Mikroe

Every now and then I get a chance to talk to the guys at Mikroe and they never fail to surprise me, both for the amount of work they get done in a short time and most importantly the quality of it.

Here is a quick update on projects they completed since I last met with them in Nuremberg  during the Embedded World show.

Also they added WiFi software support for MRF24WB0MA in bundle with MCW1001:

The support package can be found on Libstock:  http://www.libstock.com/projects/view/356/network-wifi-library

Quite impressive!

SDHC and SDXC

SDXC

A couple of readers have warned me recently that SDHC and SDXC cards are becoming the norm and that spells troubles for the unaware.

In fact, both in the PIC24 (both editions) and the PIC32 book, I spent a couple of chapters to discuss the interface to SD/MMC Cards and developing a small library to allow access to files when the cards are formatted using a FAT16 file system.

While the key principles remain the same, things change quite a bit when you start consider (7 years later) what the market offers. Basically, SD/MMC cards are slowly disappearing as the memory size upper limit (2GB) of the original standard has been reached and quickly passed. To overcome that limitation, since 2009, several vendors have started adopting the SDHC specifications first (increasing that limit to 32GB) and the SDXC specification later (increasing the limit to 2TB).

At the same time the file system has changed as most users nowadays prefer FAT32 formatting and eventually the SDXC cards have been standardizing on the “exFAT” (patented) file system.

The SDMMC.c and FileIO.c examples do NOT support any such features!

Clearly it goes beyond the scope of the books I wrote, and it would require a much more complex body of code to keep up with these advances. Although I might soon add support for the FAT32 file system (or I might simply replace it in the examples), I think the most appropriate thing to do is to direct my readers to the Microchip MDD File System library.  This is a standard component of the larger Microchip Application Library and is a free, current, professionally maintained and documented piece of software that I greatly recommend for all actual embedded control applications!

CUI32 Stem

CUI32StemCUI stands for “Create USB Interface” and it is really an open project based on the PIC32 that includes a large set of modular hardware and software solutions, in their words:

The Create USB Interface is an open source microcontroller board that can be programmed in C, BASIC, or Arduino languages. This latest version is called the CUI32Stem, which is designed to work ‘hand-in-hand’ with the GROVE prototyping system including a wide range of sensors and actuators. It utilizes a high-performance Microchip® PIC32 microcontroller, allowing programmable interaction with all sorts of user inventions, no soldering required! “

I have recently taken a second look (here my first) at it and I was pleasantly surprised to see how polished and complete it got.

I like the USB bootloader, the Arduino compatible hardware, the StickOS simplicity and (why not) BASIC interpreter for some quick and dirty work.

32-bit PIC programming in Python!

PIC32MX4 Micromedia Python Demo

It has been a long journey for me to learn about modern interpreted object oriented programming languages, first on the desktop (see post here), later on industrial control and data acquisition applications (see post here) and now I feel like I have finally closed the circle: Python programming on an embedded control (32-bit) microcontroller thanks to the “Python-on-a-chip” project!

Dean Hall has been working at this project for several years now. He has demonstrated the possibility to run a small Python interpreter even on 8-bit architectures and others before me have ported the (well written) code to 16-bit microcontrollers like the PIC24. But since all Python interpreters have a huge thirst for RAM, it is only in the flat an (virtually) unlimited addressing space of a 32-bit microcontroller that Python starts really to make sense in my opinion.

So I have created a clone of the project (Mercurial) repository for the purpose (link)  and developed a new PIC32 port for the v10 revision of the project. While describing the whole project would take a while, it is interesting to note that the time I spent to “port” the PIC32 code in itself (from pull to first successful build) was less than an hour!

Actually most of the time for me went into figuring out how to use Python effectively to wrap existing libraries and get a useable,  or I should say a useful, package to develop applications on the PIC32 MX4 Micromedia Board.

At the moment I have demonstrated good real time support for the following features:

  • QVGA Graphics Primitives
  • Touch screen input
  • Joystick input
  • LED output
  • Serial input/output
  • Accelerometer input
  • Temperature sensor input
  • Audio (work in progress)

Eventually the project begs to be recompiled for a PIC32MX7 Micromedia board (128K of RAM!) where I could even dream to attempt a port of the PyGame libs to make development of little interactive applications real fast…

Please feel free to review the code and send your comments… but beware this is not a project for the faint of heart!

You will be required to master the following tools/application libraries:

  • MPLAB X
  • C32 Compiler
  • PIC32 peripheral libs
  • Microchip Application Libraries (GFX, MDD File System…)
  • Scons project manager
  • Mercurial versioning tools
  • Doxygen automated documentation generator/manager

Enjoy!