CY8CKIT-025 PSoC® Precision Analog Temperature Sensor Expansion Board Kit Guide, Doc. # 001-65791 Rev. *J
59
Example Projects
5.3.3.1
Project Schematic
shows the PSoC Creator schematic of the Sequenced ADC project. To facilitate ADC
readings at consistent intervals, a hardware counter is used to trigger the start of convert (SOC). The
SOC is automatically triggered by the hardware 16-bit counter "Scheduler". This counter triggers an
ADC reading every 606 µs. The counter interval is selected to support the 15 ADC readings at a rep-
etition rate of 110 Hz per reading. To change this rate, change the ADC_PERIOD defined in
sen-
sors.h
. Note that if this define is changed, the counter period should not run faster than the ADC
conversion rate and processing time for the ADC interrupt. The ADC conversion rate of 3861 sam-
ples per second takes 259 µs. The processing time takes about 320 µs with the BUS_CLK set to 48
MHz.
Every time the ADC finishes a conversion, it triggers an interrupt, ADC_INT.c. In this interrupt, the
IDAC8, CurrentMux, ADCMux, and ADC are changed to prepare the signal chain for the next mea-
surement. Also, the ADC readings are filtered in this ISR. The filtered results are then stored in a
ping-pong buffer to be read later.
To ensure that the firmware in the ADC ISR executes before the next ADC SOC is triggered by the
scheduler, the counter "Slot Counter" is used. This hardware counter counts the number of SOCs
triggered by the scheduler. This count is compared against a software counter in the ADC ISR. If the
two counters do not match, then the reading is flagged as invalid.
The control register CtrlScheduler is used to control whether the scheduler is running. Setting this
control register low disables the scheduler and stops ADC readings.
IDAC8 is used to force current through the RTD, diode, and reference resistor. Diode P3_7 is used
to force GND collector of the diode.
Manual routing is used on the RTD to ensure that the load resistance of the IDAC does not cause
the value to droop between the reference resistor reading and RTD reading. For more information,
refer to
.