Learn to Optimize Code in Assembly… for Android

When programming a microcontroller, there are some physical limitations that you’ll come across much earlier than programming a modern computer, whether that’s program size or even processor speed. To make the most use of a small chip, we can easily dig into the assembly language to optimize our code. On the other hand, modern processors in everyday computers and smartphones are so fast and have so much memory compared to microcontrollers that this is rarely necessary, but on the off-chance that you really want to dig into the assembly language for ARM, [Uri Shaked] has a tutorial to get you started.

The tutorial starts with a “hello, world” program for Android written entirely in assembly. [Uri] goes into detail on every line of the program, since it looks a little confusing if you’ve never dealt with assembly before. The second half of the program is a walkthrough on how to actually execute this program on your device by using the Android Native Deveolpment Kit (NDK) and using ADB to communicate with the phone. This might be second nature for some of us already, but for those who have never programmed on a handheld device before, it’s worthwhile to notice that there are a lot more steps to go through than you might have on a regular computer.

If you want to skip the assembly language part of all of this and just get started writing programs for Android, you can download an IDE and get started pretty easily, but there’s a huge advantage to knowing assembly once you get deep in the weeds especially if you want to start reverse engineering software or bitbanging communications protocols. And if you don’t have an Android device handy to learn on, you can still learn assembly just by playing a game.

A Close Look at the Prusa i3 MK3

The Prusa i3 MK3 is, for lack of a better word, inescapable. Nearly every hacker or tech event that I’ve attended in 2018 has had dozens of them humming away, and you won’t get long looking up 3D printing on YouTube or discussion forums without somebody singing its praises. Demand for Prusa’s latest i3 printer is so high that there’s a literal waiting list to get one.

At the time of this writing, over a year after the printer was officially put up for sale, there’s still nearly a month lead time on the assembled version. Even longer if you want to wait on the upgraded powder coated bed, which has unfortunately turned out to be a considerable production bottleneck. But the team has finally caught up enough that the kit version of the printer (minus the powder coated bed) is currently in stock and shipping next day.

I thought this was a good a time as any to pull the trigger on the kit and see for myself what all the excitement is about. Now that I’ve had the Prusa i3 MK3 up and running for a couple of weeks, I can say with confidence that it’s not just hype. It isn’t a revolution in desktop 3D printing, but it’s absolutely an evolution, and almost certainly represents the shape of things to come for the next few years.

That said, it isn’t perfect. There’s still a few elements of the design that left me scratching my head a bit, and some parts of the assembly weren’t quite as smooth as the rest. I’ve put together some of those observations below. This isn’t meant to be a review of the Prusa i3 MK3 printer, there’s more than enough of those already, but hopefully these assorted notes may be of use to anyone thinking of jumping on the Prusa bandwagon now that production has started really ramping up.

Continue reading “A Close Look at the Prusa i3 MK3”

Displaying Bitmaps on the Apple II

The Apple II was the popular darling that truly kicked off the ascention of the company that would later bring you darlings such as the iMac, iPod, and iPhone. The brainchild of the legendary Steve Wozniak, it was a low-cost home computer that made use of some interesting compromises to create video output with the bare minimum components. This can make it difficult if you want to output full-bitmap graphics on the Apple II – but it is certainly possible.

[cybernesto] set about completing this task, and released VBMP on GitHub. Programmed in assembly, it builds upon the work of democoder Arnaud Cocquière to display bitmap images on the vintage 6502-powered machine. Capable of displaying monochrome images in 560 x 192 or sixteen colors in 140 x 192, it loads slowly but does get the job done.

We’ve seen similar development underway elsewhere, too – on this vintage satellite tracker project. [Keplermatic] reports that their code runs at a similar speed to the VBMP loader, despite doing several things differently. It’s also available over at GitHub, for your reading pleasure.

If you’re looking to achieve something similar with your vintage hardware, it’s worth a look. Having the source available makes integrating it into further projects a snap. Learning to program these older machines can be challenging, but that’s half the fun – and when you build something awesome, be sure to drop it on the tips line.

Acrylic Stencils Help with Component Placement for SMD Assembly

Surface mount is where the action is in the world of DIY PCBs, and deservedly so. SMDs are so much smaller than through-hole components, and fewer holes to drill make surface-mount PCBs easier to manufacture. Reflow soldering is even a snap now thanks to DIY ovens and solder stencils you can get when you order your boards.

So what’s the point of adding another stencil to the surface-mount process? These component placement stencils are [James Bowman]’s solution for speeding up assembly of boards in production runs too small to justify a pick and place robot. [James] finds that placing small components like discrete resistors and caps easy, but struggles with the placement of the larger components, like QFN packaged microcontrollers. Getting such packages lined up exactly is hard when the leads are underneath, and he found repositioning led to smeared solder paste. His acrylic stencils, which are laser-cut from SVGs derived directly from the Eagle files with a script he provides, sandwich the prepped board and let him just drop the big packages into their holes. The acrylic pops off after placement, leaving the components stuck to the solder paste and ready for their trip to the Easy Bake.

[James] claims it really speeds up hand placement in his biggish runs, and it’s a whole lot cheaper than a dedicated robot. But as slick as we think this idea is, a DIY pick and place is still really sweet.

Tables are Turned as Robots Assemble IKEA Furniture

Hackaday pages are rife with examples of robots being built with furniture parts. In this example, the tables are turned and robots are the masters of IKEA pieces. We are not silly enough to assume that these robots unfolded the instructions, looked at one another, scratched their CPUs, and began assembling. Of course, the procedure was preordained by the programmers, but the way they mate the pegs into the ends of the cross-members is a very human thing to do. It reminds us of finding a phone charging socket in the dark. This kind of behavior is due to force feedback which tell the robots when a piece is properly seated which means that they can use vision to fit the components together without sub-millimeter precision.

All the hardware used to make the IKEA assembler is publicly available, and while it may be out of the typical hacker price range, this is a sign of the times as robots become part of the household. Currently, the household robots are washing machines, smart speakers, and 3D printers. Ten years ago those weren’t Internet connected machines so it should be no surprise if robotic arms join the club of household robots soon. Your next robotics project could be the tipping point that brings a new class of robots to the home.

Back to our usual hijinks, here is a robot arm from IKEA parts and a projector built into a similar lamp. or a 3D printer enclosed in an IKEA cabinet for a classy home robot.

Continue reading “Tables are Turned as Robots Assemble IKEA Furniture”

3D Printed Tool Tips to Straighten DIP Chips and Unstraighten Resistors

Watching someone assemble a kit is a great way to see some tools you may have not encountered before and maybe learn some new tricks. During [Marco Reps’] recent build of a GPS synchronized Nixie clock kit we spied a couple of handy tools that you can 3D print for your own bench.

Fresh from the factory Dual Inline Package (DIP) chips come with their legs splayed every so slightly apart — enough to not fit into the carefully designed footprints on a circuit board. You may be used to imprecisely bending them by hand on the surface of the bench. [Marco] is more refined and shows off a neat little spring loaded tool that just takes a couple of squeezes to neatly bend both sides of the DIP, leaving every leg the perfect angle. Shown here is a 3D printed version called the IC Pin Straightener that you can throw together with springs and common fasteners.

Another tool which caught our eye is the one he uses for bending the metal film resistor leads: the “Biegelehre” or lead bending tool. You can see that [Marco’s] tool has an angled trench to account for different resistor body widths, with stepped edges for standard PCB footprint spacing. We bet you frequently use the same resistor bodies so 3D printing is made easier by using a single tool for each width. If you really must copy what [Marco] is using, we did find this other model that more closely resembles his.

As for new tricks, there are a lot of small details worth appreciating in the kit assembly. [Marco] cleans up the boards using snips to cut away the support material and runs them over sandpaper on a flat surface. Not all Nixie tubes are perfectly uniform so there’s some manual adjustment there. And in general his soldering practices are among the best we’ve seen. As usual, there’s plenty of [Marco’s] unique brand of humor to enjoy along the way.

We have a warm spot in our heart for simple tools you can whip up on the ‘ole 3D printer. Check out the PCB vise, a set of ball and socket helping hands, and a collection of toolbag essentials.

Continue reading “3D Printed Tool Tips to Straighten DIP Chips and Unstraighten Resistors”

Simple Mechanism Gives Support for SMT Assembly

With the fine work needed for surface-mount technology, most of the job entails overcoming the limits of the human body. Eyes more than a couple of decades old need help to see what’s going on, and fingers that are fine for manipulating relatively large objects need mechanical assistance to grasp tiny SMT components. But where it can really fall apart is when you get the shakes, those involuntary tiny muscle movements that we rarely notice in the real world, but wreak havoc as we try to place components on a PCB.

To fight the shakes, you can do one of two things: remove the human, or improve the human. Unable to justify a pick and place robot for the former, [Tom] opted to build a quick hand support for surface-mount work, and the results are impressive considering it’s built entirely of scrap. It’s just a three-piece arm with standard butt hinges for joints; mounted so the hinge pins are perpendicular to the work surface and fitted with a horizontal hand rest, it constrains movement to a plane above the PCB. A hole in the hand rest for a small vacuum tip allows [Tom] to pick up a part and place it on the board — he reports that the tackiness of the solder paste is enough to remove the SMD from the tip. The video below shows it in action with decent results, but we wonder if an acrylic hand rest might provide better visibility.

Not ready for your own pick and place? That’s understandable; not every shop needs that scale of production. But we think this is a great idea for making SMT approachable to a wider audience.

Continue reading “Simple Mechanism Gives Support for SMT Assembly”