# Adafruit ATtiny Breakouts with seesaw

## Overview

![](https://cdn-learn.adafruit.com/assets/assets/000/105/222/medium800thumb/adafruit_products_ATTiny_NeoPixel_ring.jpg?1633639240)

These are the Adafruit ATtiny817, ATtiny816 and ATtiny1616 breakouts with seesaw! These breakout boards are a "three in one" product:

1. The ATtiny817, ATtiny816 and ATtiny1616 are part of the 'next gen' of AVR microcontrollers, and now we have a cute development/breakout board for them, with just enough hardware to get the chip up and running.
2. It's also an Adafruit seesaw board. Adafruit seesaw is a near-universal converter framework which allows you to add&nbsp;and extend hardware support to any I2C-capable microcontroller or microcomputer. Instead of getting separate I2C GPIO expanders, ADCs, PWM drivers, etc, seesaw can be configured to give a wide range of capabilities.
3. Finally, with STEMMA QT connectors on it, you could use it as either an I2C controller or peripheral with plug-and play support.

![](https://cdn-learn.adafruit.com/assets/assets/000/122/973/medium800/adafruit_products_5681-00.jpg?1690378338)

We primarily designed this board for our own use: it's a mini dev board that lets us design with the ATtinyxxx, [just like we did for the ATSAMD09](https://www.adafruit.com/product/3657). With the 2021-2022 silicon shortage, we're adapting some of our SAMD09 designs to the ATtinyxxx series and wanted a quick minimal board to test code on.

Each breakout comes with the assembled and tested board, as well as some header strips. Each PCB is fairly minimal and contains:

![](https://cdn-learn.adafruit.com/assets/assets/000/122/974/medium800/adafruit_products_5681-01.jpg?1690378354)

### **ATtiny817 8-bit microcontroller**

- 8KB flash, 512 bytes of RAM, 128 bytes of EEPROM
- Internal oscillator can run up to 20MHz
- Internal hardware multiplier
- Can run from 2V to 5V power/logic (check the datasheet for max speed at desired power)
- **3.3V regulator** - by default we run at the Vin voltage, which can be 5V, but there's a solder jumper on the bottom if you'd like to select 3V logic.
- **Green power LED**
- **Red indicator LED**
- **Two STEMMA QT I2C connectors** with 10K pullup resistors, connected to pins 10 and 11. The default I2C address is **0x49**.

![adafruit_products_5233-04.jpg](https://cdn-learn.adafruit.com/assets/assets/000/118/840/medium640/adafruit_products_5233-04.jpg?1677165021)

### **ATtiny816 8-bit microcontroller**

- 8KB flash, 512 bytes of RAM, 128 bytes of EEPROM
- Internal oscillator can run up to 20MHz
- Internal hardware multiplier
- Can run from 2V to 5V power/logic (check the datasheet for max speed at desired power)
- **3.3V regulator** &nbsp;- by default we run at the Vin voltage, which can be 5V, but there's a solder jumper on the bottom if you'd like to select 3V logic.
- **Green power LED**
- **Red indicator LED**
- **Two STEMMA QT I2C connectors** &nbsp;with 10K pullup resistors, connected to pins 8&nbsp;and 9. The default I2C address is **0x49**.

![adafruit_products_5681-03.jpg](https://cdn-learn.adafruit.com/assets/assets/000/118/841/medium640/adafruit_products_5681-03.jpg?1677165064)

### **ATtiny1616 8-bit microcontroller**

- 16KB flash, 2KB of RAM, 256&nbsp;bytes of EEPROM
- Internal oscillator can run up to 20MHz
- Internal hardware multiplier
- Can run from 2V to 5V power/logic (check the datasheet for max speed at desired power)
- **3.3V regulator** &nbsp;- by default we run at the Vin voltage, which can be 5V, but there's a solder jumper on the bottom if you'd like to select 3V logic.
- **Green power LED**
- **Red indicator LED**
- **Two STEMMA QT I2C connectors** &nbsp;with 10K pullup resistors, connected to pins 8&nbsp;and 9. The default I2C address is **0x49**.

![adafruit_products_5690-04.jpg](https://cdn-learn.adafruit.com/assets/assets/000/118/842/medium640/adafruit_products_5690-04.jpg?1677165106)

![](https://cdn-learn.adafruit.com/assets/assets/000/105/225/medium800/adafruit_products_ATTiny_STEMMA_side.jpg?1633639282)

[This boards comes pre-programmed with seesaw peripheral code](https://github.com/adafruit/Adafruit_seesawPeripheral) that will let it act as an "I2C to something" converter, basically a little I2C-controlled friend to do all the timing-sensitive things many microcontrollers and microcomputers are not good at.

For example, using the ATtiny817 breakout with the pre-burned seesaw firmware gives you:

- 14 x GPIO with selectable pullup resistors
- 9 x 10-bit ADC inputs - pins 0, 1, 2, 3, 6, 7, 18, 19, 20
- 5 x 8-bit PWM outputs -&nbsp;pins 0, 1, 9, 12, 13
- 1 x NeoPixel output (up to 60 pixels)
- 1 x EEPROM with 127 byte of NVM memory (handy for storing small access tokens or MAC addresses) - last byte of EEPROM is used for I2C address selection
- 1 x Interrupt output that can be triggered by any of the accessories - pin 15
- 2 x I2C address selection pins - pins 16 and 17
- 1 x Activity LED on pin 5, tied active low

Using the ATtinyx16 breakouts with pre-burned seesaw firmware gives you:

- 12 x GPIO with selectable pullup resistors: 0-5, 6, 8, 11, 14, 15, 16
- 9 x 10-bit ADC inputs - pins 0, 1, 2, 3, 4, 5, 14, 15, 16
- 5 x 8-bit PWM outputs - pins 0, 1, 7, 11, 16
- 1 x NeoPixel output (up to 250 pixels)
- 1 x EEPROM with 127 byte of NVM memory (handy for storing small access tokens or MAC addresses) - last byte of EEPROM is used for I2C address selection
- 1 x Interrupt output that can be triggered by any of the accessories - pin 6
- 2 x I2C address selection pins - pins 12 and 13
- 1 x Activity LED on pin 10, tied active low

![](https://cdn-learn.adafruit.com/assets/assets/000/105/226/medium800/adafruit_products_ATTiny_back.jpg?1633639296)

Of course you can configure or reprogram the chip to however you want to use it - [we like using SpenceKonde's megaTinyCore which brings Arduino peripheral support](https://github.com/SpenceKonde/megaTinyCore) to this series of chips. To program the chip [you will need a 'UPDI' programmer](https://github.com/SpenceKonde/megaTinyCore), which you can make with a [USB-to-Serial cable](https://www.adafruit.com/product/954) and [a single 4.7K or 10K resistor](https://www.adafruit.com/product/2783).

**Please note:** The boards do not come with a bootloader. If you want to do development on seesaw (e.g. changing the configuration) you need a separate UPDI programming setup! [The firmware we put on is available as this example sketch](https://github.com/adafruit/Adafruit_seesawPeripheral/blob/main/examples/example_pid5233/example_pid5233.ino), compiled using the megaTinyCore. We don't provide any support for custom builds of seesaw - we think this is cool and useful for the Maker community!

# Adafruit ATtiny Breakouts with seesaw

## ATtiny816 and ATtiny1616 Breakout Pinouts

![](https://cdn-learn.adafruit.com/assets/assets/000/118/849/medium800/adafruit_products_double.jpg?1677167575)

The default I2C address is **0x49**.

## Power Pins:

- **Vin** - this is the power pin. The ATtinyx16 operates between 1.8V and 5.5V. However, we still included a 3.3V voltage regulator. You can power the board from 2V to 5V. It defaults to Vin voltage, which can be between 3.3V and 5V, or cut the jumper on the back and bridge the other pad to select 3.3V logic.
- **3V** &nbsp;- This is the 3.3V output from the voltage regulator. You can grab up to 100mA from this if you like.
- **G** &nbsp;- This is common ground for power and logic.

Info: 

## I2C

- **SCL** - This is the I2C clock pin. Connect to your microcontrollers I2C clock line. There is a 10K pullup on this pin to **Vin**.
- **SDA** - This is the I2C data pin. Connect to your microcontrollers I2C data line. There is a 10K pullup on this pin to **Vin**.
- [**STEMMA QT**](https://learn.adafruit.com/introducing-adafruit-stemma-qt) **-** These I2C connectors, located on each end of the board, have 10K pullup resistors. They allow you to connect to development boards with **STEMMA QT** connectors, or to other things, with [various associated accessories](https://www.adafruit.com/?q=JST%20SH%204).

## seesaw GPIO Pins:

- **0-5, 11, 14, 15, 16** - These are the 10 GPIO pins available with selectable pullup resistors.

## seesaw Interrupt Pins:

- **6** - This pin can be set to pull low by the breakout and can signal to your host microcontroller that an interrupt has occurred.

## seesaw I2C Address Pins:

The default I2C address is **0x49**.

- **12 / AD0** - This is the ADDR0 pin. Connect this to ground to increment the device's I2C address by 1.
- **13 / AD1** - this is the ADDR1 pin. Connect this to ground to increment the device's I2C address by 2.

## seesaw NeoPixel-Capable Pins:

- **0-5, 11, 14, 15, 16** - Any GPIO pin can be a NeoPixel pin, **however, you can only use one pin at a time.** There is only one NeoPixel buffer, and therefore only one NeoPixel output. It can drive up to 60 pixels.

## ADC Pins:

- **0-5, 14, 15, 16** &nbsp;- There are nine 10-bit ADC pins.

## PWM Pins:

- **0, 1, 7, 11, 16** - There are five 8-bit PWM output pins.  

## LED Pin

- For the 816 and 1616, there is a red LED that can be turned on by using seesaw Pin **10**. Note the LED pin is different on the 817.

## Programming Pins:

- **UPDI** - This is the single-pin **U** nified **P** rogram and **D** ebug **I** nterface. This pin is for external programming or on-chip-debugging. It uses the reset pin on the ATtiny.

Warning: 

# Adafruit ATtiny Breakouts with seesaw

## ATtiny817 Breakout Pinouts

![](https://cdn-learn.adafruit.com/assets/assets/000/105/369/medium800/adafruit_products_ATtiny_pinouts_page.jpg?1634049179)

## Power Pins:

- **Vin** - this is the power pin. The ATtiny8x7 operates between 1.8V and 5.5V. However, we still included a 3.3V voltage regulator. You can power from 3.3V to 5V. It defaults to Vin voltage, which can be between 3.3V and 5V, or cut the jumper on the back and bridge the other pad to select 3.3V logic.
- **3Vo** - This is the 3.3V output from the voltage regulator. You can grab up to 100mA from this if you like.
- **GND** - This is common ground for power and logic.

Info: 

## I2C Pins / STEMMA QT:

The default I2C address is **0x49**.

- **SCL** - This is the I2C clock pin. Connect to your microcontrollers I2C clock line. There is a 10K pullup on this pin to **Vin**.
- **SDA** - This is the I2C data pin. Connect to your microcontrollers I2C data line. There is a 10K pullup on this pin to **Vin**.
- [**STEMMA QT**](https://learn.adafruit.com/introducing-adafruit-stemma-qt) **-** These I2C connectors, located on each end of the board, have 10K pullup resistors. They allow you to connect to development boards with **STEMMA QT** connectors, or to other things, with [various associated accessories](https://www.adafruit.com/?q=JST%20SH%204).

## seesaw GPIO Pins:

- **0, 1, 2, 3, 20, 5, 6, 7, 8, 9, 12, 13, 14, 18, 19** - These are the 15 GPIO pins available.

Warning: 

## seesaw Interrupt Pins:

- **15** - This pin can be set to pull low by the breakout to signal to your host microcontroller that an interrupt has occurred.

## seesaw I2C Address Pins:

The default I2C address is **0x49**.

- **16 / AD0** - This is the ADDR0 pin. Connect this to ground to increment the device's I2C address by 1.
- **17 / AD1&nbsp;** - this is the ADDR1 pin. Connect this to ground to increment the device's I2C address by 2.

## seesaw NeoPixel-Capable Pins:

- **0, 1, 2, 3, 20, 5, 6, 7, 8, 9, 12, 13, 14, 18, 19** - Any GPIO pin can be a NeoPixel pin, **however, you can only use one pin at a time.** There is only one NeoPixel buffer, and therefore only one NeoPixel output. It can drive up to 60 pixels.

## ADC Pins:

- **0, 1, 2, 3, 6, 7, 18, 19, 20** - There are nine 10-bit ADC pins.

## PWM Pins:

- **0, 1, 9, 12, 13** - There are five 8-bit PWM output pins.  

## LED Pin

- For the 817 there is a red LED that can be turned on by using seesaw Pin&nbsp; **5**. Note the LED pin is different on the 816/1616.

## Programming Pins:

- **UPDI** - This is the single-pin **U** nified **P** rogram and **D** ebug **I** nterface. This pin is for external programming or on-chip-debugging. It uses the reset pin on the ATtiny.

Warning: 

# Adafruit ATtiny Breakouts with seesaw

## Python & CircuitPython

The [Adafruit CircuitPython seesaw library](https://github.com/adafruit/Adafruit_CircuitPython_seesaw) makes it easy to do all kinds of things with your ATtiny817 Breakout. This section includes a quick way to verify your breakout is hooked up properly and functioning.

You can use this sensor with any CircuitPython microcontroller board or with a computer that has GPIO and Python [thanks to Adafruit\_Blinka, our CircuitPython-for-Python compatibility library](https://learn.adafruit.com/circuitpython-on-raspberrypi-linux).

## CircuitPython Microcontroller Wiring

First wire up a ATtiny817 breakout to your microcontroller board exactly as shown below. Here's an example of wiring a Feather RP2040 to the breakout using I2C via the STEMMA QT connector.

- Use a **STEMMA QT cable** to connect the **STEMMA QT connector on the Feather** to the **STEMMA QT connector on the breakout**.

![adafruit_products_ATtinyB_Feather_STEMMA_bb.jpg](https://cdn-learn.adafruit.com/assets/assets/000/105/450/medium640/adafruit_products_ATtinyB_Feather_STEMMA_bb.jpg?1634149359)

Here's an example connecting the breakout STEMMA QT connector to a solderless breadboard.

- Plug a **[STEMMA QT to male jumper wire cable](https://www.adafruit.com/product/4209)** into the **STEMMA QT connector on the breakout.**  
- **Feather 3V** &nbsp;to **breakout VIN (red wire)**  
- **Feather GND** &nbsp;to **breakout GND (black wire)**  
- **Feather SCL** &nbsp;to **breakout SCL (yellow wire)**  
- **Feather SDA** &nbsp;to **breakout SDA (blue wire)**

![adafruit_products_ATtinyB_Feather_breadboard_bb.jpg](https://cdn-learn.adafruit.com/assets/assets/000/105/452/medium640/adafruit_products_ATtinyB_Feather_breadboard_bb.jpg?1634149493)

## Python Computer Wiring

Since there's _dozens_ of Linux computers/boards you can use we will show wiring for Raspberry Pi. For other platforms, [please visit the guide for CircuitPython on Linux to see whether your platform is supported](https://learn.adafruit.com/circuitpython-on-raspberrypi-linux).&nbsp;

Here's the Raspberry Pi wired with I2C.

- **Plug a [STEMMA QT to male jumper wire cable](https://www.adafruit.com/product/4209) into the STEMMA QT connector on the breakout.**
- **Pi 3V3** to **breakout VIN (red wire)**  
- **Pi GND** to **breakout GND (black wire)**  
- **Pi SCL** to **breakout SCL (yellow wire)**  
- **Pi SDA** to **breakout SDA (blue wire)**

![adafruit_products_ATtinyB_RasPi_bb.jpg](https://cdn-learn.adafruit.com/assets/assets/000/105/453/medium640/adafruit_products_ATtinyB_RasPi_bb.jpg?1634149901)

## Python Installation of seesaw Library

You'll need to install the Adafruit\_Blinka library that provides the CircuitPython support in Python. This may also require enabling I2C on your platform and verifying you are running Python 3. [Since each platform is a little different, and Linux changes often, please visit the CircuitPython on Linux guide to get your computer ready](https://learn.adafruit.com/circuitpython-on-raspberrypi-linux)!

Once that's done, from your command line run the following command:

- `pip3 install adafruit-circuitpython-seesaw`

If your default Python is version 3 you may need to run 'pip' instead. Just make sure you aren't trying to use CircuitPython on Python 2.x, it isn't supported!

## CircuitPython Usage

To use with CircuitPython, you need to first install the seesaw library into the **lib** folder on your **CIRCUITPY** drive. Then you need to update **code.py** with the example script.

Thankfully, you can do this in one go. In the example below, click the **Download Project Bundle** button below to download the necessary libraries and the **code.py** file in a zip file. Extract the contents of the zip file, and copy the **entire**  **lib**  **folder** and the **code.py** file to your **CIRCUITPY** drive.

Your **CIRCUITPY/lib** folder should contain the following folders:

- **adafruit\_bus\_device/**
- **adafruit\_seesaw/**

![CIRCUITPY](https://adafruit.github.io/Adafruit_CircuitPython_Bundle/seesaw_seesaw_attiny_simpletest.py.png )

## Python Usage

Once you have the library `pip3` installed on your computer, copy or download the following example to your computer, and run the following, replacing **code.py** with whatever you named the file: `python3 code.py`

## Example Code:
Warning: The example below is for the 817. If you are using the 816/1616, please change seesaw Pin 5 to Pin 10. No other changes are needed.

https://github.com/adafruit/Adafruit_CircuitPython_seesaw/blob/main/examples/seesaw_attiny_simpletest.py

 **If running CircuitPython:** Once everything is saved to the **CIRCUITPY** drive, the built-in LED will begin blinking!

**If running Python:** Once you run the example, the built-in LED will begin blinking!

![](https://cdn-learn.adafruit.com/assets/assets/000/105/665/medium800thumb/adafruit_products_ATtinyB_CP_blink.jpg?1634678375)

In this example, you first import the required modules and library. Then you initialise the seesaw and provide it the I2C board object.

Next, you setup pin 5 as an output.

Inside the loop, you first set the LED to `False` to turn it on. `False` is the voltage level. You set it to `False` to turn it on because the LED is tied active low. Then, you wait for one second. Next, you turn off the LED by setting it to `True`, and then wait one more second before beginning the loop again.

That's all there is to blinking the built-in LED on the ATtiny817 breakout using CircuitPython and the seesaw library!

# Adafruit ATtiny Breakouts with seesaw

## Analog In

The seesaw firmware that ships with the ATtinyxxx breakouts includes analog capabilities on specific pins. This simple example reads the analog value of a pin.

Follow the instructions on the [Python & CircuitPython page](https://learn.adafruit.com/adafruit-attiny817-seesaw/circuitpython) to get set up.

Info: 

## Analog Pins

The ATtiny817 breakout with seesaw firmware provides analog on the following pins:

- **0-3, 6, 7, 18-20**

The ATtiny816 and ATtiny1616 breakout with seesaw firmware provides analog on the following pins:

- **0-5, 14-16**

## Example Code

Update your **code.py** to the following.

https://github.com/adafruit/Adafruit_CircuitPython_seesaw/blob/main/examples/seesaw_analogin_test.py

Now, connect to the serial console to see the values printed out.

![](https://cdn-learn.adafruit.com/assets/assets/000/105/481/medium800/adafruit_products_ATtinyB_analogin_serial_output.png?1634236106)

First you import the necessary modules and libraries. Then, you instantiate the seesaw on I2C.

Next, you choose the analog pin from which you would like to read values, in this case pin 2, and then set it up as an `AnalogInput`.

Inside the loop, you read the analog pin value and print it to the serial console. Finally, you include a short delay to keep the values readable.

That's all there is to using CircuitPython seesaw analog with the ATtinyxxx breakouts!

# Adafruit ATtiny Breakouts with seesaw

## Digital Input

The seesaw firmware that ships with the ATtinyxxx breakouts includes digital capabilities on specific pins. This example blinks the turns on the built-in LED when a button is pressed.

Follow the instructions on the [Python & CircuitPython page](https://learn.adafruit.com/adafruit-attiny817-seesaw/circuitpython) to get set up.

Info: 

## Digital Pins

There are 15 pins on the ATtiny817 breakout that can be used with digitalio:

- **0-3, 5-9, 12-14, 18-20**

There are 12 pins on the ATtinyx16 breakouts that can be used with digitalio:

- **0-6, 8, 11, 14-16**

## Wiring

Connect a button up to your already wired up breakout as follows.

- Use a **STEMMA QT cable** to connect the **STEMMA QT connector on the Feather** to the **STEMMA QT connector on the breakout**.
- Connect **one leg of button** to **breakout GND**
- Connect **opposite leg of button** to **breakout pin 2**

![adafruit_products_ATtinyB_Feather_button_bb.jpg](https://cdn-learn.adafruit.com/assets/assets/000/105/480/medium640/adafruit_products_ATtinyB_Feather_button_bb.jpg?1634235471)

## Example Code

Update your **code.py** to the following.

https://github.com/adafruit/Adafruit_CircuitPython_seesaw/blob/main/examples/seesaw_digitalio_test.py

Now, press the button to see the little red LED light up! Release the button to turn it off.

![](https://cdn-learn.adafruit.com/assets/assets/000/105/664/medium800thumb/adafruit_products_ATtinyB_CP_digital_button.jpg?1634677647)

First, you import all the necessary modules and libraries. Then you instantiate the seesaw on I2C.

Next, you choose the button pin and LED pin. The button is on pin 2, and the built-in LED is on pin 5.

Then you create the button object, and set it up as an input with a pullup. Following that, you create the LED object and set up the pin as an output.

Finally, inside the loop, you simply set the LED state equal to the button state with a 0.1 second delay for debounce.

That's all there is to using CircuitPython seesaw digitalio with the ATtinyxxx breakouts!

# Adafruit ATtiny Breakouts with seesaw

## NeoPixel

The seesaw firmware that ships with the ATtinyxxx breakouts include the ability to power up to 60 NeoPixels on one pin. This example displays a rainbow across a NeoPixel ring.

Follow the instructions on the [Python & CircuitPython page](https://learn.adafruit.com/adafruit-attiny817-seesaw/circuitpython) to get set up.

## NeoPixel Pins

**Only one pin can be used at a time** for powering NeoPixels on the ATtinyxxx breakouts!

There are 15 pins on the ATtiny817 breakout that can be used for powering NeoPixels:

- **0-3, 5-9, 12-14, 18-20**

There are 12 pins on the ATtinyx16 breakouts that can be used for powering NeoPixels:

- **0-6, 8, 11, 14-16**

## Wiring

As stated above, you can use many different pins for powering NeoPixels, but this example uses pin 19. Connect a NeoPixel ring (or strip) to the breakout as follows.

- Use a **STEMMA QT cable** to connect the **STEMMA QT connector on the Feather** to the **STEMMA QT connector on the breakout**.
- Connect **NeoPixel ring GND** to **breakout GND**
- Connect **NeoPixel ring IN (data in)** to **breakout pin 19**
- Connect **NeoPIxel ring power** to **breakout VIN**

![adafruit_products_ATtinyB_Feather_NeoPixel_ring_bb.jpg](https://cdn-learn.adafruit.com/assets/assets/000/105/487/medium640/adafruit_products_ATtinyB_Feather_NeoPixel_ring_bb.jpg?1634238816)

Warning: 

## Example Code

Update your **code.py** to the following. If you are using an ATtinyx16, update `NEOPIXEL_PIN` to be one of the NeoPixel capable pins listed above to match your wiring.

https://github.com/adafruit/Adafruit_CircuitPython_seesaw/blob/main/examples/seesaw_neopixel_test.py

The NeoPixel ring lights up in a rainbow!

![](https://cdn-learn.adafruit.com/assets/assets/000/105/661/medium800thumb/adafruit_products_ATtinyB_CP_NeoPixel.jpg?1634675912)

First you import all the necessary modules and libraries. Then you instantiate the seesaw on I2C.

Next, you set the NeoPixel pin, and the number of pixels to match your wiring and pixel number. This example uses pin 19 and a 12-pixel ring.

Then, you create the pixels object with the pin and number you set above.

Before the loop, you set pixel brightness to 30% and create a `color_offset` variable and set it to 0 to start the colorwheel at red.

Inside the loop, you display the rainbow with a slight delay. Increase this to slow down the rainbow if desired.

That's all there is to using CircuitPython seesaw NeoPixel with the ATtinyxxx breakouts!

# Adafruit ATtiny Breakouts with seesaw

## PWMOut

The seesaw firmware that ships with the ATtinyxxx breakouts includes PWM capabilities on specific pins. This example fades an external LED.

Follow the instructions on the [Python & CircuitPython page](https://learn.adafruit.com/adafruit-attiny817-seesaw/circuitpython) to get set&nbsp; up.

## PWM Pins

The ATtiny817 breakout with seesaw firmware provides PWM on the following pins:

- **0, 1, 9, 12, 13**

The ATtiny816 and ATtiny1616 breakouts with seesaw firmware provides PWM on the following pins:

- **0, 1, 7, 11, 16**

## Wiring

This example uses an external LED. Wire it up as follows.

- Use a **STEMMA QT cable** to connect the **STEMMA QT connector on the Feather** to the **STEMMA QT connector on the breakout**.
- Connect the **+ leg (longer leg)**  **of LED** to **breakout pin**  **12**
- Connect the **- leg (shorter leg) of LED** to **1kΩ resistor**
- Connect **1kΩ resistor** to **breakout GND**

![adafruit_products_ATtinyB_Feather_external_LED_bb.jpg](https://cdn-learn.adafruit.com/assets/assets/000/105/489/medium640/adafruit_products_ATtinyB_Feather_external_LED_bb.jpg?1634244306)

Warning: 

## Example Code

Update your **code.py** to the following. If you are using an ATtinyx16, update `PWM_PIN` to be one of the PWM capable pins listed above to match your wiring.

https://github.com/adafruit/Adafruit_CircuitPython_seesaw/blob/main/examples/seesaw_pwmout_test.py

The brightness of the LED will fade up and then down, and repeat!

![](https://cdn-learn.adafruit.com/assets/assets/000/105/663/medium800thumb/adafruit_products_ATtinyB_CP_PWM_LED.jpg?1634677065)

First, you import all the necessary modules and libraries. Then you instantiate the seesaw on I2C.

Next, you choose a pin for the LED, and then create the LED `PWMOut` object and provide it the `PWM_PIN`.

Before the loop, you set a delay of 0.01 seconds.

Inside the loop, you initially cycle up through the PWM range (0 - 65535) in increments 0f 256, and once complete, cycle down from the max back to 0 in increments of 256. The step is limited to increments of 256 because the resolution is often only 8 bits underneath. Both cycles have the delay included.

That's all there is to using CircuitPython seesaw PWM to fade an LED on the ATtinyxxx breakouts!

# Adafruit ATtiny Breakouts with seesaw

## EEPROM

The seesaw firmware that ships with the ATtinyxxx breakouts provides access to the 128 byte EEPROM. This example reads from and writes to the EEPROM.

Follow the instructions on the [Python & CircuitPython page](https://learn.adafruit.com/adafruit-attiny817-seesaw/circuitpython) to get set up.

## Example Code

Update your **code.py** to the following.

**Before saving the file, connect to the serial console.** The print statements are only sent the first time the code runs, so if you connect after you save the file, you may not see them printed to the serial console.

https://github.com/adafruit/Adafruit_CircuitPython_seesaw/blob/main/examples/seesaw_eeprom_test.py

Warning: 

![](https://cdn-learn.adafruit.com/assets/assets/000/105/662/medium800/adafruit_products_ATtinyB_CP_EEPROM.png?1634676034)

First, you import all the necessary modules and libraries, and you instantiate the seesaw on I2C.

Next, you read the value from address 2.

Then, you increment that value by +1.

Finally, you read the new value from address 2.

Inside the loop, is a 1 second delay. Do not write EEPROM in a loop, because it has a 100k cycle life.

# Adafruit ATtiny Breakouts with seesaw

## Python Docs

# Adafruit ATtiny Breakouts with seesaw

## Arduino

The Adafruit Seesaw library makes it easy to use your ATtinyxxx breakout with Arduino. Install the necessary libraries, and load the examples to use your ATtinyxxx breakout for all sorts of purposes. This example is designed to verify that your breakout is working - it simply blinks the built-in LED. No hardware other than the breakout and microcontroller is needed.

Info: 

## Wiring

You can use many different Arduino boards, but this example shows the QT Py M0, and the Adafruit Metro. Connect up the ATtiny817 breakout as shown below.

Here is the QT Py wired up:

- Use a **STEMMA QT cable** to connect the **STEMMA QT connector on the QT Py** to the **STEMMA QT connector on the breakout**.

![adafruit_products_ATtinyB_QTPy_Arduino_bb.jpg](https://cdn-learn.adafruit.com/assets/assets/000/105/503/medium640/adafruit_products_ATtinyB_QTPy_Arduino_bb.jpg?1634317923)

Here is the Metro wired up:

- Plug a **[STEMMA QT to male jumper wire cable](https://www.adafruit.com/product/4209)** into the **STEMMA QT connector on the breakout.**
- **Metro 5V** &nbsp;to **breakout VIN (red wire)**  
- **Metro GND** &nbsp;to **breakout GND (black wire)**  
- **Metro SCL** &nbsp;to **breakout SCL (yellow wire)**  
- **Metro SDA** &nbsp;to **breakout SDA (blue wire)**

![adafruit_products_ATtinyB_Metro_Arduino_bb.jpg](https://cdn-learn.adafruit.com/assets/assets/000/105/504/medium640/adafruit_products_ATtinyB_Metro_Arduino_bb.jpg?1634317989)

## Library Installation

You can install the **Adafruit Seesaw Library** for Arduino using the Library Manager in the Arduino IDE:

![](https://cdn-learn.adafruit.com/assets/assets/000/105/500/medium800/adafruit_products_Arduino_Open_Library_Manager.png?1634317339)

Click the&nbsp; **Manage Libraries ...** menu item, search for **seesaw** , and select the&nbsp; **Adafruit Seesaw** library:

![](https://cdn-learn.adafruit.com/assets/assets/000/105/501/medium800/adafruit_products_ATtinyB_Arduino_seesaw_lib_install.png?1634317369)

If asked to install dependencies, choose **Install all**.

![](https://cdn-learn.adafruit.com/assets/assets/000/105/502/medium800/adafruit_products_ATtinyB_Arduino_dependency_install.png?1634317403)

## Load Example

Open up&nbsp; **File -\> Examples -\> Adafruit Seesaw**  **-\> digital -\> attiny\_blink** and upload to your Arduino wired up to the breakout.

Upload the sketch to your board and open up the Serial Monitor ( **Tools-\>Serial Monitor** ). You should see `seesaw started ok!`. If you don't, check your wiring.

Warning: 

Warning: The example below is for the 817. If you are using the 816/1616, please change `#define BLINK_PIN 5` to `#define BLINK_PIN 10`. No other changes are needed.

https://github.com/adafruit/Adafruit_Seesaw/blob/master/examples/digital/attiny_blink/attiny_blink.ino

Once you've successfully loaded the sketch onto your board, the little red LED will begin blinking!

![](https://cdn-learn.adafruit.com/assets/assets/000/105/649/medium800thumb/adafruit_products_ATtinyB_Arduino_blink.jpg?1634666465)

# Adafruit ATtiny Breakouts with seesaw

## Analog In

The seesaw firmware that ships with the ATtinyxxx breakouts includes analog capabilities on specific pins. This example reads the analog value of a pin.

Follow the steps on the [Arduino page](https://learn.adafruit.com/adafruit-attiny817-seesaw/arduino) to get set up.

## Analog Pins

The ATtiny817 breakout with seesaw firmware provides analog on the following pins:

- **0-3, 6, 7, 18-20**

The ATtiny816 and ATtiny1616 breakout with seesaw firmware provides analog on the following pins:

- **0-5, 14-16**

## Example Code
Open up&nbsp; **File -\> Examples -\> Adafruit Seesaw**  **-\> analog -\> analogRead** and upload to your Arduino wired up to the breakout.

https://github.com/adafruit/Adafruit_Seesaw/blob/master/examples/analog/analogRead/analogRead.ino

Once you've successfully loaded the sketch onto your board, open the Serial Monitor ( **Tools-\>Serial Monitor** ). Your output should look something like the following.

![](https://cdn-learn.adafruit.com/assets/assets/000/105/642/medium800/adafruit_products_ATtinyB_Arduino_analog_read_serial_output.png?1634663959)

# Adafruit ATtiny Breakouts with seesaw

## PWM

The seesaw firmware that ships with the ATtiny817 breakout includes PWM capabilities on specific pins. This example fades an external LED.

Follow the steps on the [Arduino page](https://learn.adafruit.com/adafruit-attiny817-seesaw/arduino) to get set up.

## PWM Pins

The ATtiny817 breakout with seesaw firmware provides PWM on the following pins:

- **0, 1, 9, 12, 13**

The ATtiny816 and ATtiny1616 breakouts with seesaw firmware provides PWM on the following pins:

- **0, 1, 7, 11, 16**

## Wiring

Follow the instructions to add an external LED to your existing setup.

- Use a **STEMMA QT cable** to connect the **STEMMA QT connector on the Qt Py** to the **STEMMA QT connector on the breakout**.
- Connect the **+ leg (longer leg)**  **of LED** to **breakout pin**  **12**
- Connect the **- leg (shorter leg) of LED** to **1kΩ resistor**
- Connect **1kΩ resistor** to **breakout GND**

![adafruit_products_ATtinyB_QTPy_Arduino_external_LED_bb.jpg](https://cdn-learn.adafruit.com/assets/assets/000/105/650/medium640/adafruit_products_ATtinyB_QTPy_Arduino_external_LED_bb.jpg?1634667144)

Warning: 

## Example Code

Open up&nbsp; **File -\> Examples -\> Adafruit Seesaw**  **-\> analog -\> Fade**.

Before you upload it to your microcontroller, you must make a change for it to work with the ATtinyxxx breakouts.

Warning: 

Update the following line:

`int led = 6;           // the PWM pin the LED is attached to`

To one of the PWM capable pins on the ATtinyxxx, such as pin 1:

`int led = 1;           // the PWM pin the LED is attached to`

You must do this before uploading the sketch, or it won't work with your setup!

https://github.com/adafruit/Adafruit_Seesaw/blob/master/examples/analog/Fade/Fade.ino

Once you've successfully uploaded the sketch to your board, open the Serial Monitor ( **Tools-\>Serial Monitor** ), and the LED will begin to fade bright and dim!

![](https://cdn-learn.adafruit.com/assets/assets/000/105/651/medium800thumb/adafruit_products_ATtinyB_Arduino_fade.jpg?1634668618)

# Adafruit ATtiny Breakouts with seesaw

## NeoPixel

The seesaw firmware that ships with the ATtinyxxx breakouts includes the ability to power up to 60 NeoPixels on one pin. This example displays a series of color wipes, a theatre chase effect in different colors, and a rainbow across a NeoPixel ring.

Follow the steps on the [Arduino page](https://learn.adafruit.com/adafruit-attiny817-seesaw/arduino) to get set up.

## NeoPixel Pins

**Only one pin can be used at a time** for powering NeoPixels on the ATtinyxxx breakouts!

There are 15 pins on the ATtiny817 breakout that can be used for powering NeoPixels:

- **0-3, 5-9, 12-14, 18-20**

There are 12 pins on the ATtinyx16 breakouts that can be used for powering NeoPixels:

- **0-6, 8, 11, 14-16**

## Wiring

Follow the instructions to add an external LED to your existing setup.

- Use a **STEMMA QT cable** to connect the **STEMMA QT connector on the Feather** to the **STEMMA QT connector on the breakout**.
- Connect **NeoPixel ring GND** to **breakout GND**
- Connect **NeoPixel ring IN (data in)** to **breakout pin 19**
- Connect **NeoPIxel ring power** to **breakout VIN**

![adafruit_products_ATtinyB_QTPy_Arduino_NeoPixel_ring_bb.jpg](https://cdn-learn.adafruit.com/assets/assets/000/105/658/medium640/adafruit_products_ATtinyB_QTPy_Arduino_NeoPixel_ring_bb.jpg?1634671446)

Warning: 

## Example Code

Open up&nbsp; **File -\> Examples -\> Adafruit Seesaw**  **-\> NeoPixel -\> NeoPixel\_strandtest**.

Before you upload it to your microcontroller, you must make a change for it to work with the ATtinyxxx breakout.

Warning: 

Update the following line:

`#define PIN 10`

To one of the NeoPixel capable pins on the ATtinyxxx, such as pin 8:

`#define PIN 8`

You must do this before uploading the sketch, or it won't work with your setup!

https://github.com/adafruit/Adafruit_Seesaw/blob/master/examples/NeoPixel/NeoPixel_strandtest/NeoPixel_strandtest.ino

Once successfully uploaded, your NeoPixel light show will begin! Color wipe, followed by theatre chase, followed by full rainbow, followed by rainbow cycle.

![](https://cdn-learn.adafruit.com/assets/assets/000/105/654/medium800thumb/adafruit_products_ATtinyB_Arduino_NeoPixel.jpg?1634671116)

# Adafruit ATtiny Breakouts with seesaw

## EEPROM

The seesaw firmware that ships with the ATtinyxxx breakouts provides access to the 128 byte EEPROM. This example reads from and writes to the EEPROM.

Follow the steps on the [Arduino page](https://learn.adafruit.com/adafruit-attiny817-seesaw/arduino) to get set up.

## Example Code

Open up&nbsp; **File -\> Examples -\> Adafruit Seesaw**  **-\> EEPROM**.

https://github.com/adafruit/Adafruit_Seesaw/blob/master/examples/EEPROM/EEPROM.ino

Once you've successfully uploaded the sketch to your board, open the Serial Monitor ( **Tools-\>Serial Monitor** ), and see the info printed out!

![](https://cdn-learn.adafruit.com/assets/assets/000/105/660/medium800/adafruit_products_ATtinyB_Arduino_EEPROM_serial_output.png?1634672361)

# Adafruit ATtiny Breakouts with seesaw

## Using the Seesaw Platform

![](https://cdn-learn.adafruit.com/assets/assets/000/047/815/medium800/sensors_seesawlogo.gif?1509570247)

The sections under this heading contain more detailed information about how the Seesaw platform works.&nbsp; **If you are using our Arduino, CircuitPython, or Python API you can skip these sections.** These sections are intended for people who either want to understand and modify seesaw, or who want to make their own API for a platform that is not officially supported by Adafruit such as C/C++ on Raspberry Pi.

## Repo Summary

There are numerous code repositories with "seesaw" in the name.&nbsp; The firmware repositories contain the code running on the seesaw device itself. The support libraries are used to interact with \*any\* seesaw device.

If you are an end user of a seesaw device, then it is the support libraries you want.

There is no support for custom firmware development.

Firmware

- [seesaw](https://github.com/adafruit/seesaw) - for SAMD based boards
- [Adafruit\_seesawPeripheral](https://github.com/adafruit/Adafruit_seesawPeripheral) - for ATtiny 1-series based boards

Support Libraries

- [Adafruit\_CircuitPython\_seesaw](https://github.com/adafruit/Adafruit_CircuitPython_seesaw) - for use with CircuitPython or Blinka
- [Adafruit\_Seesaw](https://github.com/adafruit/Adafruit_Seesaw) - for use with Arduino

# Adafruit ATtiny Breakouts with seesaw

## Reading and Writing Data

The SeeSaw operates as an I2C secondary device using standard I2C protocol. It uses the **SDA&nbsp;** and&nbsp; **SCL&nbsp;** pins to communicate with the host system.

The I2C bus on the SAMD09 is 3.3V logic level, but all boards&nbsp;_other_ than the SAMD09 breakout have level shifting so you can use 3 or 5V logic. Boards with Attiny chips are 3 or 5V safe so you can use either for power and logic

Only 7-bit addressing is supported.

I2C pullup resistors are included in our SeeSaw boards but if you are DIY'ing, be sure to add your own! 2.2K - 10K is a good range.

# Setting the Device Address

Standard 7-bit addressing is used. The seesaw's default I2C address is initially configured in the compiled firmware (e.g for theSeeSaw breakouts we use **0x49** ) but other boards will have a different base address. Check the board documentation for the default base I2C address, [or you can plug it in and scan the I2C bus to find it](https://learn.adafruit.com/scanning-i2c-addresses).

This address can be modified using the address select pins, there can be multiple address pins. If address select pin 0 ( **A0** ) is tied to ground on boot, the I2C address is incremented by 1. If address select pin 1 ( **A1** ) is pulled low, the I2C address is incremented by 2. If both address select pins are pulled low, the I2C address is incremented by 3. Thus you can, with the same hardware, have up to 4 devices

On both the SAMD09 and Attiny817 breakouts, the default A0 pin is **16** , default A1 pin is **17**. On boards where the chips are embedded, there may be as many as 4 address pins, they'll be labeled with jumpers

The base I2C address can also be modified by writing a new address to EEPROM. See the EEPROM section for more information.

# I2C Transactions

We recommend using 100KHz I2C, but speeds of up to 400KHz are supported. You may want to decrease the SDA/SCL pullups to 2.2K from 10K in that case.

## Writing Data

A seesaw write command consists of the standard I2C write header&nbsp;(with the R/W bit set to 0), followed by 2 **register&nbsp;bytes** followed by zero or more **data bytes**.

The first register byte is the&nbsp; **module&nbsp;**** base register address**. Each&nbsp;module&nbsp;(GPIO, ADC, DAC, etc.) has it's own unique 8 bit base identifier.

The second register byte is the **module function&nbsp;**** register address**. This byte specifies the desired register within the module to be written.

Thus we have up to 254 modules available (0x00 is reserved) and 255 functions per module - plenty to allow all sorts of different capabilities!

In code, this may look like this (using the Arduino wire I2C object):

```
void Adafruit_seesaw::write(uint8_t moduleBase, uint8_t moduleFunction, uint8_t *buf, uint8_t num)
{ 
	Wire.beginTransmission((uint8_t)_i2caddr);
	Wire.write((uint8_t)moduleBase); //module base register address
	Wire.write((uint8_t)moduleFunction); //module function register address
	Wire.write((uint8_t *)buf, num); //data bytes
	Wire.endTransmission();
}
```

Warning: 

## Base Register Summary

The following table summarizes the **module base registers addresses**. Further details about the function registers associated for each base register are covered in later sections.

Info: 

## Reading Data

A register read is accomplished by first&nbsp;sending the standard I2C write header, followed by the two **register bytes** corresponding to the data to be read. Allow a short delay, and then send a standard I2C read header (with the R/W bit set to 1) to read the data.

The length of the required delay depends on the data that is to be read. These delays are discussed in the sections specific to each module.

In code, this may look like this &nbsp;(using the Arduino wire I2C object):

```
void Adafruit_seesaw::read(uint8_t moduleBase, uint8_t moduleFunction, uint8_t *buf, uint8_t num, uint16_t delay)
{
  Wire.beginTransmission((uint8_t)_i2caddr);
  Wire.write((uint8_t)moduleBase); //module base register address
  Wire.write((uint8_t)moduleFunction); //module function register address
  Wire.endTransmission();

  delayMicroseconds(delay);

  Wire.requestFrom((uint8_t)_i2caddr, num);

  for(int i=0; i&lt;num; i++){
    buf[i] = Wire.read();
  }
}
```

# Adafruit ATtiny Breakouts with seesaw

## GPIO

The GPIO module provides every day input and outputs. You'll get logic GPIO pins that can act as outputs or inputs. With pullups or pulldowns. When inputs, you can also create pin-change interrupts that are routed the the IRQ pin.

On SAMD09-based boards the GPIO is 3V only. On ATtiny-based boards, the GPIO logic is whatever the power pin is, 3V or 5V.

The module base register address for the GPIO module is&nbsp; **0x01**.&nbsp;

# &nbsp;Function Registers
Writes of GPIO function registers should contain **4 data bytes** (32 bits)&nbsp;following the initial register data bytes. Each bit in these registers represents a GPIO pin on **PORTA** of the seesaw device.

If the corresponding pin does not exist on the SeeSaw device, then reading or writing the bit has no effect.

We decided to go with this method to make GPIO toggling fast (rather than having one i2c transaction per individual pin control) but the host processor will need to do a little work to keep the pins identified.

## GPIO register setup on SAMD09:
## GPIO register setup on ATTiny8x7:

([this is the same as the megaTinyCore pin mapping](https://github.com/SpenceKonde/megaTinyCore/blob/master/megaavr/extras/ATtiny_x17.md))

- Bit 0: PA4
- Bit 1: PA5
- Bit 2: PA6
- Bit 3: PA7
- Bit 4: PB7
- Bit 5: PB6
- Bit 6: PB5
- Bit 7: PB4
- Bit 8: PB3
- Bit 9: PB2
- Bit 10: PB1
- Bit 11: PB0
- Bit 12: PC0
- Bit 13: PC1
- Bit 14: PC2
- Bit 15: PC3
- Bit 16: PC4
- Bit 17: PC5
- Bit 18: PA1
- Bit 19: PA2
- Bit 20: PA3

# DIRSET (0x02, 32 bits, Write Only)

Writing a 1 to any bit in this register sets the direction of the corresponding pin to OUTPUT.

Writing zeros to this register has no effect.

# DIRCLR (0x03, 32 bits, Write Only)

Writing a 1 to any bit in this register sets the direction of the corresponding pin to INPUT.

Writing zeros to this register has no effect.

# GPIO (0x04, 32 bits, Read/Write)

When this register is written, all bits that are set to 0 will have their corresponding pins set LOW.

All bits that are set to 1 will have their corresponding pins set HIGH.

Reading this register reads all pins on of the seesaw device. On the Attiny series please wait at least 250uS between command write and data read to allow the data to be read and formatted for retrieval. **Reading this register will also reset the IRQ pin if it was configured.**

# SET (0x05, 32 bits, Write Only)

Writing a 1 to any bit in this register writes the corresponding pin HIGH.

Writing zeros to this register has no effect.

# CLR (0x06, 32 bits, Write Only)

Writing a 1 to any bit in this register writes the corresponding pin LOW.

Writing zeros to this register has no effect.

# TOGGLE (0x07, 32 bits, Write Only)

Writing a 1 to any bit in this register&nbsp;toggles the corresponding pin.

Writing zeros to this register has no effect.

# INTENSET (0x08, 32 bits, Write Only)

Writing a 1 to any bit in this register enables the interrupt on the corresponding pin. When the value on this pin changes, the corresponding bit will be set in the **INTFLAG** register.

Writing zeros to this register has no effect.

# INTENCLR (0x09, 32 bits, Write Only)

Writing a 1 to any bit in this register disables the interrupt on the corresponding pin.

Writing zeros to this register has no effect.

# INTFLAG (0x0A, 32 bits, Read Only)

This register hold the status of all GPIO interrupts. When an interrupt fires, the corresponding bit in this register gets set. Reading this register clears all interrupts. **This will also reset the IRQ pin if it was configured.**

Writing to this register has no effect.

# PULLENSET&nbsp;(0x0B, 32 bits, Write Only)

Writing a 1 to any bit in this register&nbsp;enables the internal pullup or pulldown on the corresponding pin. The pull direction (up/down) is determined by the **GPIO** (output) value - if the corresponding GPIO register bit is low,&nbsp; its a pulldown. High, its a pullup.

Writing zeros to this register has no effect.

# PULLENCLR (0x0C, 32 bits, Write Only)

Writing a 1 to any bit in this register disables the&nbsp;pull up/down on the corresponding pin.

Writing zeros to this register has no effect.

# Adafruit ATtiny Breakouts with seesaw

## Analog to Digital Converter

The ADC provides the ability to measure analog voltages at 10-bit resolution. The SAMD09 seesaw has 4 ADC inputs, the Attiny8x7 has 11 ADC inputs.

The module base register address for the ADC is&nbsp; **0x09**

Conversions can be read by reading the corresponding CHANNEL register.

When reading ADC data, there should be at least a 500 uS delay between writing the register number you would like to read from and attempting to read the data.

Allow a delay of at least 1ms in between sequential ADC reads on different channels.

## SAMD09 ADC channels are:
## ATtiny8x7 ADC channels are:

- Channel 0: PA4
- Channel 1: PA5
- Channel 2: PA6
- Channel 3: PA7
- Channel 6: PB5
- Channel 7: PB4
- Channel 10: PB1
- Channel 11: PB0
- Channel 18: PA1
- Channel 19: PA2
- Channel 20: PA3

([These are the same as the Arduino GPIO pin names for the ADCs in megaTinyCore](https://github.com/SpenceKonde/megaTinyCore/blob/master/megaavr/extras/ATtiny_x17.md))

# Function Registers
Info: 

# STATUS (0x00, 8bits, Read Only)

This register contains status information on the ADC

# &nbsp;

# INTENSET (0x02, 8bits, Write Only)

Writing a 1 to any bit in this register enables the corresponding interrupt.

Writing zeros to this register has no effect.

# INTENCLR (0x03, 8bits, Write Only)

Writing a 1 to any bit in this register enables the corresponding interrupt.

Writing zeros to this register has no effect.

# WINMODE (0x04, 8bits, Write Only)

Writing 1 to this register&nbsp;sets window control.

# WINTHRESH (0x05, 32bits, Write Only)

This register sets the threshold values for window mode.

# CHANNEL\_0 (0x07, 16bits, Read Only)

ADC value for channel 0

# CHANNEL\_1 (0x08, 16bits, Read Only)

ADC value for channel 1

# CHANNEL\_2 (0x09, 16bits, Read Only)

ADC value for channel 2

# CHANNEL\_3 (0x0A, 16bits, Read Only)

ADC value for channel 3

...

# CHANNEL\_20 (0x1B, 16bits, Read Only)

ADC value for channel 20

# Adafruit ATtiny Breakouts with seesaw

## Interrupts

The seesaw has a configurable interrupt pin that can be triggered through various channels.

Once the interrupt is triggered, it can be only be cleared when the conditions&nbsp;of it's source module(s) have been met (e.g. data has been read, an interrupt has been cleared by reading an INTFLAG register).

See individual module sections for details on their available interrupt configurations.

The hardware interrupt pin is available on **PA08** ( **#8** )

# Adafruit ATtiny Breakouts with seesaw

## EEPROM

The EEPROM module provides persistent storage of data across reboots.

On the SAMD09, there are **64 bytes** of _emulated_ EEPROM available for use. Byte 63 ( **0x3F** ) can be written to change the devices default I2C address.

On the ATtiny817, there are 128 bytes of actual EEPROM available for use. Byte 127 ( **0x7F** ) can be written to change the device's default I2C address.

The module base register address for the EEPROM module is&nbsp; **0x0D** &nbsp;

Info: 

# Function Registers
## SAMD09
## ATtiny817
# Adafruit ATtiny Breakouts with seesaw

## 

The seesaw has built in NeoPixel support for up to 170 RGB or 127 RGBW pixels. The output pin as well as the communication protocol frequency are configurable. _Note: older firmware is limited to 63 pixels max._

The module base register address for the NeoPixel module is&nbsp; **0x0E**.

# Function Registers
# PIN (0x01, 8bits, Write Only)

This register sets the pin number (PORTA) that is used for the NeoPixel output.

# SPEED (0x02, 8bits, Write Only)

The protocol speed.

**0x00 = 400khz**

**0x01 = 800khz (default)**

# BUF\_LENGTH (0x03, 16bits LE, Write Only)

the number of bytes currently used for the pixel array. This is dependent on when the pixels you are using are RGB or RGBW. 2 Bytes, little endian order

# BUF (0x04, 32 bytes, Write Only)

The data buffer. The first 2 bytes are the start address, and the data to write follows. Data should be written in blocks of maximum size 30 bytes at a time.

# SHOW (0x05, no args, Write Only)

Sending the SHOW command will cause the output to update. There's no arguments/data after the command

# Adafruit ATtiny Breakouts with seesaw

## PWM

This module provides support for Pulse Width Modulation (PWM) output.

# Nomenclature

The seesaw PWM Function Registers are defined using a generic nomenclature as follows:

- **PWM Number** - Specifies a specific PWM output (pin).
- **PWM Value** - Specifies the PWM **duty cycle**.
- **PWM Frequency** - Specifies the PWM **frequency**.

See the Port Specific Details section below for further information.

# Function Register Summary
# Function Register Description
## 0x01 - PWM\_VAL
Sets the **PWM Value** for a specified **PWM Number**. The first byte written is the **PWM Number**. The next two bytes are the 16 bit **PWM Value** , most significant byte (MSB) followed by least significant byte (LSB).

## 0x02 - PWM\_FREQ
Sets the **PWM Frequency** for a specified **PWM Number**. The first byte written is the **PWM Number**. The next two bytes are the 16 bit **PWM Frequency** , most significant byte (MSB) followed by least significant byte (LSB).

# Port Specific Details
## SAMD

PWM outputs are available on pins PA04, PA05, PA06, and PA07. The **PWM Number** for each is shown in the table below.

The full 16 bit **PWM Value** is used. This value should be an unsigned integer ranging from 0 for full off to 65535 for full on.

The **PWM Frequency** is a 16 bit unsigned integer value which specifies the frequency in hertz (Hz).

## ATtiny

The **PWM Number** is the Arduino GPIO pin number.

Currently, only the MSB of the 16 bit **PWM Value** is used. This is due to the 8 bit limit of analogWrite() used internally. However, a full 16 bit value should be sent from 0 for full off to 65535 for full on.

The **PWM Frequency** is a 16 bit unsigned integer value which specifies the frequency in hertz (Hz). ( **NOTE** : uses tone() internally)

# Adafruit ATtiny Breakouts with seesaw

## Advanced: Reprogramming with UPDI

Warning: 

You can reprogram these ATtiny breakouts to run your own firmware. However, the boards do not come with a bootloader. If you want to do development on seesaw (e.g. changing the configuration) you need a separate UPDI programming setup! You can build this setup with a 1K resistor and a USB to Serial cable or with the UPDI Friend board.

### Adafruit UPDI Friend - USB Serial UPDI Programmer

[Adafruit UPDI Friend - USB Serial UPDI Programmer](https://www.adafruit.com/product/5879)
 **UPDI** &nbsp;stands for [Unified Program and Debug Interface](http://onlinedocs.microchip.com/pr/GUID-DDB0017E-84E3-4E77-AAE9-7AC4290E5E8B-en-US-4/index.html?GUID-9B349315-2842-4189-B88C-49F4E1055D7F), but this board is so smol and cute that we&nbsp;will call it the...

In Stock
[Buy Now](https://www.adafruit.com/product/5879)
[Related Guides to the Product](https://learn.adafruit.com/products/5879/guides)
![Overhead shot of a half-size breadboard connected to a UPDI board and an AtTiny breakout board. the LEDs light up green on both boards.](https://cdn-shop.adafruit.com/640x480/5879-05.jpg)

### USB to TTL Serial Cable - Debug / Console Cable for Raspberry Pi

[USB to TTL Serial Cable - Debug / Console Cable for Raspberry Pi](https://www.adafruit.com/product/954)
The cable is easiest way ever to connect to your microcontroller/Raspberry Pi/WiFi router serial console port. Inside the big USB plug is a USB\<-\>Serial conversion chip and at the end of the 36" cable are four wire - red power, black ground, white RX into USB port, and green TX out...

In Stock
[Buy Now](https://www.adafruit.com/product/954)
[Related Guides to the Product](https://learn.adafruit.com/products/954/guides)
![USB to TTL Serial Cable With Type A plug and 4 wire sockets](https://cdn-shop.adafruit.com/640x480/954-02.jpg)

### Through-Hole Resistors - 1.0K ohm 5% 1/4W - Pack of 25

[Through-Hole Resistors - 1.0K ohm 5% 1/4W - Pack of 25](https://www.adafruit.com/product/4294)
ΩMG! You're not going to be able to resist these handy resistor packs!&nbsp;Well, axially, they&nbsp;do all of the resisting for you!

This is a **25 Pack of 1.0KΩ Resistors.** More specifically, they are **carbon film** , through-hole...

In Stock
[Buy Now](https://www.adafruit.com/product/4294)
[Related Guides to the Product](https://learn.adafruit.com/products/4294/guides)
![Angled shot of 25 Through-Hole Resistors - 1.0K ohm 5% 1/4W.](https://cdn-shop.adafruit.com/640x480/4294-00.jpg)

## Building a UPDI Programmer
- **USB to Serial cable power** to **ATtiny VIN (red wire)**
- **USB to Serial cable ground** to **ATtiny G (black wire)**
- **USB to Serial cable RX** to **1K resistor (white wire)**
- **USB to Serial cable TX** to **1K resistor (green wire)**
- **1K resistor** to **ATtiny UPDI pin (white wire)**

![adafruit_products_programmingFritz_bb.jpg](https://cdn-learn.adafruit.com/assets/assets/000/118/909/medium640/adafruit_products_programmingFritz_bb.jpg?1677510461)

## Wiring with the UPDI Friend
- **UPDI Friend PWR** to **ATtiny VIN (red wire)**
- **UPDI Friend GND** to **ATtiny G (black wire)**
- **UPDI Friend UPDI** to **ATtiny UPDI pin (white wire)**

![adafruit_products_updiFriendFritz_bb.jpg](https://cdn-learn.adafruit.com/assets/assets/000/127/464/medium640/adafruit_products_updiFriendFritz_bb.jpg?1707140183)

## Install megaTinyCore

You can compile code for the ATtiny using the [megaTinyCore](https://github.com/SpenceKonde/megaTinyCore) board support package in the Arduino IDE. There are detailed [installation instructions](https://github.com/SpenceKonde/megaTinyCore/blob/master/Installation.md) in the megaTinyCore GitHub repository. The following steps outline how to install it using the Boards Manager.

In the Arduino IDE, go to **Preferences** and add the megaTinyCore boards manager URL to the **Additional Boards Manager URLs list** :

```auto
http://drazzy.com/package_drazzy.com_index.json
```

![](https://cdn-learn.adafruit.com/assets/assets/000/118/913/medium800/adafruit_products_boardsManager.png?1677510959)

Go to **Tools** - **Board** - **Boards Manager...**

![](https://cdn-learn.adafruit.com/assets/assets/000/118/914/medium800/adafruit_products_boardsTools.png?1677511154)

In the **Boards Manager** , search for **megaTinyCore**. Click **Install** to install the board support package.

![](https://cdn-learn.adafruit.com/assets/assets/000/118/915/medium800/adafruit_products_installMegaTinyCore.png?1677511207)

## Program the ATtiny
After the megaTinyCore finishes installing, go to **Tools - Board - megaTinyCore** and **select the board list** that includes your ATtiny.

![](https://cdn-learn.adafruit.com/assets/assets/000/118/916/medium800/adafruit_products_chooseBoard.png?1677511313)

Then, **select the chip** of your ATtiny.

![](https://cdn-learn.adafruit.com/assets/assets/000/118/917/medium800/adafruit_products_selectChip.png?1677511367)

Next, **set clock** if needed. The default 20 MHz clock option is only valid if powering with 5V. If powering with 3.3V, select 10 MHz for the clock.

![](https://cdn-learn.adafruit.com/assets/assets/000/128/194/medium800/adafruit_products_set_clock.png?1709075761)

Under **Programmer** , select **SerialUPDI - SLOW: 57600 baud**.

![](https://cdn-learn.adafruit.com/assets/assets/000/118/918/medium800/adafruit_products_uploader.png?1677511409)

Warning: 

Finally, go to **Preferences** and **check ON Show verbose output during upload**. This will give you the upload details and progress in the monitor at the bottom of the Arduino IDE, which is very useful for debugging.

![](https://cdn-learn.adafruit.com/assets/assets/000/118/919/medium800/adafruit_products_verboseUpload.png?1677511503)

Now you can compile code with the megaTinyCore to upload to the ATtiny with the UPDI programmer by going to **Sketch \> Upload Using Programmer**.

![](https://cdn-learn.adafruit.com/assets/assets/000/129/367/medium800/adafruit_products_Screenshot_2024-04-15_at_12.01.47_PM.jpg?1713207762)

## Blink Test
This simple example blinks the ATTiny816 onboard red indicator LED on pin 10.

```cpp
void setup() {
  pinMode(10, OUTPUT);
}

void loop() {
  digitalWrite(10, HIGH);
  delay(1000);
  digitalWrite(10, LOW);
  delay(1000);
}
```

If using this with the ATTiny817, you'll want to update the pin to 5, as shown below.

```cpp
void setup() {
  pinMode(5, OUTPUT);
}

void loop() {
  digitalWrite(5, HIGH);
  delay(1000);
  digitalWrite(5, LOW);
  delay(1000);
}
```

Upload the sketch using the UPDI programmer. You should see this output in the monitor after the upload has completed successfully:

![](https://cdn-learn.adafruit.com/assets/assets/000/118/920/medium800/adafruit_products_verboseProgramming.png?1677511806)

The red LED on the ATtiny should be blinking!

# Adafruit ATtiny Breakouts with seesaw

## Reloading the seesaw Firmware

You can reinstall the default seesaw Firmware using the UPDI programmer, [megaTinyCore](https://github.com/SpenceKonde/megaTinyCore#readme) and the [Adafruit\_seesawPeripheral library](https://github.com/adafruit/Adafruit_seesawPeripheral).

## Install the Libraries
Install the [Adafruit\_seesawPeripheral library](https://github.com/adafruit/Adafruit_seesawPeripheral), [Adafruit\_BusIO library](https://github.com/adafruit/Adafruit_BusIO) and the [Adafruit\_Seesaw library](https://github.com/adafruit/Adafruit_Seesaw) by cloning the repository and adding the folder to your Arduino **libraries** folder on your computer.

![](https://cdn-learn.adafruit.com/assets/assets/000/118/921/medium800/adafruit_products_libraries.png?1677512209)

![](https://cdn-learn.adafruit.com/assets/assets/000/118/922/medium800/adafruit_products_periphFiles.png?1677512217)

## Upload the seesaw Firmware

In the Arduino IDE, go to **File - Examples - Adafruit seesaw Peripheral**.

![](https://cdn-learn.adafruit.com/assets/assets/000/118/923/medium800/adafruit_products_examplesPeriph.png?1677512375)

The `example_pid####` sketches contain the default seesaw firmware for each seesaw breakout. The `pid####` portion of the name corresponds to the Adafruit product ID of the board. For example, to upload the firmware to the ATtiny816 breakout, you would select `example_pid5681`.

After selecting the corresponding firmware sketch, upload it to your board using the UPDI programmer. You can confirm that the seesaw firmware was successfully uploaded by connecting the ATtiny breakout to a board via I2C and performing an I2C scan. The address `0x49` should appear.

# Adafruit ATtiny Breakouts with seesaw

## megaTinyCore Docs

# Adafruit ATtiny Breakouts with seesaw

## Downloads

## Files

- [ATtiny8x7 datasheet](https://cdn-learn.adafruit.com/assets/assets/000/105/460/original/ATtiny417-814-816-817-DataSheet-DS40002288A.pdf?1634157151)
- [ATtiny816 Datasheet](https://cdn-learn.adafruit.com/assets/assets/000/118/838/original/ATtiny816-Datasheet.pdf?1677164075)
- [ATtiny1616 Datasheet](https://cdn-learn.adafruit.com/assets/assets/000/118/839/original/ATtiny1616-Datasheet.pdf?1677164088)
- [ATtiny817 EagleCAD PCB files on GitHub](https://github.com/adafruit/Adafruit-ATtiny8x7-Breakout-PCB)
- [ATtinyx16 EagleCAD PCB files on GitHub](https://github.com/adafruit/Adafruit-ATtinyx16-Breakouts-PCB)
- [ATtiny817 Fritzing object in the Adafruit Fritzing Library](https://github.com/adafruit/Fritzing-Library/blob/master/parts/Adafruit%20ATtiny8x7%20Breakout%20with%20seesaw.fzpz)
- [ATtinyx16 Fritzing object in the Adafruit Fritzing Library](https://github.com/adafruit/Fritzing-Library/blob/master/parts/Adafruit%20ATtinyx16%20Breakout.fzpz)

## ATtinyx16 Breakout Schematic and Fab Print
![](https://cdn-learn.adafruit.com/assets/assets/000/118/844/medium800/adafruit_products_schem.png?1677165894)

![](https://cdn-learn.adafruit.com/assets/assets/000/118/845/medium800/adafruit_products_fab.png?1677165901)

## ATtiny817 Breakout Schematic and Fab Print
![](https://cdn-learn.adafruit.com/assets/assets/000/105/461/medium800/adafruit_products_ATtiny_sch.png?1634157432)

![](https://cdn-learn.adafruit.com/assets/assets/000/105/462/medium800/adafruit_products_ATtiny_fab_print.png?1634157453)


## Primary Products

### Adafruit ATtiny817 Breakout with seesaw - STEMMA QT / Qwiic

[Adafruit ATtiny817 Breakout with seesaw - STEMMA QT / Qwiic](https://www.adafruit.com/product/5233)
This breakout board is a "three in one" product:

1. The ATtiny817 is part of the 'next gen' of AVR microcontrollers, and now we have a cute development/breakout board for it, with just enough hardware to get the chip up and running.
2. It's also an Adafruit...

In Stock
[Buy Now](https://www.adafruit.com/product/5233)
[Related Guides to the Product](https://learn.adafruit.com/products/5233/guides)
### Adafruit ATtiny816 Breakout with seesaw - STEMMA QT / Qwiic

[Adafruit ATtiny816 Breakout with seesaw - STEMMA QT / Qwiic](https://www.adafruit.com/product/5681)
This breakout board is a "three in one" product:

1. The ATtiny816 is part of the 'next gen' of AVR microcontrollers, and now we have a cute development/breakout board for it, with just enough hardware to get the chip up and running.
2. It's also an Adafruit...

In Stock
[Buy Now](https://www.adafruit.com/product/5681)
[Related Guides to the Product](https://learn.adafruit.com/products/5681/guides)
### Adafruit ATtiny1616 Breakout with seesaw - STEMMA QT / Qwiic

[Adafruit ATtiny1616 Breakout with seesaw - STEMMA QT / Qwiic](https://www.adafruit.com/product/5690)
This breakout board is a "three in one" product:

1. The ATtiny1616 is part of the 'next gen' of AVR microcontrollers, and now we have a cute development/breakout board for it, with just enough hardware to get the chip up and running.
2. It's also an Adafruit...

In Stock
[Buy Now](https://www.adafruit.com/product/5690)
[Related Guides to the Product](https://learn.adafruit.com/products/5690/guides)

## Featured Products

### STEMMA QT / Qwiic JST SH 4-Pin Cable - 50mm Long

[STEMMA QT / Qwiic JST SH 4-Pin Cable - 50mm Long](https://www.adafruit.com/product/4399)
This 4-wire cable is&nbsp;50mm / 1.9" long and fitted with JST SH female 4-pin connectors on both ends. Compared with the chunkier JST PH these are 1mm pitch instead of 2mm, but still have a nice latching feel, while being easy to insert and remove.

<a...></a...>

In Stock
[Buy Now](https://www.adafruit.com/product/4399)
[Related Guides to the Product](https://learn.adafruit.com/products/4399/guides)
### USB to TTL Serial Cable - Debug / Console Cable for Raspberry Pi

[USB to TTL Serial Cable - Debug / Console Cable for Raspberry Pi](https://www.adafruit.com/product/954)
The cable is easiest way ever to connect to your microcontroller/Raspberry Pi/WiFi router serial console port. Inside the big USB plug is a USB\<-\>Serial conversion chip and at the end of the 36" cable are four wire - red power, black ground, white RX into USB port, and green TX out...

In Stock
[Buy Now](https://www.adafruit.com/product/954)
[Related Guides to the Product](https://learn.adafruit.com/products/954/guides)

## Related Guides

- [Adafruit UPDI Friend](https://learn.adafruit.com/adafruit-updi-friend.md)
- [Adafruit APDS9999 Proximity, Lux Light & Color Sensor](https://learn.adafruit.com/adafruit-apds9999-proximity-lux-light-color-sensor.md)
- [Fisher-Price USB Foot Pedal](https://learn.adafruit.com/fisher-price-usb-foot-pedal.md)
- [Introducing Adafruit Feather](https://learn.adafruit.com/adafruit-feather.md)
- [Adafruit BrainCraft HAT - Easy Machine Learning for Raspberry Pi](https://learn.adafruit.com/adafruit-braincraft-hat-easy-machine-learning-for-raspberry-pi.md)
- [Bubble Table with LED Animations and IR Remote Control](https://learn.adafruit.com/bubble-table-with-led-animations-and-ir-remote-control.md)
- [I Vote(d) Pin](https://learn.adafruit.com/i-vote-d-pin.md)
- [LIS3MDL Triple-axis Magnetometer](https://learn.adafruit.com/lis3mdl-triple-axis-magnetometer.md)
- [CAN Bus with CircuitPython: Using the canio module](https://learn.adafruit.com/using-canio-circuitpython.md)
- [Microsoft Azure Cost Monitor](https://learn.adafruit.com/azure-cost-monitor.md)
- [Lightsaber Prop-Maker RP2040](https://learn.adafruit.com/lightsaber-rp2040.md)
- [Using MPL3115A2 with CircuitPython](https://learn.adafruit.com/using-mpl3115a2-with-circuitpython.md)
- [Program an AVR or Arduino Using Raspberry Pi GPIO](https://learn.adafruit.com/program-an-avr-or-arduino-using-raspberry-pi-gpio-pins.md)
- [Adafruit I2S Amplifier BFF](https://learn.adafruit.com/i2s-amplifier-bff.md)
- [Pocket Galaxy](https://learn.adafruit.com/pocket-galaxy.md)
