Tuesday, July 29, 2014

An improvement for the USB µISP

I wanted the USB µISP programmer I designed a couple posts ago to be agile down to 1.8 volt systems, but the problem with that idea is that the voltage "break point" for a 5 volt ATTiny2313 is too high to register a 1.8 volt logic high.

But it struck me... why power the ATTiny with 5 volts? I went to the trouble of adding a 3.3 volt LDO to the thing... Why not have that power the controller as well as the target (if selected)?

If you do that, you can also dispense with the level shifting hardware for the USB pins - you can just connect them directly up! Because of the 74HC125 bus buffer, you can program 5 volt systems just fine, since it will happily level-shift the SPI signals up to 5 volts. When the bus buffer is powered by 1.8 volts, the logic high threshold for a 3.3 volt 2313 is still met, and the reverse is true when the bus buffer is powered by 5 volts.

So the net result is that the v0.2 of the µISP should be able to program AVRs operating at all allowable voltage ranges, and can optionally power either 3.3 or 5 volt targets!

Sunday, July 27, 2014

My take on an AVR ISP programmer

I've been using the SparkFun Pocket AVR for all of the time I've been doing it.

It does well enough for what I need, but it does have a couple of deficiencies that I'd address, if I had my druthers.

Firstly, it comes with a Mini USB plug. It's the only thing in our house that has one of those. Everything else is either full size or micro-B. I'd much prefer either over the now oddball mini B connector.

Secondly, though it comes with a switch to select whether or not to apply target power, there is a leak through the buffer control pull-up resistor that applies power even when target power is disabled. Others on the SparkFun comments for the product have noted this, pointing out that it's not safe to use with 3.3 volt devices. Even if it were, your choice is to either power the target at 5 volts or not power it at all.

Adafruit was the source of the original design. They sell a USB Tiny AVR kit. It didn't have the problem of leaking USB power to the target despite target power being disabled because it simply lacked the pull-up resistor. But that means that if you leave the USB end disconnected that the buffer pin will float, potentially taking the buffer chip out of its high-impedance state when you're not actually programming. Also, like SparkFun's programmer, there's no choice other than 5 volt target power or nothing.

So I sat down to make the best-of-breed USB Tiny ISP. My design is all surface mount, so it's quite small. It has a 6 pin ISP socket rather than a 10 pin, because 6 pin is all I use, and if you must, you can always make a wiring shim to turn 6 into 10. Like the original design, there is a 74HC125 bus buffer chip, and when target power is turned off, it is itself powered from the VCC pin of the ISP plug, so it is guaranteed to feed target-power based logic levels at all times. My addition to the design is a 3.3 volt LDO and a 3 pin .1" header that can be used with a jumper to select whether to provide the target with 3.3 volts, 5 volts or no power at all. I also kept the SparkFun addition of a PTC on the USB power input to protect the host PC. In the SparkFun version, they added a pull-up resistor on the BUFFEN line to insure that when the programmer wasn't actually programming the target that the buffers would be tri-stated. The problem with their design is that nothing prevents 5 volt power from being applied to the target through the pull-up from the CTL line when it is high. A simple 1N4148 diode fixes that problem.

In fact, the SOT-23-5 layout for the LDO can, in principle, take a 1.8 volt LDO as well, should you be designing for that voltage instead of 3.3. Turns out that the problem with a 1.8 volt programmer is that the ATTiny still running at 5 volts has a logic-high threshold of over 2 volts. A 1.8 volt programmer would need similar diode-and-pullup treatment on the "near" side of the bus buffer chip, and I'm not going to bother with that. You could power the ATTiny at 3.3 volts. You'd then have to move the zener-and-protection-resistor trickery from the USB bus pins over to MISO. I might consider looking into that as a next step in the design if 1.8 volt programming is a real demand.

JP1 is the self-programming interface. Since the 2313 is SMD, there's no (good) opportunity to program it out-of-circuit, so there needs to be an ISP for it, and since the buffer chip isn't bi-directional, the target ISP socket can't be used. Since I have a pogo pin ISP adapter I got from SparkFun, I can program the 2313 with that and to save space, bury it on the bottom of the board under the 2313.

I need help completing the Magic Trackpad Plugger

The Magic Trackpad "plugger" is a board with a 3.3 volt regulator that's designed to be the exact size of two AA batteries. Its purpose is to allow you to power an Apple Magic Trackpad with a USB connection rather than two AA batteries.

I sell the board in my Tindie store, but it's not a compelling product, as it's not quite complete.

What I envision to complete the product is a replacement for Apple's metal plug with a #6 hole down the middle of it, and a stiff metal spring that can be soldered to the - connector on the board.

The idea is that the USB cable would run up through the middle of the spring and through the hole in the metal plug. You'd insert the board into the battery cavity and then screw the plug in. As the plug was screwed in, it would compress the spring, pressing the + contact at the front of the board into its mate as well as insuring a good contact between the spring and the plug.

I envision the plug being created by Thingiverse out of metal.

But I don't have the 3D modeling skills to create such a thing, nor to spec or obtain the spring.

Can anyone help me out?

Thursday, July 24, 2014

Pi Power IndieGoGo

I've decided to dip my toe into crowd funding again. This time, it's Pi Power.

If you've been following along, you'll remember the last try was for an AD8495 breakout board. That didn't work out, but admittedly, it was a very narrow audience.

I think Pi Power has a much broader appeal.

Check it out at IndieGoGo. If I can fund building 1000 of them, then Pi Power will be self-perpetuating, since the proceeds from the first 1000 would be able to be used to build another 1000 and so forth.

Tuesday, July 22, 2014

A variable bench switching supply?

I've been doing the switching supply thing a lot lately, it seems.

I think the next thing I do might be something along the lines of a bench power supply.

I don't need something hyper-isolated or lab quality, but I would like something that would have a constant voltage output combined with an ammeter.

My thought is that if I start with a very standard 18 VDC, 5A unregulated supply (that is, nothing more than a transformer, bridge rectifier and a big filter cap), I can follow that up with an adjustable buck converter followed by an ammeter and a voltmeter.

I think that requires further consideration...

Sunday, July 20, 2014

Raspberry Pi GPS Stratum 1 NTP server

First. most of the credit for this goes to this page.

I stumbled across it after asking myself (and Twitter) how accurate a GPS based NTP server on the Raspberry Pi could be. Accurate timekeeping has always been an interest of mine. Back when I was in college I breadboarded a CHU modem. I bought an early Magellan developer's board and always intended to turn that into a stratum 1 NTP server, but never got around to it. It was always made more difficult because desktop computers generally didn't have very good facilities for accepting the PPS input. Of course, the Raspberry Pi is a whole 'nother story.

I designed a GPS Pi Plate for the purpose, but it turns out that if you just get yourself the Adafruit Ultimate GPS module breakout board, you can pretty easily make yourself a custom 5 pin cable and be done with it.

What you need to make is a 5 pin .1" SIP cable. This cable is going to connect between pins 4 through 12 (that is 4, 6, 8, 10 and 12) on the GPIO connector and the bottom 5 pins of the breakout board (TX, RX, Vin, GND and PPS).

What you want to do is connect pin 4 to Vin, 6 to GND, 8 to RX, 10 to TX and 12 to PPS.

You can use these to achieve this. I used my own supply, but it's the same concept.

I went down the user-space path. All I had to do was install gpsd (and I'm not entirely sure how necessary that was) and rpi_gpio_ntp. The ntpd that comes with wheezy works just fine and is capable of accepting the 127.127.8.x "server" declarations.

ntp.kfu.com is the result - it's a public stratum 1 server. The catch is that it's IPv6 only. :)

More power supply fun: Micro Boost

I don't know why, but I found myself looking at the Minty Boost today. It's been around for a very long time, but I noticed that it was all through-hole stuff. Even so, the layout is extremely compact, and I wondered for a moment whether one could do something similar with surface-mount components.

Long story short, I was able to recreate the Minty Boost design with surface mount components. The board I came up with was slightly larger than theirs, but I actually put a couple of #4 mounting holes in mine. Believe it or not, that accounts for a lot of the difference.

I started to price it out and noticed immediately that the boost converter they were using was a whopping $6. No wonder they are charging $20 for the kit!

Well, shoot, that just doesn't seem reasonable to me.

I immediately lit upon the NCP1402, which I had used with great success on a GPS reverse geocaching project a few months ago. The only problem with that was that it topped out at 200 mA, which isn't enough for the Minty Boost's 500 mA spec.

Well, that led me to the NCP1450, which is almost exactly like the 1402, but with an externalized MOSFET switch. Since the switch is external, there's no longer a current spec - you use however beefy a MOSFET you need. The NCP1450-5 and a NTGS3446 together are less than a third the cost of the LT1302 they're using. In fact, I could sell the "Micro Boost" on Tindie for $10 without a case (that's the board with all of the electronics assembled, plus a 2xAA battery holder), and I'm fairly sure it would fit in the $2 AdaFruit clone of the Altoids tin.

But would anyone want one? Can't you just buy these at Walgreens now?