element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
WorkBench Wednesdays
  • Challenges & Projects
  • element14 presents
  • WorkBench Wednesdays
  • More
  • Cancel
WorkBench Wednesdays
Blog 7 reasons why I like the ATmega128Dx MCUs
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join WorkBench Wednesdays to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: baldengineer
  • Date Created: 16 Jun 2021 1:40 AM Date Created
  • Views 3019 views
  • Likes 13 likes
  • Comments 1 comment
Related
Recommended

7 reasons why I like the ATmega128Dx MCUs

baldengineer
baldengineer
16 Jun 2021

Microchip introduced the ATmega128Dx in three variants: -DA, -DB, and -DD. These 8-bit microcontrollers can run at 5 volts and have several compelling features. While no "official" Arduino board exists based on these chips, an open-source package adds support to the Arduino IDE: DxCore. I liked the chips so much that I featured them in a Workbench Wednesdays episode.

 

Unlike the ATmega328p found in the venerable Arduino Uno or Nano, the newer ATmega128Dx chips have a "MegaAVR" core. Frankly, I'm not enough of an expert to explain the difference. However, if you're familiar with the AVR, the MegaAVR is an excellent successor.

image

Here are seven reasons why I like the ATmega128DB (and its friends) so much.

 

#1. Works with Arduino

Long story short, I like to call the Arduino IDE the "Arduino library." It is a programming language. Instead, it is a very sophisticated C++ library with a ton of great features.

 

DxCore adds support for the ATmega128Dx and its Dx variants. (Hence the name.) It implements most, if not all, of the Arduino library's commands. Functions like analogRead() output an analog voltage instead of a PWM signal, like on other boards with a DAC.

 

#2. Built-in (analog) Op Amps

The aspect I was most interested in is the support for the built-in op-amps. The -DB and -DD have two or three op-amps, depending on the chip's package. Each one has a resistor ladder associated with it, and you can cascade them! So it is possible to build multiple-amplifier stages without using any external components.

 

Although I point out in the WBW episode, you are somewhat limited to what gains you can get with the built-in resistor ladders.

 

DxCore's op-amp library makes working with them relatively easy. Instead of setting bits in registers directly, DxCore has some enums that are more friendly to read. For example, in this code, I configured one of the op-amps as a non-inverting amplifier. This code is the example included with DxCore.

 

#include <Opamp.h>

void setup()
{
  // Configure opamp input pins
  Opamp0.input_p = in_p::pin;   // Connect positive input to external input pin (PD1)
  Opamp0.input_n = in_n::wiper; // Connect negative input to the "middle" position of the resistor ladder

  // Configure resistor ladder
  Opamp0.ladder_top    = top::output;   // Connect the resistor ladder top to the opamp output
  Opamp0.ladder_bottom = bottom::gnd;   // Connect the resistor ladder bottom to ground
  Opamp0.ladder_wiper  = wiper::wiper3; // Set a gain of two

  // Enable opamp output
  Opamp0.output = out::enable;

  // Initialize Opamp0
  Opamp0.init();

  // Start the Opamp hardware
  Opamp::start();
}

 

By the way, the ATmega128DA does not feature op-amps! (I found that the hard way.)

 

#3. Multi-IO Voltages

Using a microcontroller in a system designed for 5 volts goes from comforting to frustrating, like when I was creating the Baldcorder, very quickly. Why? Because so many sensors and peripherals run at 3.3 volts or less. (The TOF sensor we used came on an eval board with a 5 volt level shifter, but it actually ran at 2.8 volts with a max input of 3.2 for the I/O!)

 

The ATmega128DB and -DD have "multi-IO core" capability. You can reference GPIO pins to a voltage OTHER than Vdd! So you can run the microcontroller at 5 volts, gaining maximum speed, while operating the IO pins at a lower voltage for full capability. Or!

 

You can operate the ATmega128Dx at 3.3 volts to save power, but interface with a TTL (5 Volt) device, like NeoPixels (ws2812s!)

 

#4. Internal clock runs up to 24 MHz

Most 8-bit microcontrollers have a built-in oscillator, which is generally limited to a few megahertz. For example, the ATmega328p used in the Arduino Nano only has an internal 8 MHz RC-oscillator.

 

The ATmega128Dx, on the other hand, can run up to 24 MHz with the internal oscillator and multipliers. So you achieve high performance without the need for an external crystal, resonator, or oscillator circuit.

 

# 5. It comes in a DIP-28 Package

As the electronics supply chain continues to move towards surface mount components, it is surprising to see Microchip package such a powerful chip in a DIP.image

 

You give up some flexibility with the pins and at least one op-amp when moving from a surface-mount package to a through-hole DIP.

 

But it is nice to build a breadboard-friendly 24 MHz microcontroller circuit that only needs a couple of decoupling capacitors.

 

# 6. So. Much. Analog.

I have gushed enough about the built-in operational amplifiers. There is also an analog-to-digital converter, a digital-to-analog converter, PWM pins, plus more. And unlike the older the 328p, there is far more flexibility to which pin does what. (There is an eye chart in the datasheet.)

 

The feature that caught my attention was the built-in op-amps. In other Microchip designs, like the SAMD21, there are configurable amplifiers on the ADC inputs. These op-amps seem to be an extension of that design.

 

Other analog features include a 10-bit DAC, three analog comparators, three zero-cross detectors, and a 12-bit ADC! Plus, all of the digital busses you'd expect to find on an 8-bit microcontroller like I2C.

 

#7. UPDI Programming

While I am not excited about "yet another programming standard," I am very happy with UPDI. It is a one-wire programming and debug interface. You can program an Arduino-Nano to act as a programmer to program ATmega128Dx chips. In the Op-Amps without Op Amps workbench Wednesdays episode, that is why I had a Nano clone on the breadboard. It is now my dedicated UPDI programmer. (Well, it was, until the other day when I broke off the USB connector. But that's a story for another post.)

 

Conclusion

The entire ATmega128Dx series of chips are interesting. Although, I am not sure why you might pick a -DA over a -DB or -DD. The -DA lacks several core features that the others have, and they aren't that much cheaper.

 

Frankly, I do not know how long the ATmega328p has been around. But I know its predecessor, the ATmega8, has been in use for a long time. So to see a chip with a similarly easy-to-work-with core equipped with modern features is exciting.

 

Have you checked these chips out? If so, what do you think about them?

  • Sign in to reply

Top Comments

  • DAB
    DAB over 4 years ago +1
    I can see why you like these chips. DAB
  • DAB
    DAB over 4 years ago

    I can see why you like these chips.

     

    DAB

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube