AP16098
UPS Main Control
XC164CS Implementation of Main Control
Application Note
14
V1.0, 2007-03
“Trap/INT”:
Do not use pin #CTRAP as input. In “Interrupt Configuration” Enable T12
interrupt/node I2.
“Interrupts”:
CCU6 I2 INT -> Level 14, Group 2.
“Functions”:
In “Initialization Function” select “CCU6_vInit”; In “Function Library (Part
1)” select “CCU6_vStartTmr”, “CCU6_vStopTmr”, “CCU6_vResetTmr”,
“CCU6_vEnableShadowTransfer”.
4.3.2
ADC
The ADC initialization for sampling physical parameters is summarized as (according to
display order in DAvE):
“Module Clock”
:
Enable module.
“Control”:
Select “Enhanced Mode”. In “Enhanced Mode” select “Fixed channel single
conversion”; 10-bit resolution; In “Analog Channel Input Selection” select
“Analog channel 2”; Conversion basic clock is fcpu/1 (tbc=25ns); Sample
time is tbc*8=200ns.
“Port Control”:
Disconnect all digital input stages from port P5.
“Functions”:
In “Initialization Function” select “ADC_vInit”; In “Function Library (Part
1)” select “ADC_vStartConv”, “ADC_uwReadConv”.
4.3.3
CAPCOM2
The CAPCOM2 initialization for capturing line voltage zero-crossing signal is
summarized as (according to display order in DAvE):
“Module Clock”:
Enable module.
“Control”:
The content of the port register is changed by the CAPCOM2 unit.
“Timer7/8”:
Timer 7 Input Selection as “Module Clock / 32 (Resolution: 0.8us)”
“Channels”:
In “Configure channel 22” select “Capture on positive transition at pin
CC22IO
(P1L.7)”;
CC22
allocated
to
timer
T7;
Enable
Capture/Compare interrupt (IE).
“Interrupts”:
CC2 ch22 INT -> Level 14, Group 0.
“Functions”:
In “Initialization Function” select “CC2_vInit”; In “Function Library (Part
1)” Select “CC2_vStartTmr”, “CC2_vStopTmr”, “CC2_vClearTmr”.
4.3.4
I/O Ports
The “Port” module in DAvE is configured as:
P1H.0 as general IO, In; P1L.4/P1L.5 as general IO, Out;
P3.8 as general IO, Out, Open drain;
P9.0 as general IO, In; P9.1 as general IO, Out.