Category Archives: Design Tips & Tricks

Video: Atmel’s Paul Rako talks CE and FCC testing

In this episode of Atmel Edge, Analog Aficionado Paul Rako discussed three clever tricks to keep your high-speed circuit boards from radiating energy and failing CE or FCC testing.

Flip your planes, stitch around the edges, or bring the power and ground planes really close together to keep them from oscillating and pumping RF out the edges. These three quick PCB layout tricks will help you pass FCC emissions in no time!

More specifically, says Rako, you take inner plane layers on a four-layer board (or more), bringing them to the outside, effectively creating a containment vessel that prevents radiation from escaping. 

The second?

“Istvan Novak works at [Oracle] Sun Microsystems,” Rako explains. “He says there is prior art; he didn’t invent it, but he figured out you could stitch RCs all around the edge, and that would keep the radiation from not only leaking out, but from bouncing back in.”

As for the third trick, if you go cut up power planes, you can ultimately bring them very close together.

“You can bring them close together and use other planes to contain the RF – distributing your power and ground with intimate one-mil spacing between the planes. That brings the same kind of damping in as the other trick with putting RCs around the edge,” he adds. “So those three tricks are ways to get you through FCC and CE immunity testing.”

Interested in learning more? You can watch the full video here.

Video: Retro gaming with the Magpi (Arduino Pro Mini)

A Maker by the name of Zippy314 has created a retro “Magpi” gaming platform using an Arduino Pro Mini (ATmega328).

Aside from the Atmel based Arduino board, additional key project specs and features include:

  • 3D-printed case and PCB
  • Nokia 5110/3310 LCD
  • 6 Square tactile button switches
  • 1 tall tactile button switch
  • LiPo Charger Basic (Micro-USB)
  • 400mAh lipo battery
  • SPDT mini power switch
  • Breakaway male headers (Right Angle)
  • Wire & solder
FTDI basic breakout

“This project was an experiment for me in making a 3D printed mounting board for the various parts instead of having to have a standard PC board with the etching done. It felt like there were few enough connections that it would be pretty easy to solder with just plain wire as long as there was a decent support layout,” Zippy314 explained in a recent Instructables post.

“The important thing was to get all the buttons in a fixed place so they wouldn’t move around as you use the Magpi. Because printing small bore holes is tricky, what I did was leave the very bottom layer of the print solid and then drill holes through it with a 1/16″ drill bit. After you drill the holes insert [the] buttons and make sure [they are placed well].”

On the software side, Zippy314 said he and his son have already written two games and a basic drawing app. 

Interested in learning more? You can check out the project’s official page and relevant files on Github here.

The new Atmel-ICE debugger is here

I ordered the new Atmel ICE debugger as soon as it appeared on the company store. I see there is still stock so feel free to put in an order with us or your favorite distributor. Don’t get this new one confused with our JTAGICE3,  sometimes called JTAGICE markIII or mk3. It looks similar, but this new one has two debugging connectors. One is for the AVR microcontrollers, and one is for ARM MCU devices. There is a nice slide-show and explanation on our Norway site.

Atmel-ICE+JTAGICE3

The new Atmel-ICE is white and has two connectors for debugging. The old JTAGICE3 (inset) is silver and only has one connector, although you can upgrade the firmware so it can debug SAM D20 ARM-based MCUs.

Best yet, just like we lowered the priced between the JTAGICE2 and JTAGICE3, we lowered it again for the Atmel ICE. You can get the fancy high-zoot version for 85 bucks. It has the pretty box and all the cables. Then there is a stripper version with just one debug cable for $49. Finally, you can get a bare-board version with no case or cables for a measly $32. This is a great deal when you think that a JTAGICE2 was $399.

Atmel-ICE_angle1024

This new Atmel-ICE replaces both the Dragon and the JTAGICE3. The only other ARV debugger you might need is the AVRONE! debugger that has trace capability. It’s 600 bucks, but that is worth every penny if you are trying to figure out where your program went or how it entered a subroutine or interrupt vector.

For the “big iron” ARM MPU (microprocessor units) with external memory you can use the SAM ICE. The SAM-ICE is in our store for 100 dollars. This works with Atmel’s MPU chips like the ARM Cortex A5-based chips like the SAMA5D series, and the ARM9-based SAM9x parts.

I unboxed my new Atmel-ICE today, here are the pictures:

Atmel-ICE_overall

The box has a Norse warrior on it, as tribute to the brilliant Norwegian engineers that invented the AVR chip.

Atmel-ICE_inside-box

Open the box and you see the Atmel-ICE on the left, safely snuggles in anti-static foam, and a box on the right with the three cables and breakout PCB.

Atmel-ICE_connectors

Here is a close-up of the debug connectors. Identical, but the one on the right is for AVR and the one on the left is for ARM-based MCUs.

Atmel-ICE_USB

The Atmel ICE uses the micro USB connector. The two more expensive versions come with the cable, the bare PCB does not.

Atmel-ICE_small

To keep costs down we didn’t paint the logo on, you can see it is nicely inset, as are the “AVR” and “SAM” indicators to tell you which debug connector is which. Check out how nice and small the unit is. This is another improvement over the JTAGICE2, and a real benefit on a crowded desk or lab bench.

Atmel-ICE_cables

Here is the cables that come in the 85-dollar unit. You also get the USB cable. Note the one cable comes with that cool breakout board.

Atmel-ICE_breakout-PCB

The breakout board has a silkscreen on both sides to help you figure out what it plugs into.

Using Arduino PWM for constant-current drive

The always excellent Circuit Cellar Magazine has a nice article by Ed Nisley. Arduino PWM vs MOSFET Transconductance describes his characterization of Arduino PWM outputs for the constant-current drive of MOSFETs. His application is LED drive, but you could use the knowledge anywhere, including a programmable current sink. Now Circuit Cellar is a paid-subscription magazine, so I can’t link to free article, but maybe their lawyers will let me take a picture of a picture in the print magazine, to which I am a long-time subscriber.

Ed-Nisley_Arduino-PWM-vs-MOSFET-Transconductance_PCB

This photo of the board Ed Nisley used to develop his constant-current source tells you it is not some Spice simulation or a theoretical track. This is a sure tip-off that Ed knows what he is writing about.

Ed-Nisley_Arduino-PWM-vs-MOSFET-Transconductance_scope

This scope shot also reassures you that Ed is not venturing forth some opinion on how the hardware and firmware works, it is proof positive he built this stuff and that it really works. I scratched off the readouts to make sure this is fair use and not a violation of Circuit Cellar’s copyrights.

Analog Guru Paul Grohe taught me that you should always look for pictures of real hardware in articles, and that if the curves are ”too pretty” they are probably marketing BS instead of real data. That is the great thing about this article; it’s got both pictures and data that tell you that you can trust the content.

There is another interesting article in the March 2014 Circuit Cellar issue. It’s about an outfit called ImageCraft. They make a C compiler with an IDE (integrated development environment) for Atmel AVR and ARM Cortex-based MCUs. Now I am a fan of Atmel’s free Studio 6 IDE, but feel free to use whatever IDE you prefer to write the code for your projects.

Now I can’t show you these articles on-line, since Circuit Cellar is a subscription print magazine. You have to give them 50 bucks a year to get it. You can get it as a digital pdf if you want to save trees. Its $85 a year for the both print and digital versions. There are large discounts for two- or three-year subscriptions. Best of all, you can give them something like $225 and get every single issue in history on a thumb drive. Then with your combo subscription you can add your monthly pdf to the archive thumb drive, and still have the print edition to impress your friends and boss.

3D printing at Brookhaven Hospital

Steven Jaworski is a biomedical technician at Brookhaven Memorial Hospital Medical Center in Patchogue, NY. As Blake Eskin of the official MakerBot blog reports, Jaworski does everything from outfit Brookhaven’s new cardiac health lab to replacing critical ER cables.

“Those cables are essential, since they set off an alarm when your heart races or your blood pressure plummets,” Eskin explained.

“They are also expensive: $294.85 for a set of three, which adds up. If you had to replace cables once a year for each of the 315 beds at Brookhaven Memorial Hospital Medical Center in Patchogue, NY, it would cost $92,877.75.”

Jaworski says he had to replace so many cables that he ended up ordering cable tethers from a medical supplier for $24.50 per cable, or $73.50 for a set of three. Unfortunately, surgical scissors are able to easily cut through the tethers – forcing the hospital to step up its purchases of additional tethers.

That is, until Jaworski asked for an MakerBot Replicator 2 Desktop 3D Printer to solve his cable problem. Using the Atmel-powered platform, the technician designed a tamperproof cable tether with a dense black PLA and thick wire. The total cost? $7.94 for a tether that holds three cables. Simply put, Jaworski’s cable tethers saved Brookhaven Hospital a grand total of $60,000 in three months.

According to Jaworski, the best thing about having a MakerBot Replicator 2 is its versatility.

“It’s not a Phillips-head screwdriver when you need a flathead. It’s basically a solution that has paid for itself many times over… You don’t know when you’re going use it, you don’t know what you’re going to use it for, but you’re always going to need it,” he added.

SAMA5 and SAM9: Atmel’s big iron microprocessors

Atmel is rightly famous for its AVR line of 8-bit Flash microcontrollers. But we also have “big iron” chips like the SAMA5 and SAM9 ARM-core microprocessors. A microcontroller has its own internal Flash memory. A microprocessor uses external memory, as much or as little as your application might need.

Hardware engineers have two big worries with any “big iron” microprocessor. First, they are in big packages, hundreds of pins in a ball-grid array. That can be hard to prototype with, since it needs a fine-line PCB that costs a lot to spin. The other big concern is laying out the DDR memory interface. These are wickedly fast and require best layout practices and some register tweaking to get them up to full speed.

SAMA5D3_Xplained_angle

The SAMA5D3 Xplained kit has connectors for Arduino Shields and dual Ethernet ports.

Thankfully, Atmel has solved both problems with a series of evaluation systems. For the SAMA5, you can start with a 79-dollar SAMA5D3 Xplained Kit. It has solved your DDR memory problem since it’s got 256MB on-board. One of the coolest things is that it has connectors where you can plug in any Arduino Shield. Now you can’t use the Arduino libraries, those are based on Atmel’s 8-bit AVR, but it’s not hard to re-write the open source code libraries into something that will run on ARM, if someone hasn’t done it already. The eval board has Atmel’s SAMA5D36 Cortex-A5 Microprocessor, 256Mbytes of NAND Flash, LCD connectors, dual Ethernet (GMAC + EMAC) with PHY and connectors, three USB connectors (2 Host + 1 Device), one SD/eMMC and one MicroSD slots, expansions headers, and power measurement straps.

SAM9N12-EK_SAM5D3x-MB

Atmel makes eval kits for the SAM9N12 (left) and SAM5D3x ARM-based microprocessors.

For those that are doing higher-level applications, the fact that you can run Linux brings all the advantages of open-source development to the SAMA5 and SAM9 microprocessors. And best yet, you get a powerful CPU that uses very little power thanks to Atmel’s architecture. The SAMA5 uses 150mW when running at full speed. It has a DDR controller that give you 1328MB/s of bandwidth. It comes with for gigabit Ethernet, 3 USB ports, dual CAN, UARTs, SPI, and an LCD controller with a graphics accelerator. There is a camera interface, a 12-bit analog to digital converter (ADC) and 32-bit timers.

A SAMA5 chip can run Linux and even has the power to run Android in a “headless” application, that is, where there is not a high-resolution display to eat up your CPU cycles. With an ARM core it’s ideal if you want to do “bare metal” development, where you are writing native ARM code.

SAM9N12-block-diagram

The SAM9N12 architecture gives you low power and a great peripheral set.

Looking at the SAM9, the SAM9CN runs at 400MHz. They have security built in with a cryptographic engine and a secure boot. There is an LCD controller with touchscreen interface, USB, MLC NAND memory support, along with multiple UARTs and I2C. It sips 103mW at 400MHz.

You can get separate LCD panels made to work with the SAMA5 Xplained kit. But if you want to get a SAMA5 kit with the LCD already included, look at the 595-dollar SAMA5D31, SAMA5D33, SAMA5D34 and SAMA5D36 kits. There is also the 445-dollar SAMA5D35 kit, which is cheaper since it does not have an LCD system. These kits cost more but they come ready to go. These are a small working computer that you can immediately start programming in high-level languages or Linux scripts. The kits come with installed applications for its Qt-based GUI.

SAMA5D3-EK_launch-screen

The SAM5A5Dx-EK demo kit comes with Linux and some demo applications pre-installed.

And if you dread laying out a PCB with a working DDR memory interface, but don’t need the whole $595 kit, you can get help there as well. You will notice that the microprocessor and memory are on a little mezzanine PCB in the SAMA5D3 demo kits. This PCB will be available from Embest and other partners. The SAM9 is also available as a tiny SBC (single-board computer).

SAMA5D3-EK_mezzinine_PCB

The SAMA5D3-EK series are designed with a mezzanine card holding the CPU and DDR memory. You can use this card in your high-volume designs.

So now you can develop your custom hardware starting with the SAMA5D3 kit, and then make your own custom hardware that still uses the same exact CPU+memory mezzanine card. While you are perfecting and troubleshooting that hardware, your software team can be working on the Atmel eval kit. This paralleled development will substantially speed up your time to market. And best yet, you won’t be bogged down trying to troubleshoot the DDR memory interface, since it is already working on the mezzanine card.

So don’t just think of 8-bit AVRs when you consider Atmel. We make some really high-power MPU products for everything from IoT (Internet of Things) servers to routers and industrial automation. With Atmel’s kits and our extensive partner network, we can get you up and running in no time, for very little cost, and you can have confidence you designs will work on that final hardware spin.

Passing CE immunity testing

When I was working on semiconductor machinery, we used TUV to get CE certification so we could sell the machines in Europe. We got through emissions alright, it’s similar to the FCC testing we already did, but immunity testing was brutal. When we broadcast RF at a machine, the wafer elevators went nuts and started breaking wafers. We had managed to convince the TUV guy that the speckles and snow on the monitor were not technically a failure, since you could still read it. But robots going open-loop? No, nobody could talk that past TUV. Turns out the cabling was the culprit. There was shielded twisted pair to the Banner sensors that located the elevator stops. In fact, I think they even used braid+foil shielded wire. But the semiconductor machinery company connected the cables with those red-brick AMP connectors, the MR series.

MR-connector

MR These MR (miniature rectangular) connectors work great for appliance wiring, but they provide no continuous shielded path for radio frequency interference (RFI).

Now designing cabling is often thought of as a mechanical engineering function. But mechanical engineers often don’t understand the principles of RF shielding. Get this— they cut the cable shielding about 2 inches back, connected the power, ground, and signal to pins, and yeah, they connected the braid to a pin, and sent it into the connector, to mate with another cable that had 2 inches pulled back. The cables were all dressed beautifully and shrink tubing everywhere. But like my buddy says—“4 inches of untwisted unshielded wire is a nice antenna.”

D-sub_metal-shell

D-sub The D-sub connector was developed for military applications and then picked up by PC makers for serial, parallel and video ports. One reason is its good RF performance. Make sure your cable braid contacts the metal shell.

I switched them to D-subs using 9 pins with a metal shell, and we finally passed. So remember, RF energy is like light—it can leak into the smallest spaces and screw things up. Make sure the EE department revises the detailed design of the cable, or your machine might get held up in certification too.

Crushed avionics from a 737 nose wheel collapse

I have several pals that work on airplane avionics. Talking to one last week, he mentioned that he has a picture of what happens to the high-dollar avionics bay of a 737NG when the nose wheel folds back and collapses on landing.

737NG-avionics-bay-crushed

Ouch. This 737NG avionics bag got pretty well crushed when the nose gear folded up on landing.

Be glad your electronics was not in this mess. I guess this is a case of just taking out the whole rack and putting in a new one. It was nice that the collapsing electronics sort of cushioned the blow, and protected the airframe from a high-g impact.

My pal Jerry Alvarado (RIP) worked as a machinist for United up in San Francisco airport. He told me that they were constantly rebuilding nose gears, as the load when the plane drops onto it is pretty severe. I asked if they pushed him to rush out a job, and he said “No way, I can take as long as I need. Hey, our mothers ride on airplanes too.”

That was certainly comforting in this day of cutting corners and slapping things together.

Arduino powers these solar-tracking blinds


Yesterday, Bits & Pieces took a closer look at an Instructable that described how to automate smart window blinds with an Arduino Fio. Today, we’re going to be covering a solar-tracking automatic motorized window blind project powered by an Atmel-based Arduino Uno (ATmega328 MCU).

“Sunlight can be broken into essentially two components: direct and diffuse. The direct component comes straight from the sun, whereas the diffuse component is created when a portion of direct sunlight scatters due to molecules in the atmosphere,” project creator Nickzibin explained in a recent Instructables post.

“This project aims to control shade position to always block direct sunlight when present and maximize the diffuse component entering the workspace.”

As such, the motor moves the shade position depending on the of the location of the sun and the amount of light hitting a specific (targeted area). One of the best parts of this Instructable? Makers don’t need to purchase a brand new roller shade to make it work.

Aside from the Atmel-powered Arduino board, key project specs include:

  • Adafruit motor shield
  • Headers
  • Digital luminosity sensor
  • 
Stepper motor with planetary gear box
  • Power supply (12V)
  • 
3D printed gear via shapeways.com
  • 
Elastic band
  • Parametric CAD file of ball-chain gear

Perhaps the most important part of Nickzibin’s retrofitted solar-tracking blinds project is the control strategy algorithm based on the Tzempelikos method, where the shade height is controlled based on the calculated position of the sun and corresponding brightness.

“Their algorithm was based on open loop procedures which moved shade height to the position where it just blocks direct sunlight from falling on the workplane. The code in this project adopted their open loop aspects and added closed loop control during certain conditions,” said Nickzibin.

“The position of the sun is known in terms of its solar altitude (α) and solar surface azimuth (γ). The solar altitude is the angle between the horizon and the sun. The solar surface azimuth is the angle between the outward normal of a surface (e.g., vertical window) and the sun.”

More specifically, Nickzibin’s code calculated α and γ based on latitude, longitude altitude and angle from south to outward normal of vertical surface (azimuth) – all based on the following variables:

  • The sun is on the window surface: α > 0° & |γ| < 90°
  • The sun is not on the window surface: α > 0° & γ > 90°
  • The sun is below the horizontal α < 0°

“Developing prototypes using Arduino specific to building technology has [significant] potential to substantially reduce energy use in buildings,” Nickzibin added.

“This project can be easily integrated with a lighting system. In the future, the system could also be integrated with an HVAC system in order to minimize cooling and heating loads.”

Interested in learning more? You can check out Nickzibin’s official project page here.

Teaching Earth Science with 3D printing



Ryan Cain – who teaches Earth Science to second graders – wanted to finish the most recent semester with a special, interactive project.

To help his class emphasize with hurricane victims, Cain decided to teach his students how to design their own buildings using 3D modeling software and MakerBot Replicator 2 3D printers. The structures were then placed along the banks of a simple model river consisting of a water pump and a sandbox.

“By turning up the power on the water pump, Cain unleashed a flood on his class’s model city,” MakerBot’s Ben Millstein explain in a recent blog post. “This gives students a memorable visual on the effects of soil erosion.”

Erosion is the process by which soil and rock are removed from the Earth’s surface by exogenic processes such as wind or water flow – and then transported and deposited in other locations.

According to Wikipedia, excessive erosion causes problems such as desertification, decreases in agricultural productivity due to land degradation, sedimentation of waterways and ecological collapse due to loss of the nutrient rich upper soil layers. Industrial agriculture, deforestation, roads, anthropogenic climate change and urban sprawl are amongst the most significant human activities in regard to their effect on stimulating erosion.

Unsurprisingly, teaching second graders how to design and 3D print an entire riverbank of model buildings isn’t the only impressive thing Cain has done with his MakerBot 3D Printers, as he recently:

  • Embarked on a “30 days of creativity” project, starting with 3D printing a replacement knob on his dresser.
  • Printed new buildings for his erosion model.
  • Taught his robotics students how to design and 3D print concepts for relief delivery drones that could reach victims in the wake of natural disasters.

“Cain has been a fan of MakerBot since the Cupcake CNC,” Millstein noted.

“He was also one of the first educators to bring MakerBot 3D Printers into the classroom. We can’t wait to see what this pioneering educator will come up with next!”

As we’ve previously discussed on Bits & Pieces, the DIY Maker Movement has been using Atmel-powered 3D printers like MakerBot and RepRap for some time now. However, 3D printing has clearly entered a new and important stage in a number of spaces including the medical sphere, architectural arena and science lab.

Indeed, the meteoric rise of 3D printing has paved the way for a new generation of Internet entrepreneurs, Makers and do-it-yourself (DIY) manufacturers. So it comes as little surprise that the lucrative 3D printing industry is on track to be worth a staggering $3 billion by 2016.