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.]

Monday, April 20, 2009

Using ncurses and unicode

Here's a useful post explaining how to output unicode characters in an application linked with the ncursesw library:

http://mail.nl.linux.org/linux-utf8/2004-08/msg00001.html

Xfce under Debian!

After my recent switch from using Ubuntu to Debian on my laptop, I decided to try installing Xfce. The standard Gnome environment that Debian provides is nice enough, and refreshingly free from the various broken and unintuitive add-ons that Ubuntu adds (e.g., compiz). However, I've never exactly loved Gnome, and the philosophy of Xfce --- a simple and easy to use desktop environment --- sounded extremely appealing.

Well, all I can say is that using Xfce was like coming home after years in the wilderness. It's plain, it's simple, people who like all sorts of desktop effects would probably say it's boring, but my god, things just work. It reminds me, in a good way, of using fvwm back in the late 90s, except that modern conveniences (e.g., wicd to manage network connections, xfce4-battery-plugin to monitor the battery) are easily available and integrate unobtrusively.

When I started using Ubuntu, I can remember reading articles that expressed the opinion that Ubuntu was trying to turn Linux into Windows. I thought that view was alarmist at the time, but given the recent efforts of both the Ubuntu and Kubuntu projects to drastically reduce functionality and usability in the name of "modernizing" the user experience, I'm forced to conclude that the alarmists were right. There's a quote from Marge Simpson that I think summarizes the situation nicely: in an episode taking place in the near future, she says "Fox turned into a hard-core pornography network so gradually, I didn't even notice."