This application note shows how to use the ATtiny1617's Configurable Custom Logic to create a night‑light that operates independently of the CPU.
About this manual
The note describes a night‑light implementation that uses the ATtiny1617's Configurable Custom Logic (CCL) to process inputs from a passive infrared (PIR) sensor and an ambient light sensor. The CCL operates without CPU intervention, turning the LEDs on only when the environment is dark and motion is detected.
Hardware includes a STK600 development board, a HC‑SR505 mini PIR sensor, a TEMT6000 ambient light sensor, and a WS2812B‑16 addressable RGB LED strip. Connections and CCL configuration details are provided, along with example code and guidance for modifying the number of LEDs. This manual is written in Chinese.
What's inside
- Introduction
- Related Devices
- Components
- Implementation
- System Overview
- Connections
- CCL Configuration
- LUT0 Configuration
- LUT1 Configuration
- Program Flow
Specifications
| Timer/Counter Type A (TCA0) | 16‑bit |
|---|
| SPI interface | SPI0 |
|---|
| Analog comparator | AC0 |
|---|
| Digital‑to‑Analog Converter | DAC |
|---|
| EEPROM data memory | present |
|---|
| Number of addressable RGB LEDs | 16 (default) |
Frequently asked questions
How does the night light decide when to turn on?
It uses the Configurable Custom Logic to monitor the PIR sensor and ambient light sensor, lighting the LEDs only when the environment is dark and motion is detected.
Can the number of LEDs be changed?
Yes, the default is 16 LEDs, but the count can be changed by modifying the Number_of_LEDS variable in the source code.