Monday, July 13, 2009

AS1106/AS1107 LED display drivers

I've been using the max7219 to control 7-segment LED displays. They're nice, and easy to use, but they're expensive (around $10).

I discovered today that there is a cheap alternative: the AS1106 and AS1107 from Austria Micro Systems. They appear to be functionally identical to the max7219 and max7221, respectively. And, you can buy them from Newark for $4 in qty 1. Sweet.

I've ordered some samples, so we'll see how they work out...

Friday, June 26, 2009

Super-nifty perl script for cropping pdf files

I often need to include a PDF file in a LaTeX document. This works great if the PDF file has a reasonable bounding box, but most software exports PDFs as full-page.

I found a really great perl script that will crop a PDF by settings its bounding box to precisely enclose the PDF file's contents:

http://ctan.org/pkg/pdfcrop

I used it on a couple PDF tables produced by (gag) Microsoft Word 2007, and it worked great.

Thursday, June 25, 2009

Fun with 7-segment LED displays

Here's a circuit with an atmega8 hooked up to a max7219 7-segment display driver chip, with six 7-segment LED displays:


The max7219 is the chip hidden in the rats nest of wires :-)

There's a ds1305 RTC chip on the breadboard, but it's not connected to anything yet.

Cheap USB AVR programmer

I have been using a serial-port AVR programmer (the Olimex one you can buy from Sparkfun) to do AVR development, but my laptop doesn't have a serial port.

There are a number of USB-based AVR programmers, and they're not particularly expensive (e.g., the Atmel AVR-ISP mkII is $34 from Digikey), but being the cheapskate that I am I was looking for something really inexpensive.

I'm happy to report that I've found one that works very well, and is only $10:

http://alldav.com/index.php?main_page=product_info&cPath=5&products_id=24

I'm using it with Sparkfun's AVR breakout board to bring the programming signals onto a breadboard using a single-row 6-pin cable from Digilent. Here's a picture of the whole setup:


The programmer is the small green board on the left. The breakout board is the even smaller red board connected to the programmer at a right angle.

In the host OS, the programmer appears as a serial port (/dev/ttyUSB0 on my Debian laptop). The programmer type for avrdude is "stk500v2".

As an additional bonus, the programmer supplies 5V to your circuit, using the host USB port as the power source. I don't think it will source a lot of current, but it's certainly fine for a few ICs and LEDs. The circuit on the breadboard in the picture has an atmega8 and an LED.

Friday, May 15, 2009

The Xfce challenge

Every Linux (and BSD) user who is currently using Gnome or KDE4 should try Xfce for a week or two.

I've been using Xfce for a couple weeks now, and I can't get over how much more pleasant it is. It's simple. It's unobtrusive. It does what you want with a minimum of fuss. It starts quickly. It reminds me why I use Linux and not a certain commercial OS from a company in Washington state.

I'm now running Xubuntu 9.04 on my desktop machine at work, and I have to say, it's really nice. I take back some of bad things I said about the beta (which utterly failed to connect to any wireless networks on my laptop). The nice thing about having a wired network connection is not having to deal with the disgraceful gnome network manager.

One interesting note about Xubuntu 9.04 is that I have configured it to use nouveau instead of the proprietary nvidia drivers (because the restricted devices manager could not download the latter.) I installed nouveau from the package repository, which apparently doesn't give you 3D acceleration, but I don't care about that.

I had to learn about and futz with xrandr, but eventually I got it completely working with both of my monitors (which are both 1680x1050 widescreens). Here's my xorg.conf if anyone's interested:
http://faculty.ycp.edu/~dhovemey/linux/nouveau-dualhead-xorg.conf

Thursday, April 23, 2009

More Mandelbrot fun

I modified the viewer so that the coordinates of the region being displayed are shown. I also changed the color scheme to show more variation in points close to the set.

Wednesday, April 22, 2009

C#, Mono/Monodevelop, Mandelbrot set

I am teaching a section of CS 101 here at YCP this semester, and we're finishing up the course with a few weeks of C# using Visual Studio. The current assignment is to write a program to display the Mandelbrot set, so of course I had to write my own implementation, which I did. I can definitely recommend it as an enjoyable way to spend an evening

Being a geek, I decided to use multiple threads to speed up the computation, but VMware player (which I use to run Windows XP within Linux) does not appear to emulate multiple CPUs. So, I decided to see if I could compile and run the program using Monodevelop. Sure enough, Monodevelop had no trouble importing a Visual Studio project. I had to fix a couple bugs that hadn't manifested under Windows, but then it worked perfectly.

Obligatory screenshot:


[Yes, I'm still running KDE on my desktop machine. It will be replaced with Xfce after the semester ends.]