Tag Archives: MCUs

Wearable tech gets a major fashion makeover

For some of us, the phrase “wearable tech” conjures up images of the terribly embarrassing pocket protectors of the 1980s, even if those weren’t strictly considered “tech.”

And let’s face it, back before the days of Steve Jobs and Bill Gates, individuals who wore pocket protectors or other “techie” items probably wouldn’t have to worry about overbooking their velcro calendars with hot dates or social events.

Oh, how times have changed. As the Agence France-Presse (AFP) informs us, wearable tech is now getting a long overdue makeover, as Internet-linked computers are woven into formerly brainless attire such as glasses, bracelets and shoes.

“We are heading for the wearable computing era,” Gartner analyst Van Baker told the AFP. “People are going to be walking around with personal area networks on their bodies and have multiple devices that talk to each other and the Web.”

Indeed, a Forrester Research survey conducted early this year determined that 6 percent of US adults wore a gadget to track performance in a sport, while five percent used a device to track daily activity or how well they sleep. Unsurprisingly, worldwide shipments of wearable computing devices could climb as high as 30 million units this year.

“It is just amazing. We will see an exciting future ahead. Contextually aware computers will be hot topics for at least the next decade,” engineering professor Asim Smailagic, director of a wearable computer lab at Carnegie Mellon University in Pennsylvania, told the publication.

“They can help you when you need help, even to look smarter. Everybody likes to have the kind of help contextual computing can provide. When you combine wearable computing with sensors and machine learning algorithms then you get context, the computer knows your state and is able to help out clearly in the situation.”

As previously discussed on Bits & Pieces, Atmel is right in the middle of the wearable tech revolution. First off, Atmel’s SAM4S and tinyAVRMCUs are inside the Agent smart-watch (pictured above) which recently hit Kickstarter.  Atmel MCUs have also tipped up in a number of Maker projects for wearable tech, like the LED pocket watch we featured earlier this week.

Of course, wearable tech also ties into the Internet of Things (IoT), which refers to a future world where all types of electronic devices link to each other via the Internet. Today, it’s estimated that there are nearly 10 billion devices in the world connected to the Internet, a figure expected to triple to nearly 30 billion devices by 2020.

“Traditional technology companies will have to start paying attention to how sensors are enabling us to live,” added Ben Arnold, director of industry analysis for consumer technology at NPD. “Consumers are ultimately going to become more aware of their data in the digital ether. I suspect wearables are going to disrupt the way tech firms are doing business now.”

This ATmega1284 is an 8-voice 32 kHz synthesizer

Atmel’s ATmega1284 is certainly a versatile microcontroller, but how many of us have thought of using the MCU to power an 8-voice 32 kHz synthesizer like Mike of Epromfoundry?

As the Hack A Day crew notes, we should particularly admire the cleanliness of the prototype shown in the video above, with each part given ample room on its own board – and interconnected by 10-pin IDC ribbon connectors.

So, how does it work? Well, to generate audio from the digital microcontroller, Mike built his own R2R digital to analog converter. A resistor ladder – created from 16 resistors – feeds a rail-to-rail amplifier. And although the sound is mono, playback is actually polyphonic due to Atmel’s stalwart ATmega1284.

“It is reading MIDI commands coming in from an external controller (we assume it’s the computer on which the hardware is sitting),” Hack A Day’s Mike Szczys explained.

“The chip’s 128 KB of Flash memory leave plenty of room to store samples, which are selected from a lookup table based on the MIDI data. If more than one sample is to be played the chip averages the data and sets the 8-bit output port accordingly.”

Additional information about the 8-voice 32 kHz synthesizer can be found here.

Open source hardware sees increased use by hobbyists, engineers

Analysts at Premier Farnell expect the use of open source hardware and software to increase among professional engineers and the growing Maker community in 2013.

According to the results of a recent survey commissioned by element14, 56% of professional engineers are more likely to use open source hardware such as Arduino (powered by Atmel MCUs) and other devices, with Maker hobbyists weighing in at a rather impressive 82%.

Similarly, 52% of professional engineers and 81% of hobbyists report being more likely to use open source software in 2013 – while 54% of hobbyists have confirmed using dev kits at least once per quarter for personal projects.

“The numbers paint a very clear picture that open source hardware is showing strong traction among professional engineers and hobbyists as well as educators and students,” said Andrea Koritala, global head of technology integration at Premier Farnell.

“With a high level of crossover between professionals and hobbyists, this increase in adoption extends to the workplace. An engineer on the job is looking for access to many of the same tools and resources accessible to the hobbyist community.”

As Koritala notes, professional engineers rated reference designs as the resource that weighs most heavily in the decision to select a dev kit. Among hobbyists, the most important factor was the availability of online tutorials, webinars and videos.

“This trend also speaks to the importance of ease of access and use, as a strong community can help bring ideas and designs to life,” she explained.

“Engineers have historically been hesitant to fully embrace open source, but the sheer availability of open-source tools and resources has mitigated many of the risks associated with designing in open source for commercial use.”

The above-mentioned survey, conducted in April 2013, included responses from a mix of professional engineers, hobbyists and students. All respondents had purchased one or more dev kits or related products in the year prior to taking the survey.

Atmel-powered Babuino connects smartphones to digital devices

The Atmel-powered Babuino (USB) stick allows users to easily control multiple electronic devices from their smartphones.

Babuino, designed by OpenJungle, is also capable of the reverse – controlling a smartphone from a PC or Mac.

There are currently two versions of the open source Babuino: one enclosed in a case (stick) and the other, as a board, sans case with fully accessible ports. As noted above, both iterations of the device are powered by an Atmel MCU.

Specifically, original prototypes are equipped with an ATMega32U4 microcontroller, although the final versions of Babuino are expected to boast the ATXMega128A1U MCU. Additional hardware specs include a Bluetooth module, infrared RX/TX and 128KB Flash Memory (without bootloader).

More information about Babuino can be found here on IndieGoGo.

The value of microcontrollers (MCUs) with dual-bank flash

Written by Brian Hammill

Atmel, along with a number of other industry heavyweights, recently introduced a slew of Cortex-M microcontrollers (MCUs) equipped with a dual-bank flash feature.  While single bank flash is sufficient for numerous applications, the dual-bank feature offers significant value in specific scenarios. So let’s discuss the added benefit of dual-bank flash.

Fig 3: Dual bank flash provides a fail safe method of implementing remote firmware upgrades

Dual bank flash provides a fail safe method of implementing remote firmware upgrades

First, we need to understand the role of flash in a MCU.  Just under 100% of the time, the flash memory in your MCU is in read mode.  The processor core is almost always fetching instructions to execute out of the flash. Exceptions? When code is being run from RAM, internal or external, or ROM.  Meaning, with typical flash memory, you cannot read while you are writing to it.  As such, during firmware upgrades and data storage operations, the processor core cannot execute code from the flash.  Either the processor has to wait for the write operation to complete, or the core can continue to execute from other physical memory such as RAM or ROM.

In Atmel’s single bank SAM3 and SAM4 family flash MCUs, this problem has been solved in a somewhat novel manner by providing flash programming code in the factory programmed ROM.  This means that whenever the firmware engineer wants to write the flash, it will buffer the data to be written and make a call to a routine in ROM.  The processor core will then be executing from ROM while the flash is being written.  Since flash erase and programming operations can take milliseconds (a very long time for a MCU core running at up to 150 MHz), the ROM routine may have to sit in a do nothing loop while the flash operation completes.

Admittedly there are limitations, but this method generally works just fine for systems with external storage such as serial flash – retaining downloaded firmware images until they can be written to the internal flash.  It also works well in systems which infrequently write a few bytes of data to the flash.

Firmware upgrades can be risky, especially in applications where firmware images are downloaded across slow unreliable wireless links – or where systems are prone to power failures. In a single bank flash system, ensuring a reliable firmware upgrade means there is a part of the flash that you never erase or write over. The code contained in that part of the flash knows how to detect corrupted code in the rest of the flash.

Using a checksum, CRC, or even a digital signature are common ways to determine the validity of the flash image on boot or reset.  If the check comes out bad, the code in the part of flash that is never over-written knows to look for a backup image and attempt to reprogram the application.  The backup image can be located in an external memory such as a serial flash or if there is enough space, in an unused part of the internal flash.

Managing backup images in internal flash or external serial flash can be done reliably in a well planned system with single bank flash.  The key is well-planned, although the firmware engineer has to jump through some hoops because changing the interrupt table ordinarily means you have to change the very lowest flash addresses.  Plus, you cannot keep that part of flash unchanged over the life of the product in the field.  So it is necessary to have the fixed interrupt vectors point at defined locations where the actual interrupt service routines are located.  And finally, the actual ISRs can be changed when the application is changed by a firmware update, although this can lead to size restrictions or wasted flash space between the ISRs.

Designing a board management controller with Atmel’s SAM D20 MCU

A board management controller (BMC) is a platform that monitors the physical state of an enclosure or system using physical sensors.  The sensors track a number of critical variables including humidity, temperature, power-supply voltage, fan speed, communications parameters and operating system functions.

Unsurprisingly, a BMC typically operates independently of the main system (out of band). Key design considerations of a board management controller include connectivity; multiple serial interfaces to communicate with various sensors and administrative terminal; low-power operation in low power mode to protect against system as well power outages; and continuous operation during system outages for uninterrupted system management. atmelboardcontrollersamd20

A number of Atmel hardware components can be used to design a board management controller, including the SAM D20 ARM Cortex-M0+ (ARM) based MCU, the SHA204 Authentication IC (for security), 30TS temperature sensor and AT24/AT25 Serial EEPROM.

“The SAM D20 offers versatile connectivity options, low-power operation and a high level of integration to reduce BOM cost. Indeed, there are 6 SERCOM modules, each configurable as USART, I2C or SPI for sensors and terminal communication, thereby facilitating smaller packages and easier PCB layout,” Atmel engineer Bob Martin told Bits & Pieces. “Meanwhile, integrated 12-bit 300ksps ADC with gain stage removes the need for external components to monitor local battery voltage, as low-power operation ensures protection against system/power outages.”

Martin also noted that Atmel’s SAM D20 ensures high reliability even under system outages, with the platform featuring integrated 32-bit Cyclic Redundancy Check (CRC) of Flash, EEPROM emulation, as well as SRAM and integrated memory BIST (MBIST) to execute production testing of internal memories.

On the software side, the SAM D20 offers users access to an expansive array of tools and comprehensive ecosystem including Atmel Studio 6 (free IDE with compiler), Atmel’s Software Framework (ASF) with free SW libraries of production-ready source code. There is also the Atmel Gallery and the SAMD20 Xplained Pro Kit which boasts a built-in programmer and debugger with connectors for expansion wings.

Additional information about Atmel’s SAMD 20 MCU can be found here.

Building a GPS tracker with Atmel’s SAM D20 MCU

A GPS tracking unit uses the Global Positioning System to determine and record the precise location of a vehicle, device or individual. Key design requirements for a GPS tracker include a small form factor, low power consumption and flexible connectivity options.

Atmel’s recently launched SAM D20 ARM Cortex-M0+ based MCU can be used to power such a device, taking all of the above-mentioned design requirements into account.

“The SAM D20 MCU – embedded with serial communication modules (SERCOM) and low power consumption – provides the flexibility, connectivity and low power required for GPS tracker applications,” Atmel engineering manager Bob Martin told Bits & Pieces.

“How low is low in terms of power consumption? Well, we are talking about <150µA/MHz in active (CoreMark) and <2µA with RTC and full RAM retention. Meanwhile, the peripheral event system and intelligent peripherals with Atmel SleepWalking technology further reduce CPU activity and power consumption.”

Martin also noted that the SAM D20 MCU offers design engineers 6 highly flexible serial communication modules (SERCOM), each configurable to operate as USART, I2C and SPI – thereby facilitating easy and flexible connection to external sensors, memories, PCs and wireless modules.

As expected, Atmel supports a wide range of dev tools and software, including Atmel Studio 6 (free IDE with GCC compiler), Atmel Software Framework (free SW libraries of production ready source code), Atmel Gallery (open to extensions) and the SAM D20 Xplained Pro Kit which is packaged with programmer and debugger, as well as connectors for expansion wings.

Playing virtual chess with Atmel-powered glove controllers

Students at Cornell University have designed a game of virtual chess using glove controllers powered by Atmel’s stalwart ATmega1284 microcontroller (MCU).

“Each player wears a glove (there are two gloves for two players) and uses hand-motions to play a chess application. The chess board graphical user interface is generated using MATLAB, which receives information from the player’s gloves through a serial connection with the microcontroller, and updates the game appropriately. As such, when a player tilts his hand in a certain direction, the cursor on the computer screen moves accordingly,” the Cornell students explained.

“Since the glove also has contact sensors in the form of copper strips on both the thumb and pointer finger, pressing these two fingers together simulates picking up or dropping a piece at the location of the cursor. The goal of our project was to simulate the physical motions involved in playing chess without the need for a physical chess set.”

Essentially, the contact sensors simulate a button click. As noted above, pressing the pointer finger and thumb together creates an active-low signal that is sent to the Atmega1284 microcontroller.

“The x-data and y-data from the accelerometer are [then] sent to an analog-to-digital converter in the microcontroller. The microcontroller transforms this information received from the gloves to update the cursor coordinates,” the students noted.

“The [MCU] also handles the state of the chess game, maintaining and managing a wide array of state information needed to update the game. The microcontroller continuously creates packets containing the cursor coordinates and other state data and sends them off to a MATLAB application using serial communication. MATLAB requests these packets and parses them to decide how to render and update the graphical user interface (GUI) representing the chess board.”

In addition to Atmel’s ATmega1284, the virtual chess project was built using the following components: 3-axis accelerometer module, white board, target board, small solder board, header pins, power supply, push buttons, gloves, copper strips, voltage regulator, potentiometer, wires, resistors and capacitors.

Tactilu is a bracelet for remote tactile communication

Tactilu can best be described as a bracelet for remote tactile communication. Designed by the panGenerator collective in partnership with Cheil, the Tactilu bracelet is capable of transmitting a “touch” sensation between two individuals.

“Tactilu is based on technologies like flexinol wire for actuation of touch and QTC  (quantum tunneling composite) on the touch sensor layer,” the Tactilu crew wrote in a blog post published on the Creative Applications Network.

“The bracelet is comprised of two elements, one for sending data and the other for receiving, [with a] touch sensor located on the upper side of the bracelet [that] converts swipes into tactile/haptic motion on the receiving device.”

Tactilu is powered by Atmel’s ATmega328 MCU fitted into an Arduino Pro Mini. As previously discussed on Bits & Pieces, the high-performance Atmel 8-bit AVR RISC-based microcontroller executes powerful instructions in a single clock cycle, achieving throughputs approaching 1 MIPS per MHz.

Tactilu is currently in alpha. The next version expected to be approximately 50% slimmer, with the temporary textile strip replaced by casted polyurethane.

Building an optical transceiver with Atmel’s SAM D20

An optical transceiver can best be described as a device that converts high-speed data from a cable source (e.g., Gigabit Ethernet) to an optical signal for communication over optical fiber.

In the vast majority of configurations, a small microcontroller is used to control the Laser Driver Diode (LDD) and Linear Transconductance Amplifier (LTA) of the transceiver.

opticaltransceiversamd20

An optical transceiver is typically packed into a small form factor, simply because standards such as SFP and XFP require MCUs in the 3mm to 4mm square range.

Additional key design requirements include flexible serial and analog peripherals – with multiple LDD, LTA, host standards and interfaces requiring numerous digital and multi-channel analog interfaces. Perhaps most importantly, extremely low latency responses are necessary to control the LDD and LTA due to control loops required to sustain the high data throughput.

Atmel’s SAM D20 ARM Cortex-M0+ based MCU can be used in the design of a standard optical transceiver, along with other Atmel components, including the 30TS temperature sensor and AT24/AT25 Serial EEPROM.

“To satisfy the requirements of optical transceiver controllers, the SAM D20 offers very small package options (32QFN4x4 mm package, chip scale package <3×3 x 0.5mm), with flexible serial and analog peripherals, as well as fast and low-latency interfaces. In terms of flexible serial and multi-channel analog peripherals, Atmel’s SAM D20-based platform offers 6 SERCOM interfaces, each configurable as SPI, I2C, or USART,” Atmel engineering manager Bob Martin told Bits & Pieces.

“There is also 12-bit, 16-channel ADC, 10-bit DAC and 2 full-featured analog comparators to support multiple feedback capabilities and control interfaces. Meanwhile, fast and low-latency interfaces include optimized 300ksps, ADC and DAC analog peripherals, along with I2C, SPI, and USART serial communications interfaces – supporting up to 24Mbps data transfers, as well as single clock cycle IO control for minimal control loop latency.”

On the software side, Atmel provides an extensive development ecosystem, including debuggers development kits such as Atmel’s IDE (Studio 6), along with ready-to-run peripheral drivers and communication stacks (ASF). There is also Atmel’s Gallery and SAM D20 Xplained Pro Kit which packs an integrated programmer and debugger with connectors for expansion wings.

Additional information about Atmel’s SAM D20 MCU can be found here.