I have a problem getting the TCPWM quadrature detector to work. it's not counting !
I have used a quadrature detector in the past, UDB based and the app worked without any problems, only after replacing it with a more resource-smart alternative I cannot seem to make it work.
The automatically generated API within psoc creator does look different, but I only require the Start() and readCounter() calls...
1. the TCPWM based solution does not count, the read results always in 0... what am I doing wrong?
2. Asuming I can make it work with other (more) API calls....Why does a simple replacement of the detector implementation
requires me to change the API anyway.... apart from the namechange of the readCounter method (GetCounter()) it simple
should work, that's the promise of a good API, right?
the attachment shows the schematic, inputs (p1, p1) -> glitch filter (4us) -> TCPWM QD (x1, A+B=level, no interrupt)
sprintf(uart_tx_buffer, "%d", (uint16) QuadDec_2_ReadCounter() );
After changing back to the UDB implementation it works as expected, but consumes a lot of valuable resources on my PSoC4 (4245). I'm using latest version of PSoC creator, all updates ok etc...
Anybody run into this issue before? any help very welcome !
// and yes it i'm using the UDB implementation the glitch filter could be moved inside... but i require glitch-free signals from A-input for other parts (not shown) of the design... 😉
new testbench, doesn't require a rotary encoder...
I have used to clocks to create some activity on A/B inputs of the quadrature encoders,
so the decoder is now slowly counting up.
in software it's now a very small routine to test results over uart.
sprintf(uart_tx_buffer, "%d", (uint16) QuadDec_1_ReadCounter());
sprintf(uart_tx_buffer, "%d", (uint16) QuadDec_2_GetCounter());
results from uart terminal:
thanks for the link odissey1, helpful.
but it does not solve why the QD (TCPWM) is not counting and the QD (UDB) just seems to work,
latest test bench is even without any rotary encoder, so the input signals are glitch-free 😉
still hoping somebody tries to make it work, currently I just don't understand what i'm doing wrong...