Atmel ATtiny417/814/816/817 Include Core Independent Peripherals (CIPs)

Atmel tinyAVR microcontrollers are optimized for applications that require performance, power efficiency and ease of use in a small package. All tinyAVR devices are based on the same architecture with other AVR devices. The integrated ADC, DAC, EEPROM memory and brown-out detector let you build applications without adding external components. The tinyAVR also offers Flash Memory for fast, secure and cost-effective in-circuit upgrades that significantly cuts your time to market.

The latest tinyAVR devices (ATtiny417/814/816/817) by Atmel combine AVR core with CIPs (Core Independent Peripherals). PIC microcontrollers with Core Independent Peripherals (CIPs) already raised the performance of 8-Bit-MCUs to a new level. Since the acquisition of Atmel by Microchip, this is the first time the company leverages features from both MCU families.

So, now the question is:

What Is CIP?

In fact, the term CIP or Core Independent Peripherals is pretty much self-explanatory. Microchip’s description of CIP is:

CIPs allow the peripherals to operate independently of the core, including serial communication and analog peripherals. Together with the Event System, that allows peripherals to communicate without using the CPU, applications can be optimized at a system level. This lowers power consumption and increases throughput and system reliability.

Core Independent Peripherals or CIPs are designed to handle their tasks with no code or supervision from the CPU to maintain their operations. As a result, they simplify the implementation of complex logic control systems and give designers the flexibility to innovate.

ATtiny417/814/816/817 with Core Independent Peripherals block diagram
ATtiny417/814/816/817 with Core Independent Peripherals block diagram

ATtiny Models With CIPs:

  • 8-bit Atmel AVR microcontroller with 4KB Flash, 256 bytes SRAM, 128 bytes EEPROM, 20MHz/20 MIPS, two 16-bit timer/counters, one 12-bit timer/counter, RTC, USART, SPI, Two-wire Interface (I2C), 10-bit ADC, 8-bit DAC, analog comparator, accurate internal oscillators and multiple calibrated voltage references, Custom Logic, 10-bytes unique ID, and 24 pins.
  • ATtiny814 :
  • 8-bit Atmel AVR microcontroller with 8KB Flash, 512 bytes SRAM, 128 bytes EEPROM, 20MHz/20 MIPS, two 16-bit timer/counters, one 12-bit timer/counter, RTC, USART, SPI, Two-wire Interface (I2C), 10-bit ADC, 8-bit DAC, analog comparator, accurate internal oscillators and multiple calibrated voltage references, Peripheral Touch Controller (PTC), Custom Logic, 10-bytes unique ID, and 14 pins.
  • ATtiny816 :
  • 8-bit Atmel AVR microcontroller with 8KB Flash, 512 bytes SRAM, 128 bytes EEPROM, 20MHz/20 MIPS, two 16-bit timer/counters, one 12-bit timer/counter, RTC, USART, SPI, Two-wire Interface (I2C), 10-bit ADC, 8-bit DAC, analog comparator, accurate internal oscillators and multiple calibrated voltage references, Peripheral Touch Controller (PTC), Custom Logic, 10-bytes unique ID, and 20 pins.
  • ATtiny817 :
  • 8-bit Atmel AVR microcontroller with 8KB Flash, 512 bytes SRAM, 128 bytes EEPROM, 20MHz/20 MIPS, two 16-bit timer/counters, one 12-bit timer/counter, RTC, USART, SPI, Two-wire Interface (I2C), 10-bit ADC, 8-bit DAC, analog comparator, accurate internal oscillators and multiple calibrated voltage references, Peripheral Touch Controller (PTC), Custom Logic, 10-bytes unique ID, and 24 pins.
ATtiny417/814/816/817 With Core Independent Peripheral flash size and Pin count
ATtiny417/814/816/817 With Core Independent Peripheral flash size and Pin count

The new 8-bit tinyAVR MCUs are available in QFN and SOIC packages with pricing starting at $0.43 for 10K units. Visit Atmel tinyAVR product page for full technical details about the new MCUs.

Arduino Ouija Board

Ouija Board is a flat board marked with the letters of the alphabet, the numbers 0–9, the words “yes”, “no”, along with various symbols and graphics. It uses a small heart-shaped piece of wood or plastic called a planchette. Participants place their fingers on the planchette, and it is moved about the board to spell out words. The Ouija board is also called the spirit board and the talking board.

It was regarded as a parlor game unrelated to the occult until American spiritualist Pearl Curran popularized its use as a divining tool during World War I.

This board seems spooky! But how about combining it with Arduino? This project will introduce Arduino as the mind of this board with the planchette vibrating when it approaches certain letters plus opening a lock!

3c0hisxvd8f18esqyvsq

This project uses Radio-frequency identification (RFID) technology that uses electromagnetic fields to automatically identify and track tags attached to objects. The board has some RFID tags on its back at the exact positions of the letters and the planchette has RFID reader to be able to open the lock while choosing letters the same as the pre-configured password. Thanks to wireless technology used in this project, a radio receiver will control the lock when a password match happens!

In order to build this project you need to get a Ouija board or make one by yourself. Plus you need the following parts and materials:

You have to use Arduino IDE to program the Arduino mini.

seyvcjp8ai2mbt3f2fvy

The RFID reader is located within the planchette and it is attached to an Arduino and a battery, keeping in mind providing a place for the antenna in the planchette design. In the other side, the receiver is attached to the actuator and it contains an Arduino Pro Mini, a relay module, an NRF24L01 with a 1117-3.3 regulator attached, a separate 7805 linear regulator with some capacitors and LEDs.

zybml80obzwaptaz9h9b

You can check this board in action, the password here is “ Rose”

The sky’s the limit when it comes to choosing an actuator and the lock here in this project is just an example. You can check designs, code snippets, schematics and more detailed information about designing and programming this haunted Ouija board at the project’s page.

Simple Electronic dice

150767-51

This project is an electronic dice. It consists of seven LEDs positioned like a dice which light up to show the number.

The leds are controlled by a 74HC4017 decade counter IC. Of this IC six outputs are used to drive the LEDs and a seventh output is used to reset the counter. This way it only counts up to six. To light up the correct LEDs, diodes are used. These block the current in one way so other outputs of the IC aren’t affected when LEDs are connected to multiple outputs.

Simple Electronic dice – [Link]

RELATED POSTS

How to Setup a Raspberry Pi Without a Monitor or Keyboard

Circuit Basics writes:

In this video, I’ll walk you through the steps of setting up a Raspberry Pi from the first boot up without a keyboard or monitor. This process requires only a PC or Mac, an ethernet cable, and access to a network router.

How to Setup a Raspberry Pi Without a Monitor or Keyboard [Link]

2.8″ TFT LCD Touch Screen ILI9325 with Arduino Uno and Mega

educ8s.tv uploaded a new video. This is a 2.8” Arduino Touch Screen Tutorial with the ILI9325 driver. Nick writes:

Hey guys, I am Nick and welcome to educ8s.tv a channel that is all about DIY electronics projects with Arduino, Raspberry Pi, ESP8266 and other popular boards. Today we are going to take a look at this 2.8” touch screen designed for Arduino. As you can see, I have loaded a demo program that displays a button on the screen. When I press the button with my finger, the program displays a message. As demonstrated the touch screen is working fine! Finally we can start building projects with a touch screen which are much more interesting and easier to use.

2.8″ TFT LCD Touch Screen ILI9325 with Arduino Uno and Mega [Link]

LT6658 – Precision Dual Output, High Current, Low Noise, Voltage Reference

161103edne-linear-a-lt6658_col
Linear Technology announces the LT6658, a precision voltage reference that incorporates two high current output buffers.

The LT®6658 precision 2.5V dual output reference combines the performance of a low drift low noise reference and a linear regulator. Both outputs are ideal for driving the precision reference inputs of high resolution ADCs and DACs, even with heavy loading while simultaneously acting as output supplies powering microcontrollers and other supporting devices. Both outputs have the same precision specifications and track each other over temperature and load. Both outputs are nominally 2.5V, however each can be configured with external resistors to give an output voltage up to 6V.

LT6658 – Precision Dual Output, High Current, Low Noise, Voltage Reference – [Link]

Capacitor self-diagnostics

di5525f1

Peter Demchenko discuss about a design idea on how to test capacitors in circuit.

The electrolytic capacitor is far from being the most reliable electronic component. One of its failure modes – a gradual loss of capacity – can hardly be noticed until power supply malfunction occurs. Thus, any chance to monitor the condition of the filter capacitors of an electronic device in situ would be a useful thing.

Capacitor self-diagnostics – [Link]

Single-chip USB-C buck-boost battery charger

isl9238-battery-charger-promo

Intersil’s ISL9238 and ISL9238A add 5V-20V reverse boost for USB On-The-Go charging of portables such as smartphones and headphones; two USB-C buck-boost battery chargers support bidirectional power delivery in ultrabooks, tablets, power banks and other mobile products. by Graham Prophet @ edn-europe.com:

The single-chip ISL9238 and ISL9238A battery chargers can replace two-chip solutions to reduce bill of materials (BOM) costs by up to 40%. Both ICs employ Intersil’s R3 modulation technology to extend battery life and deliver acoustic noise-free operation, improved light-load efficiency and fast transient response. The ISL9238 and ISL9238A operate in forward buck, boost or buck-boost mode to fast charge mobile battery packs with up to 4-cell Li-ion batteries.

Single-chip USB-C buck-boost battery charger – [Link]

Programming ESP8266 With Arduino IDE : The Easy Way

The ESP8266 WiFi Module is a self-contained SOC that can give any microcontroller access to your WiFi network. It’s an extremely cost-effective board with a huge and ever-growing community. Each ESP8266 module comes pre-programmed with an AT command set firmware. This module has a powerful on-board processing and storage capability that allows it to act as a standalone microcontroller.

Following 2 easy steps, you can upload Arduino sketches on your ESP8266 using Arduino IDE.

  • Configuring the IDE
  • Making the circuit

Parts List:

  1. ESP 8266 Module.
  2. Jumper wires.
  3. A breadboard.
  4. One USB to TTL converter, a.k.a UART converter.

Configuring The IDE:

In order to bring support for ESP8266 chips to the Arduino environment, you need to add ESP8266 Arduino Core in the IDE.

NOTE: You must have Arduino IDE version 1.6.4 or higher. The latest version is highly recommended. Download the latest version of IDE from Arduino.cc.

  1. Install Arduino 1.6.8.
  2. Start Arduino and open Preferences window.
  3. Enter http://arduino.esp8266.com/stable/package_esp8266com_index.json into Additional Board Manager URLs field. (See the first image)
  4. Open Boards Manager from Tools > Board menu and install esp8266 platform. (See the second image)

Add URL to "Preferences" in Arduino IDE

Add URL to “Preferences” in Arduino IDE

Select ESP8266 board from Board Manager

Select ESP8266 board from Board Manager

Making The Circuit:

ESP8266-01 wiring for uploading program
ESP8266-01 wiring for uploading program
ESP8266-12E wiring for uploading program
ESP8266-12E wiring for uploading program

ESP-01:

  1. Connect GPIO0 to Ground (set it LOW or 0)
  2. Connect CH_PD toVcc (set it HIGH or 1)

ESP-12(E/F):

  1. Connect GPIO0 to Ground (set it LOW or 0)
  2. Connect GPIO15 to Ground (set it LOW OR 0)
  3. Connect GPIO2 to Vcc (set it HIGH or 1)
  4. Connect CH_PD toVcc (set it HIGH or 1)

Pin Vcc and GND should be connected to power supply’s +ve and -ve rail respectively. TX and RX of ESP8266 should be connected to RX and TX of USB to TTL converter respectively.

NOTE: You can replace the USB to TTL converter with an Arduino UNO board, but you have to upload a blank sketch or “bare-minimum” sketch to the Arduino so that the MCU of the Arduino board doesn’t interrupt. Connect TX and RX of the ESP8266 to RX and TX of the Arduino UNO respectively.

Conclusion:

You are done! Now just select your ESP8266 board from Tools > Board menu, write any program, and click on Upload button. The ESP8266 will run as standalone microcontroller now.

To have a clear idea, read the article FLASH AT FIRMWARE TO ESP8266 also.

DIY Spectrum Analyser

Alan X has been working on a spectrum analyser project that can show the spectrum visually! He started working with ATTiny85 and kept on updating the project over time.

1952321477553334016

Alan X used Goertzel’s algorithm with a Hamming window, this algorithm can be used to detect a frequency from sampled data. Here is the preliminary code for a spectrum analyzer:

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
// Uses Daniil Guitelson's BGI library
#include "graphics.h" // -lBGI -lgdi32


#define SampleFreq 125000


int main(void)
{
  int N=250;
  double data[N];
  double samples[N];
  double freq;
  double s;
  double s_prev;
  double s_prev2;
  double coeff;
  double magn;
  int i;


  int gd=CUSTOM, gm=CUSTOM_MODE(700,700);
  initgraph(&gd, &gm, "");
  setcolor(WHITE);


  int X1,Y1,X2,Y2;
  double scale,xmin,ymin,xmax,ymax;


  // Find the maximum and minimum data range
  xmin=0;
  ymin=0;
  xmax=50000;
  ymax=N;
  scale=1.1*(xmax-xmin>ymax-ymin?xmax-xmin:ymax-ymin);


  // Generate samples
  for (i=0;i<N;i++) {
    samples[i]=(50*sin(2*M_PI*i*3300/SampleFreq)+50*sin(2*M_PI*i*5700/SampleFreq)+50*sin(2*M_PI*i*25700/SampleFreq)+100);
    // Window the data
    // data[i]=samples[i]; // Straight Goertzel - not great
    // data[i]=samples[i]*(0.5-0.25*cos(2*M_PI*i/N)); // Hanning Window
    data[i]=samples[i]*(0.54-0.46*cos(2*M_PI*i/N)); // Hamming Window
    // data[i]=samples[i]*(0.426551-0.496561*cos(2*M_PI*i/N)+0.076848*cos(4*M_PI*i/N)); // Exact Blackman Window
  }


  // Scan frequencies
  for (freq=100;freq<=50000;freq+=100) {
    coeff=2*cos(2*M_PI*freq/SampleFreq);
    s_prev=0.0;
    s_prev2=0.0;
    for (i=0;i<N;i++) {
      // Goertzel
      s=data[i]+coeff*s_prev-s_prev2;
      s_prev2=s_prev;
      s_prev=s;


    }


    // Get magnitude
    magn=2*sqrt(s_prev2*s_prev2+s_prev*s_prev-coeff*s_prev*s_prev2)/N;
    printf("Freq: %6f Mag: %6.4f\n",freq,magn);


    // Plot data
    X1=(int)((freq-(xmin+xmax)/2)*700/scale+350);
    Y1=(int)((0+(ymin+ymax)/2)*700/scale+650);
    X2=(int)((freq-(xmin+xmax)/2)*700/scale+350);
    Y2=(int)((-magn*700/2+(ymin+ymax)/2)*700/scale+650);
    line(X1,Y1,X2,Y2);


  }
  getchar();
  closegraph();


  return 0;
}

Daniil Guitelson’s BGI library was also used for the graphics.

Output

Here is the output showing the DC, 3300 Hz, 5700 Hz and 25700 Hz signals:

8398261477186172386

 

The next step is to port the code to a suitable Arduino board and to show the results physically. Thus, he used a MicroView OLED display and here it is listening to a 3v 1kHz square wave:

68801477279127568

 

#include <MicroView.h>

// Audio Spectrum Analyser
#define SampleInput A0   // Name the sample input pin
#define BandWidth  500   // BandWidth
#define MaxFreq   4000   // Max analysis frequency
#define Trigger     10   // Trigger to synchronise the sampler 2vpp at 1kHz = 32

// Define various ADC prescaler
const unsigned char PS_16=(1<<ADPS2);
const unsigned char PS_32=(1<<ADPS2)|(1<<ADPS0);
const unsigned char PS_64=(1<<ADPS2)|(1<<ADPS1);
const unsigned char PS_128=(1<<ADPS2)|(1<<ADPS1)|(1<<ADPS0);

// Setup the serial port and pin 2
void setup() {
// Setup the ADC
pinMode(SampleInput,INPUT);
ADCSRA&=~PS_128; // Remove bits set by Arduino library
// Set prescaler
// ADCSRA|=PS_64; // 64 prescaler (250 kHz assuming a 16MHz clock)
// ADCSRA|=PS_32; // 32 prescaler (500 kHz assuming a 16MHz clock)
ADCSRA|=PS_16; // 16 prescaler (1 MHz assuming a 16MHz clock)

uView.begin();// Start MicroView
uView.clear(PAGE); // Clear page
uView.println("Spectrum  Analyser"); // Project
uView.println("0-20 kHz"); // Range
uView.println();
uView.println("agp.cooper@gmail.com"); // Author
uView.display(); // Display
uView.clear(PAGE); // Clear page
delay(2000);// Wait
}

void loop() {
static byte *samples; // Sample array pointer
static byte *window; // Window array pointer
static int N=0; // Number of samples for BandWidth
static long sampleFreq; // Sample frequency
long freq; // Frequency of interest
float s; // Goertzel variables
float s_prev;
float s_prev2;
float coeff;
float magn;
int i;

if (N==0) {
// Check sample frequency and set number of samples
samples=(byte *)malloc(100);
unsigned long ts=micros();
for (i=0;i<100;i++) samples[i]=(byte)(analogRead(SampleInput)>>2);
unsigned long tf=micros();
free(samples);
sampleFreq=100000000/(tf-ts);
N=2*sampleFreq/BandWidth+1;

uView.setCursor(0,0); // Set cursor to beginning
uView.print("SI: A"); // Sample input pin
uView.println(SampleInput-14);
uView.print("SF: "); // Sample frequency
uView.println(sampleFreq);
uView.print("MF: "); // Max frequency
uView.println(MaxFreq);
uView.print("BW: ");// andWidth
uView.println(MaxFreq);
uView.print("SN: ");// Number of samples
uView.println(N);
uView.display(); // Display
uView.clear(PAGE);// Clear page
delay(2000);

// Create arrays
samples=(byte *)malloc(N);
window=(byte *)malloc(N);

// Modified Hamming Window
for (i=0;i<N;i++) window[i]=(byte)((0.54-0.46*cos(2*M_PI*i/(N-1)))*255);

// Generate test samples
for (i=0;i<N;i++) {
samples[i]=(byte)(30*(sin(2*M_PI*i*5000/sampleFreq)+sin(2*M_PI*i*2500/sampleFreq)+sin(2*M_PI*i*7500/sampleFreq)+sin(2*M_PI*i*10000/sampleFreq))+127);
}
}

if (true) {
// Sychronise the start of sampling with data slicer
int a0,a1;
a0=1023;
for (i=0;i<N;i+=2) {
a1=analogRead(SampleInput);
a0=(a0*13+a1*3)/16;
if (a1>a0+3) break;
}
for (i=0;i<N;i++) samples[i]=(byte)(analogRead(SampleInput)>>2);
}

// Scan frequencies
for (freq=0;freq<=MaxFreq;freq+=(MaxFreq/40)) {
// Goertzel (https://en.wikipedia.org/wiki/Goertzel_algorithm)
coeff=2*cos(2*M_PI*freq/sampleFreq);
s_prev=0;
s_prev2=0;
for (i=0;i<N;i++) {
s=0.0000768935*window[i]*samples[i]+s_prev*coeff-s_prev2;
s_prev2=s_prev;
s_prev=s;
}
// Get magnitude
magn=2*sqrt(s_prev2*s_prev2+s_prev*s_prev-coeff*s_prev*s_prev2)/N;
// Display on MicroView
uView.line(freq*40/MaxFreq,47,freq*40/MaxFreq,10-(int)(20*log10(magn+0.0001)));
}
// Frequency graduations
uView.setCursor(47,0);
uView.print(MaxFreq/1000);
uView.print("k");
uView.line(0,0,0,5);
uView.line(10,0,10,2);
uView.line(20,0,20,5);
uView.line(30,0,30,2);
uView.line(40,0,40,5);
// Voltage graduations
uView.line(0,40,40,40);
uView.setCursor(47,38);
uView.print("-30");
uView.line(0,20,40,20);
uView.setCursor(47,18);
uView.print("-10");
uView.line(0,10,40,10);
uView.setCursor(47,8);
uView.print("  0");
//Display
uView.display();
uView.clear(PAGE);
}

He then updated the project to work with Nokia LCD, here it is showing the 0-3v 1 kHz square wave signal:

3095781477395166324

Amazing ideas and projects can be inspired by this project. You can download these files to start your own spectrum analyser!

The full project and detailed information are available at the project page on Hackaday. You can follow it to keep updates with the latest versions.