Monday, October 3, 2011

(not Quite) 18650 Things To Do With An Old Laptop Battery

By Roy Wood September 19, 2011 7:30 am
A partially disassembled laptop battery (photo by Roy Wood)
If you’ve owned a laptop for a few years, you’ve no doubt encountered the problem that the battery eventually loses its ability to hold a charge. Generally what happens is that one or more of the cells inside the battery pack degrades to the point that it cannot be recharged, and the entire pack loses its effectiveness. At this point, your choices are to buy a new replacement pack, or put on your hardware hacking hat and safety glasses, and start taking things apart.

Now, before you start tearing things apart, note that the lithium cells in a laptop battery can contain a lot of power, and you can hurt yourself or set things on fire if you’re not careful. Sound scary? It should! And if so, then perhaps you should content yourself with just reading through this posting, rather than messing around with things yourself. Either way, on we go.

As you can see in the image on the right above, a laptop battery pack consists of a number of individual cylindrical cells. These cells look a lot like a standard AA alkaline battery, but they’re actually a bit longer and wider than a AA battery. These are lithium cells which go by the part number “18650″ (this is usually printed on the side of the cell, in fact).

Bare 18650 lithium cells (photo by Roy Wood)
The cells are wired up in the battery pack in a combination of parallel and serial circuits in order to provide the voltage by the laptop to operate properly. As mentioned earlier, if one or more of the cells goes bad, then the entire pack cannot supply the requisite voltage, and the pack is effectively dead. At that point, you can buy yourself a new battery from the manufacturer (safe and easy!), or you can tear down the pack and replace the individual cells yourself (risky and difficult!). I’m not going to go into the details of rebuilding a laptop battery pack in this posting, but if you’re curious, check out the articles here and here, and or take a look at the following YouTube video:



Wednesday, September 21, 2011

Monday, September 12, 2011

Tuesday, August 30, 2011

Editorial: Our friend Microchip and open source


August 30, 2011 in open source, PIC by Ian

Microchip jumped into open source last spring with the chipKIT Arduino-compatible development boards and open compiler/IDE. They wanted to tap the existing tutorials, enthusiasm, and customer base of Arduino community, and they were going to play nice with open source. A review of the chipKIT situation today is disappointing. The compiler still replies on closed source, and there won’t be open drivers for key advertised features like Ethernet and USB.

Microchip parts are used in most of our projects. We think they make great chips, and PIC debugging tools are cheap and plentiful. We use Microchip stuff in open source, but Microchip isn’t always open source friendly.

When Microchip dropped the chipKIT we were optimistic. Microchip invested in the Arduino IDE and released an open source compiler for PIC32. Ethernet and USB shields were in discussion at the time (now available), and we speculated that there would be an open source USB and TCPIP stack.

Four months after the fanfare of the chipKIT launch, things aren’t quite as rosy.

Compiler issues

Microchip’s compilers are based on the open source GCC compiler, but they keep some special sauce locked up. Replacing the closed parts isn’t trivial, there aren’t any alternative open source compilers for most PIC chips. Microchip gets the benefit of a community-developed free compiler, but they keep key parts closed that prevent open alternatives. Not all manufacturers do this. Atmel played nice with open source compilers and were rewarded with the Arduino community.

We were assured there was no funny business with the chipKIT compiler, but as of today there are still parts of the chipKIT toolchain that are not open. The standard C runtime library is not available as source. This is not part of the compiler specifically, but it’s needed to build the libc.a file used by the compiler. Microchip cannot make the current version open source due to license agreements with other companies. Without this code, the chipKIT compiler is incomplete. You cannot take the github source and end up with the working package they distribute.

There are solutions to the compiler issue. The open source Newlib standard C runtime library is an alternative. Porting isn’t a pipe dream either, the Pinguino project has already done it.

Closed source drivers

This week saw the launch of Digilent’s network shield. It supports the Ethernet and USB features of the chipKIT MEGA. Some drivers are needed to do anything useful with it, the most basic are a TCPIP stack and a USB stack.

We were optimistic that Microchip wanted to play fair with the Arduino community. They would release open source drivers to support these heavily advertised features. Unfortunately, it’s not going to happen. Only Microchip’s closed-source drivers are available to support Ethernet and USB on the chipKIT network shield.

Microchip has fantastic USB drivers, and TCPIP drivers with web server demos and other good stuff. They are available under a free-as-in-beer but not free-as-in-speech license. You can get the code from their website if you agree to the Microchip Application License, appropriately abbreviated ‘MAL’. It prohibits distribution, use with non-Microchip products, and gives them:
the right to reasonably inspect Licensee’s premises and to audit Licensee’s records and inventory of Licensee Products in order to ensure Licensee’s adherence to the terms of this Agreement.
Heavy stuff, not open source friendly. We use the Microchip USB and TCPIP drivers in several open source projects. Since we can’t redistribute their code, we only include our own files in the source, you have to get the USB driver from Microchip on your own. This isn’t a huge deal, but it’s a definite barrier to a curious newbie who wants to learn more about Microchip’s products.

We don’t understand the advantage of these restrictions. Would a competitor like Atmel risk the appearance of weakness by replying on code from PICs? There are abundant free and open USB options for most other platforms (AVR, ARM), so lock-in doesn’t stop people from using a competitor’s chip. Clearly Microchip is aware of the advantages of open source because they rely on the GCC compiler and want to be in the Arduino ecosystem.

Digilent is the designer, manufacturer, and distributor of the chipKIT hardware. We applaud Digilent for releasing all the files for their chipKIT designs under an open source license.

Gene from Digilent stopped by the comments last week and gave us some background on the TCPIP and USB support for the new shield. The chipKIT team pushed hard for open drivers, but lost. Digilent may write drivers, but that’s a huge project that couldn’t possibly be a good investment for a development board maker. We urged Digilent to adopt the open source JTR-Honken USB stack and help us build a top-notch community driver without restrictions.

Why it matters

It’s great that Microchip invested in the Arduino open source IDE. Unfortunately the contributions seem to stop with support for their product. Parts of chipKIT toolchain are still closed-source, and Microchip isn’t contributing open source drivers for the highly-advertised USB and Ethernet features of the chipKIT Mega.

We buttressed this editorial by saying we’re huge fans of Microchip stuff. It’s their time-honored right to deal in closed source software – most companies do! With the chipKIT, however, Microchip wants to tap the Arduino buzz. They want promote products using the work of an open source community, but they’re not participating in the spirit of that community. It’s not illegal, it’s being a bad neighbor.

We urge Microchip to give something significant back to the community they’re tapping. Open source drivers for the chipKIT shield would be a great first step.