enCoRe™ V CY7C643xx, enCoRe™ V LV CY7C604xx TRM, Document No. 001-32519 Rev *H
65
Analog-to-Digital Converter (ADC)
7.4
Application Overview
As shown in
, the Temperature Sensor/ADC contains one read/write data port and one read only status port. Reads
from the status port return terminal conditions. The application processor/controller presents the data port with a stream of
bytes formatted to implement the desired commands.
Figure 7-3. ADC Application Interface
7.4.1
Use of Application Interface
In a typical programming operation, a command byte is writ-
ten. After the first byte of information is driven to the ADC
(which is the instruction opcode), the ADC drives the 0th bit
of the ADC_STATUS register as '1' indicating that ADC is
busy in processing the instruction. The next byte of informa-
tion should be given to the ADC only if the 1st bit of status is
set to '1'. This bit is also set when the read data is ready on
the rd_data port of the ADC. This bit is monitored by the
host processor/controller to give the next byte of data.
7.4.2
Status Codes
The ADC returns a 6-bit status code (bits 7:2 in the Status
register ADC_STATUS) after an instruction is executed. The
status code when not 0 indicates an error condition.
shows the three error codes that are associated
with the ADC operation.
The errored status code is only cleared after the next com-
mand instruction is written into the ADC.
Table 7-1. Status Code for ADC
7.4.3
ADC Usage Guidelines
The temperature sensor block needs to be powered up by
enabling the TS_EN before enabling the modulator. This is
required as this bit sets the analog ground reference for the
ADC. A minimum of 15
s of start-up time is required for the
sensor core to settle to its stable voltage level.
ADC is required to be reset before every conversion to dis-
charge the accumulator capacitor. This is done by disabling
the modulator and holding it in this state for a minimum of 5
s. Programming flexibility for resolution, MUX inputs to the
modulator and comparator are provided.
The
shows the configuration required for a 10-bit
conversion at 12 MHz sampling frequency.
Table 7-2. Configuration Values - 12 MHz, 10-Bit
Conversion
Enabling the modulator and timer starts the clocks to the
ADC block and thereby the conversion. It is recommended
that the modulator and the timer/counter be enabled at the
same time to start the ADC conversion. A minimum of 2
s
wait time is required for the modulator to be enabled after
the other registers are configured. It is desired that for reli-
able operation, register MOD_CR0 (3Bh) be written to last
after all the others.
Data
Port
APPLICATION
PROCESSOR
Command
Stream /Return
Data
Status
Port
Temperature
Sensor/ADC
Return
Status
Status Codes bits [7:2]
Meaning
0x0
Operation Successful
0x3
Invalid Instruction Code
0xC
Error Status Flag
Register Address
Register Name
Configuration Value
0x3C
MOD_CR1
0Ch
0x3D
ACLK
02h
0x3E
TS_CR0
01h
0x41
Timer Period L
FFh
0x42
Timer Period H
03h
0x55
CMP_CR0
00h
0x3B
MOD_CR0
81h