CE224891 – PSoC 4 Down Counter 7-bit
Document No. 002-24891 Rev.**
1
Objective
This example shows how to use the Count7 Component as a down counter on a PSoC
®
4 device.
Requirements
Programming Language:
C (Arm
®
GCC 5.4.1)
Associated Parts:
CY8CKIT-042 PSoC 4 Pioneer Kit
Overview
This example demonstrates the count-down and enable option features of the Count7 Component. A Control Register
Component is used to drive the Count7 enable signal. The Count7 output is read both directly and through a Status Register
Component. Both values are displayed on the terminal via UART. A kit button is used to control whether the Count7 Component
is enabled.
Hardware Setup
This code example is set up for CY8CKIT-042. If you are using a different kit, see
. In this kit, the USB-
UART bridge in the KitProg2 module is used:
1. Connect the \UART:rx\ pin P0[4] to P12[7] on header J8.
2. Connect the \UART:tx\ pin P0[5] to P12[6] on header J8.
Other kits use different pins for the UART. Make sure that you select the correct pins for your kit.
Software Setup
This design requires a terminal emulator such as PuTTY or Tera Term running on your computer.
Operation
1. Ensure that the correct pins are connected for your kit, as noted in the
2. Connect the USB cable between the PC and the PSoC 4 Pioneer Kit.
3. Build the project and program it into the PSoC 4 device. Choose
Debug
>
Program
. For more information on device
programming, see PSoC Creator Help.
4. Open a terminal emulator on your computer and configure the program to the appropriate COM port. Configure the baud
rate to 115200, data bits to 8, no parity bits, stop bit as 1, and no control flow.
5. Confirm that the terminal display shows the Component counting down, and that the count and status register values are
the same (
). Press kit button SW2 and confirm that counting stops and restarts.
Figure 1. Project Terminal Output