10 Events and Fault Handling

This section is relevant only for devices in the tinyAVR® 1-series. The Timer/Counter type D (TCD) is a timer/counter specifically designed for controlling power applications like driving LEDs, motor control, H-Bridge and power converters. An important safety feature of TCD is the built-in fault handler. The fault handler allows the output of TCD to be clamped to predefined levels upon a fault. The fault is an incoming event, and some other internal or external peripheral must be present to discover the condition.

Imagine the TCD driving an motor for a fan. The Analog Comparator (AC) is also connected to the fan and monitors the current consumption. If the current consumption rises above a predefined threshold, e.g., due to something being stuck in the fan, the AC sends an event to the TCD. Upon receiving the event, TCD immediately clamps all outputs to a predefined level, and the motor stops. This way, the motor is stopped safely before overheating or destroying the object that caused the blockage.

When using an external circuit instead of an internal peripheral, the event is generated by an edge or change in the level of the pin connected to the external circuit. Again, this event is sent to the TCD, which immediately clamps all output to a predefined state.

The event is sent via the Event System (EVSYS). The EVSYS enables direct peripheral to peripheral signaling. One peripheral (Event Generator) can signal to one or several other peripherals (Event Users), without using the CPU.

All parts of the described examples are core independent (CIP), meaning that even if the CPU is deadlocked, this safety feature will work like intended.