Can I use a Counter component to count BUSCLK?

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.
CuTh_2099391
Level 2
Level 2
First like received First like given

I am using an external Xtal Oscillator of 20MHz +/- 0.01% as BUSCLK.  I'd like to use a Counter component (32-bit UDB up counter) to count at the 20Mhz rate.  This example works if I derive a CNTR_CLOCK of 5MHz (or lower) from BUSCLK:

Capture.PNG

If I use a derived clock of 10MHz it doesn't work. I think that is because I'm sampling 10MHz at a 20MHz rate.

I'd like to just pass the 20MHz BUSCLK into something like the Counter component to get the precision and dynamic range for the interrupt I need.

I have attached the entire project.

Curtis

0 Likes
1 Solution
odissey1
Level 9
Level 9
First comment on KBA 1000 replies posted 750 replies posted

Curtis,

The standard Counter component is limited to max count frequency of about BUS_CLK/3 (BUS_CLK/2 wont work). Instead, you can use a modified counter component (Counter_ex), which can be found here:

Phase offset and Quadrature signal generator for lock-in

/odissey1

View solution in original post

4 Replies
odissey1
Level 9
Level 9
First comment on KBA 1000 replies posted 750 replies posted

Curtis,

The standard Counter component is limited to max count frequency of about BUS_CLK/3 (BUS_CLK/2 wont work). Instead, you can use a modified counter component (Counter_ex), which can be found here:

Phase offset and Quadrature signal generator for lock-in

/odissey1

Odissey1,

I'm pretty new at this PSOC Creator stuff.  I think I imported your Counter_ex component (I found a video tutorial for that).  But I can not figure out how to get it on the schematic.  It shows up in the Explorer tab:

Capture2.PNG

But not in the Component Catalog:

Capture.PNG

Curtis

0 Likes

Curtis,

The Counter_ex should appear in the Community section. You imported only Base Counter (B_Counter_ex). Base Counter is set to be invisible in the catalog tree. You need also import actual Counter_ex component which is the wrapper for Base Counter.

/odissey1

screenshot.png

Odissey,

I think that works.  Thanks for all the help.

Curtis

0 Likes