6.2.1 Initialization

The firmware execution starts with the initialization of the microcontroller and its peripherals. The Phase Sequence Detector application uses microcontroller peripherals such as SPI, TIMER, UART, ADC, Digital I/O, VREF, and ZCD. The system is initialized in the following configurations:
Table 6-1. Microcontroller Peripherals Configurations
PeripheralsSPI 0USART 1ADCTCA0TCA1VREFZCD 0 and ZCD 1
ConfigurationsSPI Clock (6 MHz)Baud Rate (230400)Resolution (12 bits)TIMER Clock (3 MHz)TIMER Clock (3 MHz)Enable reference voltage (ADC)ZCD enable
SPI Master mode Parity bit (0)ADC Clock (System Clock / 12)TIMER Mode (Normal)TIMER Mode (Normal) Reference Voltage (VDD)ZCD Interrupt (Rising Edge)
Data Mode 2 Stop bit (1)ADC Mode (Differential)TIMER Period (0xFFFF)TIMER Period (0x5EC)