Hello. Sorry for my english, I'm using a Google translator.
I want to use the quadrature decoder module to connect the mechanical encoder to the PSoC 4 (CY8CKIT-049-4200). When I add the module and collect the project, I get a message "E2071: Unable to pack the design into 4 UDBs." See the Digital Placement section of the report file for details. "
I watched in datashit that the component of the quadrature decoder (8 bits) takes 6 PLDs, if the filter is off, and 7 PLDs if the filter is turned on. By default, the filter is enabled. I turned off the filter, and was able to assemble the project. Why does not the default component allow me to build a project? Is there not enough macrocells in CY8CKIT-049-4200 4 for this?
I do not want to put external capacitors, I need this filter. I tried to add 1 external filter such as "Glitch Filter", and the project again refused to assemble with the same wording of the problem.
I was able to assemble the project by adding 2 elements such as "Debouncer". Will this element be used as a simple alternative to "Glitch Filter"?
You have exceeded the resources of your device you need a larger Psoc device. Check the resource monitor on the extreme right side of the Psoc Creator screen when you are in the Topdesign.cysch. As you can see your device only has 4 UDB resources.
I attached a table with the used cell resources in my first message.
It shows that the resource of this PSoC is far from full. I even recompiled the project for a larger chip, and made sure that the number of cells used does not exceed the allowable number for CY8CKIT-049-4200.
But after a more careful study of the datasheet on the component, almost at the very end I found a very interesting phrase: "Note The PSoC 4200 family can support 8-, 16-, or 32-bit counter size with glitch filtering disabled." Other configurations are too large For this family ". It turns out, it is not always possible to be guided only by the table of resources used.
Thanks, I already used this method (in assembler, in another project). I just wanted to make the most of the hardware capabilities of PSoC.
As you have already noted, it is not useful for resources to use the UDB component for this purpose.
It is better to use the TCPWM component. A glitch filter is not really necessary, but can be used separately (Page 16).
However, a simple software solution like Bob is recommended may have been more flexible. (On page 20).
Thus, for example, a dynamic can also be easily realized.
It is also possible to use several encoders in multiplex mode.
The attached document is an excerpt from a manuscript. Maybe it can help.
If necessary, I can provide the sample projects from the manuscript.
The manuscript is in german language - sorry.
Thank you, excellent document showing many ways to solve one task. I ask you to lay out the samples of the projects, if it is not difficult.
Attached below is a custom QuadDecoder component intended for use with simple mechanical roraty encoders. It was developed entirely in software (no hardware used) for PSoC4/5 projects with limited resources. Component realizes a state machine and can be used in two modes: (i) using pins ISR, (ii) using pins polling technique. In isr mode component currently allows only one encoder per port, with polling there are no restrictions on number of encoders and pin locations (but more CPU clocks are being wasted)
Component was tested using P4200 (Pioneer Board) and P5LP (KIT-059). Attached are component library, two demos, some documentation (sorry - no datasheet) and screenshots.
Here are the examples from the document "CY8CKIT-049-4xxx PSoC 4 Rotary Encoder - Excerpt.pdf".
Unfortunately, I can not guarantee that these examples are 100% correct.
These examples are still with an older one Creator version developed and tested.
The examples also include (actually superfluous) debug material (Analyzer Pins and code).
I hope they are helpful. If there are problems with concrete examples, I can safely help.