Quadrature 32 bit size counter Problem

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

cross mob
Anonymous
Not applicable

 Hello everyone,

Thanks in advance for any help, I'm a student which needs to use a QuadDec with 32 bit size counter, so I created a long int variable to storage it's value, because I need to send it through the UART interface as string to capture the quadrature information, the thing here is that even though I do select the counter with 32 bits, the data I'm receiving can't go up to -32 768 and +32 768 just as it was a 16 bits counter.

   

I read in the Component Data Sheet this:

   

 

   

"The 32-bit counter implements the lower 16 bits in the hardware counter and the upper 16 bits in software to reduce hardware resource use. For this target, an additional ISR is used. To work properly with the 32-bit counter, interrupts must be enabled. You can add ISR code to source files as needed; see the Interrupt Component datasheet for more details."

   

 

   

I'm not really sure to fully get what it means but as far as I can understand that it seems that it really never creates a 32 bit counter. 

   

How can I fix this?

Thanks again.

0 Likes
1 Solution
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

That statement means exactly what it says.

   

In PSoC most of the functionality is not a fixed component, but rather implemented in UDBs. There a counten needs a certain amount of resources. To save these, the QD implemts only parts of the 32bit counter in hardware, and the rest in software. For that it uses an interrupt (triggered when the lower 16 bit overflow). To work properly, you need to enabled interrupts globally.

   

This internal interrupt does not prevent you from using interrupts for your own purposes. Just connect an ISR component to the interrupt output of the QD.

View solution in original post

0 Likes
13 Replies