December 22, 2003
Document No. 38-12011 Rev. *E
239
CY8C24xxx Preliminary Data Sheet
Analog Interface
other than ‘0’, an IOR command to an SC block is assumed
to be part of a SAR sequence.
Assuming the comparator bus output is programmed for col-
umn 0, a typical firmware sequence would be as follows.
mov reg[ASY_CR], 60h // SAR count value=6,
Sign=0, Col=0
or reg[ASC10CR0], 0 // Check sign, set bit 4
or reg[ASC10CR0], 0 // Check bit 4, set bit 3
or reg[ASC10CR0], 0 // Check bit 3, set bit 2
or reg[ASC10CR0], 0 // Check bit 2, set bit 1
or reg[ASC10CR0], 0 // Check bit 1, set bit 0
or reg[ASC10CR0], 0 // Check bit 0
Bit 3: SARSIGN.
SAR sign selection. This bit optionally
inverts the comparator input to the SAR accelerator and
must be set based on the type of PSOC block configuration
selected.
Table 18-4
lists some typical examples.
Bits 2 and 1: SARCOL[1:0].
Column select for the SAR
comparator input. The DAC portion of the SAR can reside in
any of the appropriate positions in the Analog PSOC block
array. However, once the COMPARATOR block is posi-
tioned (and it is possible to have the DAC and COMPARA-
TOR in the same block), this position should be the column
selected.
Bit 0: SYNCEN.
The purpose of this bit is to synchronize
CPU data writes to Switched Capacitor (SC) block operation
in the analog array. The SC block clock is selected in the
CLK_CR0 register. The selected clock source is divided by
four and the output is a pair of two-phase, non-overlapping
clocks: PHI1 and PHI2. There is an optimal time, with
respect to the PHI1 and PHI2 clocks, to change the capaci-
tor configuration in the SC block which is typically the rising
edge of PHI1. This is normally the time when the input
branch capacitor is charging.
When this bit is set, any write to an SC block register is
stalled until the rising edge of the next PHI1 clock phase, for
the column associated with the SC block address. The stall-
ing operation is implemented by suspending the CPU clock.
No CPU activity will occur during the stall, including interrupt
processing. Therefore, the effect of stalling on CPU through-
put must be considered.
For additional information, reference the
ASY_CR register
on page 106
.
18.2.4
DEC_CR0 Register
This register contains control bits to access hardware sup-
port for both the Incremental ADC and the DELISG ADC.
For Incremental support, the upper four bits, IGEN[3:0],
select which column comparator bit will be gated by the out-
put of a digital block. The output of that digital block is typi-
cally a PWM signal; the high time of which corresponds to
the ADC conversion period. This ensures that the compara-
tor output is only processed for the precise conversion time.
The digital block selected for the gating function is controlled
by ICLKS0 in this register, and ICLKS2 and ICLKS1 bits in
DEC_CR1. Up to one of eight digital blocks may be
selected, depending on the chip resources.
The DELSIG ADC uses the hardware decimator to do a por-
tion of the post processing computation on the comparator
signal. DCOL[1:0] selects the column source for the decima-
tor data (comparator bit) and clock input (PHI clocks).
In addition, the decimator requires a timer signal to sample
the current decimator value to an output register that may
subsequently be read by the CPU. This timer period is set to
be a function of the DELSIG conversion time and may be
selected from up to one of eight digital blocks (depending on
the chip resources) with bit DCLKS0 and DCLKS2, DCLKS1
in DEC_CR1.
For additional information, reference the
DEC_CR0 register
on page 142
.
18.2.5
DEC_CR1 Register
Bit 7: ECNT.
The ECNT bit is a mode bit that controls the
operation of the decimator hardware block. By default, the
decimator is set to a double integrate function, for use in
hardware DELSIG processing. When the ECNT bit is set,
the decimator block converts to a single integrate function.
This gives the equivalent of a 16-bit counter suitable for use
in hardware support for an Incremental ADC function.
Bit 6: IDEC.
Any function using the decimator requires a
digital block timer to sample the current decimator value.
Normally, the positive edge of this signal will cause the deci-
mator output to be sampled. However, when the IDEC bit is
set, the negative edge of the selected digital block input will
cause the decimator value to be sampled.
Bits 5 to 0: ICLKSx and DCLKSx.
The
DCLKS1 bits in this register select the digital block sources
for Incremental and DELSIGN ADC hardware support (see
the DEC_CR0 register).
ICLKS1
and
For additional information, reference the
DEC_CR1 register
on page 143
.
Table 18-4. Typical PSOC Block Configurations
Configuration
SAR6 – 2 blocks
Description
Sign
1 DAC6, 1 COMP (could be
CT)
1 for both DAC6 and COMP
1 DAC10, 1 COMP (could be
CT)
(When processing MS DAC
block)
0
SAR6 – 1 block
MS SAR10 –3 blocks
1
0