All posts by dave2

bbpsu-2.0-running

Breadboard PSU Feedback

The time has come to start considering design changes for one of my more commonly shipped projects: The Breadboard PSU. It’s had a few revisions in the time I’ve been making them, most recently moving towards panelisation and automation of more of the build.

Feedback is one of the things which helps me make better things. So the point of this post is to invite people who have bought, used, or seen the PSU to give feedback about it.

At the moment, I have a few changes in the back of my head for the next revision:

  • The 3.3V reg is fed directly from the input voltage. This means it really has trouble supplying much current at all (it’s very thermal limited, since it’s a linear regulator). This should be moved to be fed from the 5V side.
  • The 5V regulator is now going to handle the most load and therefore leak the most heat. The SOT-223 package is not the best for thermal performance, I’d like to re-arrange it for a D-PAK version instead.
  • D-PAK would also allow a more comfortable fit for a heatsink, probably a small 8x8mm one just to try to help improve thermal performance.
  • The MOSFET on the input side for reverse polarity is great for low loss, but is much less critical than I originally felt. It’s slightly less area than a diode. Given the other changes, I’ll probably switch this back to a diode.
  • The DC jack is large and annoying. Either needs to be SMD mount, or possibly take the plunge on JST and include a JST to DC jack cable.

Anyway, feedback is very welcome and I’m happy to answer any questions!

libkakapo recent changes

Hi all, a quick post about some recent changes in libkakapo.

Firstly, on the major API changes, there is a different SPI API than existed previously. It now accepts arbitrary length buffers for bytes to TX and fill with RX. As TX always happens before RX, you can supply the same pointer if you wish.

The API also allows either of these buffers to be provided as NULL, which means it will either generate 0′s on TX (which is how a read-only SPI transaction works), or discard RX bytes.

In the old API, you would do this to write a 128 byte stream:

uint8_t buf[128], n;

ASSERT_CS;
for (n = 0; n < 128; n++) {
    spi_txrx(spi_d,buf[n]);
}
DEASSERT_CS;

On the surface, this doesn't seem like it's that bad, but this involves making 128 function calls to transmit each byte!

Instead, in the new API, you can do this:

uint8_t buf[128];

ASSERT_CS;
spi_txrx(spi_d,buf,NULL,128);
DEASSERT_CS;

Since we're just writing, we can just toss the RX, and throw the SPI driver the whole buffer to churn through. This eventually will allow us to decide if we want to set up DMA for the transaction, which would speed up transfers a little more.

The other changes are more minor:

  • The ringbuffer utility code now uses lengths for buffers, instead of masks. Internally, we still use masks and enforce power-of-two lengths for the ringbuffer, but the API feels more natural.
  • Added a watchdog driver, since the avr-libc one is a little inconsistent with XMEGA hardware. This has not been completely tested (I still need to write a test case for it).
  • GCC was generating warnings for the hook functions in timer.c, these have been silenced properly. (H/T: hads)
  • timer.c also was not returning the same error codes consistent with other drivers, so these have been fixed up.
  • clock.c (the system/peripheral clock configuration API) now returns a unique error code for an oscillator not being ready.

So there we are, that's the last couple of weeks on the libkakapo front!

libkakapo is now LGPL

After a bit of discussion, I came to the realisation that while I am keen to make sure that libkakapo is open source, I only care about how others improve the library, rather than what they do with it.

Pragmatically, I don’t mind if libkakapo was to be used by a closed-source project, so long as if the project made some great improvements that those changes ended up in the main source.

I had chosen GPL for the library more or less by default. But using GPL for the library means that your projects must be under the GPL as well – the linking clause requires it. This makes no sense for a library where I’m only interested in the drivers, not your project source.

LGPL means that both open source projects can use these drivers (which is good, because they can’t use Atmel’s ASF), and closed source projects can as well. The only obligation closed source projects have is to ensure they distribute the library source with their firmware (or generally make the library source available), and that any modifications to it must be included as well.

I think this is a nicer balance and I know a few people have asked about how to use this library on closed-source projects they’re being paid to develop for customers. I’m actually very supportive of that, because it indirectly funds improvements to the library. And that’s definitely a good thing.

So there we are: libkakapo is now LGPL.

Kakapo roadmap

Now that the first batch of boards has been shipped off and are starting to make their way out to customers, I thought I’d post a bit of a roadmap on things that I plan to work on around Kakapo.

First up is to resolve some of the outstanding major tickets on libkakapo. The main one to sort out is the various problems with clock.c, namely that is takes control of hardware when it shouldn’t (breaking the philosophy that you should determine how it’s used, not the framework taking it away from you) and that RTC support needs to be broken out into it’s own code.

Less urgent is to expand the number of supported modules. I’d like to get watchdog, type 2, 4, and 5 timers, and a few other things with better support. Modules present on the XMEGA D4 will be highest priority, but given I use libkakapo myself on other projects, support for some of their modules is useful to me at least.

Anyway, if you’d like some idea what I think is on my to-do list for libkakapo, have a look over the issue tracking.

I also need to write up more tutorials which build on the examples provided in the libkakapo source. Those examples actually serve as test suites as well, since they provide a quick way to check the libkakapo driver works as I expect. But they should really have documentation associated with them here about what they’re doing and why they work.

On the hardware front, the next major addition to the family will be a W5500-based Ethernet+microSD shield. This is the latest revision of the Ethernet/IP chip commonly used on Arduino Ethernet shields. The first prototypes of the PCB go off to be made this weekend. You’ll see more updates on that soon, I hope!

Lastly, thanks to everyone who has expressed interest, committed code, and generally supported getting Kakapo out and about. I really appreciate the effort people have put in.

Open Source Hardware and Kickstarter et al

You’ve designed a great widget or board, and it’s time to get some backers to turn it into a shipping product. Up goes a page on Kickstarter, and the questions and money start rolling in.

At some point, you might be asked whether your thing is going to be open source. Or, your intention is to make it open source when it ships. Great, there’s a lot of community interest in open source hardware and your Kickstarter goes well.

Only you can’t actually open source it, because it has a binary blob to support a chip. Or an NDA for the datasheets. Or you thought a published API was all you had to do. In some cases, you can’t because you didn’t understand what open source meant, and what people expected is far from what you’ve offered.

Hardware projects on Kickstarter are great, but I see too many with intentions or vague statements about open source that are straying close to misleading. Some variation from the promises made is to be expected, but making a major claim about a product (like saying it is or will be open source) is quite different.

You probably aren’t actually trying to fleece people. But as someone who actually makes Open Source Hardware, I feel like you might be treading into the area without playing fair. So before you trumpet that your widget is open source, here’s some things to think about.

Do you understand what Open Source means?

A very important first step is to make sure you are using the same meanings as everyone else. Have you read the OSHW definition, and definitions of various licenses for your firmware? Do you understand the implications of linking a binary blob into an otherwise open source piece of code? Some licenses may not allow you to do this (so-called “linking clause”).

Are you prepared to release all your design files in their original source form? It’s not sufficient to release compiled or generated files (eg, PCB gerbers), you need to provide the source used to create and edit the design.

Do your due-diligence before mentioning open source

This is a really basic thing, you should already have a good understanding about the parts you are using and what restrictions are in place for those parts. For example, if you need to sign an NDA to get the datasheet, there is a low chance you could reasonably meet Open Source.

Are the parts well documented enough to be easily replaced by alternatives? Do you need special toolchains or libraries with licenses that are incompatible with open source?

Have you chosen a license?

It can be hard to judge if you have given much thought to what open source means if you haven’t selected a license already.  You will need to consider a license for both the hardware design and the firmware or software involved in it.

License terms could exclude it from being considered as open source. For example, if you do not allow derivative works this does not meet the OSHW definition.

Conclusion

I really want to see more OSHW designs, and sites like Kickstarter are really good at getting them started. But don’t just hop on the open source bandwagon without thinking about it carefully. That just makes it harder for those of us following the rules to appear honest, and you’ll have disappointed customers too.

Quick shipping update

The first 16 Kakapo boards available to buy have been shipped to nicegear today. I still need to take proper product photos, but that doesn’t stop them working so it’s been down my priority list.

The next thing to work on is cleaning up libkakapo documentation inside the source and writing up more documentation here. I also need to submit a patch to avrdude to allow the avr109 programmer type to perform automatic reset. It’s not a huge patch, but I’m not sure when it’ll be merged.

10412884_245167922348474_1593905734_n

First shipping batch almost complete!

A bit of a production update on the Kakapo. The first production batch of 16 boards has been completed, and are ready to pack and ship off to nicegear. There is also now a product page up so you can register to buy one before they arrive.

The next task is the final boxing. I had originally planned to use a set of black boxes with a sleeve, but they are quite large. They fit the boards plus the USB cable just fine, but I have been thinking about a more compact box.

BqsWn4YCEAAqwx1Playing around in Inkscape with a flat-box design and cutting from 160gsm card stock, I think I’ve come up with a nice compact box which is large enough for the board (in a bubble anti-static bag) and USB cable.

Now the question is, figuring out how to get lots of them made cheaply and easily. Hand-cut is fine for a prototype but it definitely won’t scale.

The pricing of things

The part about making electronics for people to buy that I really don’t do well is the price. Designing something, while it has some challenges, doesn’t stump me as hard as picking a price for the result.

Covering the obvious costs (ie, the components) is usually pretty easy. Covering my time is harder, since even for assembly time I don’t have a useful value for it. Not one I could reasonably apply.

There’s also some complexity in the cost of the components. I’m not making thousands or millions of these, so the prices for components are volatile and sensitive to quantity.

This then means the price for initial runs has to be just high enough to cover the big costs and a little more to help fund the next run, but not so high it won’t sell at all.

While I’d like to think I’m inventing new things, I am not and the market already has a price for many of these things. The heuristic of “cost times three” breaks down – I don’t have the same production capacity or immediate demand to make that viable against the market price.

A lot of the future is about getting better pricing on the parts I am using, and improving build processes so that it takes less time to do each build.

Funnily enough, I am working through the pricing for the Kakapo dev board, which is what prompted this post. Should be an announcement soon on what that looks like!

Kakapo production boards

20140610_181047

The Kakapo production boards have arrived! These are a 2×2 panel (so a total of 4 boards within each panel) and the new silk has turned out fantastically well. Hackvana has supplied these boards and they have delivered very high quality PCBs again.

The new Kakapo logo was redone for this run, mostly to make it look better in white rather than the black I had originally planned. The drawing was redone in Inkscape, with cut-out lines for adding detail to the solid area. I think it’s turned out great, the picture doesn’t do justice to how fine the detail lines actually are.

I expect to start production on these at the weekend, starting with shipping the final configuration to Nicegear for feedback and then ramping up making the first run.

It’s also about time I worked out the pricing, I’m aiming for around the same as an Arduino Uno, at least as close as I can make it. It will depend on how much small runs (as it currently is being made) adds to the costs.

Kicad Nightly

Since the excellent CERN push and shove router has been pulled into mainline, I’ve been playing around with the KiCad nightlies. This is a bit bleeding edge, but given the rate of development (and, so far, mostly minor crashes) it’s been okay.

The push and shove router is just awesome. At the moment it still only exists as a special rendering mode, so it’s a bit cumbersome to switch between it and the rest of the functionality. I can’t wait for the OpenGL rendering CERN have added to be the default.

There’s a few really powerful changes straight off in the OpenGL mode. The first is the layer you’re working on is brought to the top, so you can much more easily see the related traces for the layer. This seems simple, but it makes a world of difference for running traces.

The push and shove router has some great features. Apart from being able to more intelligently follow where you are pushing the cursor, it will adjust tracks around the path you’re taking to meet design rules. This means tracks are gently pushed away to fit the new track, but only enough distance to ensure you are within DRC.

But you can also drag traces like never before. Hitting G on a trace allows you to just drag the trace section, so it adjusts how it connects to the other stationary parts, and adjusts other traces to suit how you are trying to push the segment around.

kicad-opengl

For example, in the screenshot above, I’ve just pulled the LED lines so they are spaced close, and clear of the mounting hole. It’s easy to just grab the angle section and pull it towards the capacitor to the left, and then pull the other lines to bring them together.

Similarly, I ran the USB D+/D- lines first, but then needed access to the two pins beside them. It’s easy to start a trace, and drop a via, with the lines being gently pushed out to suit.

KiCad was already allowing me a lot less instances of having to rip-up traces, but with the new router I’m doing so even less, and it’s much easier to get a really tight design done.