Tag Archives: AVR microcontrollers

The first-ever Rad Tolerant megaAVR is out of this world!


With billions of AVR chips already deployed throughout the world, it’s now time to take them into space!


This news may come as one small step for boards, one giant leap for Maker-kind: the ATmegaS128 has launched! Not only does Atmel’s first uC Rad Tolerant device share the popular features of the megaAVR family, this out-of-the-world MCU delivers full wafer lot traceability, 64-lead ceramic package (CQFP), space screening, space qualification according to QML and ESCC flow and total ionizing dose up to 30 Krad (Si) for space applications. What’s more, the ATMegaS128 is “latch up” immune thanks to a dedicated silicon process: SEL LET > 62.5Mev at 125°C, 8MHz/3.3V. SEU to heavy ions is estimated to 10-3 error/device/day for low Earth orbit applications.

space

With billions of commercial AVR chips widely deployed throughout the world, the new space-grade AVR family benefits from support of the Atmel Studio ecosystem and lets aerospace developers to the industrial-version of the ATmega to prototype their applications for a fraction of the cost. The latest board is available in a ceramic hermetic packaging and is pin-to-pin and drop-in compatible with existing ATmega128 MCUs, allowing flexibility between commercial and qualified devices, enabling faster-time-to-market and minimizing development costs. With this cost-effective approach and a plastic Hirel-qualified version, the ATmegaS128 can be also considered in more general aerospace applications including class A and B avionic critical cases where radiation tolerance is also a key requirement.

“With nearly three decades of aerospace experience, we are thrilled to bring one of our most popular MCU cores to space — the AVR MCU,” explained Patrick Sauvage, General Manager of Atmel’s Aerospace Business Unit. “By improving radiation performance with our proven Atmel AVR cores and ecosystem, the new ATmegaS128 provides developers targeting space applications a smaller footprint, lower power and full analog integration such as motor and sensor control along with data handling functions for payload and platform. We look forward to putting more Atmel solutions into space.”

Among its notable features, the space-ready MCU boasts high endurance and non-volatile memory, robust peripherals (including 8- and 16-bit timers/counters, six PWM channels, 8-channel, 10-bit ADC, TWI/USARTs/SPI serial interface, programmable watchdog timer and on-chip analog compactor), power-on reset and programmable brown-out detection, internal calibrated RC oscillator, external and internal interrupt sources, six sleep modes, as well as power-down, standby and extended standby.

maxresdefault

The STK600 starter kit and development system for the ATmegaS128 will provide users a quick start in developing code on the AVR with advanced features for prototyping and testing new designs. The recently-revealed AVRs are supported by the proven Atmel Studio IDP for developing and debugging Atmel | SMART ARM-based and AVR MCU applications, along with the Atmel Software Framework. Intrigued? Check out the uC Rad Tolerant device here.

Atmel Studio 7 is now live!


Atmel Studio 7 accelerates MCU designs for both developers and Makers alike, bridging the gap between the MakerSpace and MarketPlace.


For those who may have attended the recent World Maker Faire in New York, this announcement should come as no surprise. However, if you were unable to get to the New York Hall of Science to swing by the Atmel booth or sit in on one of our panel discussions over the weekend, we’ve got some great news. The highly anticipated Atmel Studio 7 is now live!

Studio7__Google+_1160x805

Atmel Studio is a comprehensive, free integrated development environment (IDE) for microcontroller design using both Atmel | SMART ARM-based and AVR MCUs. What’s more, we are also excited to be launching Atmel START — a new, extremely intuitive graphical platform for creating and configuring embedded applications that allow developers to build custom software platforms.

Due to increased complexity and more demanding requirements, embedded developers are turning to IDEs to deliver more intelligence, performance and ease-of-use. Based on the latest Microsoft Visual Studio Shell, Atmel Studio 7 dramatically reduces overall design time by delivering significant performance enhancements for developing and debugging with a simple user interface, improved responsiveness for consumer, industrial and Maker markets, and much more. Plus, the brand-spankin’ new IDE provides real-time application data and power visualization to better optimize application performance and power utilization.

Ideal for the Maker community, the IDE lets Arduino developers quickly port their sketches created in the Arduino environment as C++ projects, and seamlessly migrate their prototypes into the professional Studio 7 environment. This will further streamline a Maker’s ability to help migrate their projects from ‘the MakerSpace to MarketPlace.’

Given the rise of the Internet of Things market and the projected billions of devices to follow, high quality, well integrated embedded software is key to enable designers to devise robust, smart solutions based on today’s connectivity and security standards. Cognizant of this, we are pleased to launch Atmel START which is a web-based tool that helps developers easily integrate basic software building blocks and focus on their own applications rather than having to deal with the headache of configuration and integration.

“Atmel Studio 7 IDE and Atmel START extend our commitment to bridge the gap between the Maker and professional environments, accelerating time-to-market for developers of all levels,” says Steve Pancoast, Atmel Vice President of Applications, Software and Tools. “Our new, innovative development tools and software provide Atmel’s customers with solutions for embedded system designs in low power and wireless communications such as our power visualizer and Atmel START. We are committed to bringing the best tools to market, enabling developers of all levels — from professionals to students, hobbyists and Makers — to get their projects quickly to market.”

Atmel START gives software developers the ability to graphically select software components and configure them for Atmel’s large family of evaluation boards or for their own custom hardware. Developers can build software platforms consisting of low-level drivers, advanced middleware, Real Time Operating Systems (RTOS), high-level communication stacks and more, as well as download the configured software package into their own IDE and make their application.

Atmel START supports graphical configuring of pin-muxes, along with clock trees, and the configured software package can be downloaded for a variety of supported development environments, such as Atmel Studio 7, IAR Embedded Workbench and Keil µVision. In addition to all that, the tool is entirely web-based so no installation is required before you get started — and the downloaded code will always be up-to-date.

“The Atmel START platform makes it easy for developers to get projects off the ground quickly and obtain the most benefit from working with ARM Keil MDK tools,” adds Reinhard Keil, ARM Director of Microcontroller Tools. “By using CMSIS, Atmel has once again proven the value of creating a platform built on a standards-based approach. Atmel START creates a robust and portable software management system that makes it easy for developers to deploy applications in any environment.”

Interested? Atmel Studio 7 is free of charge and is integrated with the Atmel Software Framework (ASF) — a large library of free source code with 1,600 project examples. Those wishing to get started with the IDE can head over to its official page here, as well as explore Atmel START in more depth by downloading the latest white paper on the platform.

This wearable device lets you touch your virtual reality world


UnlimitedHand is the world’s first video game controller with newly-developed haptic feedback technology.


It’s safe to say that virtual reality has grown leaps and bounds in recent years; however, despite these advancements, one thing that has been lacking was an interface that actually let you ’touch’ the VR world. This is exactly what one Tokyo-based startup set out to develop.

Viru

The team over at H2L has created what they’re calling the world’s first video game controller that enables you to feel things as if they existed in your real environment. UnlimitedHand is essentially a haptic sensor that goes around your arm and syncs with your hand to interact with onscreen objects.

Through Bluetooth, the wearable contraption delivers your finger and arm movements to the game while receiving data back that is felt in the form of haptic feedback. In other words, you will be able to grab, push, throw, hit and manipulate your digital surroundings as if you were really there.

1443172790613702577

The device, which straps around your forearm like an Ace bandage, is equipped with a muscle sensor, a 3D motion sensor, a multi-channel electronic muscle stimulator (EMS) and a vibration motor. The embedded motion and muscle sensors are tasked with recognizing user input, just like any other haptic gadget. UnlimitedHand then stimulates your muscles through EMS, controlling your fingers and hands while mirroring what’s happening in the game. By integrating this technology into the accessory, you will be able to ‘feel’ whatever your character experiences.

1443172790888624305

What will surely be appealing to developers, UnlimitedHand has made it easy to integrate with existing games through Unity plug-ins. Furthermore, its circuit is also Arduino-compatible, allowing Makers to hack it for a wide range of other applications. Whether it’s feeling the strings of a virtual guitar as it’s being played or commanding a robotic arm, the possibilities are endless. Intrigued? Head over to its Kickstarter campaign, which has already garnered well over its asking goal of $20,000. Units are expected to begin shipping in March 2016

IAR Systems adds powerful code analysis possibilities for 8-bit AVR developers


New version of IAR Embedded Workbench for AVR introduces static code analysis and stack usage analysis.


IAR Systems has unveiled version 6.60 of its IAR Embedded Workbench for AVR microcontrollers. The update extends code analysis possibilities with the integration of static code analysis tools and stack usage analysis.

ew-top

The latest version of IAR Embedded Workbench for AVR adds support for IAR Systems’ static analysis add-on product C-STAT. Completely integrated within the IAR Embedded Workbench IDE, C-STAT can perform numerous checks for compliance with rules as defined by the coding standards MISRA C:2004, MISRA C++:2008 and MISRA C:2012, as well as rules based on CWE (the Common Weakness Enumeration) and CERT C/C++. By using static analysis, developers can identify errors such as memory leaks, access violations, arithmetic errors, and array and string overruns at an early stage to ensure code quality and minimize the impact of errors on the finished product and on the project timeline.

Additionally, the version 6.60 introduces stack usage analysis. Seeing as though the stack is a fundamental property of an embedded application, setting it up properly is essential for ensuring the application’s stability and reliability. However, calculating the stack space is notoriously difficult for all but the smallest of systems. This challenging task can be greatly simplified by granting access to information around the worst case maximum stack depth of the application. Enabling stack usage analysis in IAR Embedded Workbench provides just that, adding listings of the maximum stack depth for each call graph root to the linker map file. The analysis process can be customized to take into account such constructs as calls via function pointers and recursion.

template-monitor-b-perspective-micrum

”The new functionality in IAR Embedded Workbench provides great advantages for our customers,” explains Steve Pancoast, Atmel VP of Software Applications, Tools and Development. “Developers can leverage the new analysis possibilities to improve the quality of their code, as well as streamline their development process. Atmel’s strong partnership with IAR Systems gives our customers access to world-leading tools across our entire range of AVR and Atmel | SMART ARM-based microcontrollers and microprocessors.”

IAR Embedded Workbench for AVR is a complete set of high-performance C/C++ tools featuring world-leading code optimizations creating compact, fast performing code. Version 6.60 also features parallel build, which will surely have a major impact on expediting development. Now, the user can optionally set the compiler to run in several processes simultaneously, which can significantly reduce compiler times.

This DIY monitor measures water usage throughout your house


While we may not be able to fix the drought, one Maker has set out to change how we use water at home.


As many of you are aware, California is currently facing one of the most severe droughts on record. While it may be a bit difficult to enact immediate change at the municipal level, we can drastically alter how we use our water at home. With this in mind, Maker Will Buchanan recently decided that it would be a good idea to focus his energies toward reshaping our consumption habits.

FYAPP4RI15KZLKT.MEDIUM

“It’s possible to dramatically change our behavior simply by making us aware, but we simply don’t know where our water goes. A bill at the end of the month doesn’t give you much useful information, and it gives you the information a month too late,” Buchanan writes.

Inspired by an earlier low-cost water flow sensor project, the Maker devised a plumbing-free, home automation system that can track water usage in real-time across in-home fixtures. This was done by employing a piezo buzzer and a Pinoccio mesh networking device.

F1TM4FXI15KZLUP.MEDIUM

For those unfamiliar with the IoT startup, a Pinoccio Scout is a pocket-sized board packed with wireless networking, a rechargeable LiPo battery, some sensors, and the ability to expand its capabilities through shields, much like an Arduino. It is equipped with an ATmega256RFR2 and a single-chip AVR 8-bit processor, along with a low power 2.4GHz transceiver for IEEE 802.15.4 communications.

In order to get a comprehensive idea of where the water goes, Buchanan thought it would be a good idea to monitor it at the outlet as well as the inlet. Through visual queues (such as light color, duration and intensity) at each fixture, the system can inform a user as to how much water they are using at any given moment.

FMZRFMNI12K9R97.MEDIUM

Beyond that, he wanted the mechanism to relay the information to the cloud, where the data could be parsed and visualized in a “household usage” dashboard using Plotly’s streaming API. To accomplish this, the Maker created a source stream via Pinoccio and a destination stream with data.sparkfun.com, while Python was used to bridge the selected data. Buchanan then uploaded an Arduino code onto his respective wireless Field Scouts.

While this DIY system may not solve the impending crisis, it is surely a start. Not to mention, the monitor may make for a great Hackaday Prize submission. So if you’re ready to save the world one drop at a time, head over to the project’s detailed page here.

Atmel to showcase smart and securely connected solutions at Embedded World 2015


Demonstrations to showcase Atmel | SMART and Atmel AVR MCUs and MPUs highlighted in a variety of technology zones.


In a matter of days, Atmel will be showcasing a number of smart and securely connected solutions that will power next-generation Internet of Things (IoT) applications at Embedded World 2015 held in Nuremberg, Germany, February 24-27. These demos will be available in the company’s booth located in Hall 4A / Booth 4-230.

EmbedW2015_Facebook_851x315_Final

To better illustrate Atmel’s broad portfolio of IoT solutions, the demonstrations will be highlighted in several technology zones.

AUTOMOTIVE: As a leader in local interconnect networking (LIN) and automotive touch, Atmel is enabling smart, connected vehicles.

Atmel’s automotive technology pod will showcase the company’s broad automotive product portfolio for car access systems, networking, drivers, Ethernet Audio/Video Bridging (AVB), and the future of human machine interface (HMI) in next-generation center consoles. By popular demand, Atmel will also be showcasing its next-generation AvantCar concept demo, a host of passive entry car access solutions using Atmel’s latest and highly secure products, including AES encryption 125kHz LF and and RF technologies, along with its popular maXTouch and QTouch capacitive touch solutions. The Atmel | SMART SAM V71 ARM Cortex-M7-based MCU will also be highlighted in an automotive application to deliver the world’s highest performance Cortex-M-based Flash MCU, along with an automotive touch application powered by Atmel’s recently launched Touch Controller solution. And, a demonstration running Audioweaver from DSPConcepts showcasing the SAM V71 ARM Cortex-M7 processor-based MCU will also be exhibited in this zone.

atmel-avantcar-2

INDUSTRIAL: Atmel provides leading-edge MCU- and MPU-based solutions for the smart, industrial market.

In the industrial technology pod, Atmel will showcase a variety of smart, secure and connected solutions for the industrial market powered by Atmel | SMART solutions including an Ultra home automation and smart fridge application running on the SAMA5D4 Xplained, and Atmel | SMART ARM Cortex-A5 processor-based boards displaying HDMI video. Other industrial applications on display include a power supply temperature monitoring and cooling using an Atmel temperature sensor and an treadmill application featuring an Atmel | SMART SAMA5D4.

maxresdefault-1-1

SMART LIVING: As a leading provider of smart and securely connected solutions, this technology zone showcases next-generation applications of modern living.

Highlighting the latest innovations for your living room, the Smart Living technology zone will highlight a number of applications ranging from a low-power Bluetooth beacon to a digital temperature sensor, a ZigBee-based smart lighting with cryptographic security (ATSHA204), and a secure IoT camera system featuring Atmel’s newly announced elliptic curve network security chip, the ATECC508A. See Atmel’s recently launched SIGFOX IoT solution, powered by Atmel’s ATA8520, communicating to the cloud while transmitting metering values, alarm signals and more. The company will also be showcasing the Atmel SmartConnect family, leveraging ultra-low power secure, wireless connectivity. A number of applications will be demoed including a weight scale, door bell with camera, Wi-Fi connected speaker, motion sensors on the window, smart plug, light bulb and gateway connected via ZigBee technologies—all controllable through a smart, mobile device. A QTouch-based water level sensing application showcasing advanced HMI and sensing capability will also be exhibited, along with a display demonstrating the world’s lowest power capacitive touch surface. Other demonstrations powered by Atmel’s maXTouch technologies and Atmel AVR MCU solutions showcasing ultra-low power smart, connected devices will be available in this zone.

1491653_1012994838717686_5322643470985167253_n

CLOUD PARTNERS: Highlighting cloud platform partner solutions.

IoT requires a system-level solution encompassing the whole system, from the smallest edge/sensing node devices to the cloud. The company has partnered with best-in-class cloud partners that can support a variety of applications for both Tier-1 OEMs and smaller companies. Atmel has integrated the partners’ technology into the company’s cloud solutions framework adding the cloud platform functionality seamlessly to all of Atmel’s wireless MCU offerings, regardless of standards or transport technology. Come meet some of the cloud platform partner solutions from companies like PubNub, Proximetry and Arrayent that are available on Atmel wireless MCUs today.

POWERED BY ATMEL. Showcasing the latest gadgets and devices powered by Atmel technologies.

Highlighting the latest smartphones, tablets and wearables available today, everything from a wireless drive and narrative life logging camera to record your every step, to fitness bands, to Atmel’s latest MCU and touch technologies, will be on display. See ‘wear’ the market is headed next!

camera_narrative-clip-teardown-00

MAKERS: From Maker space to market place, this technology pod highlights Atmel enabling unlimited possibilities.

The Maker space showcases the well-received Arduino Wi-Fi Shield which enables rapid prototyping of Internet of Things (IoT) applications on the Arduino platform, and will be featured to highlight its simplicity for the professional and Maker communities. The company will also display a number of Maker demonstrations including a remote-controlled Maker Robot powered by the Atmel | SMART SAM D21 will be displayed. “Mr. Abot” is controlled through an Android app and the communications driven through Atmel’s recently announced WINC1500 Wi-Fi solution.

Bx7bxbfIIAEeC5Z

Additionally, Atmel’s resident security expert Kerry Maletsky will be presenting “Making IoT a Reality – Leveraging Hardware Security Devices” on February 25 from 12-12:30 pm CET (Session 09/I).

And for those of you waiting to see the one-and-only AVR Man, you’re in luck. The embedded community’s favorite superhero will be in attendance!

avr-man-with-team

Arduino Day 2015 set for March 28, 2015


Mark your calendars! One of the biggest Maker ‘holidays’ is just around the corner. 


As Makers, there’s one special occasion that we just can’t help but love: Arduino Day! It is a 24-hour celebration – both official and independent – where hobbyists, tinkerers and even some experienced engineers from all over the world come together to share their DIY experiences. This year, the second annual ‘holiday’ is slated for March 28, 2015.

ARDUINODAY15_banners_720x300

2014 saw more than 240 user groups, Makerspaces, hackerspaces, fablabs, schools, studios and educators throughout Europe, North and South America, Asia, Africa and Australia involved in planning activities, workshops, and events for a wide range of audiences and skill sets. Those needing a refresher can tune-in to Massimo Banzi’s official announcement from last year here.

“You can attend an event or organize one for your community. It doesn’t matter whether you are an expert or a newbie, an engineer, a designer, a crafter or a Maker: Arduino Day is open to anyone who wants to celebrate Arduino and all the things that have been done (or can be done) with it,” the team writes. “The events will offer different types of activities, tailored to local audiences all over the world.”

As far as official events are concerned, the company has organized five of them in Torino, Malmo, Bangalore, Boston and Budapest. Meanwhile, local events are put together by the community, just supported and curated by the Arduino crew. If you’re interested in creating a get-together at your Makerspace, you can do so by submitting an application.

ArduinoUno_r2_front

Like we’ve previously discussed on Bits & Pieces, Atmel is at the very heart of nearly ever Arduino board on the market today, thereby helping tinkerers bring their wildest creations to life.

Indeed, as our resident Wizard of Make Bob Martin noted, our 8- and 32-bit MCUs have been the chips of choice for Arduino since the boards first hit the streets way back in 2005 — as you can see in the first prototype below. More specifically, he attributes the success of Arduino to its easy-to-use, free cross-platform toolchain and simple do-it-yourself packages with Atmel MCUs.

“These factors helped initially steer the Arduino team to choose our AVR microcontrollers – and today, both our AVR and Atmel | SMART ARM-based MCUs,” Martin explained.

4441590461_26c63592a8_b

In addition to young Makers and educators, it’s no surprise that the open-source electronics platform has even become increasingly popular among experienced designers, architects and engineers as well.

Now just a few weeks away, you can follow along with Arduino’s official countdown and locate an #ArduinoD15 meet-up near you! In the meantime, as you get started on your next project to celebrate the occasion, you can find out which Atmel based ‘duino is right for you here. Of course, we’ll also be celebrating Arduino Day at Atmel with extra project coverage, so be sure to stop by and check out our upcoming blog posts around the Maker favorite platform!

Make your houseplants smile with ATtiny85


This simple sensor can tell you exactly how your plants “feel.”


Faced with hectic schedules, it is often easy for us to forget to water our favorite plants. Typically the strong and silent type, plants likely won’t notify you when they are in need of a drink or some nutrients. However, that may all change after one Maker’s clever Atmel based design which now provides plant owners with a visual representation of just how their plant is feeling.

Feelings

“Thanasisloi7” hooked an ATtiny85 to a soil hydrometer sensor that analyzes the current moisture within the plants soil. When the soil is properly watered, an LED matrix displays a happy face. Conversely, when the soil moisture falls below a specified level, the smiling face disappears. Thus, any plant owner with common sense can know when to replenish the pot’s water supply.

feeling2

Though just a simple project, this quick design will make sure you never let your plants go thirsty again. As they say, a smile is worth a thousand words. Looking to build a better bond with your plants? Check out his official project page here.

This isn’t the first time once-ordinary objects have been transformed into “sentient beings.” Last summer, digital agency Soap Creative launched Cars That Feel, an interactive festival installation designed with Toyota. The project featured a number of cars, each of which boasted their own personality and connected with people via light projections, color and sound. The vehicles were equipped six internal BenQ projectors, Atmel powered controllers and high intensity LED light rigs. Meanwhile, a custom app was tasked with controlling internal projection mapping, lighting, sound and animation.

An open-source PLC to control the Internet of Things


Controllino is the first software open-source, Arduino-compatible PLC. 


Designed by the SG-Tronic team, the Controllino is an open-source programmable logic controller (PLC) built around Atmel’s ATmega328 and ATmega2560 microcontrollers (MCUs). Recently funded on Kickstarter, the Arduino-compatible PLC allows Makers to produce and control their next Internet of Things project, ranging from industrial to home automation applications.

photo-1024x768

“When I was at electronic school, I would have loved Arduino. But back then, microcontroller programming wasn’t that easy. When I became aware of Arduino, I thought… What a great idea for young people and those who are not hardcore microcontroller programmers,” creator Marco Riedesser explained. “The only problem with Arduino is [that] when you don’t really know so much about electronic hardware, driving more than a LED can become difficult. And using an Arduino board in a professional project or even a product that you want to sell is quasi impossible if you want to get certification.”

Now fully UL and CE-certified, Makers can begin creating and actually shipping gadgets such as drones, home appliances, or any other electronic project that comes to mind. The Atmel powered PLC is currently being presented in three models: Mini, Maxi and Mega.

“I had to repair the coffee machine for my brother-in-law. I thought it would be easy to use Arduino but there was nothing on the market that could handle switching high voltage and high current. So I thought I had to come forward with a product,” Riedesser revealed to TechCrunch earlier this year.

automatic-input-voltage-range-selection

All Controllino PLCs are equipped with an internal RTC using SPI, which can be switched on/off and allow for the use of SPI for other purposes via pin header. With built-in processor contact, Makers have a direct link to a number of boards (like Arduino). All pins are also 4000V ESD protected. What’s more, both the Controllino Maxi and Mega let users select between internal RTC and Ethernet using SPI, as well as turn it off so they can use the SPI for other purposes via pin header.

The versatile device works in altitudes up to 2,000m above sea level, in temperatures ranging between 5°C to 55°C, and in maximum relative humidity 80% for temperatures up to 31°C decreasing linearly to 50% relative humidity at 55°C. Each Controllino features an automatic input voltage range selection. This internal function changes voltage dividers ratio on the processor input, and enables the use of one input for analog and digital and for 12V or 24V input voltage range without user action. In addition, the Controllino’s main supply voltage fluctuates up to ±10% of the nominal voltage

e3ea5b4bf1a713af6f0f90899c84d908_large

Key Mini specs:

  • MCU: ATmega328 MCU
  • RTC
  • Clock speed: 16 MHz
  • 1x RS232 interface
  • 1x SPI interface
  • 6x relay outputs (230V/6A)
  • 8x digital outputs (2A @12V or 24V)
  • 8x analog/digital inputs
  • 10A input current max

8cb6d192e0aa469906eeb2b889ec8146_large

Key Maxi specs:

  • MCU: ATmega2560
  • RTC
  • Clock speed: 16 MHz
  • Ethernet connection
  • 2x RS232 interface
  • 1x RS485 interface
  • 1x I2C interface
  • 1x SPI interface
  • 10x relay outputs (230V/6A)
  • 12x digital outputs ( 2A @12V or 24V)
  • 12x analog/digital inputs
  • 20A input current max

00abfb9840ea9be26fcda783c07e395d_large-1

Key Mega specs:

  • MCU: ATmega2560 MCU
  • RTC
  • Clock speed: 16 MHz
  • Ethernet connection
  • 2x RS232 interface
  • 1x RS485 interface
  • 1x I2C interface
  • 1x SPI interface
  • 16x relay outputs (230V/6A)
  • 24x analog/digital inputs
  • 12x digital outputs – high side switch (2A @12V or 24V)
  • 12x digital outputs – half-bridge (2A @12V or 24V)
  • 20A input current max

Interested in learning more? You can check out Controllino’s official page here. Those wishing to purchase the Mini, Maxi and Mega can now do so for € 119.00, € 199.00 and € 269.00, respectively.

Tutorial: Building cool projects with MCUs (Part 5)

I finally received the circuit boards! And, in this fifth and final part of the microcontroller tutorial, we are going to solder the components to the circuit board and program the MCU using the USB port of a computer.

Just to refresh our memories, so far we have learned:

Microcontroller PCB

I recently ordered the PCBs from Seeed Studio. In order to expedite their delivery, I used a more expensive shipping option from UPS. I did get the boards pretty fast – but I also got an unexpected bill from them because they had to take it through customs.

So, even though the boards were only $10, I ended up with paying about $60 in shipping and customs… But luckily, there exists a much cheaper shipping option (about $3-4) – you just have to wait a little bit longer for the boards to arrive.

Let’s solder the board!

I wanted to make this circuit in such a way that it was possible to make it at home. To solder the circuit, I’m going to use my old Ersa soldering iron and some standard solder wire. The tip of the iron is a bit thick, so it’s really not ideal for this job. However, I know many people only have a simple soldering iron like this lying around the house – so it’s the perfect test to see if this is something that anyone can build from the comfort of your home.

Ersa30 Soldering Iron

The first thing we’re going to solder is the MCU chip. This is also the hardest part to solder. I have to admit – when I looked at my soldering iron, then looked at the chip – I was a bit worried that it was going to be hard. But the main trick here was to be patient!

To solder the surface mount components, we can use the techniques described in this smd soldering article.

First, we solder one corner pin of the chip. When we have managed to solder this one pin correctly – and all the pins are aligned over their pads – we move on to the corner on the other side. With two corners soldered properly, all we need to do is to add a tiny bit of solder to all the other pins and pads.

MCU chip soldered

Don’t rush it. Take your time. Inspect the pins closely to see if they are soldered and that they don’t have a “solder bridges” to their neighbors. And, don’t worry if it looks a bit like a war-zone with solder all over – just look at mine above – it still works!

Now, safe to say that the worst part is over. The other components are pretty straightforward to solder. Just make sure the LED and the polarized capacitor is placed in the correct direction.

Microcontroller circuit board

Programming the circuit

Once we are confident that the components are soldered properly, it’s time to test it! First, we need to check if the USB interface works. Otherwise, we won’t be able to program the circuit. To test the USB interface, all we need to do is to connect a USB cable and connect the circuit to our computer. From there, we can just check if it pops up as a USB device on the computer.

And… it does!

So, let’s program the MCU. A simple way of testing it is to make an LED-blink program. This is a simple program that, well, makes our LED blink. It looks like this:

#define F_CPU 1000000 // The chip runs at 1 MHz as default (even if you are using a 8MHz crystal)

#include
#include

int main(void)
{
DDRC = (1<<PC7); //Sets the direction of the PC7 to output
PORTC = (1<<PC7); //Sets PC7 high

while(1)
{
_delay_ms(500); //Wait 500 milliseconds
PORTC &= ~(1<<PC7); //Turn LED off

_delay_ms(500); //Wait 500 milliseconds
PORTC |= (1<<PC7); //Turn LED on
}

return 0;
}

We save this code in a file called led-blink.c

Compiling our code

The first thing we need to do is to compile our code into machine code that the MCU can read. One way of doing this is through Atmel Studio. But, since I am a big fan of using the Linux terminal, I’ll show you how to compile and upload a program using Ubuntu.

First, install avr-gcc with the command:

sudo apt-get install avr-gcc

Then, compile the code and make it into the right format with the following commands:

avr-gcc -mmcu=atmega32u2 -Os blink-led.c -o blink-led.out
avr-objcopy -j .text -j .data -O ihex blink-led.out blink-led.hex

The resulting file – blink-led.hex – can now be uploaded to the microcontroller. You can find more information on the commands here.

Uploading the code to the MCU

Time to upload the program and see if it works. One way to do this is by using Atmel’s FLIP software. But, once again, let’s see how we can do it with the Linux terminal.

Install dfu-programmer with the command:

sudo apt-get install dfu-programmer

Then, erase the old flash memory on the MCU and upload the compiled .hex file:

sudo dfu-programmer atmega32u2 erase
sudo dfu-programmer atmega32u2 flash blink-led.hex

Unplug the circuit from your computer, then plug it in again. And what do you know, the LED starts to blink!

Blink LED microcontroller circuit

Making something cool

Now that we’ve got it working, we’re ready to make something cool. There are so many cool things you can make with a microcontroller. For example, you can connect it to this Wi-Fi module and make the LED blink every time @AtmelMakes posts a new tweet.

Or, how about connecting it to this sound module and this motion sensor, and make it play a Christmas song every time someone goes near your Christmas tree? As Atmel always says, the possibilities are truly endless.

If you missed any of the previous parts of this tutorial – you can find them here: