- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi guys,
Simple question sorry, but I am trying to start a second timer from the CC output of the first.
Psoc4100, TCPWM v2.10
TCPWM1 setup:
TC mode.
All 3 ip's tied together:
Reload (Rising Edge)
Start (Falling Edge)
Stop (Rising Edge)
Counter mode: Up
Run mode: Continuous
Capture/Compare: Capture
Interrupt on Terminal Count.
Period: 10000
IP Clock: 1khz
The CC output is wired to Timer2: Start,Stop,Reload pins, ties togther aswell.
Note: This timer runs ok, and generates a nice interrupt to turn an beeper on after 10 secs.
Timer2 setup:
TC mode. Same as above.
All 3 ip's tied together:
Reload (Falling Edge)
Start (Rising Edge)
Stop (Falling Edge)
Counter mode: Up
Run mode: Continuous
Capture/Compare: Capture
Interrupt on Terminal Count.
Period: 5000
IP Clock: 1khz
Note: This timer does NOT run ok, the interrupt (to turn the beeper off after 5 secs) never occurs.
Things I have tried without success:
a) Wire timer1 interrupt op to the timer 2 start ip. This flagged a routing error.
b) Starting timer 2 with API call:
timer2_TriggerCommand(timer2_MASK,timer_door_alarm_timout_CMD_START);
but this didn't work, ie. didn't start the timer. No interrupt generated after 5 secs.
I've attached the project zipped.
Any advice would be appreciated.
Thanks,
David
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Welcome in the forum, David!
I cannot help you with your project, because
You are using more resources than available, try to use TCPWMs instead of UDB-based components. You even may use a single PWM or TCPWM to control your buzzer.
Your PSoC4 has got four TCPWMs and four 8-bit wide UDBs which you may use. Consider to lower the clocks for UDB-based components to use 8-bit wide components instead of 24 bit or even 32 bit.
Lastly: when creating a file to upload your project and all of your settings use
Creator->File->Create Workspace Bundle (minimal)
and attach the resulting file.
Bob
PS: Where in Germany are you located? I live near Bremen.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
PWM period 15 seconds, compare 10 seconds, inverse output. after tc stop in isr.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Bob, sorry but could you elaborate on that a bit more? - I don't quite understand:/
I am very familiar with capture compare, and generating isrs etc.
An example would be great, only if you have time.
Many thanks!
David
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Bob, I was using non-udb timers, as I said in my first post: TCPWM v2.70.
I am puzzled as to why you said 'I am using UDB timers, more resources than available', when the resources are just fine.
Can anyone see why the second timer: timer_door_alarm_timout
does not start?
PSA Bundle.
Kind regards,
David
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am puzzled as to why you said 'I am using UDB timers, more resources than available', when the resources are just fine.
When I built your attached project there was an error stating that you used more resources than available.
The project you supplied now looks completely different to the first..
The ov pulse is only 2 bus clock cycles wide, that will not be detected with a 1kHz. clock. Best could be to use a pulse converter component.
Bob