Monday, December 10, 2007

Oww, my head...


Luminary Micros board
Originally uploaded by sciencedave

I have a Mac and several PCs at home. I like my Mac, and usually, it's the only computer that I use at home, because the others are busy looking up ancient ancestors or fighting aliens.

One of my hobbies is programming little single board computers to do nerdariffic things. The one in the photo is especially cool. I won't geek-speak about the details, but I got it for around 50 bucks from a company called Luminary Micros, if anyone is interested. I really like the organic LED display- it is 128x64 pixels, and each pixel can be one of 16 shades of gray. The program running on the board in this picture is just presenting text (and is related to the headache I have), but I have written a Java program that allows me to design graphics for the display.

Macs are not all that popular amongst the engineering crowd, and development boards like this are almost never provided with drivers or software to communicate to a Mac. My goal of using this board (to connect to a GPS, and do some cool stuff) has been stymied for several weeks as I figured out what the hell I needed to do to to make the damned thing talk to the Mac. It talks sweetly to my Dell laptop. But it has nothing for my beloved Apple.

First, I spent a bunch of time trolling message boards and looking for drivers on the manufacturers site. I listened to a bunch of anti-Mac trash talk, but I no longer participate in the techno-religious wars, so I just look for info and go on.

Staring at the board and the schematic revealed that the USB chip is from FTDI, and hot damn, they had drivers for OS X on their website! Which seemed to do exactly nothing. Hmm.

Every chip has a long and boring booklet associated with it called a 'data sheet'. It most assuredly is not a sheet. It is a book. A fairly short, but incredibly dense book full of lots of obscure talk about all the detail necessary to use a chip. They are great when you know what piece of data you are looking for, and indispensable if you plan to actually design something yourself. I just wanted to know why the @#$!% thing wasn't recognized by my Mac.

It turns out that USB is really weird, and every commercial piece of USB equipment has unique ID. This ID is used by the operating system to load the proper driver when you plug in the USB thingy you want to use. The FTDI chip has its own ID, and drivers, but can read external memory and use data there to provide a unique ID for an application.

So, the Luminary board has its own ID. Luckily, I had stumbled on the System Profiler utility on the Mac before, so I recalled seeing lots of data on hardware. When I looked, the info for the luminary board was there. I didn't know what to do with it, but it was there.

After some flailing, I saw a site that had a workaround for using a USB weather station that has an FTDI chip in it. It detailed how to edit a file so that the Mac would recognize the device.

So I tried this, carefully studying examples and copying the data I had found into the right places, and it kinda, sorta worked. But not really. The Mac saw the board, but couldn't talk to it.

So I pored over data that Luminary Micros provided. Finally, I saw it. There are TWO channels in the USB chip. The first is used as a programmer for the chip. The second, ta daa, handles serial communication.

So I changed the file to reflect this arcane bit of knowledge, and it worked. My ears are still ringing from the adrenaline. I choked the mother of 12 bastards to the ground and made it work. Whoo Hooo!

Now, just a couple of months of hair pulling, and I should have this thing done.

2 Comments:

At Tuesday, December 11, 2007, Blogger Ψ*Ψ said...

Ouch! sounds a little painful.
The OLED display is SUPER AWESOME, though!

 
At Tuesday, December 11, 2007, Blogger Robin St. John said...

It's mind boggling how much time I spend chasing my tail. It's not that different from chemistry, but with science, there is an excuse- nobody knows the answer. With electronics, someone knows, they just aren't sayin'.

The display is way cool. The company that made this particular display is leaving the OLED market, but other companies are making compatible display, so the new boards still have the cool displays. I think these might be in some cell phones and mp3 players.

I've found some OLED displays that are multicolor, which I plan to use in another iteration.

 

Post a Comment

<< Home