Mcu category

ATtiny1607 – A TinyAVR MCU Family For Real-Time Control Systems

In continuation of the development of microcontrollers for a real-time control system, Microchip unveils a new set of microcontroller family based around the known Atmel ATtiny family called the ATtiny1607 family. Microchip is hoping to continue support for the Atmel’s famous AVR set of microcontrollers.

Microchip recently launched the PIC18 Q10 family of MCUs earlier on that features multiple intelligent Core Independent Peripherals (CIPs) and was tailored for real-time control systems. The ATtiny1607 family of AVR® microcontrollers (MCUs) offers similar features like the PIC18 Q10 MCUs, it is equipped with high-speed integrated analog, hardware-based Core Independent Peripherals (CIPs) and low-power performance for efficient, real-time control and sensor node applications in a small physical footprint to help optimize board layout.

The family offers a lot of options; it is made up of about ten different MCUs coming in different package type from DIP to QFN, which makes it ideal for space-constrained closed-loop system especially the 3 x 3 mm 20-pin QFN package. The family offers a broad range of memory, pin and package configurations, program memory from  2KB to 16KB, SRAM from 256 Bytes to 1024 Bytes, pin count from 8 to 24 pin packages, and MCUs in the family all have 12 ADC input.

The family offers an accurate and temperature-stable 20 MHz internal RC oscillator, a configurable custom logic (CCL) and core independent peripherals. These inbuilt features nullify the need for external components which will help it in reducing the cost of the final product.

Below are some of the ATtiny 1607 key attributes:

  • Internal 20 MHz oscillator
  • Up to 16 KB of FLASH memory
  • Up to 12-channel, 115 ksps 10-bit ADC
  • Cyclic Redundancy Check (CRC) scan
  • 16-bit Real-Time Clock and Periodic Interrupt Timer
  • Configurable Custom Logic (CCL) peripheral
  • 3-channel Peripheral Event System
  • Analog Comparator with a scalable reference input
  • Configurable, internally generated reference voltage
  • USART / SPI / dual-mode TWI
  • Available with up to 22 I/O

Getting started to work with the ATtiny 1607 is straightforward. An evaluation kit called ATmega4809-XPRO Evaluation Kit is available for getting starting with the family. It is the ideal platform for rapid prototyping of the new tinyAVR and even megaAVR® MCUs. The kit is a USB powered kit and features an onboard programmer and debugger that seamlessly integrates with Atmel Studio and other peripherals. The board also has a MikroBUS™ -compatible socket, allowing you to easily add sensors, actuators or communications interfaces from Mikroelektronika’s extensive library of click boards™.

ATmega 4809 Evaluation Kit

Development time for the ATtiny1607 can be greatly reduced by using Atmel START, an intuitive web-based graphical configuration tool for embedded projects. Atmel START generates factory-validated C-code to help get an embedded design started. More informaton about Atmel START can be found here.

The tinyAVR® microcontrollers are well-suited for a wide range of applications including industrial, consumer, appliance, automotive and Internet of Things (IoT) sensor nodes. More information about the product family is available on the product page.

CortexProg is a Cortex-M Programmer and Debugger

The ARM Cortex family of 32-bit RISC-based processors has emerged as the leading processor core in embedded designs due to its efficient architecture, robust and scalable instruction set, and extensive base of development tools and software. Cortex-M MCUs has been one of the most used microcontrollers for embedded systems and they have seen applications in various hardware products from wearables to IoT applications. The ARM Cortex-M series offers a range of scalable and compatible core options, from the ultra-low-power Cortex-M0+ to the top-of-the-range, high-performance Cortex-M7.

One significant advantage of the Cortex-M series over the other 32-bit microcontrollers or the 8-bit microcontroller like the Atmega 328P is it’s low cost and low power requirement. Despite their awesomeness, they still face some challenges especially in the aspect of development tools. Developers and engineers tend to use different tools for microcontroller flashing and also debugging which not only increase the cost of development but also waste valuable time.

The CortexProg

Using different ARM chips from some different manufacturers, users will tend to have different programmers because of the different programming by manufactures. Dmitry Grinberg wants to solve this with the CortexProg, a universal programmer of the Arm Cortex-M series.

CortexProg is meant to be a debugger for all Cortex-M microcontrollers. When users are looking into the possibility of reverse-engineering a device, creating new designs, debugging embedded and cortex-m microcontrollers, programming individual boards or on a production line, and other makers exploits, CortexProg might just come in very handy unlike using several tools for those purposes.

The quest of building the CortexProg is not something that just started from this year according to Dmitry. Dmitry wanted to create a generic Cortex-M debugger out of everyday components a maker can find around. The first prototype was based around an AVR ATTiny85 using the ModulaR bootloader. It provided support for an HID-based communications protocol to a PC and firmware updates. It could only debug 3.3V targets, and rather slowly at that.

First working CortexProg

The first prototype based around a V-USB setup is actually open-source for anyone interested in building one. Of course, don’t expect the same performance as the current version and it comes with an upload speed of about 800 bytes per second.

CortexProg can read data from a microcontroller, write data into it, program flash, provide live tracing for printf-style debugging (ZeroWireTrace), and even allow complete GDB debugging. The PC-side tool uses the HID transport to not need any drivers on any of the supported OSs: Linux, Windows, MacOS. The tool source is also available, so you can build yourself a copy for whatever other esoteric environments you might desire to run it on. CortexProg is the complete solution for all your ARM Cortex-M debuggng and programming needs.

Dmitry is currently running a crowdfunding campaign for the device on Kickstarter. Backing the crowdfunding campaign at the $25 level will get you a CortexProg board. It is estimated the boards will be ready for shipment starting at November.

STM8S903K3T6C 8Bit Microcontroller from STMicroelectronics

If an 8bit microcontroller is needed…

If an 8bit microcontroller is needed, Microchip normally comes up first. STMicroelectronics, a company more commonly associated with 32-bit processors, also offers quite a bit of eight bit technology.

The STM8S903K3T6C, which we are going to introduce today, is a classic member of the family. First of all, take a look at its pricing and let us compare it to a similarly specced Microchip part (PIC16F18875).

As can be seen by the OEMsecrets pricing, SGS stays true to its promise of being cheap – the part is, by and large, more affordable than parts from other vendors. When looking at the integrated peripherals, the STM8S903K3T6C gives you everything – one interesting detail is that STMicroelectronics does not use HEF, but instead provides real EPROM memory for user data. Other than that, Microchip provides more in the peripherals department – features such as the configurable logic cell, standard even on very low end PICs, are not available. However, developers do not need to worry about the development environment; both Microchip and SGS provide IDEs. ST Visual Develop, however, is a custom development not based on the recently-required Atollic.

Keep in mind that the chip is not nearly as wide-spread as PIC and AVR – getting help with an AVR problems is much easier, especially due to the large community grown by various projects such as the Arduino.

What to choose?

OEMSecrets job is to make your life easier in all aspects. Due to that, we will not limit ourselves to introducing you to affordable part – we strive to also tell you what to do. When working on a use case with a small or medium amount of production volume, microcontroller pricing usually is but a small part of the bill of materials. Use our price comparison engine to find a cheap source of a chip you know well, stick to it and run to Venezuela – the man hours needed to learn a new design will not, in most cases, be amortised. If volumes are medium to large (or you have a good relationship to SGS), the STM8 is a sensible choice. However, in many cases, an STM32 can be had for an equal amount of money – ST did an amazing job at keeping their 32bit ARM cores cheap.

Flipper Allows You Build Embbeded Applications with Any Programming Language

With the rise of Arduino, Raspberry Pi and others; embedded platform has been known to be programmed with a relatively few languages. Languages like C and C++ has been the tradition  for embedded platforms, and others like Python and maybe Javascript are beginning to see some limelight with the advent of the Rasberry Pi SBC and increase the open hardware movement.

The quest to allow programming hardware with several programming languages has been one daring challenge some makers and designers have taken upon themselves. The likes of the Johnny-Five framework and Espruino have given programmers extra options by providing options for programming the Arduino with Javascript and this will not end here. Flipper is one of such platforms that offers much more, is an embedded development board that can be controlled from any programming language.

Flipper Embedded Platform

Flipper is a unique embedded development platform that enables makers to create their own applications using whatever language they want and interestingly open-source with a growing community. Flipper completely rethinks the traditional embedded programming model, you can either build with the flipper board or interact flipper with other awesome hardware.

Flipper can be thought of as a hardware that acts like a software library, so all you just have to do now is call the library in your existing language project. According to Flipper’s designer George Morgan,

“I wanted to create an embedded development platform that could be used from any language, on any platform, and from the tools familiar to the user of the platform.”

The Flipper: Carbon board is powered by an Atmel ATSAM4S16B Arm Cortex-M4 SoC, which featured 1MB of Flash Memory, 128KB of SRAM and it allows up to 8Mb of external Flash storage. Just like every other board, it provides support for up to 32 GPIO, I2C, SPI, USART, ADC and a 8-bit DAC. It comes with one ATMega32U2 that handles the code uploading from USB to the main MCU.

The board is not totally 5V tolerant, most of the pins are only 3.3v compatible and any 5V passed through those might likely damage the board.

Flipper development board is designed to interact with a host device like a PC, a powerful SBC (Single Board Computer), and others. This strategy allows most of the heavy work to be done on the host device and then passed off to the embedded system. The Flipper board can be controlled in three main ways:

  • Programmed directly like the way we have seen on Arduino and the code runs directly on the hardware.
  • Programmed indirectly from a Host device, where the code runs on a PC for example and the information are sent in real time to the board.
  • Combining both options; in this case, some codes run directly on the board while others on the host.
Flipper hardware is in a slim form factor. It is compatible with breadboards and off-the breadboard, unlike traditionally embedded boards that makes one select one.

The possibility of programming with several languages is possible due to the Flipper API. The MCUs on the board come pre-installed with a custom real-time operating system called Osmium that enables the device to talk to a variety of higher-level libraries written in a variety of programming languages. These libraries contain API that can control the device’s hardware peripherals. For example, if you’re writing an iOS or macOS app, you can simply drag and drop the .framework into your Xcode project and get started.

Flipper is still under development and already has bindings for the following languages:

  • C/C++
  • Objective-C/Swift
  • Rust
  • Python
  • Java
  • Javascript
  • Haskel

Flipper is special because it lets anyone control devices in the real world from applications written in any programming language, on any platform, with absolutely zero headache. Developers simply drag and drop our software library into their applications and start hacking. Everything works right out of the box using tools the developer is already familiar with. There is no need to learn how to use a new IDE, no need to learn a new programming language, and no need to focus on what doesn’t matter.

The Flipper board is available for purchase on tinder at a price of $49.49. More information about the Flipper platform is available on their Github page and the team behind the flipper is also looking for more contributions.

So irrespective of what hardware you want to build, the chances of building it with any language of your choice is now possible with the Flipper platform.

Tiny Machine-Code Monitor

This project is a machine-code monitor that you program from a hexadecimal keypad using a simplified instruction set. by David Johnson-Davies

It’s a good project for learning about the fundamentals of machine code, and will also appeal to people who like programming challenges. The simplified machine code, called MINIL, is designed to be easy to learn and understand. It’s similar to the Little Minion Computer [1] used in some universities to teach students about machine code. The same method could be used to emulate other simple processors, such as the SC/MP, 6800, 8080, or 6502.

Tiny Machine-Code Monitor – [Link]

An introduction to GPIO Settings

Working with microcontrollers means managing GPIO pins at some point. Many configurations have been developed for modern microcontrollers which can lead to some “fancy” terms that may confuse programmers. Its important to understand all of this to avoid confusion and errors while programming.

First, some terms need to be understood. GPIO pins have tri-state logic which means that contrary to popular beliefs GPIO pins can assume 3 states instead of 2. These values are: 0, 1 and high impedance or “Hi-Z”. There is also a state called floating which is when the state is indeterminate and floats between two states. As a result, the pull up and pull down were created, the pull up are resistors that connect a signal to VCC when the signal is floating, and pull downs do the same, but connect the signal to ground. Also, there is a “current sink” which is when the current is flowing into a pin, node, or signal. Conversely, there is a “current source” which is when the current is flowing out of a pin, node, or signal.

The modes of a GPIO pin can be classified into two categories: input, and output. Input mode means that the pin is used to read the state of the electrical signal, they are configured as high-impedance, pull up or pull down. Output modes are used to write a signal as high or low using push-pull or open drain. Push- pull is the default setting in most cases and it works by sourcing or sinking the current. On the other hand, Open- Drain only sinks current which basically makes it a switch with 2 states ground or disconnected. A useful application is for having multiple external devices drive a single, active low interrupt pin.

Regarding functionality, speed is a very important and desired characteristic for GPIO pins since it controls the rate at which it changes state. Speed configurations are referred as “slew rates”, “frequency”, and “high frequency mode”. Increasing speed leads to higher power consumption and a noisier device, so people tend to keep it low unless the project specifically requires more speed.

Another term is “High Drive” GPIO which are push-pull pins that provide more current that usual. These characteristics depend on the device and its recommended to check the datasheet, for example: if a typical GPIO can source/sink 8 mA a high drive device can source/sink 40 mA.

By reading this its easy to notice that the definitions are mostly things we are familiar with, and the only novelty are the terms used to describe them.  Learning and understanding all the modes, functionalities etc. will make working with GPIOs easier and could avoid any issues. You can learn more about GPIO states on the source below.


PIC18 Q10 Product Family – PIC® MCUs for Closed-loop Control

Real-time control systems usually are closed-loop control systems where one has a tight time window to gather data, process that data, and update the system. If the time window is missed, then the stability of the system is degraded. This reduced control can be catastrophic to some applications, such as power conversion and advanced motor control. Many semiconductor companies are claiming their MCUs can support real-time control applications, but they don’t usually offer an accurate real-time control system. Microchip has unveiled a new PIC18 Q10 family featuring multiple intelligent Core Independent Peripherals (CIPs) that help designers to simplify development and enable quick response time to system events.

Microchip which in 2016 acquired Atmel, the company famously known for the Atmega 328P, the microcontroller behind the Arduino Uno has launched a set of microcontrollers that are tailored for real-time control system called the PIC18 Q10 Family of Microcontrollers. The new family is designed for a robust system with intelligent analog, configurable peripherals and operates at 5V, making it ideal for noise prone applications because 5V offers more noise immunity as compared to 3.3V MCUs.

The PIC18 Q10 family of MCUs features CIP (Core Independent Peripherals) that provide the ability to accomplish tasks in hardware while freeing up the Central Processing Unit (CPU) to do other tasks or go to sleep to save power. The hardware-based peripherals offload timing-critical and core-intensive functions from the CPU, allowing it to focus on more complex functions within the system. This decreases system complexity by eliminating additional code and external components, reduces power consumption, allowing for deterministic response time as well as decreased validation time.

The family is made up of about seven different MCUs all coming in different package type from DIP to a QFN, making it ideal for space-constrained closed-loop control system while still applicable for hobbyist and enthusiast by leveraging on the DIP package version. The products offer Intelligent Analog peripherals including Zero Cross Detect (ZCD), on-chip comparators and a 10-bit ADC with Computation (ADC2) automating Capacitive Voltage Divider (CVD) techniques for advanced touch sensing, averaging, filtering, oversampling and automatic threshold comparison.

These are some of the PIC18 Q10 Key attributes to take note off:

  • 64 MHz internal oscillator
  • Up to 128 KB Flash program memory
  • Up to 1 KB data EEPROM
  • Up to 3615 B data SRAM
  • 10-bit ADC2 (ADC with Computation), up to 35 channels
  • Four 16-bit timers
  • Complementary Waveform Generator (CWG)
  • Two comparators
  • Zero Cross Detect (ZCD)
  • Windowed Watch Dog Timer (WWDT)
  • Peripheral Pin Select (PPS)
  • Data Signal Modulator (DSM)
  • Up to 8 Configurable Logic Cells (CLC)
  • 5-bit DAC
  • EUSART, SPI, and I2C
  • Available in 28-, 40- and 44-pins

The PIC18 Q10 family can be used with the curiosity development boards which are cost-effective MCU development platforms and can be used to accelerate the development of the MCUs family. The family is also supported by MPLAB® Code Configurator (MCC), a free software plug-in that provides a graphical interface to configure peripherals and functions specific to your application.

Based on its overwhelming featuers, the PIC18 Q10 family is suited for a broad range of applications including industrial control, consumer, automotive, touch sensing, advanced motor control, and the Internet of Things (IoT). More information about the product family can be found on the product page.

ATtiny85 20MHz Internal Clock

Here is a new tutorial from on how to run ATtiny85 with internal 20MHz clock.

The ATtiny85 is rated at a maximum clock speed of 20MHz at 4.5 – 5.5V. For some applications it would be nice to get the maximum speed without needing to buy a 20MHz crystal, or tie up two I/O lines driving the crystal. Here’s how to do it.

To test it I toggled an output at the clock frequency, and measured it with a frequency meter

The reading of 10MHz implies a clock frequency of 20MHz.

2ATtiny85 0MHz Internal Clock – [Link]


IR Remote Wand based on ATtiny85

David Johnson-Davies published another great project. It’s an IR remote that supports the most popular control protocols.

The IR Remote Wand is a universal remote control that you can program with up to five codes to control a variety of different products:

It supports some of the most popular IR remote control protocols: Philips RC-5, NEC, Samsung, and Sony. It’s based on an ATtiny85, and the circuit goes to sleep when you’re not using it, to avoid the need for an on-off switch and to prolong the battery life. You can use my earlier IR Remote Control Detective [Updated] to discover the codes for the functions you want to support.

IR Remote Wand based on ATtiny85 – [Link]

LoRa module in DIL form

Mare writes:

Murata produces LoRa module CMWX1ZZABZ-xxx based on SX1276 transceiver and STM32L072CZ microcontroller. The soldering of the LGA module is not very hobby-friendly. I constructed small breakout PCB for this module with additional buck/boost switcher and place for SMA connector. The transceiver features the LoRa®long-range modem, providing ultra-long-range spread spectrum communication and high interference immunity, minimizing current consumption. Since CMWX1ZZABZ-091 is an “open” module, it is possible to access all STM32L072 peripherals such as ADC, 16-bit timer, LP-UART, I2C, SPI and USB 2.0 FS (supporting BCD and LPM), which are not used internally by SX1276.

LoRa module in DIL form – [Link]