TCA0 Setup

TCA0 is a 16-bit timer/counter with three compare channels and six PWM outputs. In order to create a realistic application heartbeat, two PWM signals are needed, generated using two compare channels.

To create a heartbeat of approximately 60 bpm, the timer setup needs to be as follows:

When the application needs to change the heart rate, the CPU will change the value in the period buffer register.