How to use the PICkit2 programmer under Linux

I’ve been using the Microchip PICkit2 development programmer for a long time now, under Windows and Linux :), it’s a very good piece of hardware and I think the recommended companion for hobby PIC micro controller developers.

These days I had to install the software for Ubuntu Lucid (32 bits) at work, and I think I’ll list the required steps to have it working so that I don’t forget them ;), and maybe it can be of help.
Continue reading How to use the PICkit2 programmer under Linux

How to make a RTL 8185 wifi card work with Ubuntu

At work, I have an Encore ENLWI-G2 pci wifi card that used to work quite well with Ubuntu (we are using the Karmic Koala version), but after a kernel update, it didn’t work anymore. Sometimes it’d connect but then lose connection after a while, but most of the time the link led wouldn’t turn on and the card didn’t respond to any connection attempt.

The card was correctly recognized by the system, running lspci would return:

Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8185 IEEE 802.11a/b/g Wireless LAN Controller (rev 20)

As shown, the card uses a Realtek 8185 chipset.

What didn’t work:

  • Checked correct modules were running, stopped and restarted them (as some people on the Ubuntu forums suggested).
    Nothing happened.
  • Downloaded the Linux driver from the Realtek site (click here to visit it).
    Compiled and installed it, it removed previous modules and added a new rt8185 to the system, but didn’t get the card working.
  • Downloaded Windows XP driver from the Realtek site and tried using ndiswrapper.
    Drivers installed successfully and ndiswrapper showed rt8185 as an alternative to them, but the device appeared as “unclaimed” and didn’t work. As this was the first time I ever try ndiswrapper I thought I was doing something wrong, removed the Linux driver and tried several other things, but no luck.

What worked:
ndiswrapper. Yes, I said before it didn’t work, but also said that I was using the driver I downloaded from the Realtek site. After that unsuccesfull attempt, I tried again using the drivers from the installation CD ( I found it around the office) and this time it worked! We have some other wifi cards from other manufacturers using the same Realtek chip, I’d give them a try when I have some time ;).

These are the steps I followed for installing the Windows drivers:

  • Downloaded ndiswrapper from this link (most recent version was 1.56 at the time of this writing). If you have an alternative method for accessing the internet, you can install ndiswrapper from the Ubuntu repositories.
  • Uncompress, compile and install.
  • Get the Windows XP drivers from the installation CD.
  • Install the drivers using ndiswrapper:

    ndiswrapper -i net8185.inf

  • Add ndiswrapper to /etc/modules
  • Restart

————————————
06/23/10 update:
I had some trouble as I commented in a reply to this post, but I’ve switched mother board and it works again. Guess the problem is the mother board, it’s strange since I tested the wifi card under Windows, and also tried two other wifi cards in Ubuntu with that mother board. Anyway, I was able to test two other mother boards and the wifi card works great, so I must conclude the problem is with my first board.

Summary
– Under Ubuntu Karmic Koala (9.10), my Encore ENLWI-G2 (Realtek 8185) does not work with my Biostar MCP6PB M2 motherboard, no matter if using the native driver (which used to work) or the Windows driver (which also worked for some time).
– The same card works fine with other mother boards (I tested Elitegroup A780GM-A and Intel D945GCLF2) under Ubuntu Karmic (tested using ndiswrapper).
– Under Ubuntu Lucid Lynx (10.04), my wifi card works with the native rtl8180 driver, it shows less accurate signal strength than ndiswrapper under Karmic however. I think ndiswrapper would give me better perfomance under Lucid too, but I prefer the native driver and save the ndiswrapper alternative if having trouble.
– I haven’t tested: ndiswrapper under Lucid.
– Hope this info helps someone, I keep it for my records ;).

Killing mosquitoes with laser

The Intellectual Ventures company has just published a video showing a mosquito killed by a laser, one of their proposals to fight malaria. The video looks really interesting, the only thing that makes me worry is the possible misuses it could have.

Watch the video:
http://link.brightcove.com/services/player/bcpid66305942001?bctid=66338445001

On Youtube:

Cafe World Test Dish

Today, while cooking some cheese hamburgers in Cafe World (Facebook game), instead of one of the burgers I got a dish titled “Test Dish”, I thought I had made a mistake while selecting the dish from the menu, but it was not there. I made a quick web search and found some other people who found this test dish too, but couldn’t find precise information whether it is a bug or an easter egg from the programmers.

This is a screenshot showing this “Test Dish” inside the game:

Have you found it? Do you know why it appears?

Babelfish -> Google Translator -> Word Reference

Every now and then, when I’m reading documents written in English, I find some words I don’t know. And sometimes, when I’m writting in English, I’d like to have a synonym and I make use of an online English<->Spanish translator (I don’t have any translator program installed). I’ve used Babelfish a lot, until I got “weird results” with some known words. I tried these words: draw, wide and draw on.

These were the results at Babelfish:
draw -> drenaje
wide -> de par en par
draw on -> drenaje encendido (well, you could expect this one :P).

Using Google Translator:
draw -> dibujar
wide -> ancho
draw on -> aprovechar

Definitely, I won’t be using Babelfish anymore.
Another one I consider a very good option for translations is WordReference.com, you can find full definitions with several alternatives, just like a real dictionary, recommended :).

Capture screen using C#

This tiny example shows how easy is to make a desktop screenshot and save it to a file using the .NET framework.

What we will be doing is creating an instance of the Graphics class, call the CopyFromScreen function to acquire an screenshot of the desktop (just like pressing the [Print Screen] key) and, for saving it to a file, we will use the Save function of an instance of the Bitmap class, associated to the Graphics instance we created first. It’s easy, let’s have a look at the code :).

Continue reading Capture screen using C#

eaglefree18f2550: Development board for PIC18F2550

This is a development board for the PIC18F2550, I designed this board inspired by the TP-2550 development board by Giovanni Lafebre (site is in Spanish). Main difference between the original and my design is the size, mine is 10×8 cm, so it has less elements. This is because I created this board using the free version of Eagle, so I adjusted to its restrictions.

Eaglefree18f2550 features:

  • 8 LEDs.
  • 4 push buttons with pull-down 220Ω resistors.
  • 2 potentiometers.
  • 1 relay with an active LED indicator. For using the relay, you must provide an external power supply.
  • 1 H bridge.
  • 1 barrel connector for H bridge power supply.
  • The board can be supplied from the USB or from an external supply (jumper selectable).
  • 5V regulator onboard.
  • ICSP port for PIC programming.
  • Jumper for enabling/disabling programmer voltage. This allows for the programmer to be powered from the board supply, so we can have the programmer plugged to the board all the time.

Continue reading eaglefree18f2550: Development board for PIC18F2550