0R and you

Recently on Twitter I made a comment about my supplies of zero ohm resistors (0R) going missing, and I was asked why it mattered since they’re just a wire link.

It’s true that effectively a 0R is a wire link in intent, but that’s not necessarily the best way to think of them, and in many cases you actually want something which doesn’t look like a wire link at all.

Let’s say we have designed a small linear voltage regulator into a board. The most flexible design is one using an adjustable regulator, since we can set it to any desired output voltage. The circuit for that is below:

An adjustable regulator has the output voltage set by changing R1 and R2. Laying this out on a PCB, we end up with something like:

We’re using SMD components for this board. C1 and C2 are either side of the regulator in the middle. R1 and R2 are above C1 and control what voltage we want.

Most voltage regulators also come in a fixed version: R1 and R2 are hidden inside the regulator, so we don’t need to place them outside on the board like this is laid out. Instead, that adjust pin has to be tied to ground like this:

That ADJ pin is now a GND pin. If we look at our PCB, we can see we don’t need to populate R1 any more (there is no connection from Vout to the pin via a resistor), but what about R2. It was a resistor, now it has to be a link. We could design a new board, but if we look at how R2 just needs to become a link, we can do this instead:

This is where we’d use a 0R, they are not just a wire link but the same package as any other resistor. They are physically built the same as any other resistor we could use there, so we don’t need to design a whole new board.

This means we can use both fixed and adjustable versions depending on what we have available, on the same board design, with the same size components. Designing a board for implementation flexibility (in this case, being able to use both types of regulator) improves what they are capable of, so you’ll often find 0Rs on many boards.

Posted in Uncategorized | Leave a comment

Invisible software

The recent decision by the government to flip-flop on the wording of changes to the Patents Bill has pushed the concept of “embedded” software back into the limelight. The whole concept that there is an obvious or well defined line between “software” and “embedded software” is nonsense, but we seem to be persisting with this idea.

If you’ve read this blog before, you’ll have noticed I am spending a bit of time writing code for a few projects that could be called “embedded”. Actually, I don’t personally see them that way at all, they are just code running on general purpose CPUs with some restricted hardware configuration. To me, they are no different in concept to a PC or any other general purpose CPU.

That is, after all, the definition of software: instructions executed by a general purpose machine. Hardware is not a set of discrete abstracted instructions with a concept of execution. The line is very sharp between those two realms.

The arguments seem to boil down to an idea that if the software is invisible enough (to whom is not defined) then it is “embedded”. For example, recently I spent some time with a large aircraft manufacturer discussing some aspects of their aircraft systems. One component was described as an “embedded” security appliance. It actually turned out to be a Linux machine – a general purpose, commonly used OS – on merely a slightly restricted and custom board.

Does a general purpose OS, running on special hardware, but otherwise no different to any other implementation of that OS, constitute ”embedded” in any meaningful way?

Invisible to some is not enough to consider it to be some special class of software, because it’s still software. Another example is the fact that microcontrollers (general purpose CPUs in a very compact form) have reached a price point and size where they are suitable replacements for traditional logic designs. So, every headphone cable shipped with an iPhone or an iPod contains a CPU: it’s in the case with the control buttons in the cord. It’s “invisible”, so therefore it’s now a special class of software, even though it is just software?

Software should not be patentable. Period. How invisible it is, or whatever organisation structure is around how it’s written is irrelevant. Software is not different merely because it’s hidden from view.

Where this becomes complicated is inventions which depend on general purpose CPUs and code. The line should be explicitly stated in the bill: an invention may depend on such a thing but patent protection does not apply to any software involved in the invention, regardless of the form that takes.

Anything else is open to be gamed by industry to create effective patent controls on software, and “embedded” is fluid enough that you can regard all software as embedded in some way.

Posted in Opinion | Leave a comment

Circuit Lab for easy modelling

The MOSFET driver sheild has some problems in it. Both 1.0 and 1.1 don’t keep the voltage of the gate below the Vgs limit, which is usually +/-20V. It also doesn’t pull the voltage source from before the switched load, so if the load is resistive, then we get an unknown voltage into the gate. So version 1.2 of the shield will have some fixes.

But how this is supposed to be fixed was a bit of a dark art. I am not much of an analog electronics person, I understand digital fairly well, but not the analog behaviour or idioms much at all. Another problem is, short of building it and watching it explode, I really would prefer to simulate what the behaviour actually was.

The way this is usually done is with a set of tools known as SPICE. Unfortunately, SPICE does not have a very easy to use interface, you can’t just drop common components down and away you go. There are some tools which attempt to make this easier, but none are really that easy to drive either.

CircuitLab provides a SPICE-like capability with easy drag and drop design, and it’s completely online. With it I was able to correct the design of the board and get the result I wanted and validate it over a wide range of inputs. (It turns out that, as I had suspected, if I limit the current going into the gate, and provide a 10V zener diode between the gate and ground it will hold the gate at 10V when selected.)

Next time you want to do some analog electronics modelling to solve a problem? Try out CircuitLab!

Posted in Tools | Leave a comment

More new PCBs

With a new job looming (actually, already started), it is the best time to start working on electronics projects again. No, I don’t know how that works either.

NTP Server 1.5 board has been made and now awaits testing. It’s pictured below:

The changes are documented on the history page. The two major changes are using a switch-mode power supply instead of a linear one, and removing some external flash that is no longer required now I have a working XBoot setup.

The other board to arrive is the first cut at an Arduino clone based on an XMEGA 64-pin chip. There are a few XMEGA based clones floating around, this one is mostly focussed on trying to support a wide range of 64-pin XMEGA chips and provide some extra hardware to get you started. This board is pictured below:

These are the first boards I’ve had made by the people at Hackvana. The build quality is good, with very clear silk and all drills have been correct. (I’ve had boards from other places with incorrect drills). In particular, despite the very small silk text for component labels (which, I should really have made a lower weight), they’re all clear enough to be read. Tented vias also came through just fine, and Hackvana will accept two drill files for plated and unplated holes, if you prefer to not plate mounting holes.

We’ll see how the boards perform when I get around to completing an assembly, but they look pretty good so far!

Posted in Projects | Tagged , , | Leave a comment

A busy few weeks

Rather unexpectedly, it’s been a busy few weeks on the electronics front. The result has been two new projects show up, and actual real honest progress on two other projects!

The two new designs are shields for an Arduino-based project that the great people at Nicegear are working on. One is a isolated driver and input shield, that allows switching higher voltages than the little Arduino can normally drive at much higher currents; the other is a compact switch-mode supply shield to allow you to run an Arduino off higher voltages without generating large amounts of heat.

The driver shield has been already built and tested by Nicegear, and works mostly as expected. There has been a revision to it already to include more voltage input options for the Arduino on the same shield as the drivers and input isolation. The original revision was limited to 12V for powering the Arduino.

The switch-mode supply shield hasn’t been built or tested just yet, but I’ve breadboarded the design so I am reasonably certain it’s going to work okay.

On the existing projects front, both the XMEGA-based Arduino clone and my long term NTP Server project have new boards ordered and on the way. The XMEGA board turned out pretty well I think, I’m hopeful with upcoming multiarch support in the Arduino IDE to see better support for such boards. On aspect about this board is rather than overloading the shield header with a bunch of useful but in-the-way peripherals, all additional hardware is conflict-free and allows full use of all the shield pins.

For example, the board includes pads for an 8-pin SOIC SPI flash or SRAM chip. While the SPI interface is wired to the usual Arduino pins for this (10-13), the CS line for the chip is on a discrete pin not shared with any of the shield pins. The same is true of extra LEDs, 32.768kHz watch crystal for the RTC, etc.

The NTP server had a minor polish up from the last post on it, but otherwise it’s down to just getting the board made and see if I’ve nailed down the last remaining issues. The software side of this is looking almost complete enough to start field testing!

Posted in Projects | Tagged , , | Leave a comment

Project Updates

A few small updates on the state of various projects..

NTP Server: Version 1.5 board looks mostly final now. The 3.3V switchmode regulator design has been checked on a breadboard and seems to run 1.4 just fine, so we’ll be going with that on the 1.5 board. This will reduce the heat significantly, as the reverse-polarity diode (which itself loses about half a watt) is being replaced with a P-channel MOSFET and the switchmode supply loses far less heat compared to the linear regulators (almost 1.6W are sourced from them alone). Software side I’ve removed all the (hugely problematic) single precision floating point code and use the time reported in integer milliseconds instead. Much nicer!

AVR Programmer: First build has been completed, and it largely works with the LUFA code compiled and uploaded into it. Various issues have come up, such as the bootloader switch not working quite as expected (The bootloader will only enter DFU mode if the switch is closed and we’re coming out of external reset which isn’t just a power-on-reset. Ick.) External flashing of the MCU doesn’t work right (unsure why) and it seems to hold !RESET low on targets. There is a 1.1 which is in progress.

New Breadboard PSU: Following on from the tests on the new switchmode supply for the NTP server, I’ve sketched out a new breadboard PSU which uses the same design. This would be an alternative to the linear one I already make and sell. At the moment it’s a single output design, I’m thinking about ways to make it dual-output or at least easily switchable between 5V and 3.3V.

XMEGA Arduino: Most of this design is completed. I need to just do a build to see how it plays out. The new XMEGA C3 line looked interesting but imposes some annoying routing problems. While using the C3 would provide a USB XMEGA which isn’t encumbered by crypto modules (and, therefore, export regs) and the C3 has USB pins where they are on the AxU chips, it has the same selection of peripherals as the D3 and USB is camped on top of one of the SPI ports. Which makes routing hard. May stick to the D3+MEGA16U2 bridge approach for now.

 

Posted in Projects | Tagged , , , , | Leave a comment

Hakko FX-888 Soldering Station

I finally decided that the ageing cheap soldering iron I bought many years ago was probably not the best tool around for the job. My requirements haven’t really gotten that much more complex, but I had noticed while helping people out on their first soldering experience the iron I have is heavy and slow.

But could a soldering iron that costs about ten times as much as a cheapie really be that much better? It turns out, absolutely it is.

I’m not going to do a full review, but here’s a few thoughts on the Hakko FX-888 I ended up buying..

  • The iron itself is very light and the cable is flexible. This makes it much easier to handle as a tool and position it without fighting both the mass of the iron itself and it being dragged out of place by a heavy cable.
  • The power/control base feels solid and well built. The teardowns I’ve seen floating around the net suggest the internal build quality is pretty good, and the base won’t move easily at all (which again helps with the whole cable thing).
  • It’s really fast. The ceramic heater in the iron seems to hit the dialed temperature (since this is a temp controlled iron) in around 10 or 15 seconds, way quicker than a cheapie iron. I’m far too used to having to plug in the old iron several minutes before I can do anything with it.

I really wasn’t that sure a soldering iron many times more expensive than my cheapie would make such a difference, but it really has. I find it much easier to clean up solder bridges on 0.65mm pitch TSSOP parts with the new iron than I’ve ever had luck with using the old one.

Posted in Tools | Leave a comment

LCA and yet more new projects

A few weeks ago I attended linux.conf.au 2012 in Ballarat, Australia. I’ve attended it for many years now (every year since 2006!) and the conference has always been a great place to see what other people are doing with open source, discover new things I want to play with when I get back, and generally feel it’s okay to be a huge open source nerd.

This year was also the first time I’d presented at the conference, although just in one of the miniconfs. The Arduino miniconf is usually quite popular as the first half of the day is spent assembling a project – this year a full Arduino clone with a bunch of extra peripherals - and then more conventional presentations on things related.

I’ve embedded my talk below, you can probably guess the subject given how often I’ve posted about it. (The clip is a bit of a wonky encode, the AV team didn’t quite trim it properly so it doesn’t start until 57m into the video. It’s not really an hour an a half long!)

In other news, I’ve started to embark on designing an Arduino clone based off the XMEGA MCU line, probably a D3 to begin with as it’s what I’m most familar with. The rough bought layout has been done, although it’s missing switching power sources between the DC jack and USB. It’s also deliberately not using the USB capabilities of some of the XMEGAs since there’s a lack of good code around to support it and it complicates the board layout a fair bit.

The rest of the projects are slowly making their way towards further progress!

Posted in Presentations, Projects | Leave a comment

Heat

All electronics exists to convert electricity into (mostly) heat. It just happens to do something useful along the way. The progression on the design so far has been to consider digital issues first (make the circuit work at all), then mechanical (fit to the case), and now is down to thermal – what to do with the heat.

Now that I’ve started to run the prototypes in the target case I have some idea of the temp of the board, components, and how the case feels. And it’s warmer than I want.

This is somewhat of an issue since the stability of the clock is related to the temperature. If a crystal has a stability of, say, 20ppm, it is always stated with a temperature range at which that holds true. For (most) cheap crystals that’s 25 degrees. As it gets colder or warmer it gets worse.

During the design some of this was taken into consideration. Firstly, since we are aligning ourselves to GPS sources, the stability is less critical: we have a stable external reference less influenced by our local temperature. It does mean we’re limiting how long we can run without GPS sources (it’s currently in the “minutes” range, which is not far off what a $4k device does and this costs nothing like that). This is currently implemented in a coarse-grain way, we just adjust our internal clock being fed by the DS3234 output.

Secondly, the decision to use the DS3234 RTC instead of a watch crystal was driven by the fact it’s a Temperature Compensated Crystal Oscillator, that is it has a temp sensor and can tune the crystal inside it to compensate for the local temperature. Over the range 0 to 40 degrees it claims 2ppm out of the box, and 3.5ppm between -40 and +85. So even with a lot of heat it’s still significantly more stable than a cheap watch crystal.

There are some things I haven’t implemented yet which I’ll now need to consider.

The DS3234 exposes it’s tuning interface, and the datasheet mentions that with an external trusted reference (oh hai GPS) you can feed it extra offset information to further compensate for both aging and to obtain finer precision (you get about +/- 0.1ppm of control). I’ll need to add an extra step after GPS lock to tune the DS3234 against the GPS pulses, and retune it from time to time.

Once the case is closed up properly (it’s not fully closed right now), it may need some holes cut in specific places to improve natural convection. Likely places will be right under the (not very efficient, therefore a source of a lot of heat) LDO regulator. It also will likely need holes in both endplates to ensure any air that is around can get into the case.

We’re also running the main MCU at full clock rate without any regard for clocking down based on demand. While it’s a lot of work to implement, I could look at power management for the MCU by implementing dynamic clocking.

Those things can be done without changing any aspect of the board design.  But there’s board design changes I’m looking at as well.

The 1.5 board now has space for a 16x16x4mm fan in one endplate, with PWM control so we can run it as slow as possible. Like many things, it’s there if I finally decide it needs a fan, but it’s something I’m going to try to avoid. The fan is 3.3V so doesn’t need it’s own LDO (since a lot of fans are 12V, fewer 5V), but should probably have a transistor between the MCU and it to source as little current from the MCU as possible.

The LDO has also been re-arranged to make it easier to attach a small heatsink to. Ideally this will move heat away from going into the board so much, as I suspect that’s what is really causing the reported temps to be as high as they are. It might only work best with real airflow over it, but we’ll see how that goes.

There’s also some evidence the Ethernet section is drawing more power than it should do, as a result of not quite getting the front-end right. There’s fixes for that in 1.5 as well.

All in all, it feels like I’m getting into the real tail end of the project now to be considering these sorts of issues. There’s less making-it-work-at-all, and more making-it-awesome.

Posted in Design, Projects | Tagged | Leave a comment