Has anyone presented an example of using the push-button to control a timer?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

I would like to have a contact closure pull a pin high for up to 10 minutes, then wait for the next closure event. seemed simple enough...Using a CY8CKIT-049 kit.

thanks!  -Will

0 Likes
17 Replies
odissey1
Level 9
Level 9
First comment on KBA 1000 replies posted 750 replies posted

wcollierllc,

check this Application Note:

AN54460 - PSoC® 3 and PSoC 5LP Interrupts | Cypress Semiconductor

It gives an example of debouncing buttons using an interrupt and a clock. You can use second interrupt to count for 10 min.

odissey1

Debouncing buttons.png

0 Likes
Anonymous
Not applicable

Hi odissey1, apparently the CY8CKIT-049 is different enough that this doesn't work.  Thanks for the info.

0 Likes
rola_264706
Level 8
Level 8
50 likes received 25 likes received 10 likes received

Okay here is a program that will turn on a LED you can change the time by adjusting the PWM data.  Also you can add a switch to  start input to trigger it..  If you want you can add some other components like a timer or debouncer instead of the PWM. One other thing this program is setup for my system so you will need to change settings for the bootloadable component to point to your bootloader hex and elf files. Under the dependencies tab,

0 Likes
Anonymous
Not applicable

I saw one of the app-notes for this project…

I decided to take a very simplified approach: I configured a “Pin_SW” (P0.7):

And an output (P1.6):

Connected them together, expecting a button press would do SOMETHING (turn LED off or on),

But the LED just sits there…blinking slowly…ignoring any button press….

There are no errors, no warnings from the compiler.

L

0 Likes
Anonymous
Not applicable

Found the Problem!! (for now, at least…) more later….

Thanks!!

0 Likes
Anonymous
Not applicable

After changing things to be compatible with the CY8CKIT-049, the program compiles OK, but when attempting to load, I get: 06:46:34 PM - The flash row is not valid for the selected array ?? Doesn’t look good for the “home team”.

0 Likes
Vasanth
Moderator
Moderator
Moderator
250 sign-ins 500 solutions authored First question asked

Hi,

Are you adding dependency to correct hex and elf files? Could you check that once ?

As you might know CY8CKIT-049-kit comes with inbuilt bootloader. There will be updates and enhancements in each revision of kit. Bootloadable will write to the next row after bootlader, as referenced by the dependency. Thus, we have to add dependency to correct bootloader programmed to the kit while creating bootloadable application. Due to hex file mismatch, bootlodable will be trying to write to the programmed bootloader row causing "The Flash row is not valid for the selected array

Best Regards,
VSRS

0 Likes
Anonymous
Not applicable

Verified about 100 times by now. I uninstalled everything, and re-installed all, updated the bootableloader (V1.6 now), re “clean and build” everything. Results:

0 Likes
rola_264706
Level 8
Level 8
50 likes received 25 likes received 10 likes received

Are you holding SW1 down before you plug the stick into the USB port? If you did it correctly you will see the led 1 flashing blue.  Then you should be able to program the device.  If not them you will need to use another board to fix the bootloader. There use to be an example on how to do this at this location Using the CY8CKIT-049 to Program Another PSoC® 4 - KBA93541

0 Likes
Anonymous
Not applicable

Yup, holding switch closed, rapid flashing of the LED. Even the Psoc4 example won’t load. I think it’s bricked.

0 Likes
rola_264706
Level 8
Level 8
50 likes received 25 likes received 10 likes received

Did you read the end of the message you need to fix the bootloader using the example Using the CY8CKIT-049 to Program Another PSoC® 4 - KBA93541  and use another  board to repair the bootloader in your board. I assume that you changed the bootloadable dependencies in the bootloadable component.

0 Likes
Anonymous
Not applicable

Actually, I am not willing to wait for another PSoC-4. However, I believe the problem is more basic (no pun intended) – the “creator” program doesn’t like the V1.6 Bootloadable component – see below: (yes, the dep’s are correct)

0 Likes
rola_264706
Level 8
Level 8
50 likes received 25 likes received 10 likes received

The program I sent you has two sections.  You need to compile the second section this will produce the bootloader dependencies you need to point to these new dependencies in the first section of the program bootloadable component  and then try to compile the programs again it will work correctly after that.

0 Likes

I am using Psoc Creator 4.1 Update 1 (4.1.0.3210) and I am using V1.6 Bootloadable component without any issues.

0 Likes

Then you just need to point to that file location for all future projects.  By the way please post your current code so we can check it on our system.  To do this please open Psoc Creator and select file and then select create_workspace_bundle. Then attach the Zip file you created to a new comment.

0 Likes
Anonymous
Not applicable

Looks like the PSoC 4 is not listening; rapid flashing blue LED stops when programming is attempted.

Thanks for your thoughts…. I’m pretty sure this happened when I tried to program the example in AN54460.

0 Likes

Okay I tried your program and it worked on my system. The AN54460 example is for PSOC 3 and PSOC 5 this could be the reason for your bootloader error trying to use a PSOC 3/5 program on a PSOC 4 device.   I have modified the program to work on the PSOC CY8CKIT-049-42XX board. I added the switch to the timer but I have not debugged it that is up to you.

0 Likes