Core Independent Peripherals (CIPs) is a category of peripherals available on many AVR® devices. A CIP is designed to handle its tasks among one or multiple peripherals with no code or supervision from the CPU to maintain the operation. This brings up many advantages, such as providing short and predictable response times between peripherals, reducing the complexity and execution time of the software, as well as the possibility of reduced power consumption.
This repository will present an application example on how to combine CCL, Event System, RTC and ADC to filter the signal from a button and initiate an ADC conversion core independently. This may help users start building their own projects using CIPs. This example is based on the Application Note AN2451 - Getting Started with Core Independent Peripherals on AVR® Microcontrollers from Microchip and will be performed on a ATtiny817 Xplained Pro board.
- AN2451 - Getting Started with Core Independent Peripherals on AVR® Microcontrollers
- ATtiny817 Device Page
- MPLAB® X IDE v6.25 or later
- ATtiny DFP 3.3.272 or later
- MPLAB® XC8 3.00 or later
- AVR/GNU C Compiler 5.4.0 or later
- ATtiny817 Xplained Pro
- Micro-USB cable (Type-A/Micro-B)
-
Connect the ATtiny817 Xplained Pro board to the PC using the USB cable.
-
Download the zip file or clone the example to get the source code.
-
Open the project in MPLAB X IDE.
-
Using the signal from a mechanical button directly into an application without any form of filtering will in many cases lead to unpredictable behavior, since the signal often transitions several times between high and low each time the button is pushed or released. This is often referred to as bounce. If an application is required to act once each time a mechanical button is pressed, some form of filtering needs to be implemented either in hardware or software, also referred to as debouncing.
This is already implemented for you. For a complete description on how this is done refer to the document AN2451 - Getting Started with Core Independent Peripherals on AVR® Microcontrollers. -
Build the solution and program the ATtiny817.
In this example several CIPs have been studied, such as CCL, Event System, RTC and ADC so that the users now have an idea of how to start building their own projects using CIPs.