3.1 Project Overview

Project overview using the MCU:

  • CPU clock: 1 MHz
  • Peripherals used:
    • Timer6:
      • Timer6 is configured to overflow with 1.5 ms timer period and is used as CLC clock
    • CLC1, CLC2, CLC3, CLC4, and CLC5:
      • CLC3 and CLC1 are used together for onboard button S2 debouncing control
      • CLC4 and CLC2 are used together for external rotary encoder debouncing control
      • CLC5 is used to extend the 2-CLCs solution (CLC3 and CLC1) to 3-CLCs solution
    • GPIO:
      • pin RC5: CLCIN0 input signal, connected to the onboard S2 button by default
      • pin RB2: CLCIN2 input signal, manually connect it to the external rotary encoder
      • pin RA4: D2 LED output
      • pin RA5: D3 LED output
      • pin RA6: D4 LED output
      • pin RA7: D5 LED output