34
CY8CKIT-050 PSoC® 5LP Development Kit Guide, Doc. # 001-65816 Rev. *E
Code Examples
5.1
Project: VoltageDisplay_SAR_ADC
5.1.1
Project Description
This example code measures an analog voltage controlled by the potentiometer. The code uses the
internal SAR ADC configured for a 12-bit operation; the ADC range is 0 to Vdda. The results are dis-
played on the character LCD.
Note
The PSoC 5LP Development Kit is factory-programmed with this example.
5.1.2
Hardware Connections
The example requires the character LCD on P8. Because it uses the potentiometer, the jumper
POT_PWR should be in place. This connects the potentiometer to the Vdda.
5.1.3
SAR ADC Configuration
To view or configure the SAR ADC component, double-click the component in the
TopDesign.cysch
file.
Figure 5-2. SAR ADC Configuration
The SAR ADC is configured as follows:
■
Free-running mode of operation is selected because the ADC scans only one channel continu-
ously.
■
Conversion rate is set to 100 ksps. The code waits for each sample, processes it, and displays
the result on the LCD.
electronic components distributor