You are correct. The instantiation examples throughout the Component Author guide have the instance name placed at the wrong place. This has been corrected for the next version of the guide that will come out with the Beta 5 version of PSoC Creator.
When you say that the counter is not working, I'm assuming that you are not seeing it count at all. If that is the problem that you are seeing, then it is because the Count7 has both a hardware enable and a software enable. They both must be enabled in order for it to count. The software enable is part of the Aux Control register. You will need to set the enable bit to a one in software. The C call to do that will look something like:
CY_SET_REG8(count7_simple__CONTROL_AUX_CTL_REG, CY_GET_REG8(count7_simple__CONTROL_AUX_CTL_REG) | 0x20)); You will need to replace "count7_simple" with the full instance name to your count7. You can always refer to the generated cyfitter.h file for all the defines that are available. For details on the Count Start bit in the Aux control registers refer to the documentation in the Technical Reference Manual for PSoC 3 (TRM). Search for "Auxiliary Control Register".
Thank you, Brad
The counter is now counting !
But... in the Author guide, I see "cy_route_en: A Boolean to enable a routed signal as an enable to the counter. If false then the counter is always enabled, if true then the counter is only enabled while the enable input is high. Default is `FALSE.".
When cy_route_en is false, and if I put 0 in .enable(0), the counter is stopped (and the fitter said : "Warning: mpr.M0069: Count7 "\count7_simple_1:count7\" detected with a constant 0 for the enable. This will prevent the Count7 from operating. (App=cydsfit)")
I think that when cy_route_en is false, the counter is NOT "always enabled"...