Extract the archive to your disk. Open your project, in the workspace explorer select the 'components' tab.
On your project node, right click and then 'import componment item'. Select the saved project from above as source project, the you can select the component to import in your project.
It should show up under 'community component' in the component list...
I'm looking forward to create my own compnents, too. Does anybody know how I can find a tutorial or something else about this? It´s difficult for me.
When compiling in RELEASE, i get the following warnings:
.\Generated_Source\PSoC5\SysTimers_1.c:352:29: warning: array subscript is above array bounds [-Warray-bounds]
.\Generated_Source\PSoC5\SysTimers_1.c:353:29: warning: array subscript is above array bounds [-Warray-bounds]
I think the index range in the for() loop inside _ReleaseAllTimers is incorrect:
for(index = 1; index <= SysTimers_1_TIMERS; index++)
for(index = 0; index < SysTimers_1_TIMERS; index++)
Very helpful component anyway 🙂
I very happily found your SysTimers component. This is exactly what I needed.
But because I'm using a PSoC 3, I added a PSoC 3-specific implementation using a Timer component instead of the PSoC 5-native SysTicks feature.
I also added some CriticalSection locks which are imho necessary.
Please find the updated code attached.
This demo project works well. Now when I tried to introduce the systimer in another project it does recognize systime. I am not able to install systimer on my topdesign. There is no component systimer exist on my updated psoc creater. Is it a user component? How to transfer the component?
To use the SysTimer component in your own project, right click on your project under the workspace window on the left. Select "Dependencies...". Under "User Dependencies" select the folder icon then navigate to the location where the library is stored. The folder will be "SystemTimers.cylib" and inside there will be the file "SystemTimers.cyprj", select it, hit "OK" on the bottom of the Dependencies pop-up window. You should now see a "Community" tab in the Component Catalog window on the right. I usually keep all my custom libraries in one common place so they don't get lost.
In the example if I want only 2 times to blink, how to stop the loop. The following program did not work.
P02_Green_Write(P02_Green_Read() ? 0 : 1); // Toggle Green
The SystemTimer will only tell you if a period has expired. If you want something to only occur for n periods, you will have to implement that counter yourself. I have been thinking of adding callback functions, but you want these functions to be very small and quick. The user's callback function would have it's own counter so it would know that it would only occur n times then kill it's own timer. This way if you just wanted to toggle an LED n times, your callback function would know this and it would do this automatically in the ISR. Hmmm maybe I will add the callback function as an option, might be more useful than I was thinking.
here is an important fix for the updated component that I posted in February.
Please update the initialization code in Start() to:
#if `$INSTANCE_NAME`_SYSTICK_PERIOD <= 65536
#error SysTimers (instance `$INSTANCE_NAME`): Invalid timer resolution. Use a higher resolution please!
Attached to the post is version 3.0 of my SysTimers component. I have added callback functions to the timers as an option. I find the callbacks handy for simple quick periodic functions I don't want to deal with in my main loop. For example, blinking an LED at a 2 Hz rate, Blink an LED for 5 times then stop, or scan a button or keypad. Since these callbacks execute in an ISR they should be kept small.
I have attached two documents, "SysTimers.cylib.zip" which is just the library, and "SysTimersDemo2.zip" that contains a couple examples and the library. Both the library and the demos were generated with PSoC Creator 4.2. The demo "SysTimers_PSoC4_RGB_Demo" blinks the RGB LED on the pioneer board without callback functions. Demo "SysTimers_PSoC4_RGB_Demo_wCB" is the same demo but with the use of callback functions.
I assume that you know that the systick firmware that comes it PSoC4 has 4 builtin callbacks...
And people can read about the APIs in chapter 12 of the System Reference Guide.
Yes I know about the systick APIs in the PSoC library. When I originally wrote the component, they did not exist. I now allow the user to replace the standard SysTick ISR or to just put the SysTimer ISR as one of the 4 entries. The sysTimer component is really for events that occur at a slower rate than SysTick period. The SysTimer callbacks may only be executed once ever 10 seconds if you want. In the Fast mode it just handles the math for you with very little overhead at the SysTick ISR.
It was never meant as a replacement for the SysTick APIs. I use SysTimer Component for my own non-RTOS based projects and thought that other people might have a use for it as well.
I have been trying to use this with PSoC 6, and the cytypes.h is a problem. I am not a greatly experienced Cypress dude, so is this component/library suitable for PSoC 6 or do I need to make major modifications?