Timer does not startcounting

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

cross mob
Anonymous
Not applicable

Hi!

   

Sorry for the thousands of posts but the CYBLE keeps fooling me ...

   

I followed the example here: http://www.cypress.com/documentation/code-examples/ce95385-tcpwm-timercounter-operation-psoc-4?sourc... . I can't find any difference to my example and it drives me crazy. I also tried doing all the configuration 100% programmatically. Didn't work.

   

I am running out of stuff to try. I tested if the counter even counts and it doesn't. I checked every function in the datasheet and still can't figure it out ... I don't know if the clock might be broken ...

   

Thanks in advance for any help!

   

Peace Noah

0 Likes
15 Replies
lock attach
Attachments are accessible only for community members.
rola_264706
Level 8
Level 8
50 likes received 25 likes received 10 likes received

Noah There where some issues with the example program. I have fixed these and I am sending you the program. I am running PSOC Creator 3.3  SP1 (3.3.0.7343).

0 Likes
Anonymous
Not applicable

Ohh so I need to start the clock? I thought about that, but in the creator it said "start on reset" for that clock ... Or am I mistaken? Running the same Creator version here 🙂

   

Thanks for your help, Bob!

   

Peace Noah

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

Noah I start all components I think this is the best method to insure that they work as expected.

0 Likes
Anonymous
Not applicable

Adding the clk_Start() didn't help at all, unfortunately ...

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Noah, as usual: Can you please post your complete project, so that we all can have a look at all of your settings? To do so, use
Creator->File->Create Workspace Bundle (minimal)
and attach the resulting file.

   

 

   

Bob

0 Likes
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

Oh, I am very sorry ... I thought I did ... the file is compressed yet, just didn't add to the post ... 

0 Likes
rola_264706
Level 8
Level 8
50 likes received 25 likes received 10 likes received
        I have it working as per the pfd example on a PSOC 4 pioneer board. I'll try it on the PSOC Ble pioneer board today maybe there is a difference in the way it works with the Ble device.   
0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

In your interrupt handler you should clear the interrupt cause, the timer interrupt.

   

tmr_switch_ClearInterrupt(tmr_switch_GetInterruptSource());   //  Remove interrupt cause

   

 

   

Bob

0 Likes
Anonymous
Not applicable

Well, Bob, there is not even one interrupt occuring. That is my problem. I have a Breakpoint in the ISR and it doesn't stop once. Also the counter doesn't count at all (reading it in the while(1) in the main()). Clearing it is only a second step, but thanks for that one anyways 🙂

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

Noah I have found two things in the timer configuration that is different than the example I sent you.  The timer was set for a down counter and the interrupt was set to a check mark in the box compare /capture count. In the box on the right side of the timer configuration settings the capture box was checked. Also on the compare/capture pull down select box was set to capture. Check the PDF file in the example. 

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Couldn't get your timer to work either.

   

Do the following: Because I was informed that you used an old version of  some components(I have TCPWM 2.10) you should use Creator -> Project -> Update Components.

   

Remove the timer, and insert a new one, change the name to the original and it will run.

   

 

   

Bob

0 Likes
Anonymous
Not applicable

@bobgoar well, that doesn't matter. the capture is just a second feature that isn't influenced by the first one 🙂

   

@Bob Marlowe I actually updated all components in the meantime. But it told me that the timer was on the newest version yet. Removing and adding it again worked! Why so? Do you know? Well I just wasted 5 hrs on a broken component 😄 Life's good 🙂 (I love debugging, no joke)

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

I can assure you: You will not die 5 hrs earlier. At least you learnt patience 😉

   

Probably a data error in the Creator file. So the "broken" component could be repaired. I have seen an error like yours with a GPIO-pin, made me gnaw the keyboard...

   

 

   

Bob

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

@Bob When I updated the components it updated the Ble component to 4.2 and it was labeled Proto type and had a orange background. . BobGoar

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

@Bob: It updated to v 3.0 for BLE 4.2. Read datasheet "Component changes" to know it is a Beta release.

   

 

   

Bob

0 Likes