BasicCounter & Status_Reg

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

cross mob
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

Hello

   

I have two problems on my project :

   

1/ I'm using a DigitalComp to stop a BasicCounter when a specific amount is reached => It does not work (the output rises at 32 instead of 26)

   

2/ When the DigitalComp rises, I planned to generate an interrupt through a Status_Reg => It does not work (nothing change)

   

I searched around to find some clues but without success ....

   

Can you help me ?

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

1) The compare and the basic counter usually works. Check the reset pulse, it will be used at the rising edge of the clock pulse  See page 4 of basic counter datasheet.

   

2) Why don't you connect the isr directly to the DigitalComp output (set to rising edge)

   

 

   

Bob

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

Hi Bob,

   

1) You were right : everything worked fine once, then as the counter was not resetted it continued for one loop. I managed so the reset now is doing its job... The BasicCounter lacks of a configurable reset : synchronous or not !

   

2) I thought Status_Reg was mandatory to use cy_isr. I changed and connect it directly without success

   

No way to a have my interrupt callback entered.....

   

// ...

   
        
  • In fact I added     CyGlobalIntEnable;
  •    
   

And it works !

   

Thank you for your help

   

Regards

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

Vive la patience!

   

You are always welcome, Harvey.

   

 

   

Bob

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

Harvey I was looking at you last design and I found that the Clock setting of  the 1.5Mhz was incorrect and the clocks page had an ! on this clock.  Also the design also has a Combinational loop on net 1211. For stability you should break up the net with a a clocked LUT, that would force it to be registered and sampled. Do a search in the forum for Combinational Loop. It was in Aug 4 2015. 

0 Likes
Anonymous
Not applicable

Hello bobgoar,

   

Thank you for taking the time to check my project, and for your comments; I was out of the office this week but I will consider your comments.

   

Regards

0 Likes