Thursday, September 28, 2006

How to program Microchip PIC microcontrollers

This is something I learned to do fairly recently (6 months ago) on my Mac, after looking for the correct tools for a long time (like a whole year before that). Granted, I have been able to program PICs with my PC for 2 years through the "official" methods, and with a little help from the existing virtualization options.

But today I want to describe how to do it in the Macintosh, 100% no emulation, no virtualization.

First, you will need is a Pickit-1 like mine. They are dirt cheap these days, like $36 direct from Microchip.

After ordering the Pickit, you can get free samples from the company's website. Be sure to check the PIC compatibity within the Pickit-1. I ordered a bunch of 16F675 because they are the only supported PICs with hardware UARTs in them.

Second, obtain a copy of Microchip OSX Pickit tool. It comes with no official support, but it is open source. Get a copy here: Intel, PPC. Use the OSX tool to test that you can download the .HEX files included in the CDROM.

Congratulations. Now you can program PIC microcontrollers!

Of course, you will need a compiled/assembled HEX file to flash your PIC now. There are many, many ways of achieving this, and the ways are more numerous with VPC/Parallels/Bootcamp, but I am working on another blog post that will describe how to code the PIC within OS X.

Related links:

Science Fare post on OSX Pickit support
Robrohan's post on OSX PIC programming
Team Mojo webpage on OSX Pickit support
Eric Behr's page
Orion's page's page
Another Science Fare page
It's getting better's page
Support for Pickit 2!

/me ducks in anticipation of the rotten tomatoes from those who wanted to learn how to code the PIC in OS X.

Tuesday, September 26, 2006

Quartz Extreme/Core Image: applicable in robot vision?

I have been doing some experimentation with Quartz Compositor and Core Image, and it seemed to me like a big, big promise to the field of robotic vision. I am working on a Macbook 2GHz with 950GMA integrated graphics, not as good as the current Mac Pro, Macbook Pro and iMac offerings, but I am seeing very high levels of performance.

A Windows PC does not yet use the graphics card to accelerate video processing. While I know that some robot vision is developed in Matlab, I know that it takes the whole 100% of CPU time to extract relevant vision clues for robot control. An OSX machine may be able to take these tasks and only consume a fraction of CPU power (while the GPU heats up).

Anybody here working on robot vision? I'd like to grab some algorithms and test whether they would be significantly accelerated with Core Image? Any Core Image experts here?

Monday, September 25, 2006

Why do I keep doing electronics with my Mac.

If you are into electronics, you have to use Windows in one way or another. You either go to your school's PC lab to fire up PSpice or Eagle, and you get your work done wishing you could be on your Mac. You may choose to use use a virtualization/emulation application to compile your code or simulate your circuit with a Windows-only app.

That was the way I used to do some of my work with my first Mac in 1998. My iMac 233MHz was loaded with 192MB of RAM for the purpose of using Virtual PC, which I used in occassions to finish my AutoCAD work.

However, I discovered some very unique, very useful Mac apps that gave me some edge in finishing my degree. Like Logic Sim and and hc11Sim, there are many little apps gave me some relief and some independence from VPC and that PC lab filled with 200MHz Pentiums on Windows NT :p

Today, the story is much different. I don't know how many of you readers have Intel Macs now, but if you did, you would be booting Bootcamp to use that external ROM programmer or Parallels to run your favorite FPGA synthesizer. YES, I DO TOO. And my life would actually be easier if I just dropped the effort and continued developing electronics the way the manufacturers envisioned: with a white cursor, a blue taskbar, a green Start button, and rocking out with Windows Media Player.

Why do I choose this path of doing engineering within OS X? Perhaps because I am crazy, or perhaps because I am very stubborn. I like to think that using a different tool will eventually lead to a different product, something that has been evading the mind of Windows purists. Perhaps I will end up with the same product, but with an easier way to upgrade it. Perhaps I can discover and leverage some crazy Apple technology and make my creation truly exceptional.

Or maybe I just want to travel the more stylish road, documenting everything in iMovie, and presenting everything with jaw-dropping Keynote sequences.

In future posts, I will describe how I moved some of my development out of VPC/Parallels, and how I am planning to move MOST of my development into OS X.

Saturday, September 23, 2006

First off, an introduction

So... my first blog. How exciting! :D

My name is Roberto, a MSEE graduate of the University of South Florida (Go Bulls!), a BSEE graduate from Gonzaga University (Go Zags!), and a citizen of Peru (Go Peru!). Not many years ago, when I arrived to the U.S. of A., I started developing a passion for hobby electronics and robotics, and Macintosh computers.

This blog,, is intended to be an outlet for:
  • strategies and tutorials to use your Macintosh in electronic and robotic design
  • developments in Macintosh technology that are relevant to robotics
  • leveraging the collective knowledge of members/posters to improve the Mac as a design platform
  • adopting open source in OS X, with the help of seasoned Unix users.
Welcome all!

This picture here Junkyard Mac, the blog's "mascot". It is a G4 iMac, since it is one of my favorite form factors that has come from Apple. He wears soldering goggles because he is ready to hack.

If you want to leave feedback, please leave your name and whether you are just lurking around, want to actively learn, or if you want to share your skills.