MCU Series, 1: Those Pesky Fuse Bits

The content on Fuse Bits was originally posted on Microcontroller Central, which is no longer on the air. . Much of the content is as it was when I originally posted it, with updates when necessary to correct errors in the original articles or reflect more current information. The following first appeared February 3, 2012.

Hello all, and welcome to Fuse Bits. Come here to share in my travails with microcontroller project design, programming, and PCB design. I work primarily with eight-bit chips from Microchip and Atmel, but I have dabbled with a few ARM devices.

A while back, I put some effort into re-laying out an open-source Geiger counter design toconvert from thru-hole to surface-mount parts. Naturally, it didn't go quite as well as I expected. Geiger tubes require a multihundred-volt power supply, and the original design used a 555 timer to drive an RL discharge into the charge pump to generate this voltage. In theory, the design should create between 400 and 600 volts with microamps of current. Yet my layout produced only about 10 percent of that target. As a result, all of those radioactive particles just passed merrily through the tube without making so much as a tiny pip.

The determinant factors in the HV supply's performance seem to be the frequency, the duty cycle, the inductor, and the inductor discharge resistor. This isn’t my area of expertise, but as far as I can tell, all my component values were correct. Some other factor had come into play and mucked up the output. The coil inductance and the discharge resistor were the right values, but perhaps the coil's DC resistance was too high, or something along those lines.

In any case, I decided to put in a microcontroller, so I could fiddle with the 555's frequency and duty cycle without soldering and unsoldering SMT resistors.

1-20150509_154504Subbing an MCU for the 555 gives me a couple of benefits. First, I can vary the frequency and duty cycle in software. Second, the part count for that section of the circuit goes from six to two, which drops the cost from a dollar and a half to a dollar (in prototype quantities) and reduces the PCB real estate.

I had thought the ATTINY2313 could supply a PWM signal into to the charge pump, replacing the 555 circuit, but the original open-source notes said doing so might present MCU load issues and cause problems with the interrupts and timing needed by other parts of the circuit. In my PIC experience, the hardware PWM peripherals don’t impact the firmware operation in any way. Am I missing something, or shouldn’t the ATTINY work in the same way? I’d really like some clarification on this PWM issue.

Given the possibility that the ATINY isn’t up to the PWM task, I first took a look at the PIC10F200 to replace just the 555. It's a six-lead SOT23-6 that is small and inexpensive. However, a small jump up to a PIC16F1825 gives me enough additional memory and adds a hardware PWM, allowing me to chuck both the 555 and the original MCU.

I haven’t used either of those two PICs before, though, which leads back to the title of this blog. Every time I pick up a new MCU, it seems like I end up spending a few hours debugging a mystery problem that turns out to be an incorrectly set fuse bit. One of these days, I’ll realize that I fall into the same trap every time. In the meantime, I'll keep stumbling forward and dealing with those errant fuse bits as they come up.

Follow along here on Fuse Bits.