background image

 

 

CE224891 – PSoC 4 Down Counter 7-bit 

 

 

 

 

 

 

 

www.cypress.com

 

Document No. 002-24891 Rev.** 

Objective 

This example shows how to use the Count7 Component as a down counter on a PSoC

®

 4 device. 

 

Requirements 

Tool:

 

PSoC Creator

 4.2 

Programming Language: 

C (Arm

®

 GCC 5.4.1) 

Associated Parts:

 

PSoC 4

 devices with UDBs  

Related Hardware: 

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 

Reusing this Example

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 

Hardware Setup

 section.  

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 (

Figure 1

). Press kit button SW2 and confirm that counting stops and restarts. 

Figure 1. Project Terminal Output 

 

Содержание Cypress CY8CKIT-042

Страница 1: ...rs as part of the Infineon product portfolio Continuity of document content The fact that Infineon offers the following product as part of the Infineon product portfolio does not lead to any changes t...

Страница 2: ...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 corre...

Страница 3: ...values The two values should always be the same When the button is pressed Switch_ISR interrupt occurs Switch_InterruptHandler is called and the Control register output is toggled Figure 2 PSoC Creat...

Страница 4: ...esources Pins settings as needed Table 2 shows pin assignments required for UART operation on other PSoC 4 devices Note This project cannot be built for PSoC 4 devices with no UDBs Table 2 Pin Assignm...

Страница 5: ...tatus Register The Status Register allows the firmware to read digital signals General Purpose Input Output GPIO A multifunctional Component that allows hardware resources to connect to a physical por...

Страница 6: ...ss com Document No 002 24891 Rev 5 Document History Document Title CE224891 PSoC 4 Down Counter 7 bit Document Number 002 24891 Revision ECN Orig of Change Submission Date Description of Change 630228...

Страница 7: ...f the Software is prohibited TO THE EXTENT PERMITTED BY APPLICABLE LAW CYPRESS MAKES NO WARRANTY OF ANY KIND EXPRESS OR IMPLIED WITH REGARD TO THIS DOCUMENT OR ANY SOFTWARE OR ACCOMPANYING HARDWARE IN...

Отзывы: