Of embedded black boxes

Over the last few months I\’ve been working on projects using PIC microcontrollers. At first I had a rather negative view of the PIC processors. Since I started coding on them, I have come to realize that it is the compiler that I have issues with much more than the hardware. The compiler we\’ve been using by CCS is designed to get projects up and running quickly by abstracting the hardware from the coder. So, instead of directly writing to the registers, you call one of their functions. We\’ve found this works well when it is a mature processor and when we\’re not trying to do too many things at once. Where we ran into lots of frustration was with new processors. We thought we had the code written correctly, yet it wasn\’t working. Now instead of just having our code and hardware errata to look at, I also had to figure out what the CCS code was doing… which means slogging through the disassembled code and looking up the mnemonics for the different assembly operations.

Now, you need to understand where I come from. I\’m a Professional Engineer. When I vouch for something, I\’m saying that it works. When I have the black box of a intrinsic compiler functions, it makes me a little less sure about what is occurring. That\’s one of the reasons why I like the MSP430. TI does a very good job of letting me know what\’s going on with the chip. There\’s not much left to the imagination when using it. The analog functions are well documented and there are good code examples. The Stellaris line of ARM Cortex-M3 chips tries to make both camps happy. It has good documentation of things, but it also comes with a large driver library that encapsulates many of the functions for an engineer to rapidly program on it.

My beef with embedded processor abstraction through libraries or intrinsic functions is that it usually doesn\’t keep up with the latest processors and that it is too easy to do something that modifies something else and then you don\’t know where the problem is being generated because the functions work separately or in a different order. Oh, and they take more memory, on memory constrained processors. What\’s your experience?

Automating Dreamhost backups

We here at Curious System Solutions use dreamhost as our hosting provider.  One of the nice things they give us is a nice, tidy, backup every month, if we ask for it.  It may take a few days if you ask at the beginning of the month, and it is easy to forget to download.  So, we have a handy python script that will check an imap4 email server to see if the backup is ready, and if so, download it.  The script is designed to be a cron job that can be ran every night so you don\’t have to worry about remembering to download things.

Continue reading

Getting Rid of Dead Files in a Subversion Working Directory

Quick Tip:
I often find that I delete files before I remember that I should have deleted them using subversion. To help solve that problem I found/created the following command.

svn st |grep "^\\!" |cut -c8- | xargs svn rm --force

This takes all the files that are missing from the checked out version of the repository and forces their removal. Enjoy!

Concatenating IEEE E-Book PDFs

For those of you who are IEEE members, they now offer some of their \”classic\” ebooks as a free download off IEEE Xplore. The only problem is that they come in multi-part PDF files and are not named in a rational fashion. So… if you have linux, pdftk installed, and a mass download extension on your web browser, (such as the great Download-them-All for firefox) we can fix that.
Continue reading