Flash Memory Endurance Testing

[Gene] has a project that writes a lot of settings to a PIC microcontroller’s Flash memory. Flash has limited read/erase cycles, and although the obvious problem can be mitigated with error correction codes, it’s a good idea to figure out how Flash fails before picking a certain ECC. This now became a problem of banging on PICs until they puked, and mapping out the failure pattern of the Flash memory in these chips.

The chip on the chopping block for this experiment was a PIC32MX150, with 128K of NOR Flash and 3K of extra Flash for a bootloader. There’s hardware support for erasing all the Flash, erasing one page, programming one row, and programming one word. Because [Gene] expected one bit to work after it had failed and vice versa, the testing protocol used RAM buffers to compare the last state and new state for each bit tested in the Flash. 2K of RAM was tested at a time, with a total of 16K of Flash testable. The code basically cycles through a loop that erases all the pages (should set all bits to ‘1’), read the pages to check if all bits were ‘1’, writes ‘0’ to all pages, and reads pages to check if all bits were ‘0’. The output of the test was a 4.6 GB text file that looked something like this:
Continue reading “Flash Memory Endurance Testing”

Finding a Cheaper USB to Serial Chips

FTDI-gate wasn’t great for anybody, and now with hardware hobbyists and technological tinkerers moving away from the most popular USB to serial adapter, some other chip has to fill the void. The cheapest USB to serial chip on the market appears to be the CH340G, available for 20-40 cents apiece from the usual retailers. There is, however, almost no English documentation, and the datasheet for the CH340 family doesn’t include this chip. [Ian]’s here to help you out. He got his mitts on a few of these chips and managed to figure out the pinout and a few reference schematics. He even made an Eagle part for you. Isn’t that nice?

The CH340 series of chips do exactly what you would expect them to do: a full-speed USB device that emulates a standard serial interface, with speeds from 50bps to 2Mpbs. The chip supports 5V and 3.3V, and all the weird modem lines are supported. This chip even has an IrDA mode, because wireless communication in the 90s was exactly as rad as you remember.

With [Ian]’s help, we now have a cheap source of USB to serial chips. If you need the datasheet, here you go. The driver is a bit more difficult to find, but what you’re looking for is the CH341 family of chips. That can be found with a little bit of Google fu.

Palatable Pallet Procurement Procedures

Wooden pallets are a versatile and widely-available starting point for a multitude of projects. Best of all, they can usually be acquired free of charge. But choose the wrong kind of pallet and you could end up paying dearly. [Eric] has compiled a great deal of useful information about pallets that will help you find ideal candidates and prepare them for whatever project you have in mind, be it a coffee table or a backyard roller coaster.

Pallets come in several styles and loader configurations. Some are made with space between the boards, and others are closed. If you take nothing else away from his article, just remember to look for plain, untinted pallets with no markings and you’ll be fine.

No markings means the pallet was used domestically, so markings aren’t required. Marked pallets from abroad should feature the IPPC logo as well as a treatment code indicating the method used on the material. Debarked (DB), heat treated (HT), and pallets with the European Pallet Association logo (EPAL) are all safe choices. Pallets labeled (MB) were treated with methyl bromide, which is a poisonous fungicide. Colored pallets should be avoided as well. If you find one in a cool color, take a picture of it and find some paint in a similar hue.

Safe pallets can be had from many places ranging from hardware stores to feed and tack supply stores. Find someone you can ask for permission to take pallets—they might even help you load them. Keep some gloves in your trunk to avoid splinters.

A Description of Maddening Battery Terminology

Once again, [Afroman] is here for you, this time breaking down electrolyte and the terminology behind batteries.

Volts and Amps are easy mode, but what about Amp hours? They’re not coulombs per second hours, because that wouldn’t make any sense. An Amp hour is a completely different unit podcast, where a 1Ah battery can supply one amp for one hour, or two amps for 30 minutes, or 500 mA for two hours.

Okay, what if you take two batteries and put them in series? That would double the voltage, but have the same Ah rating as a single cell. Does this mean there is the same amount of energy in two batteries as what is found in a single cell? No, so we need a new unit: the Watt hour. That’s Volts times Amp hours, or more incorrectly, one joule per second hour.

Now it’s a question of the number of cells in a battery. What’s the terminology for the number of cells? S. If there are three cells in a battery, that battery has a 3S rating. You would think that C would be the best letter of the alphabet to use for this metric, but C is entirely different. Nothing here makes any sense at all.

What is C? That’s related to the number of amps a battery can discharge safely. If a 20C battery can discharge 2200mAh, it can deliver a maximum current of 44 A, with 20C times 2.2Ah being 44A.

So there you go. A complete description of something you can’t use logic and inference to reason through. Video below.

Continue reading “A Description of Maddening Battery Terminology”

A Li-ion Battery Charging Guide

Although [pinomelean’s] Lithium-ion battery guide sounds like the topic is a bit specific, you’ll find a number of rechargeable battery basics discussed at length. Don’t know what a C-rate is? Pfffft. Roll up those sleeves and let’s dive into some theory.

As if you needed a reminder, many lithium battery types are prone to outbursts if mishandled: a proper charging technique is essential. [pinomelean] provides a detailed breakdown of the typical stages involved in a charge cycle and offers some tips on the advantages to lower voltage thresholds before turning his attention to the practical side: designing your own charger circuit from scratch.

The circuit itself is based around a handful of LM324 op-amps, creating a current and voltage-limited power supply. Voltage limits to 4.2V, and current is adjustable: from 160mA to 1600mA. This charger may take a few hours to juice up your batteries, but it does so safely, and [pinomelean’s] step-by-step description of the device helps illustrate exactly how the process works.

[Thanks mansalvo]

Afroman Demonstrates Boost Converters

If you need to regulate your power input down to a reasonable voltage for a project, you reach for a switching regulator, or failing that, an inefficient linear regulator. What if you need to boost the voltage inside a project? It’s boost converter time, and Afrotechmods is here to show you how they work.

In its simplest form, a boost converter can be built from only an inductor, a diode, a capacitor, and a transistor. By switching the transistor on and off with varying duty cycles, energy is stored in the inductor, and then sent straight to the capacitor. Calculating the values for the duty cycle, frequency, inductor, and the other various parts of a boost converter means a whole bunch of math, but following the recommended layout in the datasheets for boost and switching converters is generally good enough.


[Afroman]’s example circuit for this tutorial is a simple boost converter built around an LT1370 switching regulator. In addition to that there’s also a small regulator, diode, a few big caps and resistors, and a pot for the feedback pin. This is all you need to build a simple boost converter, and the pot tied to the feedback pin varies the duty cycle of the regulator, changing the output voltage.

It’s an extremely efficient way to boost voltage, measured by [Afroman] at over 80%. It’s also exceptionally easy to build, with just a handful of parts soldered directly onto a piece of perfboard.

Video below.

Continue reading “Afroman Demonstrates Boost Converters”

More WiFi Modules for IoT Madness

The last year has brought us CC3000 WiFi module from TI, and recently the improved CC3200 that includes an integrated microcontroller. The Chinese design houses have gotten the hint, putting out the exceptionally cheap ESP8266, a serial to WiFi bridge that also includes a microcontroller to handle the TCP/IP stack and the software side of an 802.11 connection. Now there’s another dedicated WiFi module. It’s called the MT7681, and it’s exactly what you would expect given the competition: a programmable module with the ability to connect to a WiFi network.

Like TI’s CC3200, and the ESP8266, the MT7681 can be connected to any microcontroller over a serial connection, making it a serial to WiFi bridge. This module also contains a user-programmable microcontroller, meaning you don’t need to connect an Arduino to blink a few pins; UART, SPI, and a few GPIO pins are right on the board. The module also includes an SDK and gnu compiler, so development of custom code running on this module should be easier than some of the other alternatives.

You can pick up one of the MT7681 modules through the usual channels, but there’s an Indiegogo campaign based in China that takes this module and builds a ‘dock’ around it. The dock has a relay, temperature/humidity sensor, a few GPIO pins, and a USB serial connection for use as an Internet of Things base station.

For anyone looking for a little more computational horsepower, there’s also a few mentions and press releases announcing another module, the MT7688, This is a very small (12mm by 12mm) module running Linux with 256 MB of RAM and 802.11n support. This module hasn’t even hit the market yet, but we’ll be on the lookout for when it will be released.

Thanks [uhrheber] for sending this one in.