- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm using the PSoC Creator with PSoC3. I am having a problem using the Timer function.
I know this may not be the proper forum and that I will be sternly admonished,.
1. I tried using the timer to create a simple 1millisecond interrupt but could only get one frequency of interrupt output, regardless of the clock input. I lost many hours trying to figure out what might be wrong with the clock, but then I ran the clock straight into the ISR function and it worked as expected. I also tried the the Timer in UDB mode and it worked. Therefore I concluded that there must be a problem with the timer FF mode (which the datasheet recommends for simple applications like this to save resources).
2. I opened a case and someone keeps sending me zip files. I don't understand how I'm supposed to implement the bundled zip files. I unzip them and try to open the project and I get an error message saying that the path is invalid and the project needs to be in a directory of the same name. I create a directory with the name of the project, doesn't work. Same problem. Getting nowhere fast with a deadline coming on. I have attached the file I got from Cypress. You try it.
Nick
Environment:
PSoC Creator 2.0 Component Pack 2 (2.0.0.828)
Culture: English (United States)
OS Version: Microsoft Windows NT 6.1.7601 Service Pack 1
CLR Version: 2.0.50727.5466
CY8CKIT-002 MiniProg3 1.0 Rev**
PSoC Programmer 3.14
PSoC 3 Development Kit 1.0 Rev*A
PSoC Creator 2.0 Component Pack 2
Loaded Plugins:
Name: Addin Discovery
Version: 2.0.0.828
Company: Cypress Semiconductor
Description: Discovers PSoC Creator addins (kits, language packs, etc)
Name: Device Catalog
Version: 2.0.0.828
Company: Cypress Semiconductor
Description: Device Catalog Plugin
Name: Documentation
Version: 2.0.0.828
Company: Cypress Semiconductor
Description: Adds the topics available in the documentation.
Name: Start Page
Version: 2.0.0.828
Company: Cypress Semiconductor
Description: Adds a start page to the framework.
Name: Output Window Plugin
Version: 2.0.0.828
Company: Cypress Semiconductor
Description: Adds the output window
Name: SCC Manager
Version: 2.0.0.828
Company: Cypress Semiconductor
Description: The Source Code Control Manager is the central class used for SCC actions within PSoC Creator.
Name: Symbol, Schematic and SchMacro Factory
Version: 2.0.0.828
Company: Cypress Semiconductor
Description: The Symbol and Schematic Factory is used to load, cache, and retrieve symbols and schematics.
Name: Project Manager Plugin
Version: 2.0.0.828
Company: Cypress Semiconductor
Description: Adds project management related functionality.
Name: File Editor Factory Plugin
Version: 2.0.0.828
Company: Cypress Semiconductor
Description: Add file editors to the framework.
Name: GDE Plugin
Version: 2.0.0.828
Company: Cypress Semiconductor
Description: Loads the Symbol and Schematic editors
Name: Language Plugin
Version: 2.0.0.828
Company: Cypress Semiconductor
Description: Supports user files in multiple languages
Name: Workspace Factory
Version: 2.0.0.828
Company: Cypress Semiconductor
Description: The Workspace Factory is used to retrieve instances of PSoC Creator workspaces.
Name: Project Factory
Version: 2.0.0.828
Company: Cypress Semiconductor
Description: The Project Factory is used to retrieve instances of PSoC Creator projects.
Name: 8-bit PSoC Executable Project Template
Version: 2.0.0.828
Company: Cypress Semiconductor
Description: This plugin provides PSoC Creator with the ability to create PSoC Executable projects.
Name: 32-bit PSoC Executable Project Template
Version: 2.0.0.828
Company: Cypress Semiconductor
Description: This plugin provides PSoC Creator with the ability to create PSoC Executable projects.
Name: 32-bit PSoC4 Executable Project Template Loading Plugin
Version: 2.0.0.828
Company: Cypress Semiconductor
Description: This plugin provides PSoC Creator with the ability to create PSoC Executable projects.
Name: PSoC Library Project Template
Version: 2.0.0.828
Company: Cypress Semiconductor
Description: This plugin provides PSoC Creator with the ability to create PSoC Library projects.
Name: Empty Workspace Template
Version: 2.0.0.828
Company: Cypress Semiconductor
Description: This plugin provides PSoC Creator with the ability to create empty workspaces.
Name: Platform Manager
Version: 2.0.0.828
Company: Cypress Semiconductor
Description: PSoC Creator Platform Manager
Name: ARM GCC Generic
Version: 2.0.0.828
Company: Cypress Semiconductor
Description: ARM GNU Generic
Name: ARM RVDS Generic
Version: 2.0.0.828
Company: Cypress Semiconductor
Description: RealView ARM RVCT31 Generic
Name: ARM MDK Generic
Version: 2.0.0.828
Company: Cypress Semiconductor
Description: RealView MDK RVCT40 Generic
Name: DP8051 Keil Generic
Version: 2.0.0.828
Company: Cypress Semiconductor
Description: DP8051 Keil Generic
Name: Device Selector
Version: 2.0.0.828
Company: Cypress Semiconductor
Description: Adds a dialog that allows the user to select a device.
Name: Transport Framework
Version: 2.0.0.828
Company: Cypress Semiconductor
Description: Provides a generic device communication framework for use by other plugins.
Name: Debugger Core
Version: 2.0.0.828
Company: Cypress Semiconductor
Description: The Core Debugger provides an architecture independent framework for the common debug features.
Name: PSoC3 Debugger
Version: 2.0.0.828
Company: Cypress Semiconductor
Description: Provides debugging support for the PSoC3 family through a GDB backend.
Name: PSoC4 Debugger
Version: 2.0.0.828
Company: Cypress Semiconductor
Description: Provides debugging support for the PSoC4 family of devices through a GDB backend.
Name: PSoC5 Debugger
Version: 2.0.0.828
Company: Cypress Semiconductor
Description: Provides debugging support for the PSoC5 family through a GDB backend.
Name: Device IO Transport
Version: 2.0.0.828
Company: Cypress Semiconductor
Description: Provides device IO support for Cypress devices though PSoC Programmer APIs.
Name: Bootloader Host
Version: 2.0.0.828
Company: Cypress Semiconductor
Description: Provides a host tool to perform bootloading operations.
Name: Background Elaborator
Version: 2.0.0.828
Company: Cypress Semiconductor
Description: PSoC Creator Background Elaborator.
Name: TypeCache Factory
Version: 2.0.0.828
Company: Cypress Semiconductor
Description: The TypeCache Factory is used to retrieve instances of TypeCaches.
Name: DWR Plugin
Version: 2.0.0.828
Company: Cypress Semiconductor
Description: Registers resource editors with devices.
Name: DMA Wizard
Version: 2.0.0.828
Company: Cypress Semiconductor
Description: Enables quick and correct development of applications that use DMA.
Name: Notice Window
Version: 2.0.0.828
Company: Cypress Semiconductor
Description: The Notice Window displays notices (status messages / errors with managed lifetimes).
Installed CyInstaller Products:
- Labels:
-
PSoC 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
create a new folder with the name "simple.cydsn", put everything except simple.Bundle01.cywrk and simple.Bundle01.cywrk.sachin inside that folder.
Inside PSOC creator :
- Click on FIle--->Open--->Project/Workspace
select simple.cyprj
Your project will open on a new workspace.
Dunno why the path of the bundle has been inside the same directory.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
To open the full workspace (to update components)
in adition to creating the new directory and movin the files, open the simple.Bundle01.cywrk file in a text editor and replace the line
<name_val_pair name="simple" v=".\simple.cydsn\simple.cyprj" />
instead of:
<name_val_pair name="simple" v=".\simple.cyprj" />
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
One problem, you did not issue a -
timer_clock_Start(void) ;
Regards, Dana.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
That should have been typed -
timer_clock_Start( ) ;
Regards, Dana.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Also keep in mind the output, Tc (the interrupt to the pin) is a very low duty
cycle pulse, per datasheet description of Tc timing.
Regards, Dana.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Best would be when you post YOUR project here. Use the "Create Workspace Bundle" from Creator 2.2 ans uplöoad the resulting file here using ms Internet Explorer (NOT Chrome!)
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Project is posted here, at top of thread.
Regards, Dana.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
lol guys, the attached project is not his project but rather a project ent to him by Support.
The little example project works as intended and no timer_clock_start() is not needed because "Start on Reset" is activated for it in the clock configuration window.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This is why I wrote "YOUR" in capital letters. It is too much guessing without a concrete project.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
When a poster takes a project from another source, and then opens it in his
HW and environement, is it now HIS project ? LOL
Dana.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dana - I followed your advice on the directory structure and modifying the cywrk file and got the project to open.
It seems like the only knobs I can twist for the Timer are via the Configure dialog and brother I've tried every possibility there. The Timer works as expected in my design when I'm in UDB mode, but not FF. I'm going to try the sample program and play around with it on development board. My gut feeling is, there is something in the cydwrk > clocks or interrupts that's honking me in my design. Something outside of the Timer function itself. A hardware revision, compiler, component pack,. something.
I created a 1kHz clock using 'Auto' source with a divider of 100. The Creator assigned ILO.
Thanks for your help. I would like to bundle up my project but since it's so far down the road hardware wise, do you think it would do any good?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I will take another look at this myself, you have my curiosity up.
I wish I could take cred for the Zeta advice on getting the sample project
open, but I used his advice as well, or I would never have seen the light
of day on that project.
Regards, Dana.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Regarding your first question: So you want to have an interrupt be called once every 1ms, right? A timer is usually only for measuring periods, not for creating ones.
So your way of adding a clock component to your schematic and using it to trigger the interrupt is actually OK. If you need lower interrupt frequencies, you can use a PWM component instead. Make sure that the interrupt is set to edge-triggered.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Oh, and it is really helpful to have separate problems in separate threads. Your problem with timers has, I suppose, nothing to do with the problem of opening a prohject someone at Cypress sent to you (btw: why didn't you ask the sender for help?). Mixing them up only leads to confusion.
Can you create an example project for your timer problem demonstrating the problem, and upload this one? From your description there should not be more than a single timer and an interrupt component in it...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
A timer is certainly appropriate for creating periods, from datasheet -
When to Use a Timer
The default use of the Timer is to generate a periodic event or interrupt signal. However, there
are other potential uses:
Create a clock divider by driving a clock into the clock input and using the terminal count
output as the divided clock output.
Measure the length of time between hardware events by driving a clock into the clock input
and driving the test signal to the enable or capture input.
Note A Counter component is better used in situations focused on counting events. A PWM
component is better used in situations requiring multiple compare outputs with more control
features like center alignment, output kill, and dead band outputs.
A Timer is typically used to record the number of clock cycles between events. An example of
this is measuring the number of clocks between two rising edges as might be generated by a
tachometer sensor. A more complex use is to measure the period and duty cycle of a PWM
input. For PWM measurement, the Timer component is configured to start on a rising edge,
capture the next falling edge, and then capture and stop on the next rising edge. An interrupt on
the final capture signals the CPU that all of the captured values are ready in the FIFO.
Regards, Dana.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Also a timer uses a little less resources, HW and Firmware, than a PWM
for the purposes of period generation -
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I stand corrected - I just looked at the first page of the timer component data sheet, which states that it is intended for period (or time) measurements.
But I'm still wondering why the OP has problems getting a different frequency than 1kHz from the timer...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content